idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,052,119
public static void convolve5(Kernel2D_S32 kernel, GrayS32 src, GrayS32 dest) {<NEW_LINE>final <MASK><NEW_LINE>final int[] dataDst = dest.data;<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>final int kernelRadius = kernel.getRadius();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(kernelRadius, height-kernelRadius, y -> {<NEW_LINE>for (int y = kernelRadius; y < height - kernelRadius; y++) {<NEW_LINE>// first time through the value needs to be set<NEW_LINE>int k1 = kernel.data[0];<NEW_LINE>int k2 = kernel.data[1];<NEW_LINE>int k3 = kernel.data[2];<NEW_LINE>int k4 = kernel.data[3];<NEW_LINE>int k5 = kernel.data[4];<NEW_LINE>int indexDst = dest.startIndex + y * dest.stride + kernelRadius;<NEW_LINE>int indexSrcRow = src.startIndex + (y - kernelRadius) * src.stride - kernelRadius;<NEW_LINE>for (int x = kernelRadius; x < width - kernelRadius; x++) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>// rest of the convolution rows are an addition<NEW_LINE>for (int i = 1; i < 5; i++) {<NEW_LINE>indexDst = dest.startIndex + y * dest.stride + kernelRadius;<NEW_LINE>indexSrcRow = src.startIndex + (y + i - kernelRadius) * src.stride - kernelRadius;<NEW_LINE>k1 = kernel.data[i * 5 + 0];<NEW_LINE>k2 = kernel.data[i * 5 + 1];<NEW_LINE>k3 = kernel.data[i * 5 + 2];<NEW_LINE>k4 = kernel.data[i * 5 + 3];<NEW_LINE>k5 = kernel.data[i * 5 + 4];<NEW_LINE>for (int x = kernelRadius; x < width - kernelRadius; x++) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] += total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
int[] dataSrc = src.data;
8,630
public CurrencyAmount presentValue(OvernightInArrearsCapletFloorletPeriod period, RatesProvider ratesProvider, SabrParametersIborCapletFloorletVolatilities sabrVolatilities) {<NEW_LINE>Currency currency = period.getCurrency();<NEW_LINE>if (ratesProvider.getValuationDate().isAfter(period.getPaymentDate())) {<NEW_LINE>return CurrencyAmount.of(currency, 0d);<NEW_LINE>}<NEW_LINE>OvernightCompoundedRateComputation onComputation = period.getOvernightRate();<NEW_LINE>LocalDate startDate = onComputation.getStartDate();<NEW_LINE>LocalDate endDate = onComputation.getEndDate();<NEW_LINE>// The ON rates don't have an exact fixing time<NEW_LINE>double startTime = sabrVolatilities.relativeTime(startDate.atStartOfDay(ZoneOffset.UTC));<NEW_LINE>double endTime = sabrVolatilities.relativeTime(endDate.atStartOfDay(ZoneOffset.UTC));<NEW_LINE>double df = ratesProvider.discountFactor(currency, period.getPaymentDate());<NEW_LINE>PutCall putCall = period.getPutCall();<NEW_LINE>double strike = period.getStrike();<NEW_LINE>double forward = ON_FUNCT.rate(onComputation, onComputation.getStartDate(), onComputation.getEndDate(), ratesProvider);<NEW_LINE>if (!ratesProvider.getValuationDate().isBefore(period.getEndDate())) {<NEW_LINE>// Between end compounding and payment date<NEW_LINE>double dfPayment = ratesProvider.discountFactor(currency, period.getPaymentDate());<NEW_LINE>return period.payoff(forward).multipliedBy(dfPayment);<NEW_LINE>}<NEW_LINE>// parameters at start of composition period, for coherence with term rate caplets<NEW_LINE>double alpha = sabrVolatilities.alpha(startTime);<NEW_LINE>double beta = sabrVolatilities.beta(startTime);<NEW_LINE>double rho = sabrVolatilities.rho(startTime);<NEW_LINE>double nu = sabrVolatilities.nu(startTime);<NEW_LINE>double shift = sabrVolatilities.shift(startTime);<NEW_LINE>SabrFormulaData sabr = SabrFormulaData.of(alpha, beta, rho, nu);<NEW_LINE>SabrFormulaData sabrAdjusted = sabrInArrearsFunction.<MASK><NEW_LINE>double volatility = sabrVolatilities.getParameters().getSabrVolatilityFormula().volatility(forward + shift, strike + shift, endTime, sabrAdjusted.getAlpha(), sabrAdjusted.getBeta(), sabrAdjusted.getRho(), sabrAdjusted.getNu());<NEW_LINE>double price = df * period.getYearFraction() * BlackFormulaRepository.price(forward + shift, strike + shift, endTime, volatility, putCall.isCall());<NEW_LINE>return CurrencyAmount.of(currency, price * period.getNotional());<NEW_LINE>}
effectiveSabr(sabr, startTime, endTime);
1,546,327
public void close() {<NEW_LINE>boolean lockGained = false;<NEW_LINE>try {<NEW_LINE>// dont want to wait too long during shutdown or update<NEW_LINE>lockGained = storageLock.tryLock(15, TimeUnit.SECONDS);<NEW_LINE>// if lockGained within timeout, then try to remove old entries<NEW_LINE>if (lockGained) {<NEW_LINE>String handlesSSV = <MASK><NEW_LINE>if (handlesSSV != null) {<NEW_LINE>String[] handles = handlesSSV.trim().split(" ");<NEW_LINE>for (String handle : handles) {<NEW_LINE>LocalDateTime lastUsed = (LocalDateTime) get(handle, LAST_USED);<NEW_LINE>if (isExpired(lastUsed)) {<NEW_LINE>removeByHandle(handle);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// if lock is not acquired within the timeout or thread is interruted<NEW_LINE>// then forget about the old entries, do not try to delete them.<NEW_LINE>// re-setting thread state to interrupted<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} finally {<NEW_LINE>if (lockGained) {<NEW_LINE>try {<NEW_LINE>storageLock.unlock();<NEW_LINE>} catch (IllegalMonitorStateException e) {<NEW_LINE>// never reach here normally<NEW_LINE>logger.error("Unexpected attempt to unlock without lock", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
this.storage.get(STORE_KEY_INDEX_OF_HANDLES);
89,707
public boolean accept(Key k, Value v) {<NEW_LINE>ByteSequence testVis = k.getColumnVisibilityData();<NEW_LINE>if (filterInvalid) {<NEW_LINE>Boolean b = cache.get(testVis);<NEW_LINE>if (b != null)<NEW_LINE>return b;<NEW_LINE>try {<NEW_LINE>new <MASK><NEW_LINE>cache.put(testVis, true);<NEW_LINE>return true;<NEW_LINE>} catch (BadArgumentException e) {<NEW_LINE>cache.put(testVis, false);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (testVis.length() == 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Boolean b = cache.get(testVis);<NEW_LINE>if (b != null)<NEW_LINE>return b;<NEW_LINE>try {<NEW_LINE>boolean bb = ve.evaluate(new ColumnVisibility(testVis.toArray()));<NEW_LINE>cache.put(testVis, bb);<NEW_LINE>return bb;<NEW_LINE>} catch (VisibilityParseException | BadArgumentException e) {<NEW_LINE>log.error("Parse Error", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ColumnVisibility(testVis.toArray());
666,539
private Mono<Response<Void>> deleteWithResponseAsync(String vaultName, String resourceGroupName, String resourceGuardProxyName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vaultName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGuardProxyName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), resourceGuardProxyName, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGuardProxyName is required and cannot be null."));
1,006,183
public List<? extends PackagingElement<?>> createElements(@Nonnull ArtifactEditorContext context) {<NEW_LINE>final Set<Module> modules = new LinkedHashSet<Module>();<NEW_LINE>collectDependentModules(myModule, modules, context);<NEW_LINE>final Artifact artifact = context.getArtifact();<NEW_LINE>final ArtifactType artifactType = artifact.getArtifactType();<NEW_LINE>Set<PackagingSourceItem> items <MASK><NEW_LINE>for (Module module : modules) {<NEW_LINE>for (PackagingSourceItemsProvider provider : PackagingSourceItemsProvider.EP_NAME.getExtensions()) {<NEW_LINE>final ModuleSourceItemGroup parent = new ModuleSourceItemGroup(module);<NEW_LINE>for (PackagingSourceItem sourceItem : provider.getSourceItems(context, artifact, parent)) {<NEW_LINE>if (artifactType.isSuitableItem(sourceItem) && sourceItem.isProvideElements()) {<NEW_LINE>items.add(sourceItem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<PackagingElement<?>> result = new ArrayList<PackagingElement<?>>();<NEW_LINE>final PackagingElementFactory factory = PackagingElementFactory.getInstance(context.getProject());<NEW_LINE>for (PackagingSourceItem item : items) {<NEW_LINE>final String path = artifactType.getDefaultPathFor(item.getKindOfProducedElements());<NEW_LINE>if (path != null) {<NEW_LINE>result.addAll(factory.createParentDirectories(path, item.createElements(context)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
= new LinkedHashSet<PackagingSourceItem>();
1,573,622
protected void construct(InputStream is) throws TOTorrentException {<NEW_LINE>ByteArrayOutputStream metaInfo = new ByteArrayOutputStream(64 * 1024);<NEW_LINE>try {<NEW_LINE>// raised this limit as 2k was rather too small<NEW_LINE>byte[] buf = new byte[32 * 1024];<NEW_LINE>// do a check to see if it's a BEncode file.<NEW_LINE>int iFirstByte = is.read();<NEW_LINE>if (iFirstByte != 'd' && iFirstByte != 'e' && iFirstByte != 'i' && !(iFirstByte >= '0' && iFirstByte <= '9')) {<NEW_LINE>// often people download an HTML file by accident - if it looks like HTML<NEW_LINE>// then produce a more informative error<NEW_LINE>try {<NEW_LINE>metaInfo.write(iFirstByte);<NEW_LINE>int nbRead;<NEW_LINE>while ((nbRead = is.read(buf)) > 0 && metaInfo.size() < 32000) {<NEW_LINE>metaInfo.write(buf, 0, nbRead);<NEW_LINE>}<NEW_LINE>String char_data = new String(metaInfo.toByteArray());<NEW_LINE>if (char_data.toLowerCase().contains("html")) {<NEW_LINE><MASK><NEW_LINE>char_data = HTMLUtils.splitWithLineLength(char_data, 80);<NEW_LINE>if (char_data.length() > 400) {<NEW_LINE>char_data = char_data.substring(0, 400) + "...";<NEW_LINE>}<NEW_LINE>throw (new TOTorrentException("Contents maybe HTML:\n" + char_data, TOTorrentException.RT_DECODE_FAILS));<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (e instanceof TOTorrentException) {<NEW_LINE>throw ((TOTorrentException) e);<NEW_LINE>}<NEW_LINE>// ignore this<NEW_LINE>}<NEW_LINE>throw (new TOTorrentException("Contents invalid - bad header", TOTorrentException.RT_DECODE_FAILS));<NEW_LINE>}<NEW_LINE>metaInfo.write(iFirstByte);<NEW_LINE>int nbRead;<NEW_LINE>while ((nbRead = is.read(buf)) > 0) {<NEW_LINE>metaInfo.write(buf, 0, nbRead);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw (new TOTorrentException("Error reading torrent: " + Debug.getNestedExceptionMessage(e), TOTorrentException.RT_READ_FAILS));<NEW_LINE>}<NEW_LINE>construct(metaInfo.toByteArray());<NEW_LINE>}
char_data = HTMLUtils.convertHTMLToText2(char_data);
184,318
void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>if ((decoder.state_vvvv_invalidCheck & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>instruction.setCode(code);<NEW_LINE>instruction.setOp0Register(decoder.state_reg + decoder.<MASK><NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp1Register(decoder.state_rm + decoder.state_extraBaseRegisterBaseEVEX + baseReg2);<NEW_LINE>if (((decoder.state_zs_flags & StateFlags.B) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>} else {<NEW_LINE>instruction.setOp1Kind(OpKind.MEMORY);<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.B) != 0) {<NEW_LINE>if (canBroadcast)<NEW_LINE>instruction.setBroadcast(true);<NEW_LINE>else if (decoder.invalidCheckMask != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>}<NEW_LINE>decoder.readOpMem(instruction, tupleType);<NEW_LINE>}<NEW_LINE>}
state_zs_extraRegisterBase + decoder.state_extraRegisterBaseEVEX + baseReg1);
969,253
protected AbstractBeanDefinition doParse(Element element, ParserContext parserContext, String channelName) {<NEW_LINE>BeanMetadataElement source = this.parseSource(element, parserContext);<NEW_LINE>if (source == null) {<NEW_LINE>parserContext.getReaderContext().error("failed to parse source", element);<NEW_LINE>}<NEW_LINE>BeanDefinitionBuilder adapterBuilder = BeanDefinitionBuilder.genericBeanDefinition(SourcePollingChannelAdapterFactoryBean.class);<NEW_LINE>String sourceBeanName = null;<NEW_LINE>if (source instanceof BeanDefinition) {<NEW_LINE>String channelAdapterId = this.resolveId(element, adapterBuilder.getRawBeanDefinition(), parserContext);<NEW_LINE>sourceBeanName = channelAdapterId + ".source";<NEW_LINE>parserContext.getRegistry().registerBeanDefinition<MASK><NEW_LINE>} else if (source instanceof RuntimeBeanReference) {<NEW_LINE>sourceBeanName = ((RuntimeBeanReference) source).getBeanName();<NEW_LINE>} else {<NEW_LINE>parserContext.getReaderContext().error("Wrong 'source' type: must be 'BeanDefinition' or 'RuntimeBeanReference'", source);<NEW_LINE>}<NEW_LINE>adapterBuilder.addPropertyReference("source", sourceBeanName);<NEW_LINE>adapterBuilder.addPropertyReference("outputChannel", channelName);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(adapterBuilder, element, "send-timeout");<NEW_LINE>Element pollerElement = DomUtils.getChildElementByTagName(element, "poller");<NEW_LINE>if (pollerElement != null) {<NEW_LINE>IntegrationNamespaceUtils.configurePollerMetadata(pollerElement, adapterBuilder, parserContext);<NEW_LINE>}<NEW_LINE>return adapterBuilder.getBeanDefinition();<NEW_LINE>}
(sourceBeanName, (BeanDefinition) source);
880,776
private void convertPicture(Row row, T obj, Integer index, Field field) {<NEW_LINE>byte[] pictureData;<NEW_LINE>if (isXSSFSheet) {<NEW_LINE>XSSFPicture xssfPicture = xssfPicturesMap.get(row.getRowNum() + "_" + index);<NEW_LINE>if (xssfPicture == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pictureData = xssfPicture<MASK><NEW_LINE>} else {<NEW_LINE>HSSFPicture hssfPicture = hssfPictureMap.get(row.getRowNum() + "_" + index);<NEW_LINE>if (hssfPicture == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pictureData = hssfPicture.getPictureData().getData();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>field.set(obj, new ByteArrayInputStream(pictureData));<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new ExcelReadException("Failed to read picture.", e);<NEW_LINE>}<NEW_LINE>}
.getPictureData().getData();
494,165
private void iterate(Platform platform, String[] registryNames, Registry registry, Product[] combination, int index, List<Product> products, int start) throws ManagerException {<NEW_LINE>for (int i = start; i < products.size(); i++) {<NEW_LINE>combination[index] = products.get(i);<NEW_LINE>if (index == combination.length - 1) {<NEW_LINE>for (Product product : products) {<NEW_LINE>product.setStatus(Status.NOT_INSTALLED);<NEW_LINE>}<NEW_LINE>for (Product product : combination) {<NEW_LINE>product.setStatus(Status.TO_BE_INSTALLED);<NEW_LINE>}<NEW_LINE>if (registry.getProductsToInstall().size() == combination.length) {<NEW_LINE>String[] components <MASK><NEW_LINE>for (int j = 0; j < combination.length; j++) {<NEW_LINE>components[j] = combination[j].getUid() + "," + combination[j].getVersion().toString();<NEW_LINE>}<NEW_LINE>createBundle(platform, registryNames, components);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>iterate(platform, registryNames, registry, combination, index + 1, products, i + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new String[combination.length];
390,748
public void updateBlock(GlowBlock block) {<NEW_LINE>MaterialData data = block.getState().getData();<NEW_LINE>if (data instanceof CocoaPlant) {<NEW_LINE>CocoaPlant cocoa = (CocoaPlant) data;<NEW_LINE>CocoaPlantSize size = cocoa.getSize();<NEW_LINE>if (size != CocoaPlantSize.LARGE && ThreadLocalRandom.current().nextInt(5) == 0) {<NEW_LINE>if (size == CocoaPlantSize.SMALL) {<NEW_LINE>cocoa.setSize(CocoaPlantSize.MEDIUM);<NEW_LINE>} else if (size == CocoaPlantSize.MEDIUM) {<NEW_LINE>cocoa.setSize(CocoaPlantSize.LARGE);<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GlowBlockState state = block.getState();<NEW_LINE>state.setData(cocoa);<NEW_LINE>BlockGrowEvent growEvent = new BlockGrowEvent(block, state);<NEW_LINE>EventFactory.<MASK><NEW_LINE>if (!growEvent.isCancelled()) {<NEW_LINE>state.update(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>warnMaterialData(CocoaPlant.class, data);<NEW_LINE>}<NEW_LINE>}
getInstance().callEvent(growEvent);
1,828,777
private void registerHostnameVerifier(String verifier, RestClientBuilder builder) {<NEW_LINE>try {<NEW_LINE>Class<?> verifierClass = Thread.currentThread().getContextClassLoader().loadClass(verifier);<NEW_LINE>builder.hostnameVerifier((HostnameVerifier) verifierClass.getDeclaredConstructor().newInstance());<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new RuntimeException("Could not find a public, no-argument constructor for the hostname verifier class " + verifier, e);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new <MASK><NEW_LINE>} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {<NEW_LINE>throw new RuntimeException("Failed to instantiate hostname verifier class " + verifier + ". Make sure it has a public, no-argument constructor", e);<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>throw new RuntimeException("The provided hostname verifier " + verifier + " is not an instance of HostnameVerifier", e);<NEW_LINE>}<NEW_LINE>}
RuntimeException("Could not find hostname verifier class " + verifier, e);
946,927
public GetUserSettingsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetUserSettingsResult getUserSettingsResult = new GetUserSettingsResult();<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 getUserSettingsResult;<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("userSettings", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getUserSettingsResult.setUserSettings(UserSettingsJsonUnmarshaller.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 getUserSettingsResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
41,211
public static Action createDebuggerGoToAction(final ProjectContext pc, final Debugger debugger) {<NEW_LINE>Models.ActionPerformer actionPerform = new Models.ActionPerformer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isEnabled(Object object) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void perform(Object[] nodes) {<NEW_LINE>Object node = nodes[0];<NEW_LINE>if (node instanceof CallFrame) {<NEW_LINE>CallFrame cf = ((CallFrame) node);<NEW_LINE>Project project = pc.getProject();<NEW_LINE>Line line = MiscEditorUtil.getLine(debugger, project, cf.getScript(), cf.getLineNumber(), cf.getColumnNumber());<NEW_LINE>if (line != null) {<NEW_LINE>showLine(line, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return Models.createAction(NbBundle.getMessage(MiscEditorUtil.class, "CTL_GoToSource"<MASK><NEW_LINE>}
), actionPerform, Models.MULTISELECTION_TYPE_EXACTLY_ONE);
1,148,654
private ObjectNode createIntegration(Context<? extends Trait> context, OperationShape shape, Trait integration) {<NEW_LINE>ObjectNode integrationNode;<NEW_LINE>if (integration instanceof MockIntegrationTrait) {<NEW_LINE>integrationNode = integration.toNode().expectObjectNode().withMember("type", Node.from("mock"));<NEW_LINE>} else if (integration instanceof IntegrationTrait) {<NEW_LINE>validateTraitConfiguration((IntegrationTrait) integration, context, shape);<NEW_LINE>integrationNode = ((IntegrationTrait) integration).toExpandedNode(context.getService(), shape);<NEW_LINE>} else {<NEW_LINE>throw new OpenApiException("Unexpected integration trait: " + integration);<NEW_LINE>}<NEW_LINE>// Fix a naming issue where the Smithy trait uses a different casing for "passthroughBehavior"<NEW_LINE>Optional<Node> passthroughBehavior = integrationNode.getMember(INCORRECT_PASSTHROUGH_BEHAVIOR);<NEW_LINE>if (passthroughBehavior.isPresent()) {<NEW_LINE>integrationNode = integrationNode.withoutMember(INCORRECT_PASSTHROUGH_BEHAVIOR).withMember(<MASK><NEW_LINE>}<NEW_LINE>return integrationNode;<NEW_LINE>}
PASSTHROUGH_BEHAVIOR, passthroughBehavior.get());
1,275,294
public PyObject __call__() {<NEW_LINE>ThreadState ts = Py.getThreadState();<NEW_LINE>if (!ts.enterRepr(self)) {<NEW_LINE>return Py.newString("{...}");<NEW_LINE>} else {<NEW_LINE>StringBuilder repr = new StringBuilder("{");<NEW_LINE>boolean first = true;<NEW_LINE>for (Map.Entry<Object, Object> entry : asMap().entrySet()) {<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>repr.append(", ");<NEW_LINE>}<NEW_LINE>PyObject key = Py.java2py(entry.getKey());<NEW_LINE>repr.append(key.__repr__().toString());<NEW_LINE>repr.append(": ");<NEW_LINE>PyObject value = Py.<MASK><NEW_LINE>repr.append(value.__repr__().toString());<NEW_LINE>}<NEW_LINE>repr.append("}");<NEW_LINE>ts.exitRepr(self);<NEW_LINE>return Py.newString(repr.toString());<NEW_LINE>}<NEW_LINE>}
java2py(entry.getValue());
739,141
public void onBindViewHolder(final RecyclerView.ViewHolder holder, final int position) {<NEW_LINE>int type = getItemViewType(position);<NEW_LINE>switch(type) {<NEW_LINE>case TYPE_ACTION_HEADER:<NEW_LINE>{<NEW_LINE>HeaderViewHolder headerViewHolder = (HeaderViewHolder) holder;<NEW_LINE>headerViewHolder.setAction(mMassOperationAction, BookmarkManager.INSTANCE.areAllCategoriesInvisible());<NEW_LINE>headerViewHolder.getText().setText(R.string.bookmark_lists);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_CATEGORY_ITEM:<NEW_LINE>{<NEW_LINE>final BookmarkCategory category <MASK><NEW_LINE>CategoryViewHolder categoryHolder = (CategoryViewHolder) holder;<NEW_LINE>categoryHolder.setCategory(category);<NEW_LINE>categoryHolder.setName(category.getName());<NEW_LINE>bindSize(categoryHolder, category);<NEW_LINE>categoryHolder.setVisibilityState(category.isVisible());<NEW_LINE>ToggleVisibilityClickListener visibilityListener = new ToggleVisibilityClickListener(categoryHolder);<NEW_LINE>categoryHolder.setVisibilityListener(visibilityListener);<NEW_LINE>CategoryItemMoreClickListener moreClickListener = new CategoryItemMoreClickListener(categoryHolder);<NEW_LINE>categoryHolder.setMoreButtonClickListener(moreClickListener);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_ACTION_ADD:<NEW_LINE>{<NEW_LINE>Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;<NEW_LINE>generalViewHolder.getImage().setImageResource(R.drawable.ic_checkbox_add);<NEW_LINE>generalViewHolder.getText().setText(R.string.bookmarks_create_new_group);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_ACTION_IMPORT:<NEW_LINE>{<NEW_LINE>Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;<NEW_LINE>generalViewHolder.getImage().setImageResource(R.drawable.ic_checkbox_add);<NEW_LINE>generalViewHolder.getText().setText(R.string.bookmarks_import);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new AssertionError("Invalid item type: " + type);<NEW_LINE>}<NEW_LINE>}
= getCategoryByPosition(toCategoryPosition(position));
1,776,066
public CompilationDescription extract(String target, Iterable<String> sources, Iterable<String> classpath, Iterable<String> bootclasspath, Iterable<String> sourcepath, Iterable<String> processorpath, Iterable<String> processors, Iterable<String> options, String outputPath) throws ExtractionException {<NEW_LINE>Preconditions.checkNotNull(target);<NEW_LINE>Preconditions.checkNotNull(sources);<NEW_LINE>Preconditions.checkNotNull(classpath);<NEW_LINE>Preconditions.checkNotNull(bootclasspath);<NEW_LINE>Preconditions.checkNotNull(sourcepath);<NEW_LINE>Preconditions.checkNotNull(processorpath);<NEW_LINE>Preconditions.checkNotNull(processors);<NEW_LINE>Preconditions.checkNotNull(options);<NEW_LINE>Preconditions.checkNotNull(outputPath);<NEW_LINE>return extract(target, sources, ImmutableMap.of(StandardLocation.CLASS_PATH, classpath, StandardLocation.PLATFORM_CLASS_PATH, bootclasspath, StandardLocation.SOURCE_PATH, sourcepath, StandardLocation.ANNOTATION_PROCESSOR_PATH, processorpath<MASK><NEW_LINE>}
), processors, options, outputPath);
561,607
private void lookForQnameDefinition(Node n) {<NEW_LINE>// TODO(b/123725559): There are lots of cases where this could fail to find the right<NEW_LINE>// definition or be fooled by there being multiple definitions.<NEW_LINE>if (n.isClass()) {<NEW_LINE>if (NodeUtil.isClassDeclaration(n)) {<NEW_LINE>// class Foo {...}<NEW_LINE>definitionMap.put(n.getFirstChild().getString(), n);<NEW_LINE>}<NEW_LINE>} else if (n.isFunction()) {<NEW_LINE>if (NodeUtil.isFunctionDeclaration(n)) {<NEW_LINE>// function foo() {...}<NEW_LINE>definitionMap.put(n.getFirstChild().getString(), n);<NEW_LINE>}<NEW_LINE>} else if (n.isAssign()) {<NEW_LINE>// TODO(b/123718645): Add support for destructuring assignments<NEW_LINE>Node lhs = n.getFirstChild();<NEW_LINE>if (lhs.isQualifiedName() && (!lhs.hasChildren() || !lhs.getFirstChild().isThis())) {<NEW_LINE>// qualified.name = value;<NEW_LINE>// but not<NEW_LINE>// this.prop = value;<NEW_LINE>definitionMap.put(lhs.getQualifiedName(), n.getLastChild());<NEW_LINE>}<NEW_LINE>} else if (n.isName()) {<NEW_LINE>// TODO(b/123718645): Add support for destructuring declarations<NEW_LINE>Node parent = checkNotNull(n.getParent(), n);<NEW_LINE>if (NodeUtil.isNameDeclaration(parent)) {<NEW_LINE><MASK><NEW_LINE>if (value != null) {<NEW_LINE>// const foo = value;<NEW_LINE>definitionMap.put(n.getString(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (n.isMemberFunctionDef()) {<NEW_LINE>// Try to find a fully qualified name for the method<NEW_LINE>String lvalueName = NodeUtil.getBestLValueName(n);<NEW_LINE>if (lvalueName != null) {<NEW_LINE>// Store the function as the value<NEW_LINE>definitionMap.put(lvalueName, n.getOnlyChild());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO(b/123725422): Getters and setters?<NEW_LINE>}
Node value = n.getFirstChild();
1,086,568
public MLMethod decode(final NEATPopulation pop, final Substrate substrate, final Genome genome) {<NEW_LINE>// obtain the CPPN<NEW_LINE>final NEATCODEC neatCodec = new NEATCODEC();<NEW_LINE>final NEATNetwork cppn = (NEATNetwork) neatCodec.decode(genome);<NEW_LINE>final List<NEATLink> linkList = new ArrayList<NEATLink>();<NEW_LINE>final ActivationFunction[] afs = new ActivationFunction[substrate.getNodeCount()];<NEW_LINE>final ActivationFunction af = new ActivationSteepenedSigmoid();<NEW_LINE>// all activation functions are the same<NEW_LINE>for (int i = 0; i < afs.length; i++) {<NEW_LINE>afs[i] = af;<NEW_LINE>}<NEW_LINE>final double c = this.maxWeight / (1.0 - this.minWeight);<NEW_LINE>final MLData input = new BasicMLData(cppn.getInputCount());<NEW_LINE>// First create all of the non-bias links.<NEW_LINE>for (final SubstrateLink link : substrate.getLinks()) {<NEW_LINE>final SubstrateNode source = link.getSource();<NEW_LINE>final SubstrateNode target = link.getTarget();<NEW_LINE>int index = 0;<NEW_LINE>for (final double d : source.getLocation()) {<NEW_LINE>input.setData(index++, d);<NEW_LINE>}<NEW_LINE>for (final double d : target.getLocation()) {<NEW_LINE>input.setData(index++, d);<NEW_LINE>}<NEW_LINE>final MLData output = cppn.compute(input);<NEW_LINE>double weight = output.getData(0);<NEW_LINE>if (Math.abs(weight) > this.minWeight) {<NEW_LINE>weight = (Math.abs(weight) - this.minWeight) * c * Math.signum(weight);<NEW_LINE>linkList.add(new NEATLink(source.getId(), target<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now create biased links<NEW_LINE>input.clear();<NEW_LINE>final int d = substrate.getDimensions();<NEW_LINE>final List<SubstrateNode> biasedNodes = substrate.getBiasedNodes();<NEW_LINE>for (final SubstrateNode target : biasedNodes) {<NEW_LINE>for (int i = 0; i < d; i++) {<NEW_LINE>input.setData(d + i, target.getLocation()[i]);<NEW_LINE>}<NEW_LINE>final MLData output = cppn.compute(input);<NEW_LINE>double biasWeight = output.getData(1);<NEW_LINE>if (Math.abs(biasWeight) > this.minWeight) {<NEW_LINE>biasWeight = (Math.abs(biasWeight) - this.minWeight) * c * Math.signum(biasWeight);<NEW_LINE>linkList.add(new NEATLink(0, target.getId(), biasWeight));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check for invalid neural network<NEW_LINE>if (linkList.size() == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Collections.sort(linkList);<NEW_LINE>final NEATNetwork network = new NEATNetwork(substrate.getInputCount(), substrate.getOutputCount(), linkList, afs);<NEW_LINE>network.setActivationCycles(substrate.getActivationCycles());<NEW_LINE>return network;<NEW_LINE>}
.getId(), weight));
1,412,884
private static String dumpActionMapInfo(ActionMap map, Object q, Lookup prev, Lookup now, Lookup globalContext, Lookup originalLkp) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>sb.append("We really get map from the lookup. Map: ").append(map).append(" returned: ").// NOI18N<NEW_LINE>append(q);<NEW_LINE>// NOI18N<NEW_LINE>sb.append("\nprev: ").append(prev == null ? "null prev" : prev<MASK><NEW_LINE>// NOI18N<NEW_LINE>sb.append("\nnow : ").append(now == null ? "null now" : now.lookupAll(Object.class));<NEW_LINE>// NOI18N<NEW_LINE>sb.append("\nglobal ctx : ").append(globalContext == null ? "null" : globalContext.lookupAll(Object.class));<NEW_LINE>// NOI18N<NEW_LINE>sb.append("\noriginal lkp : ").append(originalLkp == null ? "null" : originalLkp.lookupAll(Object.class));<NEW_LINE>return sb.toString();<NEW_LINE>}
.lookupAll(Object.class));
1,095,955
protected void paintComponent(final Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>final Graphics2D g2d = (Graphics2D) g;<NEW_LINE>final Object aa = GraphicsUtils.setupAntialias(g2d);<NEW_LINE>if (image != null) {<NEW_LINE>g2d.drawImage(image, getWidth() / 2 - image.getWidth() / 2 + 1, getHeight() / 2 - image.getHeight(<MASK><NEW_LINE>}<NEW_LINE>final Shape border = new RoundRectangle2D.Double(getWidth() / 2 - width / 2 + 1, getHeight() / 2 - height / 2 + 1, width - (image == null ? 3 : 1), height - (image == null ? 3 : 1), round * 2, round * 2);<NEW_LINE>if (image == null) {<NEW_LINE>g2d.setPaint(new Color(242, 242, 242));<NEW_LINE>g2d.fill(border);<NEW_LINE>g2d.setStroke(new BasicStroke(2, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f, new float[] { MathUtils.limit(5f, Math.max(width, height) / 6, 10f), 8f }, 4f));<NEW_LINE>g2d.setPaint(Color.LIGHT_GRAY);<NEW_LINE>g2d.draw(border);<NEW_LINE>}<NEW_LINE>GraphicsUtils.restoreAntialias(g2d, aa);<NEW_LINE>}
) / 2 + 1, null);
376,284
protected void initComponent(CubaCalendar component) {<NEW_LINE>Messages messages = beanLocator.get(Messages.NAME);<NEW_LINE>String[] monthNamesShort = new String[12];<NEW_LINE>monthNamesShort[0] = messages.getMainMessage("calendar.januaryCaption");<NEW_LINE>monthNamesShort[1] = messages.getMainMessage("calendar.februaryCaption");<NEW_LINE>monthNamesShort[2] = messages.getMainMessage("calendar.marchCaption");<NEW_LINE>monthNamesShort[3] = messages.getMainMessage("calendar.aprilCaption");<NEW_LINE>monthNamesShort[4] = messages.getMainMessage("calendar.mayCaption");<NEW_LINE>monthNamesShort[5] = messages.getMainMessage("calendar.juneCaption");<NEW_LINE>monthNamesShort[6] = messages.getMainMessage("calendar.julyCaption");<NEW_LINE>monthNamesShort[7] = messages.getMainMessage("calendar.augustCaption");<NEW_LINE>monthNamesShort[8] = messages.getMainMessage("calendar.septemberCaption");<NEW_LINE>monthNamesShort[9] = messages.getMainMessage("calendar.octoberCaption");<NEW_LINE>monthNamesShort[10] = messages.getMainMessage("calendar.novemberCaption");<NEW_LINE>monthNamesShort[11] = messages.getMainMessage("calendar.decemberCaption");<NEW_LINE>component.setMonthNamesShort(monthNamesShort);<NEW_LINE>String[] dayNamesShort = new String[7];<NEW_LINE>dayNamesShort[0] = messages.getMainMessage("calendar.sundayCaption");<NEW_LINE>dayNamesShort[1<MASK><NEW_LINE>dayNamesShort[2] = messages.getMainMessage("calendar.tuesdayCaption");<NEW_LINE>dayNamesShort[3] = messages.getMainMessage("calendar.wednesdayCaption");<NEW_LINE>dayNamesShort[4] = messages.getMainMessage("calendar.thursdayCaption");<NEW_LINE>dayNamesShort[5] = messages.getMainMessage("calendar.fridayCaption");<NEW_LINE>dayNamesShort[6] = messages.getMainMessage("calendar.saturdayCaption");<NEW_LINE>component.setDayNamesShort(dayNamesShort);<NEW_LINE>if (TIME_FORMAT_12H.equals(messages.getMainMessage("calendar.timeFormat"))) {<NEW_LINE>setTimeFormat(TimeFormat.FORMAT_12H);<NEW_LINE>} else if (TIME_FORMAT_24H.equals(messages.getMainMessage("calendar.timeFormat"))) {<NEW_LINE>setTimeFormat(TimeFormat.FORMAT_24H);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(String.format("Can't set time format '%s'", messages.getMainMessage("calendar.timeFormat")));<NEW_LINE>}<NEW_LINE>UserSessionSource userSessionSource = beanLocator.get(UserSessionSource.NAME);<NEW_LINE>TimeZone userTimeZone = userSessionSource.getUserSession().getTimeZone();<NEW_LINE>if (userTimeZone != null) {<NEW_LINE>setTimeZone(userTimeZone);<NEW_LINE>}<NEW_LINE>setNavigationButtonsStyle(navigationButtonsVisible);<NEW_LINE>}
] = messages.getMainMessage("calendar.mondayCaption");
612,965
public void marshall(CustomRoutingAccelerator customRoutingAccelerator, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (customRoutingAccelerator == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(customRoutingAccelerator.getAcceleratorArn(), ACCELERATORARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(customRoutingAccelerator.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(customRoutingAccelerator.getEnabled(), ENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(customRoutingAccelerator.getIpSets(), IPSETS_BINDING);<NEW_LINE>protocolMarshaller.marshall(customRoutingAccelerator.getDnsName(), DNSNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(customRoutingAccelerator.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(customRoutingAccelerator.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(customRoutingAccelerator.getLastModifiedTime(), LASTMODIFIEDTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
customRoutingAccelerator.getIpAddressType(), IPADDRESSTYPE_BINDING);
1,131,955
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>poolNameLabel = new javax.swing.JLabel();<NEW_LINE>poolNameCombo = <MASK><NEW_LINE>poolNameLabel.setLabelFor(poolNameCombo);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(poolNameLabel, org.openide.util.NbBundle.getMessage(ConnectorCustomizer.class, "ConnectorCustomizer.poolNameLabel.text"));<NEW_LINE>poolNameCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "fetching data...." }));<NEW_LINE>// NOI18N<NEW_LINE>poolNameCombo.setActionCommand("resources\\.connector-connection-pool\\..*\\.name");<NEW_LINE>// NOI18N<NEW_LINE>poolNameCombo.setName("pool-name");<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(poolNameLabel).addGap(2, 2, 2).addComponent(poolNameCombo, 0, 260, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(poolNameLabel).addComponent(poolNameCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addContainerGap(40, Short.MAX_VALUE)));<NEW_LINE>}
new javax.swing.JComboBox();
362,476
private boolean visit(List<SQLInsertStatement.ValuesClause> valuesList) {<NEW_LINE>boolean isBatch = false;<NEW_LINE>List<SQLInsertStatement.<MASK><NEW_LINE>if (newValuesList.size() < valuesList.size()) {<NEW_LINE>isBatch = true;<NEW_LINE>valuesList = newValuesList;<NEW_LINE>}<NEW_LINE>SqlNode[] rows = new SqlNode[valuesList.size()];<NEW_LINE>for (int j = 0; j < valuesList.size(); j++) {<NEW_LINE>List<SQLExpr> values = valuesList.get(j).getValues();<NEW_LINE>SqlNode[] valueNodes = new SqlNode[values.size()];<NEW_LINE>for (int i = 0; i < values.size(); i++) {<NEW_LINE>SqlNode valueNode = convertToSqlNode(values.get(i));<NEW_LINE>valueNodes[i] = valueNode;<NEW_LINE>}<NEW_LINE>SqlBasicCall row = new SqlBasicCall(SqlStdOperatorTable.ROW, valueNodes, SqlParserPos.ZERO);<NEW_LINE>rows[j] = row;<NEW_LINE>}<NEW_LINE>this.sqlNode = new SqlBasicCall(SqlStdOperatorTable.VALUES, rows, SqlParserPos.ZERO);<NEW_LINE>return isBatch;<NEW_LINE>}
ValuesClause> newValuesList = convertToSingleValuesIfNeed(valuesList);
1,439,058
public static APIAttachBackupStorageToZoneEvent __example__() {<NEW_LINE>APIAttachBackupStorageToZoneEvent event = new APIAttachBackupStorageToZoneEvent();<NEW_LINE>BackupStorageInventory bs = new BackupStorageInventory();<NEW_LINE>bs.setName("My Backup Storage");<NEW_LINE>bs.setDescription("Public Backup Storage");<NEW_LINE>bs.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>bs.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>bs.setType("Ceph");<NEW_LINE>bs.setState(BackupStorageState.Enabled.toString());<NEW_LINE>bs.setStatus(BackupStorageStatus.Connected.toString());<NEW_LINE>bs.setAvailableCapacity(924L * 1024L * 1024L);<NEW_LINE>bs.setTotalCapacity(1024L * 1024L * 1024L);<NEW_LINE>bs.setAttachedZoneUuids(Collections<MASK><NEW_LINE>event.setInventory(bs);<NEW_LINE>return event;<NEW_LINE>}
.singletonList(uuid()));
1,072,317
protected void parseIntent(Context ctx, String action, Bundle bundle) {<NEW_LINE>if (ACTION_SPOTIFY_PLAYBACKSTATECHANGED.equals(action)) {<NEW_LINE>if (bundle.getBoolean("playing")) {<NEW_LINE>setState(MicroService.State.RESUME);<NEW_LINE>setIsSameAsCurrentTrack();<NEW_LINE>} else {<NEW_LINE>setState(MicroService.State.PAUSE);<NEW_LINE>setIsSameAsCurrentTrack();<NEW_LINE>}<NEW_LINE>} else if (ACTION_SPOTIFY_METADATACHANGED.equals(action)) {<NEW_LINE>setState(MicroService.State.START);<NEW_LINE>Artist artist = Artist.get(bundle.getString("artist"));<NEW_LINE>Album album = null;<NEW_LINE>if (bundle.getString("album") != null) {<NEW_LINE>album = Album.get(bundle<MASK><NEW_LINE>}<NEW_LINE>Track track = Track.get(bundle.getString("track"), album, artist);<NEW_LINE>setTimestamp(System.currentTimeMillis());<NEW_LINE>// throws on bad data<NEW_LINE>setTrack(track);<NEW_LINE>}<NEW_LINE>}
.getString("album"), artist);
1,147,393
public FrameDetail mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>FrameDetail frame = new FrameDetail();<NEW_LINE>frame.id = rs.getString("pk_frame");<NEW_LINE>frame.dependCount = rs.getInt("int_depend_count");<NEW_LINE>frame.exitStatus = rs.getInt("int_exit_status");<NEW_LINE>frame.jobId = rs.getString("pk_job");<NEW_LINE>frame.layerId = rs.getString("pk_layer");<NEW_LINE>frame.showId = rs.getString("pk_show");<NEW_LINE>frame.maxRss = rs.getLong("int_mem_max_used");<NEW_LINE>frame.name = rs.getString("str_name");<NEW_LINE>frame.number = rs.getInt("int_number");<NEW_LINE>frame.<MASK><NEW_LINE>frame.retryCount = rs.getInt("int_retries");<NEW_LINE>frame.dateStarted = rs.getTimestamp("ts_started");<NEW_LINE>frame.dateStopped = rs.getTimestamp("ts_stopped");<NEW_LINE>frame.dateUpdated = rs.getTimestamp("ts_updated");<NEW_LINE>frame.dateLLU = rs.getTimestamp("ts_llu");<NEW_LINE>frame.version = rs.getInt("int_version");<NEW_LINE>if (rs.getString("str_host") != null) {<NEW_LINE>frame.lastResource = String.format("%s/%d/%d", rs.getString("str_host"), rs.getInt("int_cores"), rs.getInt("int_gpus"));<NEW_LINE>} else {<NEW_LINE>frame.lastResource = "";<NEW_LINE>}<NEW_LINE>frame.state = FrameState.valueOf(rs.getString("str_state"));<NEW_LINE>return frame;<NEW_LINE>}
dispatchOrder = rs.getInt("int_dispatch_order");
1,050,053
public void mapPartition(Iterable<WindowedValue<InputT>> iterable, Collector<RawUnionValue> collector) throws Exception {<NEW_LINE>ReceiverFactory receiverFactory = new ReceiverFactory(collector, outputMap);<NEW_LINE>if (sdfStateInternals != null) {<NEW_LINE>sdfTimerInternals.advanceProcessingTime(Instant.now());<NEW_LINE>sdfTimerInternals.advanceSynchronizedProcessingTime(Instant.now());<NEW_LINE>}<NEW_LINE>try (RemoteBundle bundle = stageBundleFactory.getBundle(receiverFactory, stateRequestHandler, progressHandler, finalizationHandler, bundleCheckpointHandler)) {<NEW_LINE>processElements(iterable, bundle);<NEW_LINE>}<NEW_LINE>if (sdfTimerInternals != null) {<NEW_LINE>// Finally, advance the processing time to infinity to fire any timers.<NEW_LINE>sdfTimerInternals.advanceProcessingTime(BoundedWindow.TIMESTAMP_MAX_VALUE);<NEW_LINE>sdfTimerInternals.advanceSynchronizedProcessingTime(BoundedWindow.TIMESTAMP_MAX_VALUE);<NEW_LINE>// Now we fire the SDF timers and process elements generated by timers.<NEW_LINE>while (sdfTimerInternals.hasPendingTimers()) {<NEW_LINE>try (RemoteBundle bundle = stageBundleFactory.getBundle(receiverFactory, stateRequestHandler, progressHandler, finalizationHandler, bundleCheckpointHandler)) {<NEW_LINE>List<WindowedValue<InputT>> residuals = new ArrayList<>();<NEW_LINE>TimerInternals.TimerData timer;<NEW_LINE>while ((timer = sdfTimerInternals.removeNextProcessingTimer()) != null) {<NEW_LINE>WindowedValue stateValue = sdfStateInternals.state(timer.getNamespace(), StateTags.value(timer.getTimerId()<MASK><NEW_LINE>residuals.add(stateValue);<NEW_LINE>}<NEW_LINE>processElements(residuals, bundle);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, inputCoder)).read();
933,778
private static Map<String, String> delimitedToMap(Map<String, String> map, String source, String listDelimiter, String nameValueSeparator) {<NEW_LINE>int pos = 0;<NEW_LINE>while (true) {<NEW_LINE>if (pos >= source.length()) {<NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>int equalsPos = source.indexOf(nameValueSeparator, pos);<NEW_LINE>int delimPos = source.indexOf(listDelimiter, pos);<NEW_LINE>if (delimPos == -1) {<NEW_LINE>delimPos = source.length();<NEW_LINE>}<NEW_LINE>if (equalsPos == -1) {<NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>if (delimPos == (equalsPos + 1)) {<NEW_LINE>pos = delimPos + 1;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (equalsPos > delimPos) {<NEW_LINE>// there is a key without a value?<NEW_LINE>String key = source.substring(pos, delimPos);<NEW_LINE>key = key.trim();<NEW_LINE>if (!key.isEmpty()) {<NEW_LINE>map.put(key, null);<NEW_LINE>}<NEW_LINE>pos = delimPos + 1;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String key = <MASK><NEW_LINE>String value = source.substring(equalsPos + 1, delimPos);<NEW_LINE>map.put(key.trim(), value);<NEW_LINE>pos = delimPos + 1;<NEW_LINE>}<NEW_LINE>}
source.substring(pos, equalsPos);
1,431,354
final CreateClassificationJobResult executeCreateClassificationJob(CreateClassificationJobRequest createClassificationJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createClassificationJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateClassificationJobRequest> request = null;<NEW_LINE>Response<CreateClassificationJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateClassificationJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createClassificationJobRequest));<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, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateClassificationJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateClassificationJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateClassificationJobResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime);
321,699
public ConnectionFuture<StatefulRedisConnection<K, V>> apply(ConnectionKey key) {<NEW_LINE>RedisClusterNode targetNode = null;<NEW_LINE>if (key.nodeId != null && (targetNode = getPartitions().getPartitionByNodeId(key.nodeId)) == null) {<NEW_LINE>clusterEventListener.onUnknownNode();<NEW_LINE>throw connectionAttemptRejected("node id " + key.nodeId);<NEW_LINE>}<NEW_LINE>if (key.host != null && (targetNode = partitions.getPartition(key.host, key.port)) == null) {<NEW_LINE>clusterEventListener.onUnknownNode();<NEW_LINE>if (validateClusterNodeMembership()) {<NEW_LINE>throw connectionAttemptRejected(key.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>ConnectionFuture<StatefulRedisConnection<K, V>> connection = delegate.apply(key);<NEW_LINE>LettuceAssert.notNull(connection, "Connection is null. Check ConnectionKey because host and nodeId are null.");<NEW_LINE>if (key.intent == Intent.READ) {<NEW_LINE>connection = connection.thenCompose(c -> {<NEW_LINE>RedisFuture<String> stringRedisFuture = c.async().readOnly();<NEW_LINE>return stringRedisFuture.thenApply(s -> c).whenCompleteAsync((s, throwable) -> {<NEW_LINE>if (throwable != null) {<NEW_LINE>c.close();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}<NEW_LINE>RedisClusterNode actualNode = targetNode;<NEW_LINE>connection = connection.thenApply(c -> {<NEW_LINE>synchronized (stateLock) {<NEW_LINE>c.setAutoFlushCommands(autoFlushCommands);<NEW_LINE>c.addListener(message -> onPushMessage(actualNode, message));<NEW_LINE>}<NEW_LINE>return c;<NEW_LINE>});<NEW_LINE>return connection;<NEW_LINE>}
host + ":" + key.port);
1,043,690
public Alarms unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Alarms alarms = new Alarms();<NEW_LINE><MASK><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("alarmRoleArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>alarms.setAlarmRoleArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("notificationLambdaArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>alarms.setNotificationLambdaArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return alarms;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
846,403
private void rejectOrder(String senderCompId, String targetCompId, String clOrdId, String symbol, char side, String message) {<NEW_LINE>ExecutionReport fixOrder = new ExecutionReport(new OrderID(clOrdId), new ExecID(generator.genExecutionID()), new ExecTransType(ExecTransType.NEW), new ExecType(ExecType.REJECTED), new OrdStatus(ExecType.REJECTED), new Symbol(symbol), new Side(side), new LeavesQty(0), new CumQty(0), new AvgPx(0));<NEW_LINE>fixOrder.setString(ClOrdID.FIELD, clOrdId);<NEW_LINE>fixOrder.<MASK><NEW_LINE>fixOrder.setInt(OrdRejReason.FIELD, OrdRejReason.BROKER_EXCHANGE_OPTION);<NEW_LINE>try {<NEW_LINE>Session.sendToTarget(fixOrder, senderCompId, targetCompId);<NEW_LINE>} catch (SessionNotFound e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
setString(Text.FIELD, message);
505,991
public Attributes toAttributes(Attributes attrs) {<NEW_LINE>int offsetSOF = offsetSOF();<NEW_LINE>if (offsetSOF == -1)<NEW_LINE>return null;<NEW_LINE>if (attrs == null)<NEW_LINE>attrs = new Attributes(10);<NEW_LINE>int sof = data[offsetSOF] & 255;<NEW_LINE>int p = data[offsetSOF + 3] & 0xff;<NEW_LINE>int y = ((data[offsetSOF + 3 + 1] & 0xff) << 8) | (data[offsetSOF + 3 + 2] & 0xff);<NEW_LINE>int x = ((data[offsetSOF + 3 + 3] & 0xff) << 8) | (data[offsetSOF + 3 + 4] & 0xff);<NEW_LINE>int nf = data[offsetSOF + 3 + 5] & 0xff;<NEW_LINE>attrs.setInt(Tag.SamplesPerPixel, VR.US, nf);<NEW_LINE>if (nf == 3) {<NEW_LINE>attrs.setString(Tag.PhotometricInterpretation, VR.CS, (sof == JPEG.SOF3 || sof == JPEG.SOF55) ? "RGB" : "YBR_FULL_422");<NEW_LINE>attrs.setInt(Tag.PlanarConfiguration, VR.US, 0);<NEW_LINE>} else {<NEW_LINE>attrs.setString(Tag.PhotometricInterpretation, VR.CS, "MONOCHROME2");<NEW_LINE>}<NEW_LINE>attrs.setInt(Tag.Rows, VR.US, y);<NEW_LINE>attrs.setInt(Tag.Columns, VR.US, x);<NEW_LINE>attrs.setInt(Tag.BitsAllocated, VR.US, <MASK><NEW_LINE>attrs.setInt(Tag.BitsStored, VR.US, p);<NEW_LINE>attrs.setInt(Tag.HighBit, VR.US, p - 1);<NEW_LINE>attrs.setInt(Tag.PixelRepresentation, VR.US, 0);<NEW_LINE>if (!(sof == JPEG.SOF3 || (sof == JPEG.SOF55 && ss() == 0)))<NEW_LINE>attrs.setString(Tag.LossyImageCompression, VR.CS, "01");<NEW_LINE>return attrs;<NEW_LINE>}
p > 8 ? 16 : 8);
763,429
public Future<ReconcileResult<String>> reconcile(Reconciliation reconciliation, String username, String desired) {<NEW_LINE>if (desired != null) {<NEW_LINE>UserScramCredentialUpsertion upsertion = new UserScramCredentialUpsertion(username, new ScramCredentialInfo(SCRAM_MECHANISM, ITERATIONS), desired.getBytes(StandardCharsets.UTF_8), SALT);<NEW_LINE>LOGGER.debugCr(reconciliation, "Upserting SCRAM credentials for user {}", username);<NEW_LINE>AlterUserScramCredentialsResult result = adminClient.alterUserScramCredentials(List.of(upsertion));<NEW_LINE>return Util.kafkaFutureToVertxFuture(reconciliation, vertx, result.all()).map(ReconcileResult.patched(desired));<NEW_LINE>} else {<NEW_LINE>Promise<ReconcileResult<String>> deletePromise = Promise.promise();<NEW_LINE>UserScramCredentialDeletion deletion = new UserScramCredentialDeletion(username, SCRAM_MECHANISM);<NEW_LINE>LOGGER.debugCr(reconciliation, "Deleting SCRAM credentials for user {}", username);<NEW_LINE>AlterUserScramCredentialsResult result = adminClient.alterUserScramCredentials(List.of(deletion));<NEW_LINE>result.all().whenComplete((ignore, error) -> {<NEW_LINE>vertx.runOnContext(ignore2 -> {<NEW_LINE>if (error != null) {<NEW_LINE>if (error instanceof ResourceNotFoundException) {<NEW_LINE>// Resource was not found => return success<NEW_LINE>LOGGER.debugCr(reconciliation, "Previously deleted SCRAM credentials for user {}", username);<NEW_LINE>deletePromise.complete(ReconcileResult.noop(null));<NEW_LINE>} else {<NEW_LINE>LOGGER.<MASK><NEW_LINE>deletePromise.fail(error);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.debugCr(reconciliation, "Deleted SCRAM credentials for user {}", username);<NEW_LINE>deletePromise.complete(ReconcileResult.deleted());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>return deletePromise.future();<NEW_LINE>}<NEW_LINE>}
warnCr(reconciliation, "Failed to delete SCRAM credentials for user {}", username);
1,591,537
protected List<URI> configureLogging(List<URI> defaults) {<NEW_LINE>autodetectHome();<NEW_LINE>Map<String, String> <MASK><NEW_LINE>envVars.put("home", home.toAbsolutePath().toString());<NEW_LINE>envVars.put("tstamp", tstamp);<NEW_LINE>DcsLookup.setup(envVars);<NEW_LINE>Path conf = home.resolve("conf").resolve("logging");<NEW_LINE>Path configuration;<NEW_LINE>if (super.logging.configuration != null) {<NEW_LINE>// An explicit configuration is used. Leave as-is.<NEW_LINE>return defaults;<NEW_LINE>} else if (super.logging.trace) {<NEW_LINE>configuration = conf.resolve("log4j2-trace.xml");<NEW_LINE>} else if (super.logging.verbose) {<NEW_LINE>configuration = conf.resolve("log4j2-verbose.xml");<NEW_LINE>} else if (super.logging.quiet) {<NEW_LINE>configuration = conf.resolve("log4j2-quiet.xml");<NEW_LINE>} else {<NEW_LINE>configuration = conf.resolve("log4j2-default.xml");<NEW_LINE>}<NEW_LINE>return Collections.singletonList(configuration.toUri());<NEW_LINE>}
envVars = new HashMap<>();
207,546
private void init(CacheParams cacheParams) {<NEW_LINE>clearCache();<NEW_LINE>if (mReusableBitmaps != null) {<NEW_LINE>mReusableBitmaps.clear();<NEW_LINE>mReusableBitmaps = null;<NEW_LINE>}<NEW_LINE>mParams = cacheParams;<NEW_LINE>// Set up memory cache<NEW_LINE>if (mParams.memoryCacheEnabled) {<NEW_LINE>if (Worker.debuggable > 0) {<NEW_LINE>Log.v(TAG, <MASK><NEW_LINE>}<NEW_LINE>// If we're running on Honeycomb or newer, create a set of reusable bitmaps that can be<NEW_LINE>// populated into the inBitmap field of BitmapFactory.Options. Note that the set is<NEW_LINE>// of SoftReferences which will actually not be very effective due to the garbage<NEW_LINE>// collector being aggressive clearing Soft/WeakReferences. A better approach<NEW_LINE>// would be to use a strongly references bitmaps, however this would require some<NEW_LINE>// balancing of memory usage between this set and the bitmap LruCache. It would also<NEW_LINE>// require knowledge of the expected size of the bitmaps. From Honeycomb to JellyBean<NEW_LINE>// the size would need to be precise, from KitKat onward the size would just need to<NEW_LINE>// be the upper bound (due to changes in how inBitmap can re-use bitmaps).<NEW_LINE>if (Utils.hasHoneycomb()) {<NEW_LINE>mReusableBitmaps = Collections.synchronizedSet(new HashSet<SoftReference<Bitmap>>());<NEW_LINE>}<NEW_LINE>mMemoryCacheUsage = new HashMap<String, Integer>();<NEW_LINE>mMemoryCache = new LruCache<String, Bitmap>(mParams.memCacheSize) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void entryRemoved(boolean evicted, String key, Bitmap oldValue, Bitmap newValue) {<NEW_LINE>Integer count = mMemoryCacheUsage.get(key);<NEW_LINE>if (Utils.hasHoneycomb() && (count == null || count == 0)) {<NEW_LINE>// We're running on Honeycomb or later, so add the bitmap<NEW_LINE>// to a SoftReference set for possible use with inBitmap later<NEW_LINE>mReusableBitmaps.add(new SoftReference<Bitmap>(oldValue));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected int sizeOf(String key, Bitmap value) {<NEW_LINE>final int bitmapSize = getBitmapSize(value) / 1024;<NEW_LINE>return bitmapSize == 0 ? 1 : bitmapSize;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}
"Memory cache created (size = " + mParams.memCacheSize + ")");
430,825
public static BooleanExpression asBoolean(Expression<Boolean> expr) {<NEW_LINE>Expression<Boolean> underlyingMixin = ExpressionUtils.extract(expr);<NEW_LINE>if (underlyingMixin instanceof PathImpl) {<NEW_LINE>return new BooleanPath((PathImpl<Boolean>) underlyingMixin);<NEW_LINE>} else if (underlyingMixin instanceof PredicateOperation) {<NEW_LINE>return new BooleanOperation((PredicateOperation) underlyingMixin);<NEW_LINE>} else if (underlyingMixin instanceof PredicateTemplate) {<NEW_LINE>return <MASK><NEW_LINE>} else {<NEW_LINE>return new BooleanExpression(underlyingMixin) {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = -8712299418891960222L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public <R, C> R accept(Visitor<R, C> v, C context) {<NEW_LINE>return this.mixin.accept(v, context);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean equals(Object o) {<NEW_LINE>if (o == this) {<NEW_LINE>return true;<NEW_LINE>} else if (o instanceof BooleanExpression) {<NEW_LINE>BooleanExpression other = (BooleanExpression) o;<NEW_LINE>return (other.mixin.equals(this.mixin));<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}
new BooleanTemplate((PredicateTemplate) underlyingMixin);
1,704,019
public String listResourceSets(Model m, Authentication auth) {<NEW_LINE>ensureOAuthScope(auth, SystemScopeService.UMA_PROTECTION_SCOPE);<NEW_LINE>String owner = auth.getName();<NEW_LINE>Collection<ResourceSet> resourceSets = Collections.emptySet();<NEW_LINE>if (auth instanceof OAuth2Authentication) {<NEW_LINE>// if it's an OAuth mediated call, it's on behalf of a client, so look that up too<NEW_LINE>OAuth2Authentication o2a = (OAuth2Authentication) auth;<NEW_LINE>resourceSets = resourceSetService.getAllForOwnerAndClient(owner, o2a.getOAuth2Request().getClientId());<NEW_LINE>} else {<NEW_LINE>// otherwise get everything for the current user<NEW_LINE>resourceSets = resourceSetService.getAllForOwner(owner);<NEW_LINE>}<NEW_LINE>// build the entity here and send to the display<NEW_LINE>Set<String> ids = new HashSet<>();<NEW_LINE>for (ResourceSet resourceSet : resourceSets) {<NEW_LINE>// add them all as strings so that gson renders them properly<NEW_LINE>ids.add(resourceSet.<MASK><NEW_LINE>}<NEW_LINE>m.addAttribute(JsonEntityView.ENTITY, ids);<NEW_LINE>return JsonEntityView.VIEWNAME;<NEW_LINE>}
getId().toString());
1,764,141
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "LookoutEquipment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,479,296
private void uploadAutoModeContextSettings(File remoteFolder) throws SharedConfigurationException {<NEW_LINE>logger.log(Level.INFO, <MASK><NEW_LINE>publishTask("Uploading AutoModeContext configuration files");<NEW_LINE>// Make a subfolder<NEW_LINE>File remoteAutoConfFolder = new File(remoteFolder, AUTO_MODE_FOLDER);<NEW_LINE>try {<NEW_LINE>if (remoteAutoConfFolder.exists()) {<NEW_LINE>FileUtils.deleteDirectory(remoteAutoConfFolder);<NEW_LINE>}<NEW_LINE>Files.createDirectories(remoteAutoConfFolder.toPath());<NEW_LINE>} catch (IOException | SecurityException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, "Failed to create clean shared configuration subfolder " + remoteAutoConfFolder.getAbsolutePath(), ex);<NEW_LINE>throw new SharedConfigurationException("Failed to create clean shared configuration subfolder " + remoteAutoConfFolder.getAbsolutePath());<NEW_LINE>}<NEW_LINE>IngestJobSettings ingestJobSettings = new IngestJobSettings(AutoIngestUserPreferences.getAutoModeIngestModuleContextString());<NEW_LINE>File localFolder = ingestJobSettings.getSavedModuleSettingsFolder().toFile();<NEW_LINE>if (!localFolder.exists()) {<NEW_LINE>logger.log(Level.SEVERE, "Local configuration folder {0} does not exist", localFolder.getAbsolutePath());<NEW_LINE>throw new SharedConfigurationException("Local configuration folder " + localFolder.getAbsolutePath() + " does not exist");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FileUtils.copyDirectory(localFolder, remoteAutoConfFolder);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new SharedConfigurationException(String.format("Failed to copy %s to %s", localFolder.getAbsolutePath(), remoteAutoConfFolder.getAbsolutePath()), ex);<NEW_LINE>}<NEW_LINE>}
"Uploading shared configuration to {0}", remoteFolder.getAbsolutePath());
1,839,595
private DFProgressObject changeAppRef(Target[] targets, String moduleID, String commandName, String action, Map origOptions) {<NEW_LINE>ensureConnected();<NEW_LINE>targets = getTargetServers(targets);<NEW_LINE>ProgressObjectImpl po = new ProgressObjectImpl(targets);<NEW_LINE>List<TargetModuleIDImpl> targetModuleIDList = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>final DFDeploymentProperties options = new DFDeploymentProperties();<NEW_LINE>options.putAll(origOptions);<NEW_LINE>for (Target target : targets) {<NEW_LINE>options.put(DFDeploymentProperties.TARGET, target.getName());<NEW_LINE>String[] operands = new String[] { moduleID };<NEW_LINE>DFDeploymentStatus mainStatus = null;<NEW_LINE>DFCommandRunner commandRunner = getDFCommandRunner(commandName, options, operands);<NEW_LINE>DFDeploymentStatus ds = commandRunner.run();<NEW_LINE>mainStatus = ds.getMainStatus();<NEW_LINE>String message = localStrings.getLocalString("enterprise.deployment.client.create_reference", "Creation of reference for application in target {0}", target.getName());<NEW_LINE>if (!po.checkStatusAndAddStage((TargetImpl) target, message, mainStatus)) {<NEW_LINE>return po;<NEW_LINE>}<NEW_LINE>TargetModuleIDImpl targetModuleID = new TargetModuleIDImpl((TargetImpl) target, moduleID);<NEW_LINE>targetModuleIDList.add(targetModuleID);<NEW_LINE>}<NEW_LINE>TargetModuleIDImpl[] targetModuleIDs = new TargetModuleIDImpl[targetModuleIDList.size()];<NEW_LINE><MASK><NEW_LINE>String message = localStrings.getLocalString("enterprise.deployment.client.change_reference_application", "{0} of application reference in all targets", action);<NEW_LINE>po.setupForNormalExit(message, (TargetImpl) targets[0], targetModuleIDs);<NEW_LINE>return po;<NEW_LINE>} catch (Throwable ioex) {<NEW_LINE>String message = localStrings.getLocalString("enterprise.deployment.client.change_reference_application_failed", "{0} of application reference failed - {1}", action, ioex.getMessage());<NEW_LINE>po.setupForAbnormalExit(message, (TargetImpl) targets[0]);<NEW_LINE>return po;<NEW_LINE>}<NEW_LINE>}
targetModuleIDs = targetModuleIDList.toArray(targetModuleIDs);
963,504
private File buildSegment() throws Exception {<NEW_LINE>Schema schema = new Schema();<NEW_LINE>for (int i = 0; i < NUM_COLUMNS; i++) {<NEW_LINE>String column = "column_" + i;<NEW_LINE>DimensionFieldSpec dimensionFieldSpec = new DimensionFieldSpec(column, FieldSpec.DataType.STRING, true);<NEW_LINE>schema.addField(dimensionFieldSpec);<NEW_LINE>}<NEW_LINE>TableConfig tableConfig = new TableConfigBuilder(TableType.OFFLINE).setTableName("test").build();<NEW_LINE>SegmentGeneratorConfig config = new SegmentGeneratorConfig(tableConfig, schema);<NEW_LINE>config.setRawIndexCreationColumns(Collections.singletonList(_rawIndexColumn));<NEW_LINE>config.setOutDir(SEGMENT_DIR_NAME);<NEW_LINE>config.setSegmentName(SEGMENT_NAME);<NEW_LINE>BufferedReader reader = new BufferedReader(new FileReader(_dataFile));<NEW_LINE>String value;<NEW_LINE>final List<GenericRow> rows = new ArrayList<>();<NEW_LINE>System.out.println("Reading data...");<NEW_LINE>while ((value = reader.readLine()) != null) {<NEW_LINE>HashMap<String, Object> map = new HashMap<>();<NEW_LINE>for (FieldSpec fieldSpec : schema.getAllFieldSpecs()) {<NEW_LINE>map.put(fieldSpec.getName(), value);<NEW_LINE>}<NEW_LINE>GenericRow genericRow = new GenericRow();<NEW_LINE>genericRow.init(map);<NEW_LINE>rows.add(genericRow);<NEW_LINE>_numRows++;<NEW_LINE>if (_numRows % 1000000 == 0) {<NEW_LINE>System.out.println("Read rows: " + _numRows);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Generating segment...");<NEW_LINE>SegmentIndexCreationDriverImpl driver = new SegmentIndexCreationDriverImpl();<NEW_LINE>driver.init(config, new GenericRowRecordReader(rows));<NEW_LINE>driver.build();<NEW_LINE><MASK><NEW_LINE>}
return new File(SEGMENT_DIR_NAME, SEGMENT_NAME);
1,081,438
private static VirtualMachine prepareSpecializedUnmanagedVirtualMachine(AzureResourceManager azureResourceManager, Region region, String rgName) {<NEW_LINE>final String userName = "tirekicker";<NEW_LINE>final <MASK><NEW_LINE>final String linuxVMName1 = Utils.randomResourceName(azureResourceManager, "vm" + "-", 10);<NEW_LINE>final String publicIpDnsLabel = Utils.randomResourceName(azureResourceManager, "pip" + "-", 20);<NEW_LINE>VirtualMachine linuxVM = azureResourceManager.virtualMachines().define(linuxVMName1).withRegion(region).withNewResourceGroup(rgName).withNewPrimaryNetwork("10.0.0.0/28").withPrimaryPrivateIPAddressDynamic().withNewPrimaryPublicIPAddress(publicIpDnsLabel).withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS).withRootUsername(userName).withSsh(sshPublicKey).withUnmanagedDisks().defineUnmanagedDataDisk("disk-1").withNewVhd(100).withLun(1).attach().defineUnmanagedDataDisk("disk-2").withNewVhd(50).withLun(2).attach().withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")).create();<NEW_LINE>// De-provision the virtual machine<NEW_LINE>deprovisionAgentInLinuxVM(linuxVM);<NEW_LINE>System.out.println("Deallocate VM: " + linuxVM.id());<NEW_LINE>linuxVM.deallocate();<NEW_LINE>System.out.println("Deallocated VM: " + linuxVM.id() + "; state = " + linuxVM.powerState());<NEW_LINE>System.out.println("Generalize VM: " + linuxVM.id());<NEW_LINE>linuxVM.generalize();<NEW_LINE>System.out.println("Generalized VM: " + linuxVM.id());<NEW_LINE>return linuxVM;<NEW_LINE>}
String sshPublicKey = Utils.sshPublicKey();
359,061
public Date parse(@NotNull String text, @NotNull ParsePosition pos) {<NEW_LINE>Date date = super.parse(text, pos);<NEW_LINE>if (date == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int index = pos.getIndex();<NEW_LINE>if (index < text.length() && nanoStart > 0) {<NEW_LINE>long nanos = 0;<NEW_LINE>for (int i = 0; i < nanoLength; i++) {<NEW_LINE>int digitPos = index + i;<NEW_LINE>if (digitPos == text.length()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>char c = text.charAt(digitPos);<NEW_LINE>if (!Character.isDigit(c)) {<NEW_LINE>pos.setErrorIndex(index);<NEW_LINE>pos.setIndex(index);<NEW_LINE>// throw new ParseException("Invalid nanosecond character at pos " + digitPos + ": " + c, index);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long digit = ((int) c - (int) '0');<NEW_LINE>for (int k = MAX_NANO_LENGTH - i; k > 0; k--) {<NEW_LINE>digit *= 10;<NEW_LINE>}<NEW_LINE>nanos += digit;<NEW_LINE>}<NEW_LINE>if (nanos > 0) {<NEW_LINE>Timestamp ts = new Timestamp(date.getTime());<NEW_LINE>ts<MASK><NEW_LINE>return ts;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return date;<NEW_LINE>}
.setNanos((int) nanos);
143,689
private static JMethod createEmptyMethodFromExample(JDeclaredType inType, JMethod exampleMethod, boolean isAbstract) {<NEW_LINE>JMethod emptyMethod = new JMethod(exampleMethod.getSourceInfo(), exampleMethod.getName(), inType, exampleMethod.getType(), isAbstract, false, <MASK><NEW_LINE>emptyMethod.addThrownExceptions(exampleMethod.getThrownExceptions());<NEW_LINE>emptyMethod.setSynthetic();<NEW_LINE>// Copy parameters.<NEW_LINE>for (JParameter param : exampleMethod.getParams()) {<NEW_LINE>emptyMethod.cloneParameter(param);<NEW_LINE>}<NEW_LINE>// If the enclosing type is native, make sure the synthetic empty method is native by leaving<NEW_LINE>// the body = null.<NEW_LINE>if (!inType.isJsNative()) {<NEW_LINE>JMethodBody body = new JMethodBody(exampleMethod.getSourceInfo());<NEW_LINE>emptyMethod.setBody(body);<NEW_LINE>}<NEW_LINE>emptyMethod.freezeParamTypes();<NEW_LINE>inType.addMethod(emptyMethod);<NEW_LINE>return emptyMethod;<NEW_LINE>}
false, exampleMethod.getAccess());
141,805
final GetDetectorResult executeGetDetector(GetDetectorRequest getDetectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDetectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDetectorRequest> request = null;<NEW_LINE>Response<GetDetectorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDetectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDetectorRequest));<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, "GuardDuty");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDetectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDetectorResultJsonUnmarshaller());<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);
592,919
protected void applyEnterTableKey(EventBean[] eventsPerStream, Object tableKey, ExprEvaluatorContext exprEvaluatorContext) {<NEW_LINE>ObjectArrayBackedEventBean bean = tableInstance.getCreateRowIntoTable(tableKey, exprEvaluatorContext);<NEW_LINE>currentAggregationRow = (AggregationRow) bean.getProperties()[0];<NEW_LINE>InstrumentationCommon instrumentationCommon = exprEvaluatorContext.getInstrumentationProvider();<NEW_LINE>instrumentationCommon.qAggregationGroupedApplyEnterLeave(true, methodPairs.length, accessAgents.length, tableKey);<NEW_LINE>for (int i = 0; i < methodPairs.length; i++) {<NEW_LINE>TableColumnMethodPairEval methodPair = methodPairs[i];<NEW_LINE>instrumentationCommon.qAggNoAccessEnterLeave(true, i, null, null);<NEW_LINE>Object columnResult = methodPair.getEvaluator().evaluate(eventsPerStream, true, exprEvaluatorContext);<NEW_LINE>currentAggregationRow.enterAgg(<MASK><NEW_LINE>instrumentationCommon.aAggNoAccessEnterLeave(true, i, null);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < accessAgents.length; i++) {<NEW_LINE>instrumentationCommon.qAggAccessEnterLeave(true, i, null);<NEW_LINE>accessAgents[i].applyEnter(eventsPerStream, exprEvaluatorContext, currentAggregationRow, accessColumnsZeroOffset[i]);<NEW_LINE>instrumentationCommon.aAggAccessEnterLeave(true, i);<NEW_LINE>}<NEW_LINE>tableInstance.handleRowUpdated(bean);<NEW_LINE>instrumentationCommon.aAggregationGroupedApplyEnterLeave(true);<NEW_LINE>}
methodPair.getColumn(), columnResult);
1,602,123
private Mono<Response<ConnectionSettingInner>> listWithSecretsWithResponseAsync(String resourceGroupName, String resourceName, String connectionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (connectionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listWithSecrets(this.client.getEndpoint(), resourceGroupName, resourceName, connectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
926,212
public int matchingDegree(@Nonnull String name, boolean valueStartCaseMatch, @Nullable FList<? extends TextRange> fragments) {<NEW_LINE>if (fragments == null)<NEW_LINE>return Integer.MIN_VALUE;<NEW_LINE>if (fragments.isEmpty())<NEW_LINE>return 0;<NEW_LINE>final TextRange first = fragments.getHead();<NEW_LINE>boolean startMatch = first.getStartOffset() == 0;<NEW_LINE>boolean valuedStartMatch = startMatch && valueStartCaseMatch;<NEW_LINE>int errors = 0;<NEW_LINE>int matchingCase = 0;<NEW_LINE>int p = -1;<NEW_LINE>int skippedHumps = 0;<NEW_LINE>int nextHumpStart = 0;<NEW_LINE>boolean humpStartMatchedUpperCase = false;<NEW_LINE>for (TextRange range : fragments) {<NEW_LINE>for (int i = range.getStartOffset(); i < range.getEndOffset(); i++) {<NEW_LINE>boolean afterGap = i == range.getStartOffset() && first != range;<NEW_LINE>boolean isHumpStart = false;<NEW_LINE>while (nextHumpStart <= i) {<NEW_LINE>if (nextHumpStart == i) {<NEW_LINE>isHumpStart = true;<NEW_LINE>} else if (afterGap) {<NEW_LINE>skippedHumps++;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>char c = name.charAt(i);<NEW_LINE>p = StringUtil.indexOf(myPattern, c, p + 1, myPattern.length, false);<NEW_LINE>if (p < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (isHumpStart) {<NEW_LINE>humpStartMatchedUpperCase = c == myPattern[p] && isUpperCase[p];<NEW_LINE>}<NEW_LINE>matchingCase += evaluateCaseMatching(valuedStartMatch, p, humpStartMatchedUpperCase, i, afterGap, isHumpStart, c);<NEW_LINE>}<NEW_LINE>errors += 2000.0 * Math.pow(1.0 * ((Range) range).getErrorCount() / range.getLength(), 2);<NEW_LINE>}<NEW_LINE>int startIndex = first.getStartOffset();<NEW_LINE>boolean afterSeparator = StringUtil.indexOfAny(name, myHardSeparators, 0, startIndex) >= 0;<NEW_LINE>boolean wordStart = startIndex == 0 || NameUtilCore.isWordStart(name, startIndex) && !NameUtilCore.isWordStart(name, startIndex - 1);<NEW_LINE>boolean finalMatch = fragments.get(fragments.size() - 1).getEndOffset() == name.length();<NEW_LINE>return (wordStart ? 1000 : 0) + matchingCase + -fragments.size() + -skippedHumps * 10 + -errors + (afterSeparator ? 0 : 2) + (startMatch ? 1 : 0) + (finalMatch ? 1 : 0);<NEW_LINE>}
nextHumpStart = nextWord(name, nextHumpStart);
959,442
public Optional<SOTrx> retrieveRecordSOTrx(final String tableName, final String whereClause) {<NEW_LINE>if (Check.isEmpty(tableName, true)) {<NEW_LINE>log.error("No TableName");<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (Check.isEmpty(whereClause, true)) {<NEW_LINE>log.error("No Where Clause");<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Extract the SQL to select the IsSOTrx column<NEW_LINE>final POInfo poInfo = POInfo.getPOInfo(tableName);<NEW_LINE>final String sqlSelectIsSOTrx;<NEW_LINE>// Case: tableName has the "IsSOTrx" column<NEW_LINE>if (poInfo != null && poInfo.isPhysicalColumn("IsSOTrx")) {<NEW_LINE>sqlSelectIsSOTrx = "SELECT IsSOTrx FROM " + tableName + " WHERE " + whereClause;<NEW_LINE>} else // Case: tableName does NOT have the "IsSOTrx" column but ends with "Line", so we will check the parent table.<NEW_LINE>if (tableName.endsWith("Line")) {<NEW_LINE>final String parentTableName = tableName.substring(0, tableName.indexOf("Line"));<NEW_LINE>final POInfo <MASK><NEW_LINE>if (parentPOInfo != null && parentPOInfo.isPhysicalColumn("IsSOTrx")) {<NEW_LINE>// metas: use IN instead of EXISTS as the subquery should be highly selective<NEW_LINE>sqlSelectIsSOTrx = "SELECT IsSOTrx FROM " + parentTableName + " h WHERE h." + parentTableName + "_ID IN (SELECT l." + parentTableName + "_ID FROM " + tableName + " l WHERE " + whereClause + ")";<NEW_LINE>} else {<NEW_LINE>sqlSelectIsSOTrx = null;<NEW_LINE>}<NEW_LINE>} else // Fallback: no IsSOTrx<NEW_LINE>{<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Fetch IsSOTrx value if possible<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sqlSelectIsSOTrx, ITrx.TRXNAME_None);<NEW_LINE>pstmt.setMaxRows(1);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>final boolean isSOTrx = DisplayType.toBoolean(rs.getString(1));<NEW_LINE>return SOTrx.optionalOfBoolean(isSOTrx);<NEW_LINE>} else {<NEW_LINE>log.trace("No records were found to fetch the IsSOTrx from SQL: {}", sqlSelectIsSOTrx);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>final SQLException sqlEx = DBException.extractSQLExceptionOrNull(ex);<NEW_LINE>log.trace("Error while checking isSOTrx (SQL: {})", sqlSelectIsSOTrx, sqlEx);<NEW_LINE>return Optional.empty();<NEW_LINE>} finally {<NEW_LINE>close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>}
parentPOInfo = POInfo.getPOInfo(parentTableName);
1,217,521
public void loadDynamicClasses() {<NEW_LINE>final ArrayList<SootClass> dynamicClasses = new ArrayList<>();<NEW_LINE>final Options opts = Options.v();<NEW_LINE>final Map<String, List<String>> temp = new HashMap<>();<NEW_LINE>temp.put(null, opts.dynamic_class());<NEW_LINE>final ModulePathSourceLocator msloc = ModulePathSourceLocator.v();<NEW_LINE>for (String path : opts.dynamic_dir()) {<NEW_LINE>temp.putAll<MASK><NEW_LINE>}<NEW_LINE>final SourceLocator sloc = SourceLocator.v();<NEW_LINE>for (String pkg : opts.dynamic_package()) {<NEW_LINE>temp.get(null).addAll(sloc.classesInDynamicPackage(pkg));<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, List<String>> entry : temp.entrySet()) {<NEW_LINE>for (String className : entry.getValue()) {<NEW_LINE>dynamicClasses.add(loadClassAndSupport(className, Optional.fromNullable(entry.getKey())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// remove non-concrete classes that may accidentally have been loaded<NEW_LINE>for (Iterator<SootClass> iterator = dynamicClasses.iterator(); iterator.hasNext(); ) {<NEW_LINE>SootClass c = iterator.next();<NEW_LINE>if (!c.isConcrete()) {<NEW_LINE>if (opts.verbose()) {<NEW_LINE>logger.warn("dynamic class " + c.getName() + " is abstract or an interface, and it will not be considered.");<NEW_LINE>}<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.dynamicClasses = dynamicClasses;<NEW_LINE>}
(msloc.getClassUnderModulePath(path));
720,412
public final void init(Consumer<Particle> control, Image image, Point2D position, Point2D vel, Point2D acceleration, double radius, Point2D scaleOrigin, Point2D scaleFunction, Point2D entityScale, Duration expireTime, Paint startColor, Paint endColor, BlendMode blendMode, Interpolator interpolator, boolean allowRotation, Function<Double, Point2D> equation) {<NEW_LINE>this.image = image;<NEW_LINE>this.startPosition.set(position);<NEW_LINE><MASK><NEW_LINE>this.radius.set((float) radius, (float) radius);<NEW_LINE>this.scale.set(scaleFunction);<NEW_LINE>this.entityScale.set(entityScale);<NEW_LINE>this.velocity.set(vel);<NEW_LINE>this.acceleration.set(acceleration);<NEW_LINE>this.startColor = startColor;<NEW_LINE>this.endColor = endColor;<NEW_LINE>this.blendMode = blendMode;<NEW_LINE>this.initialLife = expireTime.toSeconds();<NEW_LINE>this.life = initialLife;<NEW_LINE>this.interpolator = interpolator;<NEW_LINE>this.allowRotation = allowRotation;<NEW_LINE>this.equation = equation;<NEW_LINE>this.control = control;<NEW_LINE>this.scaleOrigin.set(scaleOrigin);<NEW_LINE>imageView.setImage(image);<NEW_LINE>imageView.getTransforms().setAll(scaleTransform);<NEW_LINE>colorAnimation = new AnimatedColor((Color) startColor, (Color) endColor);<NEW_LINE>}
this.position.set(position);
753,110
private void startupDeviceCall() {<NEW_LINE>String aUserId = bridgeSettingMaster.getBridgeSecurity().createWhitelistUser("test_ha_bridge");<NEW_LINE>List<DeviceDescriptor> deviceList = repository.findAll();<NEW_LINE>String aChangeBody;<NEW_LINE>String[] components;<NEW_LINE>boolean comma = false;<NEW_LINE>for (DeviceDescriptor aDevice : deviceList) {<NEW_LINE>if (aDevice.getStartupActions() != null && !aDevice.getStartupActions().isEmpty()) {<NEW_LINE>log.info("Startup call for {} with startupActions {}", aDevice.getName(), aDevice.getStartupActions());<NEW_LINE>aChangeBody = "{";<NEW_LINE>components = aDevice.getStartupActions().split(":");<NEW_LINE>if (components.length > 0 && components[0] != null && components[0].length() > 0) {<NEW_LINE>if (components[0].equals("On")) {<NEW_LINE>aChangeBody = aChangeBody + "\"on\":true";<NEW_LINE>} else {<NEW_LINE>aChangeBody = aChangeBody + "\"on\":false";<NEW_LINE>}<NEW_LINE>comma = true;<NEW_LINE>}<NEW_LINE>if (components.length > 1 && components[1] != null && components[1].length() > 0 && !(components.length > 2 && components[2] != null && components[2].length() > 0)) {<NEW_LINE>if (comma)<NEW_LINE>aChangeBody = aChangeBody + ",";<NEW_LINE>aChangeBody = aChangeBody + "\"bri\":" + components[1];<NEW_LINE>comma = true;<NEW_LINE>}<NEW_LINE>if (components.length > 2 && components[2] != null && components[2].length() > 0) {<NEW_LINE>if (comma)<NEW_LINE>aChangeBody = aChangeBody + ",";<NEW_LINE>String theRGB = components[2].substring(components[2].indexOf('(') + 1, components[2].indexOf(')'));<NEW_LINE>String[] RGB = theRGB.split(",");<NEW_LINE>float[] hsb = new float[3];<NEW_LINE>Color.RGBtoHSB(Integer.parseInt(RGB[0]), Integer.parseInt(RGB[1]), Integer.parseInt(<MASK><NEW_LINE>float hue = hsb[0] * (float) 360.0;<NEW_LINE>float sat = hsb[1] * (float) 100.0;<NEW_LINE>float bright = hsb[2] * (float) 100.0;<NEW_LINE>aChangeBody = String.format("%s\"hue\":%.2f,\"sat\":%.2f,\"bri\":%d", aChangeBody, hue, sat, Math.round(bright));<NEW_LINE>}<NEW_LINE>aChangeBody = aChangeBody + "}";<NEW_LINE>log.info("Startup call to set state for {} with body {}", aDevice.getName(), aChangeBody);<NEW_LINE>changeState(aUserId, aDevice.getId(), aChangeBody, "localhost", true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
RGB[2]), hsb);
1,785,363
public static void registerTornadoMathPlugins(final InvocationPlugins plugins) {<NEW_LINE>Registration registration = new Registration(plugins, TornadoMath.class);<NEW_LINE>registerFloatMath1Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerTrigonometric1Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerFloatMath2Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerFloatMath3Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerFloatMath1Plugins(registration, double.class, JavaKind.Double);<NEW_LINE>registerFloatMath2Plugins(registration, double.class, JavaKind.Double);<NEW_LINE>registerFloatMath3Plugins(registration, double.class, JavaKind.Double);<NEW_LINE>registerIntMath1Plugins(registration, int.class, JavaKind.Int);<NEW_LINE>registerIntMath2Plugins(registration, <MASK><NEW_LINE>registerIntMath3Plugins(registration, int.class, JavaKind.Int);<NEW_LINE>registerIntMath1Plugins(registration, long.class, JavaKind.Long);<NEW_LINE>registerIntMath2Plugins(registration, long.class, JavaKind.Long);<NEW_LINE>registerIntMath3Plugins(registration, long.class, JavaKind.Long);<NEW_LINE>registerIntMath1Plugins(registration, short.class, JavaKind.Short);<NEW_LINE>registerIntMath2Plugins(registration, short.class, JavaKind.Short);<NEW_LINE>registerIntMath3Plugins(registration, short.class, JavaKind.Short);<NEW_LINE>registerIntMath1Plugins(registration, byte.class, JavaKind.Byte);<NEW_LINE>registerIntMath2Plugins(registration, byte.class, JavaKind.Byte);<NEW_LINE>registerIntMath3Plugins(registration, byte.class, JavaKind.Byte);<NEW_LINE>}
int.class, JavaKind.Int);
438,712
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {<NEW_LINE>List<Class<? extends Annotation>> annotationTypes = getAnnotations();<NEW_LINE>Class<? extends Annotation> namedAnnotation = null;<NEW_LINE>String[] names = null;<NEW_LINE>ScopedProxyMode proxyMode = null;<NEW_LINE>if (annotationTypes != null) {<NEW_LINE>for (Class<? extends Annotation> annotationType : annotationTypes) {<NEW_LINE>AnnotationAttributes attributes = AnnotationAttributes.fromMap(importingClassMetadata.getAnnotationAttributes(annotationType.getName(), false));<NEW_LINE>if (attributes != null && attributes.containsKey("name")) {<NEW_LINE>names = attributes.getStringArray("name");<NEW_LINE>namedAnnotation = annotationType;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check if Scope annotation is defined and get proxyMode from it<NEW_LINE>AnnotationAttributes scopeAttributes = AnnotationAttributes.fromMap(importingClassMetadata.getAnnotationAttributes(Scope.class.getName(), false));<NEW_LINE>if (scopeAttributes != null) {<NEW_LINE>proxyMode = scopeAttributes.getEnum("proxyMode");<NEW_LINE>}<NEW_LINE>BeanDefinition beanDefinition;<NEW_LINE>try {<NEW_LINE>beanDefinition = buildBeanDefinition(importingClassMetadata, namedAnnotation);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Error with onConfigurers", e);<NEW_LINE>}<NEW_LINE>// implementation didn't return definition so don't continue registration<NEW_LINE>if (beanDefinition == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ObjectUtils.isEmpty(names)) {<NEW_LINE>// ok, name(s) not given, generate one<NEW_LINE>names = new String[] { beanNameGenerator.generateBeanName(beanDefinition, registry) };<NEW_LINE>}<NEW_LINE>registry.registerBeanDefinition(names[0], beanDefinition);<NEW_LINE>if (names.length > 1) {<NEW_LINE>for (int i = 1; i < names.length; i++) {<NEW_LINE>registry.registerAlias(names[<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// wrap in scoped proxy if needed<NEW_LINE>if (proxyMode != null && proxyMode != ScopedProxyMode.DEFAULT && proxyMode != ScopedProxyMode.NO) {<NEW_LINE>BeanDefinitionHolder definitionHolder = new BeanDefinitionHolder(beanDefinition, names[0]);<NEW_LINE>BeanDefinitionHolder scopedProxy = null;<NEW_LINE>if (proxyMode == ScopedProxyMode.TARGET_CLASS) {<NEW_LINE>scopedProxy = ScopedProxyUtils.createScopedProxy(definitionHolder, registry, true);<NEW_LINE>} else if (proxyMode == ScopedProxyMode.INTERFACES) {<NEW_LINE>scopedProxy = ScopedProxyUtils.createScopedProxy(definitionHolder, registry, false);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown proxyMode " + proxyMode);<NEW_LINE>}<NEW_LINE>BeanDefinitionReaderUtils.registerBeanDefinition(scopedProxy, registry);<NEW_LINE>}<NEW_LINE>}
0], names[i]);
921,870
// Should not warn<NEW_LINE>public void blah4() throws IOException {<NEW_LINE>List<Vector> baz = new ArrayList<Vector>();<NEW_LINE>Vector<String> vecRow = new Vector<String>();<NEW_LINE>vecRow.add("blah");<NEW_LINE>BufferedWriter bw = new BufferedWriter(new StringWriter());<NEW_LINE>String foo = "foo";<NEW_LINE>String strHtml = "<TR>" + "<TD CLASS='Cellule'>" + foo + "</TD>";<NEW_LINE>for (int j = 0; j < baz.size(); j++) {<NEW_LINE>Vector row = baz.get(j);<NEW_LINE>strHtml += "<TD><INPUT TYPE='CHECKBOX'>" + vecRow.get(0) + "</TD>" + "<TD>" + row.get(1) + "</TD>" + "<TD>" + row.get(2) + "</TD>" + "<TD>" + row.get(3) + "</TD>" + "<TD>" + row.get(4) + "</TD>" + "<TD>" + row.get(5) + "</TD>" + "<TD ALIGN=RIGHT>" + row.get(6) + "</TD>" + "</TR>";<NEW_LINE><MASK><NEW_LINE>strHtml = "blah";<NEW_LINE>bw.write(strHtml);<NEW_LINE>}<NEW_LINE>}
System.out.println(strHtml);
1,458,449
public void invalidateSchedulesForSelection(@NonNull final PInstanceId pinstanceId) {<NEW_LINE>final String description = truncInvalidateDescription("from T_Selection: " + pinstanceId);<NEW_LINE>final String chunkUUID = UUID.randomUUID().toString();<NEW_LINE>final String sql = "INSERT INTO " + M_SHIPMENT_SCHEDULE_RECOMPUTE + " (M_ShipmentSchedule_ID, Description, C_Async_Batch_ID, ChunkUUID) " + "\n SELECT " + I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID + ", ?, " + I_M_ShipmentSchedule.COLUMNNAME_C_Async_Batch_ID + " , ?" + "\n FROM " + I_M_ShipmentSchedule.Table_Name + "\n WHERE " + I_M_ShipmentSchedule.COLUMNNAME_Processed + "='N'" + "\n AND EXISTS (SELECT 1 FROM T_Selection s WHERE s.AD_PInstance_ID = ? AND s.T_Selection_ID = M_ShipmentSchedule_ID)";<NEW_LINE>final int count = DB.executeUpdateEx(sql, new Object[] { description, chunkUUID, pinstanceId }, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>logger.<MASK><NEW_LINE>//<NEW_LINE>if (count > 0) {<NEW_LINE>enqueueShipmentScheduleRecompute(Env.getCtx(), ITrx.TRXNAME_ThreadInherited, chunkUUID);<NEW_LINE>}<NEW_LINE>}
debug("Invalidated {} M_ShipmentSchedules for AD_PInstance_ID={}", count, pinstanceId);
956,710
public static Principal createUser(final SecurityContext securityContext, final PropertyKey credentialKey, final String credentialValue, final Map<String, Object> propertySet, final boolean autoCreate, final Class userClass, final String confKey) throws FrameworkException {<NEW_LINE>final PropertyKey<String> confirmationKeyKey = StructrApp.key(User.class, "confirmationKey");<NEW_LINE>Principal user = null;<NEW_LINE>// First, search for a person with that e-mail address<NEW_LINE>user = AuthHelper.getPrincipalForCredential(credentialKey, credentialValue);<NEW_LINE>if (user != null) {<NEW_LINE>user = new NodeFactory<Principal>(securityContext).instantiate(user.getNode());<NEW_LINE>// convert to user<NEW_LINE>user.unlockSystemPropertiesOnce();<NEW_LINE>final PropertyMap changedProperties = new PropertyMap();<NEW_LINE>changedProperties.put(AbstractNode.type, User.class.getSimpleName());<NEW_LINE>changedProperties.put(confirmationKeyKey, confKey);<NEW_LINE>user.setProperties(securityContext, changedProperties);<NEW_LINE>} else if (autoCreate) {<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>// Clear properties set by us from the user-defined props<NEW_LINE>propertySet.remove(credentialKey.jsonName());<NEW_LINE>propertySet.remove("confirmationKey");<NEW_LINE>PropertyMap props = PropertyMap.inputTypeToJavaType(securityContext, StructrApp.getConfiguration().getNodeEntityClass("Principal"), propertySet);<NEW_LINE>// Remove any property which is not included in configuration<NEW_LINE>// eMail is mandatory and necessary<NEW_LINE>final String customAttributesString = "eMail" + "," + Settings.RegistrationCustomAttributes.getValue();<NEW_LINE>final List<String> customAttributes = Arrays.asList(customAttributesString.split("[ ,]+"));<NEW_LINE>final Set<PropertyKey> propsToRemove = new HashSet<>();<NEW_LINE>for (final PropertyKey key : props.keySet()) {<NEW_LINE>if (!customAttributes.contains(key.jsonName())) {<NEW_LINE>propsToRemove.add(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (final PropertyKey propToRemove : propsToRemove) {<NEW_LINE>props.remove(propToRemove);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>props.put(confirmationKeyKey, confKey);<NEW_LINE>user = (Principal) app.create(userClass, props);<NEW_LINE>} else {<NEW_LINE>throw new FrameworkException(503, "User self-registration is not configured correctly.");<NEW_LINE>}<NEW_LINE>return user;<NEW_LINE>}
props.put(credentialKey, credentialValue);
1,007,733
private void initImpl(LoadedSnapshot ls) {<NEW_LINE>this.snapshot = ls;<NEW_LINE>updateSaveState();<NEW_LINE>setOpaque(false);<NEW_LINE>setFocusable(true);<NEW_LINE>setRequestFocusEnabled(true);<NEW_LINE>refreshTabName();<NEW_LINE>switch(snapshot.getType()) {<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_CPU:<NEW_LINE>setIcon(WINDOW_ICON_CPU);<NEW_LINE>helpCtx = new HelpCtx(HELP_CTX_KEY_CPU);<NEW_LINE>getAccessibleContext().setAccessibleDescription(Bundle.SnapshotResultsWindow_CpuSnapshotAccessDescr());<NEW_LINE>setupCPUResultsView();<NEW_LINE>break;<NEW_LINE>// case LoadedSnapshot.SNAPSHOT_TYPE_CODEFRAGMENT:<NEW_LINE>// getAccessibleContext().setAccessibleDescription(Bundle.SnapshotResultsWindow_FragmentSnapshotAccessDescr());<NEW_LINE>// displayCodeRegionResults(ls);<NEW_LINE>//<NEW_LINE>// break;<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_MEMORY_ALLOCATIONS:<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_MEMORY_LIVENESS:<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_MEMORY_SAMPLED:<NEW_LINE>setIcon(WINDOW_ICON_MEMORY);<NEW_LINE>helpCtx = new HelpCtx(HELP_CTX_KEY_MEM);<NEW_LINE>getAccessibleContext().setAccessibleDescription(Bundle.SnapshotResultsWindow_MemorySnapshotAccessDescr());<NEW_LINE>setupMemoryResultsView();<NEW_LINE>break;<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_CPU_JDBC:<NEW_LINE>setIcon(WINDOW_ICON_JDBC);<NEW_LINE>helpCtx = new HelpCtx(HELP_CTX_KEY_CPU);<NEW_LINE>getAccessibleContext().setAccessibleDescription(Bundle.SnapshotResultsWindow_CpuSnapshotAccessDescr());<NEW_LINE>setupJDBCResultsView();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (displayedPanel != null) {<NEW_LINE><MASK><NEW_LINE>invalidate();<NEW_LINE>doLayout();<NEW_LINE>repaint();<NEW_LINE>}<NEW_LINE>listener = Lookup.getDefault().lookup(SnapshotListener.class);<NEW_LINE>listener.registerSnapshotResultsWindow(this);<NEW_LINE>}
add(displayedPanel, BorderLayout.CENTER);
403,988
private ChiSquareTestResults toResult(List<Row> rows) {<NEW_LINE>ChiSquareTestResult[] result = new ChiSquareTestResult[rows.size()];<NEW_LINE>for (Row row : rows) {<NEW_LINE>int id = Integer.parseInt(String.valueOf(row.getField(0)));<NEW_LINE>result[id] = JsonConverter.fromJson((String) row.getField<MASK><NEW_LINE>}<NEW_LINE>ChiSquareTestResults chiSquareTestResults = new ChiSquareTestResults();<NEW_LINE>chiSquareTestResults.results = result;<NEW_LINE>chiSquareTestResults.selectedCols = new String[result.length];<NEW_LINE>for (int i = 0; i < chiSquareTestResults.selectedCols.length; i++) {<NEW_LINE>chiSquareTestResults.selectedCols[i] = String.valueOf(i);<NEW_LINE>}<NEW_LINE>return chiSquareTestResults;<NEW_LINE>}
(1), ChiSquareTestResult.class);
230,993
static final boolean testRSAKeys(byte[] b, byte[][] privKey, byte[][] pubKey) {<NEW_LINE>int l = pubKey[0].length;<NEW_LINE>if (pubKey[0][0] == 0)<NEW_LINE>l--;<NEW_LINE>long t1 = System.currentTimeMillis();<NEW_LINE>byte[] rsa_b = rsa(true, 0, pubKey, b, 1, l);<NEW_LINE>long t2 = System.currentTimeMillis();<NEW_LINE>rsa_b = rsa(false, 0, privKey, <MASK><NEW_LINE>long t3 = System.currentTimeMillis();<NEW_LINE>String s = ("RSA/" + (privKey.length == 8 ? "CRT/" : "") + (l * 8) + (pubKey[1].length == 1 && pubKey[1][0] == 3 ? "/3" : "/F4") + " ...................");<NEW_LINE>s = s.substring(0, 20);<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>String ss = " " + (i == 0 ? (t3 - t2) : (t2 - t1));<NEW_LINE>s += ss.substring(ss.length() - 5);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < rsa_b.length; i++) if (rsa_b[i] != (byte) ((i + 1) % 128)) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "RSA failed!");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
rsa_b, 0, rsa_b.length);
1,015,243
final CreateBotLocaleResult executeCreateBotLocale(CreateBotLocaleRequest createBotLocaleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createBotLocaleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateBotLocaleRequest> request = null;<NEW_LINE>Response<CreateBotLocaleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateBotLocaleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createBotLocaleRequest));<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 Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateBotLocale");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateBotLocaleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateBotLocaleResultJsonUnmarshaller());<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);
329,569
protected final void configureWebAppContext(WebAppContext context, ServletContextInitializer... initializers) {<NEW_LINE>Assert.notNull(context, "Context must not be null");<NEW_LINE>context.clearAliasChecks();<NEW_LINE>context.setTempDirectory(getTempDirectory());<NEW_LINE>if (this.resourceLoader != null) {<NEW_LINE>context.setClassLoader(<MASK><NEW_LINE>}<NEW_LINE>String contextPath = getContextPath();<NEW_LINE>context.setContextPath(StringUtils.hasLength(contextPath) ? contextPath : "/");<NEW_LINE>context.setDisplayName(getDisplayName());<NEW_LINE>configureDocumentRoot(context);<NEW_LINE>if (isRegisterDefaultServlet()) {<NEW_LINE>addDefaultServlet(context);<NEW_LINE>}<NEW_LINE>if (shouldRegisterJspServlet()) {<NEW_LINE>addJspServlet(context);<NEW_LINE>context.addBean(new JasperInitializer(context), true);<NEW_LINE>}<NEW_LINE>addLocaleMappings(context);<NEW_LINE>ServletContextInitializer[] initializersToUse = mergeInitializers(initializers);<NEW_LINE>Configuration[] configurations = getWebAppContextConfigurations(context, initializersToUse);<NEW_LINE>context.setConfigurations(configurations);<NEW_LINE>context.setThrowUnavailableOnStartupException(true);<NEW_LINE>configureSession(context);<NEW_LINE>postProcessWebAppContext(context);<NEW_LINE>}
this.resourceLoader.getClassLoader());
1,772,241
public boolean onOptionsItemSelected(final MenuItem item) {<NEW_LINE>switch(item.getItemId()) {<NEW_LINE>case // exit settings when home button (iitc icon) is pressed<NEW_LINE>android.R.id.home:<NEW_LINE>onBackPressed();<NEW_LINE>return true;<NEW_LINE>case R.id.menu_plugins_add:<NEW_LINE>// create the chooser Intent<NEW_LINE>final Intent target = new Intent(Intent.ACTION_GET_CONTENT);<NEW_LINE>// iitcm only parses *.user.js scripts<NEW_LINE>target.setType("file/*");<NEW_LINE>target.addCategory(Intent.CATEGORY_OPENABLE);<NEW_LINE>try {<NEW_LINE>startActivityForResult(Intent.createChooser(target, "Choose file"), COPY_PLUGIN_REQUEST);<NEW_LINE>} catch (final ActivityNotFoundException e) {<NEW_LINE>Toast.makeText(this, "No activity to select a file found." + "Please install a file browser of your choice!", <MASK><NEW_LINE>}<NEW_LINE>default:<NEW_LINE>return super.onOptionsItemSelected(item);<NEW_LINE>}<NEW_LINE>}
Toast.LENGTH_LONG).show();
162,380
private void enqueueGcRoots(Snapshot snapshot) {<NEW_LINE>for (RootObj rootObj : HahaSpy.allGcRoots(snapshot)) {<NEW_LINE>switch(rootObj.getRootType()) {<NEW_LINE>case JAVA_LOCAL:<NEW_LINE>Instance thread = HahaSpy.allocatingThread(rootObj);<NEW_LINE>String <MASK><NEW_LINE>Exclusion params = excludedRefs.threadNames.get(threadName);<NEW_LINE>if (params == null || !params.alwaysExclude) {<NEW_LINE>enqueue(params, null, rootObj, null);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case INTERNED_STRING:<NEW_LINE>case DEBUGGER:<NEW_LINE>case INVALID_TYPE:<NEW_LINE>// An object that is unreachable from any other root, but not a root itself.<NEW_LINE>case UNREACHABLE:<NEW_LINE>case UNKNOWN:<NEW_LINE>// An object that is in a queue, waiting for a finalizer to run.<NEW_LINE>case FINALIZING:<NEW_LINE>break;<NEW_LINE>case SYSTEM_CLASS:<NEW_LINE>case VM_INTERNAL:<NEW_LINE>// A local variable in native code.<NEW_LINE>case NATIVE_LOCAL:<NEW_LINE>// A global variable in native code.<NEW_LINE>case NATIVE_STATIC:<NEW_LINE>// An object that was referenced from an active thread block.<NEW_LINE>case THREAD_BLOCK:<NEW_LINE>// Everything that called the wait() or notify() methods, or that is synchronized.<NEW_LINE>case BUSY_MONITOR:<NEW_LINE>case NATIVE_MONITOR:<NEW_LINE>case REFERENCE_CLEANUP:<NEW_LINE>// Input or output parameters in native code.<NEW_LINE>case NATIVE_STACK:<NEW_LINE>case JAVA_STATIC:<NEW_LINE>enqueue(null, null, rootObj, null);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unknown root type:" + rootObj.getRootType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
threadName = HahaHelper.threadName(thread);
1,017,928
protected RestChannelConsumer doCatRequest(RestRequest restRequest, NodeClient client) {<NEW_LINE>String datafeedId = restRequest.param(DatafeedConfig.ID.getPreferredName());<NEW_LINE>if (Strings.isNullOrEmpty(datafeedId)) {<NEW_LINE>datafeedId = GetDatafeedsStatsAction.ALL;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>checkAndSetDeprecatedParam(DEPRECATED_ALLOW_NO_DATAFEEDS_PARAM, Request.ALLOW_NO_MATCH, RestApiVersion.V_7, restRequest, (r, s) -> r.paramAsBoolean(s, request.allowNoMatch()), request::setAllowNoMatch);<NEW_LINE>return channel -> client.execute(GetDatafeedsStatsAction.INSTANCE, request, new RestResponseListener<>(channel) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RestResponse buildResponse(Response getDatafeedsStatsRespons) throws Exception {<NEW_LINE>return RestTable.buildResponse(buildTable(restRequest, getDatafeedsStatsRespons), channel);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
Request request = new Request(datafeedId);
1,360,525
private // and class as property<NEW_LINE>Expression correctClassClassChain(PropertyExpression pe) {<NEW_LINE>LinkedList<Expression> stack <MASK><NEW_LINE>ClassExpression found = null;<NEW_LINE>for (Expression it = pe; it != null; it = ((PropertyExpression) it).getObjectExpression()) {<NEW_LINE>if (it instanceof ClassExpression) {<NEW_LINE>found = (ClassExpression) it;<NEW_LINE>break;<NEW_LINE>} else if (!(it.getClass() == PropertyExpression.class)) {<NEW_LINE>return pe;<NEW_LINE>}<NEW_LINE>stack.addFirst(it);<NEW_LINE>}<NEW_LINE>if (found == null) {<NEW_LINE>return pe;<NEW_LINE>}<NEW_LINE>if (stack.isEmpty()) {<NEW_LINE>return pe;<NEW_LINE>}<NEW_LINE>Object stackElement = stack.removeFirst();<NEW_LINE>if (!(stackElement.getClass() == PropertyExpression.class)) {<NEW_LINE>return pe;<NEW_LINE>}<NEW_LINE>PropertyExpression classPropertyExpression = (PropertyExpression) stackElement;<NEW_LINE>String propertyNamePart = classPropertyExpression.getPropertyAsString();<NEW_LINE>if (propertyNamePart == null || !propertyNamePart.equals("class")) {<NEW_LINE>return pe;<NEW_LINE>}<NEW_LINE>found.setSourcePosition(classPropertyExpression);<NEW_LINE>if (stack.isEmpty()) {<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>stackElement = stack.removeFirst();<NEW_LINE>if (!(stackElement.getClass() == PropertyExpression.class)) {<NEW_LINE>return pe;<NEW_LINE>}<NEW_LINE>PropertyExpression classPropertyExpressionContainer = (PropertyExpression) stackElement;<NEW_LINE>classPropertyExpressionContainer.setObjectExpression(found);<NEW_LINE>return pe;<NEW_LINE>}
= new LinkedList<Expression>();
1,701,442
protected void appendComponentSlot(XStringBuilder xsb, JsonStringBuilder jsb, SofaTracerSpan span) {<NEW_LINE>Map<String, String> tagStr = span.getTagsWithStr();<NEW_LINE>Map<String, Number> tagNum = span.getTagsWithNumber();<NEW_LINE>// protocol<NEW_LINE>jsb.append(CommonSpanTags.PROTOCOL, tagStr.get(CommonSpanTags.PROTOCOL));<NEW_LINE>// serviceName<NEW_LINE>jsb.append(CommonSpanTags.SERVICE, tagStr.get(CommonSpanTags.SERVICE));<NEW_LINE>// method<NEW_LINE>jsb.append(CommonSpanTags.METHOD, tagStr.get(CommonSpanTags.METHOD));<NEW_LINE>// invoke type<NEW_LINE>jsb.append(CommonSpanTags.INVOKE_TYPE, tagStr.get(CommonSpanTags.INVOKE_TYPE));<NEW_LINE>// target ip<NEW_LINE>jsb.append(CommonSpanTags.REMOTE_HOST, tagStr.get(CommonSpanTags.REMOTE_HOST));<NEW_LINE>// target port<NEW_LINE>jsb.append(CommonSpanTags.REMOTE_PORT, tagStr.get(CommonSpanTags.REMOTE_PORT));<NEW_LINE>// local ip<NEW_LINE>jsb.append(CommonSpanTags.LOCAL_HOST, tagStr<MASK><NEW_LINE>// request serialize time<NEW_LINE>jsb.append(CommonSpanTags.CLIENT_SERIALIZE_TIME, tagNum.get(AttachmentKeyConstants.CLIENT_SERIALIZE_TIME));<NEW_LINE>// response deserialize time<NEW_LINE>jsb.append(CommonSpanTags.CLIENT_DESERIALIZE_TIME, tagNum.get(AttachmentKeyConstants.CLIENT_DESERIALIZE_TIME));<NEW_LINE>// Request Body bytes length<NEW_LINE>Number reqSizeNum = tagNum.get(AttachmentKeyConstants.CLIENT_SERIALIZE_SIZE);<NEW_LINE>jsb.append(CommonSpanTags.REQ_SIZE, reqSizeNum == null ? 0 : reqSizeNum.longValue());<NEW_LINE>// Response Body bytes length<NEW_LINE>Number respSizeNum = tagNum.get(AttachmentKeyConstants.CLIENT_DESERIALIZE_SIZE);<NEW_LINE>jsb.append(CommonSpanTags.RESP_SIZE, respSizeNum == null ? 0 : respSizeNum.longValue());<NEW_LINE>// error message<NEW_LINE>if (StringUtils.isNotBlank(tagStr.get(Tags.ERROR.getKey()))) {<NEW_LINE>jsb.append(Tags.ERROR.getKey(), tagStr.get(Tags.ERROR.getKey()));<NEW_LINE>} else {<NEW_LINE>jsb.append(Tags.ERROR.getKey(), StringUtils.EMPTY_STRING);<NEW_LINE>}<NEW_LINE>}
.get(CommonSpanTags.LOCAL_HOST));
553,392
private void drawInternal(UGraphic ug) throws IOException {<NEW_LINE>double x = 0;<NEW_LINE>double y = 0;<NEW_LINE>double rawHeight = 0;<NEW_LINE>final Stdlib folder = Stdlib.retrieve(name);<NEW_LINE>final CommandFactorySprite factorySpriteCommand = new CommandFactorySprite();<NEW_LINE>Command<WithSprite> cmd = factorySpriteCommand.createMultiLine(false);<NEW_LINE>final List<String> all = folder.extractAllSprites();<NEW_LINE>int nb = 0;<NEW_LINE>for (String s : all) {<NEW_LINE>// System.err.println("s="+s);<NEW_LINE>final BlocLines bloc = BlocLines.fromArray(s.split("\n"));<NEW_LINE>try {<NEW_LINE>cmd.execute(this, bloc);<NEW_LINE>} catch (NoSuchColorException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>// System.err.println("nb=" + nb);<NEW_LINE>nb++;<NEW_LINE>}<NEW_LINE>for (String n : getSkinParam().getAllSpriteNames()) {<NEW_LINE>final Sprite sprite = getSkinParam().getSprite(n);<NEW_LINE>TextBlock blockName = Display.create(n).create(FontConfiguration.blackBlueTrue(UFont.sansSerif(14)), HorizontalAlignment.LEFT, getSkinParam());<NEW_LINE>TextBlock tb = sprite.asTextBlock(getBlack(), 1.0, getSkinParam().getColorMapper());<NEW_LINE>tb = TextBlockUtils.mergeTB(tb, blockName, HorizontalAlignment.CENTER);<NEW_LINE>tb.drawU(ug.apply(new <MASK><NEW_LINE>final Dimension2D dim = tb.calculateDimension(ug.getStringBounder());<NEW_LINE>rawHeight = Math.max(rawHeight, dim.getHeight());<NEW_LINE>x += dim.getWidth();<NEW_LINE>x += 30;<NEW_LINE>if (x > WIDTH) {<NEW_LINE>x = 0;<NEW_LINE>y += rawHeight + 50;<NEW_LINE>rawHeight = 0;<NEW_LINE>if (y > 1024) {<NEW_LINE>// break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
UTranslate(x, y)));
184,134
private static void tryAssertionLifecycleAndFilter(RegressionEnvironment env, String expressionBefore, String selector, String expressionAfter) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('expr-one') " + expressionBefore, path);<NEW_LINE>env.compileDeploy("@name('s1') " + selector, path).addListener("s1");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 0));<NEW_LINE>env.assertListenerNotInvoked("s1");<NEW_LINE>env.sendEventBean(new SupportBean("E2", 1));<NEW_LINE>env.assertListenerInvoked("s1");<NEW_LINE>SupportListener listenerS1 = env.listener("s1");<NEW_LINE>path.clear();<NEW_LINE>env.undeployAll();<NEW_LINE>env.compileDeploy("@name('expr-two') " + expressionAfter, path);<NEW_LINE>env.compileDeploy("@name('s2') " + selector, path).addListener("s2");<NEW_LINE>env.sendEventBean(new SupportBean("E3", 0));<NEW_LINE>assertFalse(listenerS1.getAndClearIsInvoked() || env.listener("s2").getAndClearIsInvoked());<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean("E4", 1));<NEW_LINE>assertFalse(listenerS1.getAndClearIsInvoked());<NEW_LINE>assertFalse(env.listener("s2").getAndClearIsInvoked());<NEW_LINE>env.sendEventBean(new SupportBean("E4", 2));<NEW_LINE>assertFalse(listenerS1.getAndClearIsInvoked());<NEW_LINE>assertTrue(env.listener<MASK><NEW_LINE>env.undeployAll();<NEW_LINE>}
("s2").getAndClearIsInvoked());
940,892
public RuleMatch adjustRuleMatchPos(RuleMatch match, int charCount, int columnCount, int lineCount, String sentence, AnnotatedText annotatedText) {<NEW_LINE>int fromPos = match.getFromPos() + charCount;<NEW_LINE>int toPos = match.getToPos() + charCount;<NEW_LINE>if (annotatedText != null) {<NEW_LINE>fromPos = annotatedText.getOriginalTextPositionFor(fromPos, false);<NEW_LINE>toPos = annotatedText.getOriginalTextPositionFor(toPos - 1, true) + 1;<NEW_LINE>}<NEW_LINE>RuleMatch thisMatch = new RuleMatch(match);<NEW_LINE>thisMatch.setOffsetPosition(fromPos, toPos);<NEW_LINE>int startPos <MASK><NEW_LINE>int endPos = match.getPatternToPos() + charCount;<NEW_LINE>thisMatch.setPatternPosition(startPos, endPos);<NEW_LINE>thisMatch.setLazySuggestedReplacements(() -> extendSuggestions(match.getSuggestedReplacementObjects()));<NEW_LINE>String sentencePartToError = sentence.substring(0, match.getFromPos());<NEW_LINE>String sentencePartToEndOfError = sentence.substring(0, match.getToPos());<NEW_LINE>int lastLineBreakPos = sentencePartToError.lastIndexOf('\n');<NEW_LINE>int column;<NEW_LINE>int endColumn;<NEW_LINE>if (lastLineBreakPos == -1) {<NEW_LINE>column = sentencePartToError.length() + columnCount;<NEW_LINE>} else {<NEW_LINE>column = sentencePartToError.length() - lastLineBreakPos;<NEW_LINE>}<NEW_LINE>int lastLineBreakPosInError = sentencePartToEndOfError.lastIndexOf('\n');<NEW_LINE>if (lastLineBreakPosInError == -1) {<NEW_LINE>endColumn = sentencePartToEndOfError.length() + columnCount;<NEW_LINE>} else {<NEW_LINE>endColumn = sentencePartToEndOfError.length() - lastLineBreakPosInError;<NEW_LINE>}<NEW_LINE>int lineBreaksToError = countLineBreaks(sentencePartToError);<NEW_LINE>int lineBreaksToEndOfError = countLineBreaks(sentencePartToEndOfError);<NEW_LINE>thisMatch.setLine(lineCount + lineBreaksToError);<NEW_LINE>thisMatch.setEndLine(lineCount + lineBreaksToEndOfError);<NEW_LINE>thisMatch.setColumn(column);<NEW_LINE>thisMatch.setEndColumn(endColumn);<NEW_LINE>return thisMatch;<NEW_LINE>}
= match.getPatternFromPos() + charCount;
1,489,810
void process(Content dataSource, DataSourceIngestModuleProgress progressBar) {<NEW_LINE>this.dataSource = dataSource;<NEW_LINE>progressBar.progress(Bundle.ExtractZone_progress_Msg());<NEW_LINE>List<AbstractFile> zoneFiles = null;<NEW_LINE>try {<NEW_LINE>zoneFiles = currentCase.getServices().getFileManager().findFiles(dataSource, ZONE_IDENTIFIER_FILE);<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE><MASK><NEW_LINE>// NON-NLS<NEW_LINE>LOG.log(Level.SEVERE, "Unable to find zone identifier files, exception thrown. ", ex);<NEW_LINE>}<NEW_LINE>if (zoneFiles == null || zoneFiles.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<Long> knownPathIDs = null;<NEW_LINE>try {<NEW_LINE>knownPathIDs = getPathIDsForType(TSK_WEB_DOWNLOAD);<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>addErrorMessage(Bundle.ExtractZone_process_errMsg());<NEW_LINE>// NON-NLS<NEW_LINE>LOG.log(Level.SEVERE, "Failed to build PathIDs List for TSK_WEB_DOWNLOAD", ex);<NEW_LINE>}<NEW_LINE>if (knownPathIDs == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Collection<BlackboardArtifact> associatedObjectArtifacts = new ArrayList<>();<NEW_LINE>Collection<BlackboardArtifact> downloadArtifacts = new ArrayList<>();<NEW_LINE>for (AbstractFile zoneFile : zoneFiles) {<NEW_LINE>if (context.dataSourceIngestIsCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>processZoneFile(zoneFile, associatedObjectArtifacts, downloadArtifacts, knownPathIDs);<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>addErrorMessage(Bundle.ExtractZone_process_errMsg());<NEW_LINE>// NON-NLS<NEW_LINE>String message = String.format("Failed to process zone identifier file %s", zoneFile.getName());<NEW_LINE>LOG.log(Level.WARNING, message, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!context.dataSourceIngestIsCancelled()) {<NEW_LINE>postArtifacts(associatedObjectArtifacts);<NEW_LINE>postArtifacts(downloadArtifacts);<NEW_LINE>}<NEW_LINE>}
addErrorMessage(Bundle.ExtractZone_process_errMsg_find());
1,537,799
protected int deleteOldContent(final Date deleteFrom) throws DotDataException {<NEW_LINE>final <MASK><NEW_LINE>calendar.setTime(deleteFrom);<NEW_LINE>calendar.set(Calendar.HOUR_OF_DAY, 0);<NEW_LINE>calendar.set(Calendar.MINUTE, 0);<NEW_LINE>calendar.set(Calendar.SECOND, 0);<NEW_LINE>calendar.set(Calendar.MILLISECOND, 0);<NEW_LINE>final Date date = calendar.getTime();<NEW_LINE>DotConnect dc = new DotConnect();<NEW_LINE>final String countSQL = "select count(*) as count from contentlet";<NEW_LINE>dc.setSQL(countSQL);<NEW_LINE>List<Map<String, String>> result = dc.loadResults();<NEW_LINE>final int before = Integer.parseInt(result.get(0).get("count"));<NEW_LINE>dc = new DotConnect();<NEW_LINE>final String query = new StringBuilder("SELECT DISTINCT inode FROM contentlet WHERE identifier <> 'SYSTEM_HOST' AND mod_date < ? AND ").append(" inode NOT IN (SELECT working_inode FROM contentlet_version_info WHERE working_inode = contentlet.inode)").append(" AND ").append(" inode NOT IN (SELECT live_inode FROM contentlet_version_info WHERE live_inode = contentlet.inode)").toString();<NEW_LINE>dc.setSQL(query);<NEW_LINE>dc.addParam(date);<NEW_LINE>result = dc.loadResults();<NEW_LINE>int oldInodesCount = result.size();<NEW_LINE>if (oldInodesCount > 0) {<NEW_LINE>final List<String> inodeList = result.stream().map(row -> row.get("inode")).collect(Collectors.toList());<NEW_LINE>deleteContentData(inodeList);<NEW_LINE>}<NEW_LINE>dc = new DotConnect();<NEW_LINE>dc.setSQL(countSQL);<NEW_LINE>result = dc.loadResults();<NEW_LINE>final int after = Integer.parseInt(result.get(0).get("count"));<NEW_LINE>final int deleted = before - after;<NEW_LINE>if (deleted > 0) {<NEW_LINE>deleteOrphanedBinaryFiles();<NEW_LINE>}<NEW_LINE>return deleted;<NEW_LINE>}
Calendar calendar = Calendar.getInstance();
1,521,163
public void testCriteriaQuery_long(TestExecutionContext testExecCtx, TestExecutionResources testExecResources, Object managedComponentObject) throws Throwable {<NEW_LINE>final String testName = getTestName();<NEW_LINE>// Verify parameters<NEW_LINE>if (testExecCtx == null || testExecResources == null) {<NEW_LINE>Assert.fail(testName + ": Missing context and/or resources. Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JPAResource jpaResource = testExecResources.getJpaResourceMap().get("test-jpa-resource");<NEW_LINE>if (jpaResource == null) {<NEW_LINE>Assert.fail("Missing JPAResource 'test-jpa-resource'). Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Process Test Properties<NEW_LINE>final Map<String, Serializable> testProps = testExecCtx.getProperties();<NEW_LINE>if (testProps != null) {<NEW_LINE>for (String key : testProps.keySet()) {<NEW_LINE>System.out.println("Test Property: " + key + " = " + testProps.get(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EntityManager em = jpaResource.getEm();<NEW_LINE>TransactionJacket tx = jpaResource.getTj();<NEW_LINE>// Execute Test Case<NEW_LINE>try {<NEW_LINE>tx.beginTransaction();<NEW_LINE>if (jpaResource.getPcCtxInfo().getPcType() == PersistenceContextType.APPLICATION_MANAGED_JTA)<NEW_LINE>em.joinTransaction();<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Entity0012> cq = cb.createQuery(Entity0012.class);<NEW_LINE>Root<Entity0012> root = cq.from(Entity0012.class);<NEW_LINE>cq.select(root);<NEW_LINE>TypedQuery<Entity0012> tq = em.createQuery(cq);<NEW_LINE>Entity0012 findEntity = tq.getSingleResult();<NEW_LINE>System.out.println("Object returned by query: " + findEntity);<NEW_LINE>assertNotNull("Did not find entity in criteria query", findEntity);<NEW_LINE>assertTrue("Entity returned by find was not contained in the persistence context.", em.contains(findEntity));<NEW_LINE>assertEquals(12L, findEntity.getEntity0012_id());<NEW_LINE>assertEquals("Entity0012_STRING01", findEntity.getEntity0012_string01());<NEW_LINE>assertEquals("Entity0012_STRING02", findEntity.getEntity0012_string02());<NEW_LINE>assertEquals("Entity0012_STRING03", findEntity.getEntity0012_string03());<NEW_LINE>tx.commitTransaction();<NEW_LINE>} finally {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>}
out.println(testName + ": End");
415,986
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>output.writeMessage(1, getMetadata());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 2, provisioner_);<NEW_LINE>}<NEW_LINE>com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(output, internalGetParameters(), ParametersDefaultEntryHolder.defaultEntry, 3);<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 4, reclaimPolicy_);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < mountOptions_.size(); i++) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 5, mountOptions_.getRaw(i));<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>output.writeBool(6, allowVolumeExpansion_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 7, volumeBindingMode_);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < allowedTopologies_.size(); i++) {<NEW_LINE>output.writeMessage(8<MASK><NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>}
, allowedTopologies_.get(i));
424,361
private ResultPoint[] detectSolid2(ResultPoint[] points) {<NEW_LINE>// A..D<NEW_LINE>// : :<NEW_LINE>// B--C<NEW_LINE>ResultPoint pointA = points[0];<NEW_LINE>ResultPoint pointB = points[1];<NEW_LINE>ResultPoint pointC = points[2];<NEW_LINE>ResultPoint pointD = points[3];<NEW_LINE>// Transition detection on the edge is not stable.<NEW_LINE>// To safely detect, shift the points to the module center.<NEW_LINE>int tr = transitionsBetween(pointA, pointD);<NEW_LINE>ResultPoint pointBs = shiftPoint(pointB, pointC, (tr + 1) * 4);<NEW_LINE>ResultPoint pointCs = shiftPoint(pointC, pointB, <MASK><NEW_LINE>int trBA = transitionsBetween(pointBs, pointA);<NEW_LINE>int trCD = transitionsBetween(pointCs, pointD);<NEW_LINE>// 0..3<NEW_LINE>// | :<NEW_LINE>// 1--2<NEW_LINE>if (trBA < trCD) {<NEW_LINE>// solid sides: A-B-C<NEW_LINE>points[0] = pointA;<NEW_LINE>points[1] = pointB;<NEW_LINE>points[2] = pointC;<NEW_LINE>points[3] = pointD;<NEW_LINE>} else {<NEW_LINE>// solid sides: B-C-D<NEW_LINE>points[0] = pointB;<NEW_LINE>points[1] = pointC;<NEW_LINE>points[2] = pointD;<NEW_LINE>points[3] = pointA;<NEW_LINE>}<NEW_LINE>return points;<NEW_LINE>}
(tr + 1) * 4);
187,081
private void generateItemsJson(@NonNull JSONArray itemsJson, @NonNull Map<File, RemoteFile> remoteInfoFiles, @NonNull List<RemoteFile> noInfoRemoteItemFiles) throws JSONException, IOException {<NEW_LINE>List<FileDownloadTask> <MASK><NEW_LINE>for (Entry<File, RemoteFile> fileEntry : remoteInfoFiles.entrySet()) {<NEW_LINE>tasks.add(new FileDownloadTask(fileEntry.getKey(), fileEntry.getValue()));<NEW_LINE>}<NEW_LINE>ThreadPoolTaskExecutor<FileDownloadTask> executor = createExecutor();<NEW_LINE>executor.run(tasks);<NEW_LINE>boolean hasDownloadErrors = hasDownloadErrors(tasks);<NEW_LINE>if (!hasDownloadErrors) {<NEW_LINE>for (File file : remoteInfoFiles.keySet()) {<NEW_LINE>String jsonStr = Algorithms.getFileAsString(file);<NEW_LINE>if (!Algorithms.isEmpty(jsonStr)) {<NEW_LINE>itemsJson.put(new JSONObject(jsonStr));<NEW_LINE>} else {<NEW_LINE>throw new IOException("Error reading item info: " + file.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IOException("Error downloading items info");<NEW_LINE>}<NEW_LINE>addRemoteFilesToJson(itemsJson, noInfoRemoteItemFiles);<NEW_LINE>}
tasks = new ArrayList<>();
145,971
public void testThreadContextBuilderOverlappingContextTypes() throws Exception {<NEW_LINE>ThreadContext.<MASK><NEW_LINE>builder.cleared(ThreadContext.SECURITY, ThreadContext.TRANSACTION, TestContextTypes.STATE);<NEW_LINE>builder.propagated(TestContextTypes.CITY, TestContextTypes.STATE, ThreadContext.APPLICATION);<NEW_LINE>builder.unchanged(ThreadContext.CDI, ThreadContext.TRANSACTION, TestContextTypes.CITY);<NEW_LINE>try {<NEW_LINE>builder.build();<NEW_LINE>} catch (IllegalStateException x) {<NEW_LINE>if (x.getMessage() == null || !x.getMessage().contains(ThreadContext.TRANSACTION) || !x.getMessage().contains(TestContextTypes.CITY) || !x.getMessage().contains(TestContextTypes.STATE))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>// conflict between cleared & unchanged only<NEW_LINE>builder.propagated(ThreadContext.ALL_REMAINING);<NEW_LINE>builder.cleared(ThreadContext.SECURITY, ThreadContext.SECURITY, TestContextTypes.CITY);<NEW_LINE>try {<NEW_LINE>builder.build();<NEW_LINE>} catch (IllegalStateException x) {<NEW_LINE>if (x.getMessage() == null || !x.getMessage().startsWith("CWWKC1152E") || !x.getMessage().contains(TestContextTypes.CITY))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>// conflict between propagated & unchanged only<NEW_LINE>builder.unchanged(ThreadContext.ALL_REMAINING);<NEW_LINE>try {<NEW_LINE>builder.build();<NEW_LINE>} catch (IllegalStateException x) {<NEW_LINE>if (x.getMessage() == null || !x.getMessage().startsWith("CWWKC1152E") || !x.getMessage().contains(ThreadContext.ALL_REMAINING))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>}
Builder builder = ThreadContext.builder();
82,615
protected void applyCommonOverrides(@Nullable RabbitListenerEndpoint endpoint, C instance) {<NEW_LINE>if (endpoint != null) {<NEW_LINE>// endpoint settings overriding default factory settings<NEW_LINE>JavaUtils.INSTANCE.acceptIfNotNull(endpoint.getAutoStartup(), instance::setAutoStartup);<NEW_LINE>instance.setListenerId(endpoint.getId());<NEW_LINE>endpoint.setupListenerContainer(instance);<NEW_LINE>}<NEW_LINE>Object iml = instance.getMessageListener();<NEW_LINE>if (iml instanceof AbstractAdaptableMessageListener) {<NEW_LINE>AbstractAdaptableMessageListener messageListener = (AbstractAdaptableMessageListener) iml;<NEW_LINE>// NOSONAR<NEW_LINE>JavaUtils.INSTANCE.acceptIfNotNull(this.beforeSendReplyPostProcessors, messageListener::setBeforeSendReplyPostProcessors).acceptIfNotNull(this.retryTemplate, messageListener::setRetryTemplate).acceptIfCondition(this.retryTemplate != null && this.recoveryCallback != null, this.recoveryCallback, messageListener::setRecoveryCallback).acceptIfNotNull(this.defaultRequeueRejected, messageListener::setDefaultRequeueRejected);<NEW_LINE>if (endpoint != null) {<NEW_LINE>JavaUtils.INSTANCE.acceptIfNotNull(endpoint.getReplyPostProcessor(), messageListener::setReplyPostProcessor).acceptIfNotNull(endpoint.<MASK><NEW_LINE>messageListener.setConverterWinsContentType(endpoint.isConverterWinsContentType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getReplyContentType(), messageListener::setReplyContentType);
1,225,431
public void resolveConfiguredHosts(Consumer<List<TransportAddress>> consumer) {<NEW_LINE>if (lifecycle.started() == false) {<NEW_LINE>LOGGER.debug("resolveConfiguredHosts: lifecycle is {}, not proceeding", lifecycle);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (resolveInProgress.compareAndSet(false, true)) {<NEW_LINE>transportService.getThreadPool().generic().execute(new AbstractRunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void doRun() {<NEW_LINE>if (lifecycle.started() == false) {<NEW_LINE>LOGGER.debug("resolveConfiguredHosts.doRun: lifecycle is {}, not proceeding", lifecycle);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<TransportAddress> providedAddresses = hostsProvider.getSeedAddresses(SeedHostsResolver.this);<NEW_LINE>consumer.accept(providedAddresses);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAfter() {<NEW_LINE>resolveInProgress.set(false);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return "SeedHostsResolver resolving unicast hosts list";<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
LOGGER.debug("failure when resolving unicast hosts list", e);
490,674
public void encodeValues(Buffer valueBuffer, List<JoinMemoryBo> joinMemoryBoList) {<NEW_LINE>if (CollectionUtils.isEmpty(joinMemoryBoList)) {<NEW_LINE>throw new IllegalArgumentException("MemoryBoList must not be empty");<NEW_LINE>}<NEW_LINE>final int numValues = joinMemoryBoList.size();<NEW_LINE>valueBuffer.putVInt(numValues);<NEW_LINE>List<Long> timestamps = new ArrayList<>(numValues);<NEW_LINE>JoinLongFieldStrategyAnalyzer.Builder heapUsedAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();<NEW_LINE>JoinLongFieldStrategyAnalyzer.Builder nonHeapUsedAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();<NEW_LINE>for (JoinMemoryBo joinMemoryBo : joinMemoryBoList) {<NEW_LINE>timestamps.<MASK><NEW_LINE>heapUsedAnalyzerBuilder.addValue(joinMemoryBo.getHeapUsedJoinValue());<NEW_LINE>nonHeapUsedAnalyzerBuilder.addValue(joinMemoryBo.getNonHeapUsedJoinValue());<NEW_LINE>}<NEW_LINE>codec.encodeTimestamps(valueBuffer, timestamps);<NEW_LINE>encodeDataPoints(valueBuffer, heapUsedAnalyzerBuilder.build(), nonHeapUsedAnalyzerBuilder.build());<NEW_LINE>}
add(joinMemoryBo.getTimestamp());
15,839
private void saveFilter() {<NEW_LINE>final OsmandApplication app = getMyApplication();<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(getContext());<NEW_LINE>builder.setTitle(R.string.access_hint_enter_name);<NEW_LINE>final EditText editText = new EditText(getContext());<NEW_LINE>editText.setHint(R.string.new_filter);<NEW_LINE>editText.setText(filter.getName());<NEW_LINE>final TextView textView = new TextView(getContext());<NEW_LINE>textView.setText(app.getString(R.string.new_filter_desc));<NEW_LINE>textView.setTextAppearance(getContext(), R.style.TextAppearance_ContextMenuSubtitle);<NEW_LINE>LinearLayout ll = new LinearLayout(getContext());<NEW_LINE>ll.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>ll.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>ll.setPadding(AndroidUtils.dpToPx(getContext(), 20f), AndroidUtils.dpToPx(getContext(), 12f), AndroidUtils.dpToPx(getContext(), 20f), AndroidUtils.dpToPx(getContext(), 12f));<NEW_LINE>ll.addView(editText, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>textView.setPadding(AndroidUtils.dpToPx(getContext(), 4f), AndroidUtils.dpToPx(getContext(), 6f), AndroidUtils.dpToPx(getContext(), 4f), AndroidUtils.dpToPx(getContext(), 4f));<NEW_LINE>ll.addView(textView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>builder.setView(ll);<NEW_LINE>builder.setNegativeButton(R.string.shared_string_cancel, null);<NEW_LINE>builder.setPositiveButton(R.string.shared_string_save, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>String filterName = editText.getText().toString();<NEW_LINE>PoiUIFilter nFilter = new PoiUIFilter(filterName, null, filter.getAcceptedTypes(), app);<NEW_LINE>applyFilterFields();<NEW_LINE>if (!Algorithms.isEmpty(filter.getFilterByName())) {<NEW_LINE>nFilter.<MASK><NEW_LINE>}<NEW_LINE>if (app.getPoiFilters().createPoiFilter(nFilter, false)) {<NEW_LINE>Toast.makeText(getContext(), getContext().getString(R.string.edit_filter_create_message, filterName), Toast.LENGTH_SHORT).show();<NEW_LINE>app.getSearchUICore().refreshCustomPoiFilters();<NEW_LINE>((QuickSearchDialogFragment) getParentFragment()).replaceQueryWithUiFilter(nFilter, "");<NEW_LINE>((QuickSearchDialogFragment) getParentFragment()).reloadCategories();<NEW_LINE>QuickSearchPoiFilterFragment.this.dismiss();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.create().show();<NEW_LINE>}
setSavedFilterByName(filter.getFilterByName());
927,646
public DescribeRecommenderResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeRecommenderResult describeRecommenderResult = new DescribeRecommenderResult();<NEW_LINE><MASK><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 describeRecommenderResult;<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("recommender", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeRecommenderResult.setRecommender(RecommenderJsonUnmarshaller.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 describeRecommenderResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
794,524
public SharingConfiguration configureSharing(String designId, UpdateSharingConfiguration config) throws ServerError, NotFoundException {<NEW_LINE>logger.debug("Configuring sharing settings for API: {} ", designId);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>final User currentUser = this.security.getCurrentUser();<NEW_LINE>// Note: only used if this is the first time<NEW_LINE>String uuid = UUID.randomUUID().toString();<NEW_LINE>if (!this.authorizationService.hasOwnerPermission(currentUser, designId)) {<NEW_LINE>throw new NotFoundException();<NEW_LINE>}<NEW_LINE>if (SharingLevel.DOCUMENTATION == config.getLevel()) {<NEW_LINE>final ApiDesignContent document = this.storage.getLatestContentDocument(currentUser.getLogin(), designId);<NEW_LINE>final String content = document.getDocument();<NEW_LINE>final DereferenceControlResult dereferenceControlResult = accessibilityAsserter.isDereferenceable(content);<NEW_LINE>if (!dereferenceControlResult.isSuccess()) {<NEW_LINE>throw new ServerError(dereferenceControlResult.getError());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.storage.setSharingConfig(designId, uuid, config.getLevel());<NEW_LINE>return this.storage.getSharingConfig(designId);<NEW_LINE>} catch (StorageException e) {<NEW_LINE>throw new ServerError(e);<NEW_LINE>}<NEW_LINE>}
metrics.apiCall("/designs/{designId}/sharing", "PUT");
1,285,896
public void onPublish(InterceptPublishMessage msg) {<NEW_LINE>String clientId = msg.getClientID();<NEW_LINE>ByteBuf payload = msg.getPayload();<NEW_LINE>String topic = msg.getTopicName();<NEW_LINE>String username = msg.getUsername();<NEW_LINE>MqttQoS qos = msg.getQos();<NEW_LINE>LOG.debug("Receive publish message. clientId: {}, username: {}, qos: {}, topic: {}, payload: {}", clientId, username, qos, topic, payload);<NEW_LINE>List<Message> events = payloadFormat.format(payload);<NEW_LINE>if (events == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// since device ids from messages maybe different, so we use the InsertPlan not<NEW_LINE>// InsertTabletPlan.<NEW_LINE>for (Message event : events) {<NEW_LINE>if (event == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean status = false;<NEW_LINE>try {<NEW_LINE>PartialPath path = new PartialPath(event.getDevice());<NEW_LINE>InsertRowPlan plan = new InsertRowPlan(path, event.getTimestamp(), event.getMeasurements().toArray(new String[0]), event.getValues().toArray(new String[0]));<NEW_LINE>TSStatus tsStatus = serviceProvider.checkAuthority(plan, sessionId);<NEW_LINE>if (tsStatus != null) {<NEW_LINE>LOG.warn(tsStatus.message);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("meet error when inserting device {}, measurements {}, at time {}, because ", event.getDevice(), event.getMeasurements(), event.getTimestamp(), e);<NEW_LINE>}<NEW_LINE>LOG.debug("event process result: {}", status);<NEW_LINE>}<NEW_LINE>}
status = serviceProvider.executeNonQuery(plan);
1,348,333
private static List<UnitCategory> makeFirstClassUpdateCategories() {<NEW_LINE>Collection<UpdateUnit> units = UpdateManager.getDefault().<MASK><NEW_LINE>List<UnitCategory> res = new ArrayList<UnitCategory>();<NEW_LINE>List<String> names = new ArrayList<String>();<NEW_LINE>final Collection<String> firstClass = getFirstClassModules();<NEW_LINE>for (UpdateUnit u : units) {<NEW_LINE>UpdateElement el = u.getInstalled();<NEW_LINE>if (!u.isPending() && el != null) {<NEW_LINE>List<UpdateElement> updates = u.getAvailableUpdates();<NEW_LINE>if (updates.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (firstClass.contains(el.getCodeName())) {<NEW_LINE>String catName = el.getCategory();<NEW_LINE>if (names.contains(catName)) {<NEW_LINE>UnitCategory cat = res.get(names.indexOf(catName));<NEW_LINE>cat.addUnit(new Unit.Update(u, false, catName));<NEW_LINE>} else {<NEW_LINE>UnitCategory cat = new UnitCategory(catName);<NEW_LINE>cat.addUnit(new Unit.Update(u, false, catName));<NEW_LINE>res.add(cat);<NEW_LINE>names.add(catName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.log(Level.FINER, "makeFirstClassUpdateCategories (" + units.size() + ") returns " + res.size());<NEW_LINE>return res;<NEW_LINE>}
getUpdateUnits(UpdateManager.TYPE.MODULE);
1,412,884
private static String dumpActionMapInfo(ActionMap map, Object q, Lookup prev, Lookup now, Lookup globalContext, Lookup originalLkp) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>sb.append("We really get map from the lookup. Map: ").append(map).append(" returned: ").// NOI18N<NEW_LINE>append(q);<NEW_LINE>// NOI18N<NEW_LINE>sb.append("\nprev: ").append(prev == null ? "null prev" : prev.lookupAll(Object.class));<NEW_LINE>// NOI18N<NEW_LINE>sb.append("\nnow : ").append(now == null ? "null now" : now<MASK><NEW_LINE>// NOI18N<NEW_LINE>sb.append("\nglobal ctx : ").append(globalContext == null ? "null" : globalContext.lookupAll(Object.class));<NEW_LINE>// NOI18N<NEW_LINE>sb.append("\noriginal lkp : ").append(originalLkp == null ? "null" : originalLkp.lookupAll(Object.class));<NEW_LINE>return sb.toString();<NEW_LINE>}
.lookupAll(Object.class));
47,270
private void acquireMinecraftToken(String xblUhs, String xblXsts) throws IOException, JSONException {<NEW_LINE>// task.publishProgressPublic();<NEW_LINE>URL url = new URL(mcLoginUrl);<NEW_LINE>Map<Object, Object> data = new HashMap<>();<NEW_LINE>data.put("identityToken", "XBL3.0 x=" + xblUhs + ";" + xblXsts);<NEW_LINE>String req = ofJSONData(data);<NEW_LINE>HttpURLConnection conn = (HttpURLConnection) url.openConnection();<NEW_LINE>conn.setRequestProperty("Content-Type", "application/json");<NEW_LINE>conn.setRequestProperty("Accept", "application/json");<NEW_LINE>conn.setRequestProperty("charset", "utf-8");<NEW_LINE>conn.setRequestProperty("Content-Length", Integer.toString(req.getBytes("UTF-8").length));<NEW_LINE>conn.setRequestMethod("POST");<NEW_LINE>conn.setUseCaches(false);<NEW_LINE>conn.setDoInput(true);<NEW_LINE>conn.setDoOutput(true);<NEW_LINE>conn.connect();<NEW_LINE>try (OutputStream wr = conn.getOutputStream()) {<NEW_LINE>wr.write(req.getBytes("UTF-8"));<NEW_LINE>}<NEW_LINE>if (conn.getResponseCode() >= 200 && conn.getResponseCode() < 300) {<NEW_LINE>JSONObject jo = new JSONObject(Tools.read(conn.getInputStream()));<NEW_LINE>// Log.i("MicroAuth","MC token: "+jo.getString("access_token"));<NEW_LINE>mcToken = jo.getString("access_token");<NEW_LINE>checkMcProfile<MASK><NEW_LINE>checkMcStore(jo.getString("access_token"));<NEW_LINE>} else {<NEW_LINE>throwResponseError(conn);<NEW_LINE>}<NEW_LINE>}
(jo.getString("access_token"));
794,852
final GetFieldLevelEncryptionProfileResult executeGetFieldLevelEncryptionProfile(GetFieldLevelEncryptionProfileRequest getFieldLevelEncryptionProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getFieldLevelEncryptionProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetFieldLevelEncryptionProfileRequest> request = null;<NEW_LINE>Response<GetFieldLevelEncryptionProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetFieldLevelEncryptionProfileRequestMarshaller().marshall(super.beforeMarshalling(getFieldLevelEncryptionProfileRequest));<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, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFieldLevelEncryptionProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetFieldLevelEncryptionProfileResult> responseHandler = new StaxResponseHandler<GetFieldLevelEncryptionProfileResult>(new GetFieldLevelEncryptionProfileResultStaxUnmarshaller());<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.endEvent(Field.RequestMarshallTime);
1,307,161
private void connectAllBticinoDevices() throws ConfigurationException {<NEW_LINE>for (String l_gw_if_id : m_bticino_devices_config.keySet()) {<NEW_LINE>BticinoConfig l_current_device_config = m_bticino_devices_config.get(l_gw_if_id);<NEW_LINE>// Create a gw service object<NEW_LINE>BticinoDevice l_bticino_device = new BticinoDevice(l_current_device_config.id, this);<NEW_LINE>l_bticino_device.setEventPublisher(eventPublisher);<NEW_LINE>l_bticino_device.setHost(l_current_device_config.host);<NEW_LINE>l_bticino_device.setPort(l_current_device_config.port);<NEW_LINE>l_bticino_device.setPasswd(l_current_device_config.passwd);<NEW_LINE>l_bticino_device.setRescanInterval(l_current_device_config.rescan_secs);<NEW_LINE>l_bticino_device.setHeatingZones(l_current_device_config.heating_zones);<NEW_LINE>l_bticino_device.setShutterRunTime(l_current_device_config.shutter_run_msecs);<NEW_LINE>try {<NEW_LINE>l_bticino_device.initialize();<NEW_LINE>} catch (InitializationException e) {<NEW_LINE>throw new ConfigurationException(l_gw_if_id, "Could not open create BTicino interface with ID [" + l_gw_if_id + <MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new ConfigurationException(l_gw_if_id, "Could not open create BTicino interface with ID [" + l_gw_if_id + "], Exception : " + e.getMessage());<NEW_LINE>}<NEW_LINE>m_bticino_devices.put(l_gw_if_id, l_bticino_device);<NEW_LINE>}<NEW_LINE>}
"], Exception : " + e.getMessage());
1,140,941
public static synchronized void doPatch(String className, ClassMethod[] classMethods) {<NEW_LINE>ClassPool classPool = ClassPool.getDefault();<NEW_LINE>try {<NEW_LINE>CtClass cls = classPool.get(className);<NEW_LINE>for (ClassMethod classMethod : classMethods) {<NEW_LINE>String method = classMethod.method;<NEW_LINE>CtMethod mtd;<NEW_LINE>String[] params = classMethod.params;<NEW_LINE>if (params != null) {<NEW_LINE>CtClass[] cts = new CtClass[params.length];<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>cts[i] = classPool.get(params[i]);<NEW_LINE>}<NEW_LINE>mtd = cls.getDeclaredMethod(method, cts);<NEW_LINE>} else {<NEW_LINE>mtd = cls.getDeclaredMethod(method);<NEW_LINE>}<NEW_LINE>String[] codes = classMethod.codes;<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < codes.length; i++) {<NEW_LINE>switch(types[i]) {<NEW_LINE>case BODY:<NEW_LINE>mtd.setBody(codes[0]);<NEW_LINE>break;<NEW_LINE>case AFTER:<NEW_LINE>mtd.insertAfter(codes[0], true);<NEW_LINE>break;<NEW_LINE>case BEFORE:<NEW_LINE>mtd.insertBefore(codes[0]);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RedefineClassAgent.redefineClasses(new ClassDefinition(Class.forName(className), cls.toBytecode()));<NEW_LINE>cls.detach();<NEW_LINE>} catch (NotFoundException | NoClassDefFoundError ignored) {<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.warn(String.format("patch %s failed", className), e);<NEW_LINE>}<NEW_LINE>}
PatchType[] types = classMethod.types;
466,586
// Read-write<NEW_LINE>@Override<NEW_LINE>public NBTTagCompound writeToNBT(NBTTagCompound nbt) {<NEW_LINE>super.writeToNBT(nbt);<NEW_LINE>nbt.setTag("battery", battery.serializeNBT());<NEW_LINE><MASK><NEW_LINE>nbt.setBoolean("inverted", inverted);<NEW_LINE>nbt.setBoolean("finished", finished);<NEW_LINE>nbt.setByte("lockedTicks", lockedTicks);<NEW_LINE>nbt.setTag("mode", NBTUtilBC.writeEnum(mode));<NEW_LINE>nbt.setTag("box", box.writeToNBT());<NEW_LINE>if (addon != null) {<NEW_LINE>nbt.setUniqueId("addonVolumeBoxId", addon.volumeBox.id);<NEW_LINE>nbt.setTag("addonSlot", NBTUtilBC.writeEnum(addon.getSlot()));<NEW_LINE>}<NEW_LINE>nbt.setBoolean("markerBox", markerBox);<NEW_LINE>nbt.setTag("patternStatement", patternStatement.writeToNbt());<NEW_LINE>Optional.ofNullable(getBuilder()).ifPresent(builder -> nbt.setTag("builder", builder.serializeNBT()));<NEW_LINE>return nbt;<NEW_LINE>}
nbt.setBoolean("canExcavate", canExcavate);
1,818,287
public void initFromTensorFlow(NodeDef nodeDef, SameDiff initWith, Map<String, AttrValue> attributesForNode, GraphDef graph) {<NEW_LINE>val aStrides = nodeDef.getAttrOrThrow("strides");<NEW_LINE>val tfStrides = aStrides.getList().getIList();<NEW_LINE>val sH = tfStrides.get(1);<NEW_LINE>val sW = tfStrides.get(2);<NEW_LINE>val aKernels = nodeDef.getAttrOrThrow("ksize");<NEW_LINE>val tfKernels = aKernels.getList().getIList();<NEW_LINE>val kH = tfKernels.get(1);<NEW_LINE>val kW = tfKernels.get(2);<NEW_LINE>val aPadding = nodeDef.getAttrOrThrow("padding");<NEW_LINE>val padding = aPadding.getList().getIList();<NEW_LINE>val paddingMode = aPadding.getS().toStringUtf8().replaceAll("\"", "");<NEW_LINE>boolean <MASK><NEW_LINE>if (!isSameMode)<NEW_LINE>log.debug("Mode: {}", paddingMode);<NEW_LINE>Pooling2DConfig pooling2DConfig = Pooling2DConfig.builder().sH(sH.intValue()).sW(sW.intValue()).type(null).paddingMode(PaddingMode.valueOf(paddingMode)).kH(kH.intValue()).kW(kW.intValue()).pH(padding.get(0).intValue()).pW(padding.get(1).intValue()).build();<NEW_LINE>this.config = pooling2DConfig;<NEW_LINE>addArgs();<NEW_LINE>log.debug("Pooling: k: [{},{}]; s: [{}, {}], padding: {}", kH, kW, sH, sW, aPadding);<NEW_LINE>}
isSameMode = paddingMode.equalsIgnoreCase("SAME");
1,565,957
public ResolvedJavaMethod lookup(UniverseMetaAccess metaAccess, ResolvedJavaMethod constructor, boolean throwAllocatedObject) {<NEW_LINE>HostedUniverse hUniverse;<NEW_LINE>AnalysisMetaAccess aMetaAccess;<NEW_LINE>if (metaAccess instanceof HostedMetaAccess) {<NEW_LINE>hUniverse = (HostedUniverse) metaAccess.getUniverse();<NEW_LINE>aMetaAccess = (AnalysisMetaAccess) metaAccess.getWrapped();<NEW_LINE>} else {<NEW_LINE>hUniverse = null;<NEW_LINE>aMetaAccess = (AnalysisMetaAccess) metaAccess;<NEW_LINE>}<NEW_LINE>AnalysisUniverse aUniverse = aMetaAccess.getUniverse();<NEW_LINE>AnalysisMethod aConstructor = constructor instanceof HostedMethod ? ((HostedMethod) constructor).getWrapped() : (AnalysisMethod) constructor;<NEW_LINE>VMError.guarantee(aConstructor.getDeclaringClass().isInstanceClass() && !aConstructor.getDeclaringClass(<MASK><NEW_LINE>Map<AnalysisMethod, FactoryMethod> methods = throwAllocatedObject ? factoryThrowMethods : factoryMethods;<NEW_LINE>FactoryMethod factoryMethod = methods.computeIfAbsent(aConstructor, key -> {<NEW_LINE>ResolvedJavaType[] unwrappedParameterTypes = new ResolvedJavaType[aConstructor.getSignature().getParameterCount(false)];<NEW_LINE>for (int i = 0; i < unwrappedParameterTypes.length; i++) {<NEW_LINE>unwrappedParameterTypes[i] = ((AnalysisType) aConstructor.getSignature().getParameterType(i, null)).getWrappedWithoutResolve();<NEW_LINE>}<NEW_LINE>ResolvedJavaType unwrappedReturnType = (throwAllocatedObject ? aMetaAccess.lookupJavaType(void.class) : aConstructor.getDeclaringClass()).getWrappedWithoutResolve();<NEW_LINE>Signature unwrappedSignature = new SimpleSignature(unwrappedParameterTypes, unwrappedReturnType);<NEW_LINE>ResolvedJavaMethod unwrappedConstructor = aConstructor.getWrapped();<NEW_LINE>ResolvedJavaType unwrappedDeclaringClass = (aMetaAccess.lookupJavaType(throwAllocatedObject ? FactoryThrowMethodHolder.class : FactoryMethodHolder.class)).getWrappedWithoutResolve();<NEW_LINE>ConstantPool unwrappedConstantPool = unwrappedConstructor.getConstantPool();<NEW_LINE>return new FactoryMethod(unwrappedConstructor, unwrappedDeclaringClass, unwrappedSignature, unwrappedConstantPool, throwAllocatedObject);<NEW_LINE>});<NEW_LINE>AnalysisMethod aFactoryMethod = aUniverse.lookup(factoryMethod);<NEW_LINE>if (hUniverse != null) {<NEW_LINE>return hUniverse.lookup(aFactoryMethod);<NEW_LINE>} else {<NEW_LINE>return aFactoryMethod;<NEW_LINE>}<NEW_LINE>}
).isAbstract(), "Must be a non-abstract instance class");
1,782,146
public RecipeMarimorphosis fromJson(@Nonnull ResourceLocation recipeId, @Nonnull JsonObject json) {<NEW_LINE>RecipeOrechid base = ModRecipeTypes.ORECHID_SERIALIZER.fromJson(recipeId, json);<NEW_LINE>Set<BiomeCategory> biomes = new HashSet<>();<NEW_LINE>var array = GsonHelper.getAsJsonArray(json, "biomes", new JsonArray());<NEW_LINE>for (JsonElement element : array) {<NEW_LINE>biomes.add(BiomeCategory.byName(GsonHelper.convertToString(element, "biome entry")));<NEW_LINE>}<NEW_LINE>int weightBonus = GsonHelper.<MASK><NEW_LINE>if (base.getWeight() + weightBonus <= 0) {<NEW_LINE>throw new JsonSyntaxException("Weight combined with bonus cannot be 0 or less");<NEW_LINE>}<NEW_LINE>return new RecipeMarimorphosis(recipeId, base.getInput(), base.getOutput(), base.getWeight(), weightBonus, biomes);<NEW_LINE>}
getAsInt(json, "biome_bonus", 0);
464,452
protected boolean handleProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws LayerGenerationException {<NEW_LINE>for (Element e : roundEnv.getElementsAnnotatedWith(EmbeddingProvider.Registration.class)) {<NEW_LINE>if (!e.getKind().isClass()) {<NEW_LINE>// NOI18N<NEW_LINE>throw new LayerGenerationException("Annotated Element has to be a class.", e);<NEW_LINE>}<NEW_LINE>final EmbeddingProvider.Registration reg = e.<MASK><NEW_LINE>String mimeType = reg.mimeType();<NEW_LINE>if (mimeType == null) {<NEW_LINE>// NOI18N<NEW_LINE>throw new LayerGenerationException("Mime type has to be given.", e);<NEW_LINE>} else if (!mimeType.isEmpty()) {<NEW_LINE>// NOI18N<NEW_LINE>mimeType = '/' + mimeType;<NEW_LINE>}<NEW_LINE>String targetMimeType = reg.targetMimeType();<NEW_LINE>if (targetMimeType == null || targetMimeType.isEmpty()) {<NEW_LINE>// NOI18N<NEW_LINE>throw new LayerGenerationException("Target mime type has to be given.", e);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>layer(e).// NOI18N<NEW_LINE>instanceFile(// NOI18N<NEW_LINE>"Editors" + mimeType, // NOI18N<NEW_LINE>null, // /NOI18N<NEW_LINE>null).// /NOI18N<NEW_LINE>stringvalue(// /NOI18N<NEW_LINE>"instanceOf", // NOI18N<NEW_LINE>TaskFactory.class.getName()).// NOI18N<NEW_LINE>methodvalue(// NOI18N<NEW_LINE>"instanceCreate", // NOI18N<NEW_LINE>EmbeddingProviderFactory.class.getName(), "create").stringvalue(EmbeddingProviderFactory.ATTR_TARGET_MIME_TYPE, targetMimeType).instanceAttribute(EmbeddingProviderFactory.ATTR_PROVIDER, EmbeddingProvider.class).write();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getAnnotation(EmbeddingProvider.Registration.class);