idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
194,999
public MagnetUri parse(URI uri) {<NEW_LINE>if (!SCHEME.equals(uri.getScheme())) {<NEW_LINE>throw new IllegalArgumentException("Invalid scheme: " + uri.getScheme());<NEW_LINE>}<NEW_LINE>Map<String, List<String>> paramsMap = collectParams(uri);<NEW_LINE>Set<String> infoHashes = getRequiredParam(UriParams.TORRENT_ID, paramsMap).stream().filter(value -> value.startsWith(INFOHASH_PREFIX)).map(value -> value.substring(INFOHASH_PREFIX.length())).collect(Collectors.toSet());<NEW_LINE>if (infoHashes.size() != 1) {<NEW_LINE>throw new IllegalStateException(String.format("Parameter '%s' has invalid number of values with prefix '%s': %s", UriParams.TORRENT_ID, INFOHASH_PREFIX<MASK><NEW_LINE>}<NEW_LINE>TorrentId torrentId = buildTorrentId(infoHashes.iterator().next());<NEW_LINE>MagnetUri.Builder builder = MagnetUri.torrentId(torrentId);<NEW_LINE>getOptionalParam(UriParams.DISPLAY_NAME, paramsMap).stream().findAny().ifPresent(builder::name);<NEW_LINE>getOptionalParam(UriParams.TRACKER_URL, paramsMap).forEach(builder::tracker);<NEW_LINE>getOptionalParam(UriParams.PEER, paramsMap).forEach(value -> {<NEW_LINE>try {<NEW_LINE>builder.peer(parsePeer(value));<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (lenient) {<NEW_LINE>LOGGER.warn("Failed to parse peer address: " + value, e);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Failed to parse peer address: " + value, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return builder.buildUri();<NEW_LINE>}
, infoHashes.size()));
1,513,524
public MaterialInstance findMaterialInstance(MaterialConfig materialConfig) {<NEW_LINE>String cacheKey = materialKey(materialConfig.getFingerprint());<NEW_LINE>MaterialInstance materialInstance = (<MASK><NEW_LINE>if (materialInstance == null) {<NEW_LINE>synchronized (cacheKey) {<NEW_LINE>materialInstance = (MaterialInstance) goCache.get(cacheKey);<NEW_LINE>if (materialInstance == null) {<NEW_LINE>DetachedCriteria hibernateCriteria = DetachedCriteria.forClass(materialConfigConverter.getInstanceType(materialConfig));<NEW_LINE>for (Map.Entry<String, Object> property : materialConfig.getSqlCriteria().entrySet()) {<NEW_LINE>if (!property.getKey().equals(AbstractMaterial.SQL_CRITERIA_TYPE)) {<NEW_LINE>// type is polymorphic mapping discriminator<NEW_LINE>if (property.getValue() == null) {<NEW_LINE>hibernateCriteria.add(isNull(property.getKey()));<NEW_LINE>} else {<NEW_LINE>hibernateCriteria.add(eq(property.getKey(), property.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>materialInstance = (MaterialInstance) firstResult(hibernateCriteria);<NEW_LINE>if (materialInstance != null) {<NEW_LINE>goCache.put(cacheKey, materialInstance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: clone me, caller may mutate<NEW_LINE>return materialInstance;<NEW_LINE>}
MaterialInstance) goCache.get(cacheKey);
493,601
public int vote(Authentication authentication, FilterInvocation filter, Collection<ConfigAttribute> attributes) {<NEW_LINE>if ("anonymousUser".equals(authentication.getPrincipal())) {<NEW_LINE>return ACCESS_DENIED;<NEW_LINE>}<NEW_LINE>if (!(authentication.getPrincipal() instanceof SecuredUser)) {<NEW_LINE>return ACCESS_DENIED;<NEW_LINE>}<NEW_LINE>SecuredUser secureUser = <MASK><NEW_LINE>User loginUser = secureUser.getUser();<NEW_LINE>if (loginUser.getRole() == Role.ADMIN) {<NEW_LINE>return ACCESS_GRANTED;<NEW_LINE>}<NEW_LINE>String realm = StringUtils.split(filter.getHttpRequest().getPathInfo(), '/')[0];<NEW_LINE>if (secureUser.getUsername().equals(realm)) {<NEW_LINE>return ACCESS_GRANTED;<NEW_LINE>} else {<NEW_LINE>User user = userService.getOneWithEagerFetch(loginUser.getUserId());<NEW_LINE>List<User> owners = user.getOwners();<NEW_LINE>for (User each : owners) {<NEW_LINE>if (realm.equals(each.getUserId())) {<NEW_LINE>return ACCESS_GRANTED;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ACCESS_DENIED;<NEW_LINE>}
cast(authentication.getPrincipal());
789,376
public void createMenuItems(Bundle savedInstanceState) {<NEW_LINE>OsmandApplication app = requiredMyApplication();<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>minZoom = savedInstanceState.getInt(MIN_ZOOM_KEY);<NEW_LINE><MASK><NEW_LINE>dialogDescrRes = savedInstanceState.getInt(DIALOG_DESCR_RES_KEY);<NEW_LINE>sliderDescrRes = savedInstanceState.getInt(SLIDER_DESCR_RES_KEY);<NEW_LINE>newMapSource = savedInstanceState.getBoolean(NEW_MAP_SOURCE);<NEW_LINE>}<NEW_LINE>LayoutInflater inflater = UiUtilities.getInflater(app, nightMode);<NEW_LINE>TitleItem titleItem = new TitleItem(getString(R.string.shared_string_zoom_levels));<NEW_LINE>items.add(titleItem);<NEW_LINE>final View sliderView = inflater.inflate(R.layout.zoom_levels_with_descr, null);<NEW_LINE>((TextView) sliderView.findViewById(R.id.slider_descr)).setText(sliderDescrRes);<NEW_LINE>TextView dialogDescrTv = sliderView.findViewById(R.id.dialog_descr);<NEW_LINE>if (dialogDescrRes == R.string.map_source_zoom_levels_descr) {<NEW_LINE>String mapSource = getString(R.string.map_source);<NEW_LINE>String overlayUnderlay = getString(R.string.pref_overlay);<NEW_LINE>String dialogDesr = getString(dialogDescrRes, mapSource, overlayUnderlay);<NEW_LINE>dialogDescrTv.setText(UiUtilities.createCustomFontSpannable(FontCache.getRobotoMedium(app), dialogDesr, mapSource, overlayUnderlay));<NEW_LINE>} else {<NEW_LINE>dialogDescrTv.setText(getString(dialogDescrRes));<NEW_LINE>}<NEW_LINE>final TextView minZoomValue = sliderView.findViewById(R.id.zoom_value_min);<NEW_LINE>minZoomValue.setText(String.valueOf(minZoom));<NEW_LINE>final TextView maxZoomValue = sliderView.findViewById(R.id.zoom_value_max);<NEW_LINE>maxZoomValue.setText(String.valueOf(maxZoom));<NEW_LINE>RangeSlider slider = sliderView.findViewById(R.id.zoom_slider);<NEW_LINE>int colorProfile = app.getSettings().getApplicationMode().getProfileColor(nightMode);<NEW_LINE>UiUtilities.setupSlider(slider, nightMode, colorProfile, true);<NEW_LINE>slider.setValueFrom(SLIDER_FROM);<NEW_LINE>slider.setValueTo(SLIDER_TO);<NEW_LINE>slider.setValues((float) minZoom, (float) maxZoom);<NEW_LINE>slider.addOnChangeListener(new RangeSlider.OnChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onValueChange(@NonNull RangeSlider slider, float value, boolean fromUser) {<NEW_LINE>List<Float> values = slider.getValues();<NEW_LINE>if (values.size() > 0) {<NEW_LINE>minZoomValue.setText(String.valueOf(values.get(0).intValue()));<NEW_LINE>maxZoomValue.setText(String.valueOf(values.get(1).intValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>slider.addOnSliderTouchListener(new RangeSlider.OnSliderTouchListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStartTrackingTouch(@NonNull RangeSlider slider) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStopTrackingTouch(@NonNull RangeSlider slider) {<NEW_LINE>List<Float> values = slider.getValues();<NEW_LINE>if (values.size() > 0) {<NEW_LINE>minZoom = values.get(0).intValue();<NEW_LINE>maxZoom = values.get(1).intValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final SimpleBottomSheetItem sliderItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder().setCustomView(sliderView).create();<NEW_LINE>items.add(sliderItem);<NEW_LINE>}
maxZoom = savedInstanceState.getInt(MAX_ZOOM_KEY);
534,733
public BuildRule createBuildRule(BuildRuleCreationContextWithTargetGraph context, BuildTarget buildTarget, BuildRuleParams params, AppleToolchainSetDescriptionArg args) {<NEW_LINE>Verify.verify(!buildTarget.isFlavored());<NEW_LINE>ImmutableList.Builder<AppleCxxPlatform> appleCxxPlatformsBuilder = ImmutableList.builder();<NEW_LINE>for (BuildTarget target : args.getAppleToolchains()) {<NEW_LINE>BuildRule appleToolchainRule = context.<MASK><NEW_LINE>if (!(appleToolchainRule instanceof AppleToolchainBuildRule)) {<NEW_LINE>throw new HumanReadableException("Expected %s to be an instance of apple_toolchain.", target);<NEW_LINE>}<NEW_LINE>appleCxxPlatformsBuilder.add(((AppleToolchainBuildRule) appleToolchainRule).getAppleCxxPlatform());<NEW_LINE>}<NEW_LINE>return new AppleToolchainSetBuildRule(buildTarget, context.getProjectFilesystem(), FlavorDomain.from("Apple C++ Platform", appleCxxPlatformsBuilder.build()));<NEW_LINE>}
getActionGraphBuilder().getRule(target);
1,833,691
public boolean replaceEvent(GameEvent event, Ability source, Game game) {<NEW_LINE>Permanent creature = game.getPermanent(event.getSourceId());<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (creature != null && controller != null) {<NEW_LINE>if (exertOnlyOncePerTurn) {<NEW_LINE>MageObjectReference creatureReference = new MageObjectReference(creature.getId(), creature.getZoneChangeCounter(game), game);<NEW_LINE>ExertedThisTurnWatcher watcher = game.getState().getWatcher(ExertedThisTurnWatcher.class);<NEW_LINE>if (watcher != null && watcher.getExertedThisTurnCreatures().contains(creatureReference)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (controller.chooseUse(outcome, "Exert " + creature.getLogName() + '?', "An exerted creature won't untap during your next untap step.", "Yes", "No", source, game)) {<NEW_LINE>if (!game.isSimulation()) {<NEW_LINE>game.informPlayers(controller.getLogName() + " exerted " + creature.getName());<NEW_LINE>}<NEW_LINE>game.fireEvent(GameEvent.getEvent(GameEvent.EventType.BECOMES_EXERTED, creature.getId(), source, source.getControllerId()));<NEW_LINE>ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect(<MASK><NEW_LINE>effect.setTargetPointer(new FixedTarget(creature, game));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
"", creature.getControllerId());
1,849,015
private void handleDescribeModel(ChannelHandlerContext ctx, String modelName) throws ModelNotFoundException {<NEW_LINE>ModelManager modelManager = ModelManager.getInstance();<NEW_LINE>Model model = modelManager.getModels().get(modelName);<NEW_LINE>if (model == null) {<NEW_LINE>throw new ModelNotFoundException("Model not found: " + modelName);<NEW_LINE>}<NEW_LINE>DescribeModelResponse resp = new DescribeModelResponse();<NEW_LINE>resp.setModelName(modelName);<NEW_LINE>resp.setModelUrl(model.getModelUrl());<NEW_LINE>resp.setBatchSize(model.getBatchSize());<NEW_LINE>resp.setMaxBatchDelay(model.getMaxBatchDelay());<NEW_LINE>resp.setMaxWorkers(model.getMaxWorkers());<NEW_LINE>resp.<MASK><NEW_LINE>resp.setLoadedAtStartup(modelManager.getStartupModels().contains(modelName));<NEW_LINE>Manifest manifest = model.getModelArchive().getManifest();<NEW_LINE>Manifest.Engine engine = manifest.getEngine();<NEW_LINE>if (engine != null) {<NEW_LINE>resp.setEngine(engine.getEngineName());<NEW_LINE>}<NEW_LINE>resp.setModelVersion(manifest.getModel().getModelVersion());<NEW_LINE>resp.setRuntime(manifest.getRuntime().getValue());<NEW_LINE>List<WorkerThread> workers = modelManager.getWorkers(modelName);<NEW_LINE>for (WorkerThread worker : workers) {<NEW_LINE>String workerId = worker.getWorkerId();<NEW_LINE>long startTime = worker.getStartTime();<NEW_LINE>boolean isRunning = worker.isRunning();<NEW_LINE>int gpuId = worker.getGpuId();<NEW_LINE>long memory = worker.getMemory();<NEW_LINE>resp.addWorker(workerId, startTime, isRunning, gpuId, memory);<NEW_LINE>}<NEW_LINE>NettyUtils.sendJsonResponse(ctx, resp);<NEW_LINE>}
setMinWorkers(model.getMinWorkers());
976,456
public EPCompiled compile(Module module, CompilerArguments arguments) throws EPCompileException {<NEW_LINE>if (arguments == null) {<NEW_LINE>arguments = new CompilerArguments(new Configuration());<NEW_LINE>}<NEW_LINE>// determine module name<NEW_LINE>String moduleName = determineModuleName(arguments.getOptions(), module);<NEW_LINE>Set<String> moduleUses = determineModuleUses(moduleName, arguments.getOptions(), module);<NEW_LINE>// get compile services<NEW_LINE>ModuleCompileTimeServices compileTimeServices = getCompileTimeServices(arguments, moduleName, moduleUses, false);<NEW_LINE>addModuleImports(<MASK><NEW_LINE>List<Compilable> compilables = new ArrayList<>();<NEW_LINE>for (ModuleItem item : module.getItems()) {<NEW_LINE>if (item.isCommentOnly()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (item.getExpression() != null && item.getModel() != null) {<NEW_LINE>throw new EPCompileException("Module item has both an EPL expression and a statement object model");<NEW_LINE>}<NEW_LINE>if (item.getExpression() != null) {<NEW_LINE>compilables.add(new CompilableEPL(item.getExpression(), item.getLineNumber()));<NEW_LINE>} else if (item.getModel() != null) {<NEW_LINE>compilables.add(new CompilableSODA(item.getModel(), item.getLineNumber()));<NEW_LINE>} else {<NEW_LINE>throw new EPCompileException("Module item has neither an EPL expression nor a statement object model");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<ModuleProperty, Object> moduleProperties = new HashMap<>();<NEW_LINE>addModuleProperty(moduleProperties, ModuleProperty.ARCHIVENAME, module.getArchiveName());<NEW_LINE>addModuleProperty(moduleProperties, ModuleProperty.URI, module.getUri());<NEW_LINE>if (arguments.getConfiguration().getCompiler().getByteCode().isAttachModuleEPL()) {<NEW_LINE>addModuleProperty(moduleProperties, ModuleProperty.MODULETEXT, module.getModuleText());<NEW_LINE>}<NEW_LINE>addModuleProperty(moduleProperties, ModuleProperty.USEROBJECT, module.getModuleUserObjectCompileTime());<NEW_LINE>addModuleProperty(moduleProperties, ModuleProperty.USES, toNullOrArray(module.getUses()));<NEW_LINE>addModuleProperty(moduleProperties, ModuleProperty.IMPORTS, toNullOrArray(module.getImports()));<NEW_LINE>// compile<NEW_LINE>return CompilerHelperModuleProvider.compile(compilables, moduleName, moduleProperties, compileTimeServices, arguments.getOptions(), arguments.getPath());<NEW_LINE>}
module.getImports(), compileTimeServices);
1,641,903
private static AppDatabase buildDatabase(final Context appContext, final AppExecutors executors) {<NEW_LINE>return Room.databaseBuilder(appContext, AppDatabase.class, DATABASE_NAME).addCallback(new Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCreate(@NonNull SupportSQLiteDatabase db) {<NEW_LINE>super.onCreate(db);<NEW_LINE>executors.diskIO().execute(() -> {<NEW_LINE>// Add a delay to simulate a long-running operation<NEW_LINE>addDelay();<NEW_LINE>// Generate the data for pre-population<NEW_LINE>AppDatabase database = AppDatabase.getInstance(appContext, executors);<NEW_LINE>List<ProductEntity> products = DataGenerator.generateProducts();<NEW_LINE>List<CommentEntity> comments = DataGenerator.generateCommentsForProducts(products);<NEW_LINE><MASK><NEW_LINE>// notify that the database was created and it's ready to be used<NEW_LINE>database.setDatabaseCreated();<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}).addMigrations(MIGRATION_1_2).build();<NEW_LINE>}
insertData(database, products, comments);
353,001
private Drawable applyRippleEffectWhenNeeded(Drawable selectable) {<NEW_LINE>if (mRippleColor != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && selectable instanceof RippleDrawable) {<NEW_LINE>int[][] states = new int[][] { new int[] { android.R.attr.state_enabled } };<NEW_LINE>int[] colors = new int[] { mRippleColor };<NEW_LINE>ColorStateList colorStateList = new ColorStateList(states, colors);<NEW_LINE>((RippleDrawable<MASK><NEW_LINE>}<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && mRippleRadius != null && selectable instanceof RippleDrawable) {<NEW_LINE>RippleDrawable rippleDrawable = (RippleDrawable) selectable;<NEW_LINE>rippleDrawable.setRadius((int) PixelUtil.toPixelFromDIP(mRippleRadius));<NEW_LINE>}<NEW_LINE>return selectable;<NEW_LINE>}
) selectable).setColor(colorStateList);
566,367
public Result processWorkPackage(final I_C_Queue_WorkPackage workPackage, final String localTrxName) {<NEW_LINE>final ILoggable loggable = Loggables.get();<NEW_LINE>final IParams params = getParameters();<NEW_LINE>//<NEW_LINE>// Extract param: SQL code to execute (and normalize it)<NEW_LINE>final String workPackageSqlRaw = params.getParameterAsString(PARAM_WORKPACKAGE_SQL);<NEW_LINE>Check.assumeNotEmpty(workPackageSqlRaw, "Missing parameter: {}", PARAM_WORKPACKAGE_SQL);<NEW_LINE>final String workPackageSql = parseSql(workPackageSqlRaw, workPackage);<NEW_LINE>loggable.addLog("SQL to execute: {0}", workPackageSql);<NEW_LINE>//<NEW_LINE>// Extract param: ReEnqueue<NEW_LINE>final boolean isReEnqueue = params.hasParameter(PARAM_ReEnqueue) ? params.getParameterAsBool(PARAM_ReEnqueue) : DEFAULT_ReEnqueue;<NEW_LINE>//<NEW_LINE>// Execute the SQL update<NEW_LINE>final int updateCount = executeSql(workPackageSql);<NEW_LINE>loggable.addLog("Updated {0} records", updateCount);<NEW_LINE>//<NEW_LINE>// Re-enqueue the Workpackage if there was something updated and if we are asked to do so<NEW_LINE>if (updateCount > 0) {<NEW_LINE>if (isReEnqueue) {<NEW_LINE>final Properties <MASK><NEW_LINE>final I_C_Queue_WorkPackage nextWorkpackage = // Workpackage Parameters<NEW_LINE>Services.get(IWorkPackageQueueFactory.class).getQueueForEnqueuing(ctx, getClass()).newWorkPackage().bindToTrxName(localTrxName).parameters().setParameter(PARAM_WORKPACKAGE_SQL, workPackageSqlRaw).setParameter(PARAM_AFTER_FINISH_SQL, params.getParameterAsString(PARAM_AFTER_FINISH_SQL)).// Build & enqueue<NEW_LINE>end().buildAndEnqueue();<NEW_LINE>loggable.addLog("New workpackage enqueued: {0}", nextWorkpackage);<NEW_LINE>} else {<NEW_LINE>loggable.addLog("No new workpackages will be reenqueued because parameter {0} is false", PARAM_ReEnqueue);<NEW_LINE>executeAfterFinishSql(workPackage);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>loggable.addLog("No new workpackages will be reenqueued because there was nothing updated in this run");<NEW_LINE>executeAfterFinishSql(workPackage);<NEW_LINE>}<NEW_LINE>return Result.SUCCESS;<NEW_LINE>}
ctx = InterfaceWrapperHelper.getCtx(workPackage);
1,479,336
public void actionPerformed(ActionEvent e) {<NEW_LINE>try {<NEW_LINE>// XmlObject xmlObject = XmlObject.Factory.parse(<NEW_LINE>// inputArea.getText() );<NEW_LINE>XmlObject xmlObject = XmlUtils.<MASK><NEW_LINE>XmlObject[] objects;<NEW_LINE>// xquery?<NEW_LINE>if (queryTabs.getSelectedIndex() == 0) {<NEW_LINE>objects = xmlObject.execQuery(xqueryArea.getText());<NEW_LINE>} else {<NEW_LINE>objects = xmlObject.selectPath(xpathArea.getText());<NEW_LINE>}<NEW_LINE>StringBuffer result = new StringBuffer();<NEW_LINE>XmlOptions options = new XmlOptions();<NEW_LINE>options.setSaveOuter();<NEW_LINE>for (int c = 0; c < objects.length; c++) {<NEW_LINE>result.append(objects[c].xmlText(options));<NEW_LINE>result.append("\n");<NEW_LINE>}<NEW_LINE>resultArea.setText(result.toString());<NEW_LINE>statusLabel.setText("Expression returned " + objects.length + " hits");<NEW_LINE>} catch (Throwable e1) {<NEW_LINE>if (e1 instanceof RuntimeException) {<NEW_LINE>e1 = ((RuntimeException) e1).getCause();<NEW_LINE>if (e1 instanceof InvocationTargetException) {<NEW_LINE>e1 = ((InvocationTargetException) e1).getTargetException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>statusLabel.setText(e1.getMessage());<NEW_LINE>}<NEW_LINE>}
createXmlObject(inputArea.getText());
453,079
protected static void patchEs256ForAuth(String deviceId, String publicKeyFilePath, String projectId, String cloudRegion, String registryName) throws GeneralSecurityException, IOException {<NEW_LINE>GoogleCredentials credential = GoogleCredentials.getApplicationDefault().createScoped(CloudIotScopes.all());<NEW_LINE>JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();<NEW_LINE><MASK><NEW_LINE>final CloudIot service = new CloudIot.Builder(GoogleNetHttpTransport.newTrustedTransport(), jsonFactory, init).setApplicationName(APP_NAME).build();<NEW_LINE>final String devicePath = String.format("projects/%s/locations/%s/registries/%s/devices/%s", projectId, cloudRegion, registryName, deviceId);<NEW_LINE>PublicKeyCredential publicKeyCredential = new PublicKeyCredential();<NEW_LINE>String key = Files.toString(new File(publicKeyFilePath), Charsets.UTF_8);<NEW_LINE>publicKeyCredential.setKey(key);<NEW_LINE>publicKeyCredential.setFormat("ES256_PEM");<NEW_LINE>DeviceCredential devCredential = new DeviceCredential();<NEW_LINE>devCredential.setPublicKey(publicKeyCredential);<NEW_LINE>Device device = new Device();<NEW_LINE>device.setCredentials(Collections.singletonList(devCredential));<NEW_LINE>Device patchedDevice = service.projects().locations().registries().devices().patch(devicePath, device).setUpdateMask("credentials").execute();<NEW_LINE>System.out.println("Patched device is " + patchedDevice.toPrettyString());<NEW_LINE>}
HttpRequestInitializer init = new HttpCredentialsAdapter(credential);
543,014
protected void logRefChange(Collection<ReceiveCommand> commands) {<NEW_LINE>boolean isRefCreationOrDeletion = false;<NEW_LINE>// log ref changes<NEW_LINE>for (ReceiveCommand cmd : commands) {<NEW_LINE>if (Result.OK.equals(cmd.getResult())) {<NEW_LINE>// add some logging for important ref changes<NEW_LINE>switch(cmd.getType()) {<NEW_LINE>case DELETE:<NEW_LINE>LOGGER.info(MessageFormat.format("{0} DELETED {1} in {2} ({3})", user.username, cmd.getRefName(), repository.name, cmd.getOldId<MASK><NEW_LINE>isRefCreationOrDeletion = true;<NEW_LINE>break;<NEW_LINE>case CREATE:<NEW_LINE>LOGGER.info(MessageFormat.format("{0} CREATED {1} in {2}", user.username, cmd.getRefName(), repository.name));<NEW_LINE>isRefCreationOrDeletion = true;<NEW_LINE>break;<NEW_LINE>case UPDATE:<NEW_LINE>LOGGER.info(MessageFormat.format("{0} UPDATED {1} in {2} (from {3} to {4})", user.username, cmd.getRefName(), repository.name, cmd.getOldId().name(), cmd.getNewId().name()));<NEW_LINE>break;<NEW_LINE>case UPDATE_NONFASTFORWARD:<NEW_LINE>LOGGER.info(MessageFormat.format("{0} UPDATED NON-FAST-FORWARD {1} in {2} (from {3} to {4})", user.username, cmd.getRefName(), repository.name, cmd.getOldId().name(), cmd.getNewId().name()));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isRefCreationOrDeletion) {<NEW_LINE>gitblit.resetRepositoryCache(repository.name);<NEW_LINE>}<NEW_LINE>}
().name()));
586,142
public DocumentExamples extract(int id, Document document, Map<Pair<Integer, Integer>, Boolean> labeledPairs, Compressor<String> compressor) {<NEW_LINE>List<Mention> mentionsList = CorefUtils.getSortedMentions(document);<NEW_LINE>Map<Integer, List<Mention>> mentionsByHeadIndex = new HashMap<>();<NEW_LINE>for (Mention m : mentionsList) {<NEW_LINE>List<Mention> withIndex = mentionsByHeadIndex.get(m.headIndex);<NEW_LINE>if (withIndex == null) {<NEW_LINE>withIndex = new ArrayList<>();<NEW_LINE>mentionsByHeadIndex.put(m.headIndex, withIndex);<NEW_LINE>}<NEW_LINE>withIndex.add(m);<NEW_LINE>}<NEW_LINE>Map<Integer, Mention> mentions = document.predictedMentionsByID;<NEW_LINE>List<Example> examples = new ArrayList<>();<NEW_LINE>Set<Integer> mentionsToExtract = new HashSet<>();<NEW_LINE>for (Map.Entry<Pair<Integer, Integer>, Boolean> pair : labeledPairs.entrySet()) {<NEW_LINE>Mention m1 = mentions.get(pair.getKey().first);<NEW_LINE>Mention m2 = mentions.get(pair.getKey().second);<NEW_LINE>mentionsToExtract.add(m1.mentionID);<NEW_LINE><MASK><NEW_LINE>CompressedFeatureVector features = compressor.compress(getFeatures(document, m1, m2));<NEW_LINE>examples.add(new Example(id, m1, m2, pair.getValue() ? 1.0 : 0.0, features));<NEW_LINE>}<NEW_LINE>Map<Integer, CompressedFeatureVector> mentionFeatures = new HashMap<>();<NEW_LINE>for (int mentionID : mentionsToExtract) {<NEW_LINE>mentionFeatures.put(mentionID, compressor.compress(getFeatures(document, document.predictedMentionsByID.get(mentionID), mentionsByHeadIndex)));<NEW_LINE>}<NEW_LINE>return new DocumentExamples(id, examples, mentionFeatures);<NEW_LINE>}
mentionsToExtract.add(m2.mentionID);
758,599
public int insert(SequenceOptRecord record) {<NEW_LINE>try {<NEW_LINE>DdlMetaLogUtil.logSql(INSERT_SEQ_OPT_TABLE, record.buildInsertParams());<NEW_LINE>return MetaDbUtil.insert(INSERT_SEQ_OPT_TABLE, <MASK><NEW_LINE>} catch (SQLException e) {<NEW_LINE>String extraMsg = "";<NEW_LINE>if (checkIfDuplicate(e)) {<NEW_LINE>SequenceOptRecord existingRecord = query(record.schemaName, record.name);<NEW_LINE>if (compare(record, existingRecord)) {<NEW_LINE>// Ignore new and use existing record.<NEW_LINE>return 1;<NEW_LINE>} else {<NEW_LINE>extraMsg = ". New and existing records don't match";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.error("Failed to insert a new record into " + SEQ_OPT_TABLE + extraMsg, e);<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_ACCESS_TO_SYSTEM_TABLE, e, "insert into", SEQ_OPT_TABLE, e.getMessage());<NEW_LINE>}<NEW_LINE>}
record.buildInsertParams(), connection);
575,950
private void catchup(final Account account) {<NEW_LINE>synchronized (this.queries) {<NEW_LINE>for (Iterator<Query> iterator = this.queries.iterator(); iterator.hasNext(); ) {<NEW_LINE>Query query = iterator.next();<NEW_LINE>if (query.getAccount() == account) {<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MamReference mamReference = MamReference.max(mXmppConnectionService.databaseBackend.getLastMessageReceived(account), mXmppConnectionService.databaseBackend.getLastClearDate(account));<NEW_LINE>mamReference = MamReference.max(mamReference, mXmppConnectionService.getAutomaticMessageDeletionDate());<NEW_LINE>long endCatchup = account.getXmppConnection().getLastSessionEstablished();<NEW_LINE>final Query query;<NEW_LINE>if (mamReference.getTimestamp() == 0) {<NEW_LINE>return;<NEW_LINE>} else if (endCatchup - mamReference.getTimestamp() >= Config.MAM_MAX_CATCHUP) {<NEW_LINE>long startCatchup = endCatchup - Config.MAM_MAX_CATCHUP;<NEW_LINE>List<Conversation> conversations = mXmppConnectionService.getConversations();<NEW_LINE>for (Conversation conversation : conversations) {<NEW_LINE>if (conversation.getMode() == Conversation.MODE_SINGLE && conversation.getAccount() == account && startCatchup > conversation.getLastMessageTransmitted().getTimestamp()) {<NEW_LINE>this.query(conversation, startCatchup, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>query = new Query(account, new MamReference(startCatchup), 0);<NEW_LINE>} else {<NEW_LINE>query = new Query(account, mamReference, 0);<NEW_LINE>}<NEW_LINE>synchronized (this.queries) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>this.execute(query);<NEW_LINE>}
this.queries.add(query);
1,608,847
private void checkAndHandlePrivateTransaction(final Transaction transaction, final GoQuorumSendRawTxArgs rawTxArgs, final JsonRpcRequestContext requestContext) {<NEW_LINE>// rawTxArgs cannot be null as the call to getRequiredParameter would have failed if it was not<NEW_LINE>// available<NEW_LINE>if (rawTxArgs.getPrivateFor() == null) {<NEW_LINE>LOG.error(JsonRpcError.GOQUORUM_NO_PRIVATE_FOR.getMessage());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (rawTxArgs.getPrivacyFlag() != 0) {<NEW_LINE>LOG.error(JsonRpcError.GOQUORUM_ONLY_STANDARD_MODE_SUPPORTED.getMessage());<NEW_LINE>throw new JsonRpcErrorResponseException(JsonRpcError.GOQUORUM_ONLY_STANDARD_MODE_SUPPORTED);<NEW_LINE>}<NEW_LINE>if (rawTxArgs.getPrivateFrom() != null) {<NEW_LINE>final String privateFrom = rawTxArgs.getPrivateFrom();<NEW_LINE>final String privacyUserId = privacyIdProvider.getPrivacyUserId(requestContext.getUser());<NEW_LINE>if (!privateFrom.equals(privacyUserId)) {<NEW_LINE>LOG.error(JsonRpcError.PRIVATE_FROM_DOES_NOT_MATCH_ENCLAVE_PUBLIC_KEY.getMessage());<NEW_LINE>throw new JsonRpcErrorResponseException(JsonRpcError.PRIVATE_FROM_DOES_NOT_MATCH_ENCLAVE_PUBLIC_KEY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!transaction.getV().equals(BigInteger.valueOf(37)) && !transaction.getV().equals(BigInteger.valueOf(38))) {<NEW_LINE>LOG.error(JsonRpcError.GOQUORUM_V_VALUE.getMessage());<NEW_LINE>throw new JsonRpcErrorResponseException(JsonRpcError.GOQUORUM_V_VALUE);<NEW_LINE>}<NEW_LINE>final Bytes txId = transaction.getPayload();<NEW_LINE>if (txId == null || txId.isEmpty()) {<NEW_LINE>throw new JsonRpcErrorResponseException(JsonRpcError.GOQUORUM_LOOKUP_ID_NOT_AVAILABLE);<NEW_LINE>}<NEW_LINE>enclave.sendSignedTransaction(txId.toArray(), rawTxArgs.getPrivateFor());<NEW_LINE>}
throw new JsonRpcErrorResponseException(JsonRpcError.GOQUORUM_NO_PRIVATE_FOR);
1,673,227
public static int launchJavaVM(final Activity activity, final List<String> JVMArgs) throws Throwable {<NEW_LINE>JREUtils.relocateLibPath(activity);<NEW_LINE>// For debugging only!<NEW_LINE>setJavaEnvironment(activity);<NEW_LINE>final String graphicsLib = loadGraphicsLibrary();<NEW_LINE>List<String> userArgs = getJavaArgs(activity);<NEW_LINE>// Remove arguments that can interfere with the good working of the launcher<NEW_LINE>purgeArg(userArgs, "-Xms");<NEW_LINE>purgeArg(userArgs, "-Xmx");<NEW_LINE>purgeArg(userArgs, "-d32");<NEW_LINE>purgeArg(userArgs, "-d64");<NEW_LINE>purgeArg(userArgs, "-Dorg.lwjgl.opengl.libname");<NEW_LINE>// Add automatically generated args<NEW_LINE>userArgs.add("-Xms" + LauncherPreferences.PREF_RAM_ALLOCATION + "M");<NEW_LINE>userArgs.add("-Xmx" + LauncherPreferences.PREF_RAM_ALLOCATION + "M");<NEW_LINE>if (LOCAL_RENDERER != null)<NEW_LINE>userArgs.add("-Dorg.lwjgl.opengl.libname=" + graphicsLib);<NEW_LINE>userArgs.addAll(JVMArgs);<NEW_LINE>activity.runOnUiThread(() -> Toast.makeText(activity, activity.getString(R.string.autoram_info_msg, LauncherPreferences.PREF_RAM_ALLOCATION), Toast.LENGTH_SHORT).show());<NEW_LINE>System.out.println(JVMArgs);<NEW_LINE>initJavaRuntime();<NEW_LINE>setupExitTrap(activity.getApplication());<NEW_LINE>chdir(Tools.DIR_GAME_NEW);<NEW_LINE>// argv[0] is the program name according to C standard.<NEW_LINE><MASK><NEW_LINE>final int exitCode = VMLauncher.launchJVM(userArgs.toArray(new String[0]));<NEW_LINE>Logger.getInstance().appendToLog("Java Exit code: " + exitCode);<NEW_LINE>if (exitCode != 0) {<NEW_LINE>activity.runOnUiThread(() -> {<NEW_LINE>AlertDialog.Builder dialog = new AlertDialog.Builder(activity);<NEW_LINE>dialog.setMessage(activity.getString(R.string.mcn_exit_title, exitCode));<NEW_LINE>dialog.setPositiveButton(android.R.string.ok, (p1, p2) -> BaseMainActivity.fullyExit());<NEW_LINE>dialog.show();<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return exitCode;<NEW_LINE>}
userArgs.add(0, "java");
1,744,947
public Clustering<BiclusterWithInversionsModel> biclustering() {<NEW_LINE>double[][] mat = RelationUtil.relationAsMatrix(relation, rowIDs);<NEW_LINE>BiclusterCandidate cand = new BiclusterCandidate(getRowDim(), getColDim());<NEW_LINE>Clustering<BiclusterWithInversionsModel> result = new Clustering<>();<NEW_LINE>Metadata.of(result).setLongName("Cheng-and-Church");<NEW_LINE>ModifiableDBIDs noise = DBIDUtil.newHashSet(relation.getDBIDs());<NEW_LINE>Random rand = rnd.getSingleThreadedRandom();<NEW_LINE>FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Extracting Cluster", n, LOG) : null;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>cand.reset();<NEW_LINE>multipleNodeDeletion(mat, cand);<NEW_LINE>if (LOG.isVeryVerbose()) {<NEW_LINE>LOG.veryverbose("Residue after Alg 2: " + cand.residue + " " + cand.<MASK><NEW_LINE>}<NEW_LINE>singleNodeDeletion(mat, cand);<NEW_LINE>if (LOG.isVeryVerbose()) {<NEW_LINE>LOG.veryverbose("Residue after Alg 1: " + cand.residue + " " + cand.rowcard + "x" + cand.colcard);<NEW_LINE>}<NEW_LINE>nodeAddition(mat, cand);<NEW_LINE>if (LOG.isVeryVerbose()) {<NEW_LINE>LOG.veryverbose("Residue after Alg 3: " + cand.residue + " " + cand.rowcard + "x" + cand.colcard);<NEW_LINE>}<NEW_LINE>cand.maskMatrix(mat, dist, rand);<NEW_LINE>BiclusterWithInversionsModel model = new BiclusterWithInversionsModel(colsBitsetToIDs(cand.cols), rowsBitsetToIDs(cand.irow));<NEW_LINE>final ArrayDBIDs cids = rowsBitsetToIDs(cand.rows);<NEW_LINE>noise.removeDBIDs(cids);<NEW_LINE>result.addToplevelCluster(new Cluster<>(cids, model));<NEW_LINE>if (LOG.isVerbose()) {<NEW_LINE>LOG.verbose("Score of bicluster " + (i + 1) + ": " + cand.residue + "\n");<NEW_LINE>LOG.verbose("Number of rows: " + cand.rowcard + "\n");<NEW_LINE>LOG.verbose("Number of columns: " + cand.colcard + "\n");<NEW_LINE>// LOG.verbose("Total number of masked values: " + maskedVals.size() +<NEW_LINE>// "\n");<NEW_LINE>}<NEW_LINE>LOG.incrementProcessed(prog);<NEW_LINE>}<NEW_LINE>// Add a noise cluster, full-dimensional.<NEW_LINE>if (!noise.isEmpty()) {<NEW_LINE>long[] allcols = BitsUtil.ones(getColDim());<NEW_LINE>BiclusterWithInversionsModel model = new BiclusterWithInversionsModel(colsBitsetToIDs(allcols), DBIDUtil.EMPTYDBIDS);<NEW_LINE>result.addToplevelCluster(new Cluster<>(noise, true, model));<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(prog);<NEW_LINE>return result;<NEW_LINE>}
rowcard + "x" + cand.colcard);
1,661,125
public ShareClientBuilder connectionString(String connectionString) {<NEW_LINE>StorageConnectionString storageConnectionString = StorageConnectionString.create(connectionString, LOGGER);<NEW_LINE><MASK><NEW_LINE>if (endpoint == null || endpoint.getPrimaryUri() == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException("connectionString missing required settings to derive file service endpoint."));<NEW_LINE>}<NEW_LINE>this.endpoint(endpoint.getPrimaryUri());<NEW_LINE>if (storageConnectionString.getAccountName() != null) {<NEW_LINE>this.accountName = storageConnectionString.getAccountName();<NEW_LINE>}<NEW_LINE>StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings();<NEW_LINE>if (authSettings.getType() == StorageAuthenticationSettings.Type.ACCOUNT_NAME_KEY) {<NEW_LINE>this.credential(new StorageSharedKeyCredential(authSettings.getAccount().getName(), authSettings.getAccount().getAccessKey()));<NEW_LINE>} else if (authSettings.getType() == StorageAuthenticationSettings.Type.SAS_TOKEN) {<NEW_LINE>this.sasToken(authSettings.getSasToken());<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
StorageEndpoint endpoint = storageConnectionString.getFileEndpoint();
48,582
public void addDetailedEntries(@Nonnull ItemStack itemstack, @Nullable EntityPlayer entityplayer, @Nonnull List<String> list, boolean flag) {<NEW_LINE>if (!SpecialTooltipHandler.showDurability(flag)) {<NEW_LINE>list.add(ItemUtil.getDurabilityString(itemstack));<NEW_LINE>}<NEW_LINE>String str = EnergyUpgradeManager.getStoredEnergyString(itemstack);<NEW_LINE>if (str != null) {<NEW_LINE>list.add(str);<NEW_LINE>}<NEW_LINE>if (EnergyUpgradeManager.itemHasAnyPowerUpgrade(itemstack)) {<NEW_LINE>list.add(<MASK><NEW_LINE>list.add(Lang.AXE_POWERED.get(TextFormatting.WHITE, DarkSteelConfig.axeEfficiencyBoostWhenPowered.get()));<NEW_LINE>}<NEW_LINE>DarkSteelTooltipManager.addAdvancedTooltipEntries(itemstack, entityplayer, list, flag);<NEW_LINE>}
Lang.AXE_MULTIHARVEST.get());
522,460
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder source, RecyclerView.ViewHolder target) {<NEW_LINE>if (source.getItemViewType() != target.getItemViewType()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (NekoConfig.enableStickerPin.Bool() && currentType == MediaDataController.TYPE_IMAGE) {<NEW_LINE>int from = source.getAdapterPosition();<NEW_LINE>int to = target.getAdapterPosition();<NEW_LINE>if (from < stickersStartRow + listAdapter.pinnedStickersCount) {<NEW_LINE>// drag a pinned sticker<NEW_LINE>if (to >= stickersStartRow + listAdapter.pinnedStickersCount) {<NEW_LINE>// to a unpinned sticker<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// drag a unpinned sticker<NEW_LINE>if (to < stickersStartRow + listAdapter.pinnedStickersCount) {<NEW_LINE>// to a pinned sticker<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>// to a unpinned sticker, like normal<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// pinned to pinned<NEW_LINE>if (from == to)<NEW_LINE>return false;<NEW_LINE>int index1 = from - stickersStartRow;<NEW_LINE>int index2 = to - stickersStartRow;<NEW_LINE>PinnedStickerHelper.getInstance(currentAccount).swap(index1, index2);<NEW_LINE>listAdapter.swapElements(from, to);<NEW_LINE>} else<NEW_LINE>listAdapter.swapElements(source.getAdapterPosition(), target.getAdapterPosition());<NEW_LINE>return true;<NEW_LINE>}
listAdapter.swapElements(from, to);
812,242
public void receiveMessages(Duration timeout, boolean returnOnTimeout, Manager.ReceiveMessageHandler handler) throws IOException {<NEW_LINE>needsToRetryFailedMessages = true;<NEW_LINE>hasCaughtUpWithOldMessages = false;<NEW_LINE>// Use a Map here because java Set doesn't have a get method ...<NEW_LINE>Map<HandleAction, HandleAction> <MASK><NEW_LINE>final var signalWebSocket = dependencies.getSignalWebSocket();<NEW_LINE>final var webSocketStateDisposable = Observable.merge(signalWebSocket.getUnidentifiedWebSocketState(), signalWebSocket.getWebSocketState()).subscribeOn(Schedulers.computation()).observeOn(Schedulers.computation()).distinctUntilChanged().subscribe(this::onWebSocketStateChange);<NEW_LINE>signalWebSocket.connect();<NEW_LINE>try {<NEW_LINE>receiveMessagesInternal(timeout, returnOnTimeout, handler, queuedActions);<NEW_LINE>} finally {<NEW_LINE>hasCaughtUpWithOldMessages = false;<NEW_LINE>handleQueuedActions(queuedActions.keySet());<NEW_LINE>queuedActions.clear();<NEW_LINE>dependencies.getSignalWebSocket().disconnect();<NEW_LINE>webSocketStateDisposable.dispose();<NEW_LINE>shouldStop = false;<NEW_LINE>}<NEW_LINE>}
queuedActions = new HashMap<>();
587,485
protected String doIt() throws Exception {<NEW_LINE>log.info("C_OrderLine_ID=" + p_C_OrderLine_ID);<NEW_LINE>if (p_C_OrderLine_ID == 0)<NEW_LINE>throw new IllegalArgumentException("No OrderLine");<NEW_LINE>//<NEW_LINE>MOrderLine line = new MOrderLine(getCtx(), p_C_OrderLine_ID, get_TrxName());<NEW_LINE>if (line.get_ID() == 0)<NEW_LINE>throw new IllegalArgumentException("Order line not found");<NEW_LINE>MOrder order = new MOrder(getCtx(), line.getC_Order_ID(), get_TrxName());<NEW_LINE>if (!MOrder.DOCSTATUS_Completed.equals(order.getDocStatus()))<NEW_LINE>throw new IllegalArgumentException("Order not completed");<NEW_LINE>MDocType doc = new MDocType(getCtx(), order.getC_DocType_ID(), get_TrxName());<NEW_LINE>if ((line.getQtyOrdered().subtract(line.getQtyDelivered())).compareTo(Env.ZERO) <= 0) {<NEW_LINE>if (// Consignment and stock orders both have subtype of ON<NEW_LINE>!doc.getDocSubTypeSO().equals("ON")) {<NEW_LINE>return "Ordered quantity already shipped";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If we don't ignore previous production, and there has been a previous one,<NEW_LINE>// throw an exception<NEW_LINE>if (!ignorePrevProduction) {<NEW_LINE>String docNo = DB.getSQLValueString(get_TrxName(), "SELECT max(DocumentNo) " + "FROM M_Production WHERE C_OrderLine_ID = ?", p_C_OrderLine_ID);<NEW_LINE>if (docNo != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>MProduction production = new MProduction(line);<NEW_LINE>production.saveEx();<NEW_LINE>production.processIt(DocAction.ACTION_Prepare);<NEW_LINE>return "@M_Production_ID@ @Created@ " + production.getDocumentNo();<NEW_LINE>}
throw new IllegalArgumentException("Production has already been created: " + docNo);
147,706
// creates the rate computation<NEW_LINE>private RateComputation createRateComputation(SchedulePeriod period, DateAdjuster fixingDateAdjuster, Function<SchedulePeriod, Schedule> resetScheduleFn, Function<LocalDate, IborIndexObservation> iborObservationFn, int scheduleIndex, Optional<SchedulePeriod> scheduleInitialStub, Optional<SchedulePeriod> scheduleFinalStub, ReferenceData refData) {<NEW_LINE>LocalDate fixingDate = fixingDateAdjuster.adjust<MASK><NEW_LINE>if (scheduleIndex == 0 && firstFixingDateOffset != null) {<NEW_LINE>fixingDate = firstFixingDateOffset.resolve(refData).adjust(fixingRelativeTo.selectBaseDate(period));<NEW_LINE>}<NEW_LINE>// initial stub<NEW_LINE>if (scheduleInitialStub.isPresent() && scheduleIndex == 0) {<NEW_LINE>if (firstRate != null && firstRegularRate == null && (initialStub == null || IborRateStubCalculation.NONE.equals(initialStub))) {<NEW_LINE>return FixedRateComputation.of(firstRate);<NEW_LINE>}<NEW_LINE>return firstNonNull(initialStub, IborRateStubCalculation.NONE).createRateComputation(fixingDate, index, refData);<NEW_LINE>}<NEW_LINE>// final stub<NEW_LINE>if (scheduleFinalStub.isPresent() && scheduleFinalStub.get() == period) {<NEW_LINE>return firstNonNull(finalStub, IborRateStubCalculation.NONE).createRateComputation(fixingDate, index, refData);<NEW_LINE>}<NEW_LINE>// override rate<NEW_LINE>Double overrideFirstRate = null;<NEW_LINE>if (firstRegularRate != null) {<NEW_LINE>if (isFirstRegularPeriod(scheduleIndex, scheduleInitialStub.isPresent())) {<NEW_LINE>overrideFirstRate = firstRegularRate;<NEW_LINE>}<NEW_LINE>} else if (firstRate != null && scheduleIndex == 0) {<NEW_LINE>overrideFirstRate = firstRate;<NEW_LINE>}<NEW_LINE>// handle explicit reset periods, possible averaging<NEW_LINE>if (resetScheduleFn != null) {<NEW_LINE>return createRateComputationWithResetPeriods(resetScheduleFn.apply(period), fixingDateAdjuster, iborObservationFn, scheduleIndex, overrideFirstRate, refData);<NEW_LINE>}<NEW_LINE>// handle possible fixed rate<NEW_LINE>if (overrideFirstRate != null) {<NEW_LINE>return FixedRateComputation.of(overrideFirstRate);<NEW_LINE>}<NEW_LINE>// simple Ibor<NEW_LINE>return IborRateComputation.of(iborObservationFn.apply(fixingDate));<NEW_LINE>}
(fixingRelativeTo.selectBaseDate(period));
1,667,799
public void writeAsBibtexCitation(OutputStream os) throws IOException {<NEW_LINE>// Use UTF-8<NEW_LINE>Writer out = new BufferedWriter(new OutputStreamWriter(os, "utf-8"));<NEW_LINE>if (getFileTitle() != null && isDirect()) {<NEW_LINE>out.write("@incollection{");<NEW_LINE>} else {<NEW_LINE>out.write("@data{");<NEW_LINE>}<NEW_LINE>out.write(persistentId.getIdentifier() + <MASK><NEW_LINE>out.write("author = {");<NEW_LINE>out.write(String.join(" and ", authors));<NEW_LINE>out.write("},\r\n");<NEW_LINE>out.write("publisher = {");<NEW_LINE>out.write(publisher);<NEW_LINE>out.write("},\r\n");<NEW_LINE>if (getFileTitle() != null && isDirect()) {<NEW_LINE>out.write("title = {");<NEW_LINE>out.write(fileTitle);<NEW_LINE>out.write("},\r\n");<NEW_LINE>out.write("booktitle = {");<NEW_LINE>out.write(title);<NEW_LINE>out.write("},\r\n");<NEW_LINE>} else {<NEW_LINE>out.write("title = {{");<NEW_LINE>String doubleQ = "\"";<NEW_LINE>String doubleTick = "``";<NEW_LINE>String doubleAp = "''";<NEW_LINE>out.write(title.replaceFirst(doubleQ, doubleTick).replaceFirst(doubleQ, doubleAp));<NEW_LINE>out.write("}},\r\n");<NEW_LINE>}<NEW_LINE>if (UNF != null) {<NEW_LINE>out.write("UNF = {");<NEW_LINE>out.write(UNF);<NEW_LINE>out.write("},\r\n");<NEW_LINE>}<NEW_LINE>out.write("year = {");<NEW_LINE>out.write(year);<NEW_LINE>out.write("},\r\n");<NEW_LINE>out.write("version = {");<NEW_LINE>out.write(version);<NEW_LINE>out.write("},\r\n");<NEW_LINE>out.write("doi = {");<NEW_LINE>out.write(persistentId.getAuthority());<NEW_LINE>out.write("/");<NEW_LINE>out.write(persistentId.getIdentifier());<NEW_LINE>out.write("},\r\n");<NEW_LINE>out.write("url = {");<NEW_LINE>out.write(persistentId.toURL().toString());<NEW_LINE>out.write("}\r\n");<NEW_LINE>out.write("}\r\n");<NEW_LINE>out.flush();<NEW_LINE>}
"_" + year + "," + "\r\n");
1,311,716
public void onStart() {<NEW_LINE>super.onStart();<NEW_LINE>createSessionViewModel.getProgress().observe(this, this::showProgress);<NEW_LINE>createSessionViewModel.getDismiss().observe(this, <MASK><NEW_LINE>createSessionViewModel.getSuccess().observe(this, this::onSuccess);<NEW_LINE>createSessionViewModel.getError().observe(this, this::showError);<NEW_LINE>createSessionViewModel.getSessionLiveData().observe(this, this::setSession);<NEW_LINE>binding.setSession(createSessionViewModel.getSession());<NEW_LINE>if (isSessionUpdating) {<NEW_LINE>createSessionViewModel.loadSession(sessionId);<NEW_LINE>}<NEW_LINE>validate(binding.form.slidesUrlLayout, ValidateUtils::validateUrl, getResources().getString(R.string.url_validation_error));<NEW_LINE>validate(binding.form.audioUrlLayout, ValidateUtils::validateUrl, getResources().getString(R.string.url_validation_error));<NEW_LINE>validate(binding.form.videoUrlLayout, ValidateUtils::validateUrl, getResources().getString(R.string.url_validation_error));<NEW_LINE>validate(binding.form.signupUrlLayout, ValidateUtils::validateUrl, getResources().getString(R.string.url_validation_error));<NEW_LINE>}
(dismiss) -> dismiss());
1,698,892
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {<NEW_LINE>NodeView <MASK><NEW_LINE>if (forX.isConstant() && forY.isConstant()) {<NEW_LINE>long yConst = forY.asJavaConstant().asLong();<NEW_LINE>if (yConst == 0) {<NEW_LINE>// Replacing a previous never 0 with constant zero can create this situation<NEW_LINE>if (floatingGuard == null) {<NEW_LINE>throw GraalError.shouldNotReachHere("Must have never been a floating div");<NEW_LINE>} else {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ConstantNode.forIntegerStamp(stamp, forX.asJavaConstant().asLong() / yConst);<NEW_LINE>} else if (forY.isConstant()) {<NEW_LINE>long c = forY.asJavaConstant().asLong();<NEW_LINE>ValueNode v = SignedDivNode.canonical(forX, c, view);<NEW_LINE>if (v != null) {<NEW_LINE>return v;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
view = NodeView.from(tool);
639,600
private void initTabs(@NonNull PullRequest pullRequest) {<NEW_LINE>TabLayout.Tab tab1 = tabs.getTabAt(0);<NEW_LINE>TabLayout.Tab tab2 = tabs.getTabAt(1);<NEW_LINE>TabLayout.Tab tab3 = tabs.getTabAt(2);<NEW_LINE>if (tab3 != null) {<NEW_LINE>tab3.setText(SpannableBuilder.builder().append(getString(R.string.files)).append(" ").append("(").append(String.valueOf(pullRequest.getChangedFiles()<MASK><NEW_LINE>}<NEW_LINE>if (tab2 != null) {<NEW_LINE>tab2.setText(SpannableBuilder.builder().append(getString(R.string.commits)).append(" ").append("(").append(String.valueOf(pullRequest.getCommits())).append(")"));<NEW_LINE>}<NEW_LINE>if (tab1 != null) {<NEW_LINE>tab1.setText(SpannableBuilder.builder().append(getString(R.string.details)).append(" ").append("(").append(String.valueOf(pullRequest.getComments())).append(")"));<NEW_LINE>}<NEW_LINE>}
)).append(")"));
189,486
private void drawShape(Fixture fixture, Transform transform, Color color) {<NEW_LINE>if (fixture.getType() == Type.Circle) {<NEW_LINE>CircleShape circle = (CircleShape) fixture.getShape();<NEW_LINE>t.set(circle.getPosition());<NEW_LINE>transform.mul(t);<NEW_LINE>drawSolidCircle(t, circle.getRadius(), axis.set(transform.vals[Transform.COS], transform.vals[Transform.SIN]), color);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fixture.getType() == Type.Edge) {<NEW_LINE>EdgeShape edge = (EdgeShape) fixture.getShape();<NEW_LINE>edge.getVertex1(vertices[0]);<NEW_LINE>edge.getVertex2(vertices[1]);<NEW_LINE>transform.mul(vertices[0]);<NEW_LINE>transform.mul(vertices[1]);<NEW_LINE>drawSolidPolygon(vertices, 2, color, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fixture.getType() == Type.Polygon) {<NEW_LINE>PolygonShape chain = (PolygonShape) fixture.getShape();<NEW_LINE>int vertexCount = chain.getVertexCount();<NEW_LINE>for (int i = 0; i < vertexCount; i++) {<NEW_LINE>chain.getVertex(i, vertices[i]);<NEW_LINE>transform<MASK><NEW_LINE>}<NEW_LINE>drawSolidPolygon(vertices, vertexCount, color, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fixture.getType() == Type.Chain) {<NEW_LINE>ChainShape chain = (ChainShape) fixture.getShape();<NEW_LINE>int vertexCount = chain.getVertexCount();<NEW_LINE>for (int i = 0; i < vertexCount; i++) {<NEW_LINE>chain.getVertex(i, vertices[i]);<NEW_LINE>transform.mul(vertices[i]);<NEW_LINE>}<NEW_LINE>drawSolidPolygon(vertices, vertexCount, color, false);<NEW_LINE>}<NEW_LINE>}
.mul(vertices[i]);
1,399,287
private DruidScanResponse parseResponse(ArrayNode responses) {<NEW_LINE>String segmentId = "empty";<NEW_LINE>ArrayList<ObjectNode> events = new ArrayList<>();<NEW_LINE>ArrayList<String> <MASK><NEW_LINE>if (responses.size() > 0) {<NEW_LINE>ObjectNode firstNode = (ObjectNode) responses.get(0);<NEW_LINE>segmentId = firstNode.get("segmentId").textValue();<NEW_LINE>ArrayNode columnsNode = (ArrayNode) firstNode.get("columns");<NEW_LINE>ArrayNode eventsNode = (ArrayNode) firstNode.get("events");<NEW_LINE>for (int i = 0; i < columnsNode.size(); i++) {<NEW_LINE>String column = columnsNode.get(i).textValue();<NEW_LINE>columns.add(column);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < eventsNode.size(); i++) {<NEW_LINE>ObjectNode eventNode = (ObjectNode) eventsNode.get(i);<NEW_LINE>events.add(eventNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new DruidScanResponse(segmentId, columns, events);<NEW_LINE>}
columns = new ArrayList<>();
1,290,248
public RegisterGameServerResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RegisterGameServerResult registerGameServerResult = new RegisterGameServerResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return registerGameServerResult;<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("GameServer", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>registerGameServerResult.setGameServer(GameServerJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return registerGameServerResult;<NEW_LINE>}
().unmarshall(context));
67,453
public Object call(Method m, Object[] args) {<NEW_LINE>U.must(!config.isEmpty(), "Cannot find configuration for the REST client interface: %s", clientInterface.getSimpleName());<NEW_LINE>Config cfg = config.sub(m.getName());<NEW_LINE>String verb = verbOf(cfg);<NEW_LINE>String url = cfg.entry(verb).str().get();<NEW_LINE>U.must(!U.isEmpty(verb), "The [verb: url] entry is not configured for the method: %s", m);<NEW_LINE>U.must(!U.isEmpty(url), "Cannot find 'url' configuration for the method: %s", m);<NEW_LINE>Class<Object> retType = (Class<Object>) m.getReturnType();<NEW_LINE>Class<?>[] paramTypes = m.getParameterTypes();<NEW_LINE>Class<?> lastParamType = U.last(paramTypes);<NEW_LINE>if (lastParamType != null && Callback.class.isAssignableFrom(lastParamType)) {<NEW_LINE>// async result with callback<NEW_LINE>U.must(retType.equals(void.class) || Future.class.isAssignableFrom(retType) || org.rapidoid.concurrent.Future.class.isAssignableFrom(retType));<NEW_LINE>Callback<Object> callback = (Callback<Object>) U.last(args);<NEW_LINE>U.notNull(callback, "callback");<NEW_LINE>args = Arr.sub(args, 0, -1);<NEW_LINE>String realUrl = String.format(url, args);<NEW_LINE>OfType ofType = Metadata.get(U.last(m.getParameterAnnotations()), OfType.class);<NEW_LINE>Class<Object> resultType = (Class<Object>) (ofType != null ? ofType.value() : Object.class);<NEW_LINE>return REST.call(verb, realUrl, resultType, callback);<NEW_LINE>} else {<NEW_LINE>String realUrl = <MASK><NEW_LINE>return REST.call(verb, realUrl, retType);<NEW_LINE>}<NEW_LINE>}
String.format(url, args);
209,144
public InboundCrossClusterSearchConnection unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InboundCrossClusterSearchConnection inboundCrossClusterSearchConnection = new InboundCrossClusterSearchConnection();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("SourceDomainInfo", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inboundCrossClusterSearchConnection.setSourceDomainInfo(DomainInformationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DestinationDomainInfo", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inboundCrossClusterSearchConnection.setDestinationDomainInfo(DomainInformationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CrossClusterSearchConnectionId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inboundCrossClusterSearchConnection.setCrossClusterSearchConnectionId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ConnectionStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inboundCrossClusterSearchConnection.setConnectionStatus(InboundCrossClusterSearchConnectionStatusJsonUnmarshaller.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 inboundCrossClusterSearchConnection;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,410,371
public void Output(IFragment<Long, Long, Long, Double> frag) {<NEW_LINE>String prefix = "/tmp/pagerank_parallel_output";<NEW_LINE>logger.info("sum double " + sumDoubleTime / 10e9 + " swap time " + swapTime / 10e9);<NEW_LINE>String filePath = prefix + "_frag_" + String.valueOf(frag.fid());<NEW_LINE>try {<NEW_LINE>FileWriter fileWritter = new FileWriter(new File(filePath));<NEW_LINE>BufferedWriter bufferedWriter = new BufferedWriter(fileWritter);<NEW_LINE>VertexRange<Long<MASK><NEW_LINE>Vertex<Long> cur = FFITypeFactoryhelper.newVertexLong();<NEW_LINE>for (long index = 0; index < frag.getInnerVerticesNum(); ++index) {<NEW_LINE>cur.SetValue(index);<NEW_LINE>Long oid = frag.getId(cur);<NEW_LINE>bufferedWriter.write(cur.GetValue() + "\t" + oid + "\t" + pagerank.get(index) + "\n");<NEW_LINE>}<NEW_LINE>bufferedWriter.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
> innerNodes = frag.innerVertices();
1,130,431
public static final MiosBindingConfig create(String context, String itemName, String unitName, int id, String stuff, Class<? extends Item> itemType, String commandTransform, String inTransform, String outTransform) throws BindingConfigParseException {<NEW_LINE>ParameterDefaults pd = paramDefaults.get(stuff);<NEW_LINE>if (pd != null) {<NEW_LINE>logger.trace("Scene ParameterDefaults FOUND '{}' for '{}', '{}'", itemName, stuff, pd);<NEW_LINE>if (commandTransform == null) {<NEW_LINE>commandTransform = pd.getCommandTransform();<NEW_LINE>logger.trace("Scene ParameterDefaults '{}' defaulted command: to '{}'", itemName, commandTransform);<NEW_LINE>}<NEW_LINE>if (inTransform == null) {<NEW_LINE>inTransform = pd.getInTransform();<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>if (outTransform == null) {<NEW_LINE>outTransform = pd.getOutTransform();<NEW_LINE>logger.trace("Scene ParameterDefaults '{}' defaulted out: to '{}'", itemName, outTransform);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.trace("Scene ParameterDefaults NOT FOUND '{}' for '{}'", itemName, stuff);<NEW_LINE>}<NEW_LINE>MiosBindingConfig c = new SceneBindingConfig(context, itemName, unitName, id, stuff, itemType, commandTransform, inTransform, outTransform);<NEW_LINE>c.initialize();<NEW_LINE>return c;<NEW_LINE>}
trace("Scene ParameterDefaults '{}' defaulted in: to '{}'", itemName, inTransform);
1,548,835
public String login(int AD_Org_ID, int AD_Role_ID, int AD_User_ID) {<NEW_LINE>if (!Ini.isSwingClient())<NEW_LINE>return null;<NEW_LINE>//<NEW_LINE>// UI<NEW_LINE>boolean changed = false;<NEW_LINE>final ISysConfigBL sysConfigBL = <MASK><NEW_LINE>ValueNamePair laf = getLookByName(sysConfigBL.getValue(SYSCONFIG_UILookFeel, Env.getAD_Client_ID(Env.getCtx())));<NEW_LINE>ValueNamePair theme = getThemeByName(sysConfigBL.getValue(SYSCONFIG_UITheme, Env.getAD_Client_ID(Env.getCtx())));<NEW_LINE>if (laf != null && theme != null) {<NEW_LINE>String clazz = laf.getValue();<NEW_LINE>String currentLaf = UIManager.getLookAndFeel().getClass().getName();<NEW_LINE>if (!Check.isEmpty(clazz) && !currentLaf.equals(clazz)) {<NEW_LINE>// laf changed<NEW_LINE>AdempierePLAF.setPLAF(laf, theme, true);<NEW_LINE>AEnv.updateUI();<NEW_LINE>changed = true;<NEW_LINE>} else {<NEW_LINE>if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) {<NEW_LINE>MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme();<NEW_LINE>String themeClass = currentTheme.getClass().getName();<NEW_LINE>String sTheme = theme.getValue();<NEW_LINE>if (sTheme != null && sTheme.length() > 0 && !sTheme.equals(themeClass)) {<NEW_LINE>ValueNamePair plaf = ValueNamePair.of(UIManager.getLookAndFeel().getClass().getName(), UIManager.getLookAndFeel().getName());<NEW_LINE>AdempierePLAF.setPLAF(plaf, theme, true);<NEW_LINE>AEnv.updateUI();<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (changed)<NEW_LINE>Ini.saveProperties();<NEW_LINE>//<NEW_LINE>// Make sure the UIDefauls from sysconfig were loaded<NEW_LINE>SysConfigUIDefaultsRepository.ofCurrentLookAndFeelId().loadAllFromSysConfigTo(UIManager.getDefaults());<NEW_LINE>return null;<NEW_LINE>}
Services.get(ISysConfigBL.class);
1,643,999
public AutoTuneOptions unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AutoTuneOptions autoTuneOptions = new AutoTuneOptions();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("DesiredState", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>autoTuneOptions.setDesiredState(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("RollbackOnDisable", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>autoTuneOptions.setRollbackOnDisable(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MaintenanceSchedules", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>autoTuneOptions.setMaintenanceSchedules(new ListUnmarshaller<AutoTuneMaintenanceSchedule>(AutoTuneMaintenanceScheduleJsonUnmarshaller.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 autoTuneOptions;<NEW_LINE>}
class).unmarshall(context));
1,081,433
public DateType invoke() {<NEW_LINE>if (!SQLDataTypeImpl.class.isInstance(dataType)) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>String[] signed = { "UNSIGNED", "SIGNED" };<NEW_LINE>String name = dataType.getName();<NEW_LINE>String dataTypeString = null;<NEW_LINE>if (signed[1].equalsIgnoreCase(name)) {<NEW_LINE>if (!dataType.isUnsigned()) {<NEW_LINE>dataTypeString = signed[1];<NEW_LINE>} else {<NEW_LINE>dataTypeString = signed[0];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dataTypeString = name.toUpperCase();<NEW_LINE>}<NEW_LINE>if (dataType.isZerofill()) {<NEW_LINE>// Nothing<NEW_LINE>}<NEW_LINE>final List<SQLExpr> arguments = dataType.getArguments();<NEW_LINE>if (arguments.size() > 0) {<NEW_LINE>final SQLExpr <MASK><NEW_LINE>if (sqlExpr instanceof SQLIntegerExpr) {<NEW_LINE>final Number number = ((SQLIntegerExpr) sqlExpr).getNumber();<NEW_LINE>this.p = number.intValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SqlTypeName castType = SqlTypeName.getNameForJdbcType(TypeUtils.mysqlTypeToJdbcType(dataTypeString));<NEW_LINE>setPAndC(castType);<NEW_LINE>setCharset();<NEW_LINE>return this;<NEW_LINE>}
sqlExpr = arguments.get(0);
1,738,043
public Sequence list(VDB vdb, String opt) {<NEW_LINE>ArchiveDir[] subDirs = this.subDirs;<NEW_LINE>if (subDirs == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int size = subDirs.length;<NEW_LINE>Sequence seq = new Sequence(size);<NEW_LINE>boolean listFiles = true, listDirs = false;<NEW_LINE>if (opt != null) {<NEW_LINE>if (opt.indexOf('w') != -1) {<NEW_LINE>listFiles = false;<NEW_LINE>} else if (opt.indexOf('d') != -1) {<NEW_LINE>listDirs = true;<NEW_LINE>listFiles = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>if (listFiles) {<NEW_LINE>if (subDirs[i].isFile()) {<NEW_LINE>ArchiveSection section = subDirs[i].getSection(vdb.getLibrary());<NEW_LINE>seq.add(new VS(vdb, section));<NEW_LINE>}<NEW_LINE>} else if (listDirs) {<NEW_LINE>if (subDirs[i].isDir()) {<NEW_LINE>ArchiveSection section = subDirs[i].<MASK><NEW_LINE>seq.add(new VS(vdb, section));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ArchiveSection section = subDirs[i].getSection(vdb.getLibrary());<NEW_LINE>seq.add(new VS(vdb, section));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return seq;<NEW_LINE>}
getSection(vdb.getLibrary());
624,485
final CreateContainerServiceDeploymentResult executeCreateContainerServiceDeployment(CreateContainerServiceDeploymentRequest createContainerServiceDeploymentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createContainerServiceDeploymentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateContainerServiceDeploymentRequest> request = null;<NEW_LINE>Response<CreateContainerServiceDeploymentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateContainerServiceDeploymentRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateContainerServiceDeployment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateContainerServiceDeploymentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateContainerServiceDeploymentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(createContainerServiceDeploymentRequest));
27,631
public void adjustAllBy(long offset) {<NEW_LINE>// fix up the timers<NEW_LINE>synchronized (this) {<NEW_LINE>// as we're adjusting all events by the same amount the ordering remains valid<NEW_LINE>Iterator<TimerEvent> it = events.iterator();<NEW_LINE>boolean resort = false;<NEW_LINE>while (it.hasNext()) {<NEW_LINE>TimerEvent event = it.next();<NEW_LINE>long old_when = event.getWhen();<NEW_LINE>long new_when = old_when + offset;<NEW_LINE>// don't wrap around by accident<NEW_LINE>if (old_when > 0 && new_when < 0 && offset > 0) {<NEW_LINE>// Debug.out( "Ignoring wrap around for " + event.getName());<NEW_LINE>resort = true;<NEW_LINE>} else {<NEW_LINE>// System.out.println( " adjusted: " + old_when + " -> " + new_when );<NEW_LINE>event.setWhen(new_when);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resort) {<NEW_LINE>events = new TreeSet<>(<MASK><NEW_LINE>}<NEW_LINE>notify();<NEW_LINE>}<NEW_LINE>}
new ArrayList<>(events));
175,464
public final void hide(Duration fadeOutDuration) {<NEW_LINE>log.info("hide:" + fadeOutDuration.toString());<NEW_LINE>// We must remove EventFilter in order to prevent memory leak.<NEW_LINE>if (ownerWindow != null) {<NEW_LINE>ownerWindow.removeEventFilter(WindowEvent.WINDOW_CLOSE_REQUEST, closePopOverOnOwnerWindowClose);<NEW_LINE>ownerWindow.removeEventFilter(WindowEvent.WINDOW_HIDING, closePopOverOnOwnerWindowClose);<NEW_LINE>}<NEW_LINE>if (fadeOutDuration == null) {<NEW_LINE>fadeOutDuration = DEFAULT_FADE_DURATION;<NEW_LINE>}<NEW_LINE>if (isShowing()) {<NEW_LINE>if (isAnimated()) {<NEW_LINE>// Fade Out<NEW_LINE>Node skinNode = getSkin().getNode();<NEW_LINE>FadeTransition fadeOut <MASK><NEW_LINE>fadeOut.setFromValue(skinNode.getOpacity());<NEW_LINE>fadeOut.setToValue(0);<NEW_LINE>fadeOut.setOnFinished(evt -> super.hide());<NEW_LINE>fadeOut.play();<NEW_LINE>} else {<NEW_LINE>super.hide();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new FadeTransition(fadeOutDuration, skinNode);
1,203,036
public PriceScheduleSpecification unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>PriceScheduleSpecification priceScheduleSpecification = new PriceScheduleSpecification();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return priceScheduleSpecification;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("currencyCode", targetDepth)) {<NEW_LINE>priceScheduleSpecification.setCurrencyCode(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("price", targetDepth)) {<NEW_LINE>priceScheduleSpecification.setPrice(DoubleStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("term", targetDepth)) {<NEW_LINE>priceScheduleSpecification.setTerm(LongStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return priceScheduleSpecification;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
423,626
/* Build call for applicationsApplicationIdPut */<NEW_LINE>private com.squareup.okhttp.Call applicationsApplicationIdPutCall(String applicationId, Application body, String contentType, String ifMatch, String ifUnmodifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/applications/{applicationId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "applicationId" + "\\}", apiClient.escapeString(applicationId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (contentType != null)<NEW_LINE>localVarHeaderParams.put("Content-Type", apiClient.parameterToString(contentType));<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("If-Match", apiClient.parameterToString(ifMatch));<NEW_LINE>if (ifUnmodifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", apiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE><MASK><NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
localVarHeaderParams.put("Content-Type", localVarContentType);
271,575
public void marshall(Application application, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (application == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(application.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getDisplayName(), DISPLAYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getIconURL(), ICONURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getLaunchPath(), LAUNCHPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getLaunchParameters(), LAUNCHPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getEnabled(), ENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(application.getWorkingDirectory(), WORKINGDIRECTORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getAppBlockArn(), APPBLOCKARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getIconS3Location(), ICONS3LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getPlatforms(), PLATFORMS_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getInstanceFamilies(), INSTANCEFAMILIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(application.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
application.getMetadata(), METADATA_BINDING);
1,530,014
private void convertSharedDirtyPagesToLocal() {<NEW_LINE>for (final Map.Entry<PageKey, OLogSequenceNumber> entry : dirtyPages.entrySet()) {<NEW_LINE>final OLogSequenceNumber localLSN = localDirtyPages.get(entry.getKey());<NEW_LINE>if (localLSN == null || localLSN.compareTo(entry.getValue()) > 0) {<NEW_LINE>localDirtyPages.put(entry.getKey(), entry.getValue());<NEW_LINE>final long segment = entry.getValue().getSegment();<NEW_LINE>TreeSet<PageKey> pages = localDirtyPagesBySegment.get(segment);<NEW_LINE>if (pages == null) {<NEW_LINE>pages = new TreeSet<>();<NEW_LINE>pages.add(entry.getKey());<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>pages.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (final Map.Entry<PageKey, OLogSequenceNumber> entry : localDirtyPages.entrySet()) {<NEW_LINE>dirtyPages.remove(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}
localDirtyPagesBySegment.put(segment, pages);
632,665
private void updateDependencyVersions() {<NEW_LINE>// Remove all dangling nodes in the graph builder.<NEW_LINE>graphBuilder.removeDanglingNodes();<NEW_LINE>// Get unresolved nodes. This list is based on the sticky option.<NEW_LINE>Collection<MASK><NEW_LINE>List<DependencyNode> errorNodes = new ArrayList<>();<NEW_LINE>// Create ResolutionRequests for all unresolved nodes by looking at the blended nodes<NEW_LINE>List<ResolutionRequest> unresolvedRequests = new ArrayList<>();<NEW_LINE>for (DependencyNode unresolvedNode : unresolvedNodes) {<NEW_LINE>if (unresolvedNode.isError) {<NEW_LINE>errorNodes.add(unresolvedNode);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>PackageDescriptor unresolvedPkgDes = unresolvedNode.pkgDesc();<NEW_LINE>Optional<BlendedManifest.Dependency> blendedDepOptional = blendedManifest.dependency(unresolvedPkgDes.org(), unresolvedPkgDes.name());<NEW_LINE>ResolutionRequest resolutionRequest = getRequestForUnresolvedNode(unresolvedNode, blendedDepOptional.orElse(null));<NEW_LINE>if (resolutionRequest == null) {<NEW_LINE>// There is a version incompatibility.<NEW_LINE>// We mark it as an error node and skip to the next node.<NEW_LINE>errorNodes.add(new DependencyNode(unresolvedNode.pkgDesc, unresolvedNode.scope, unresolvedNode.resolutionType, true));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>unresolvedRequests.add(resolutionRequest);<NEW_LINE>}<NEW_LINE>// Resolve unresolved nodes to see whether there exist newer versions<NEW_LINE>Collection<PackageMetadataResponse> pkgMetadataResponses = packageResolver.resolvePackageMetadata(unresolvedRequests, resolutionOptions);<NEW_LINE>// Update the graph with new versions of dependencies (if any)<NEW_LINE>addUpdatedPackagesToGraph(pkgMetadataResponses);<NEW_LINE>addErrorNodesToGraph(errorNodes);<NEW_LINE>dumpIntermediateGraph(1);<NEW_LINE>}
<DependencyNode> unresolvedNodes = getUnresolvedNode();
1,776,673
private void decodeSpkac(byte[] der) throws SpkacException {<NEW_LINE>try {<NEW_LINE>ASN1Sequence signedPublicKeyAndChallenge = ASN1Sequence.getInstance(der);<NEW_LINE>ASN1Sequence publicKeyAndChallenge = (ASN1Sequence) signedPublicKeyAndChallenge.getObjectAt(0);<NEW_LINE>ASN1Sequence signatureAlgorithm = (ASN1Sequence) signedPublicKeyAndChallenge.getObjectAt(1);<NEW_LINE>DERBitString signature = (DERBitString) signedPublicKeyAndChallenge.getObjectAt(2);<NEW_LINE>ASN1ObjectIdentifier signatureAlgorithmOid = (ASN1ObjectIdentifier) signatureAlgorithm.getObjectAt(0);<NEW_LINE>if (signatureAlgorithm.size() > 1) {<NEW_LINE>this.signatureAlgorithmParameters = signatureAlgorithm.getObjectAt(1).toASN1Primitive().getEncoded();<NEW_LINE>}<NEW_LINE>ASN1Sequence spki = (<MASK><NEW_LINE>DERIA5String challenge = (DERIA5String) publicKeyAndChallenge.getObjectAt(1);<NEW_LINE>ASN1Sequence publicKeyAlgorithm = (ASN1Sequence) spki.getObjectAt(0);<NEW_LINE>DERBitString publicKey = (DERBitString) spki.getObjectAt(1);<NEW_LINE>ASN1ObjectIdentifier publicKeyAlgorithmOid = (ASN1ObjectIdentifier) publicKeyAlgorithm.getObjectAt(0);<NEW_LINE>ASN1Primitive algorithmParameters = publicKeyAlgorithm.getObjectAt(1).toASN1Primitive();<NEW_LINE>this.challenge = challenge.getString();<NEW_LINE>this.publicKey = decodePublicKeyFromBitString(publicKeyAlgorithmOid, algorithmParameters, publicKey);<NEW_LINE>this.signatureAlgorithm = getSignatureAlgorithm(signatureAlgorithmOid);<NEW_LINE>this.signature = signature.getBytes();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new SpkacException(res.getString("NoDecodeSpkac.exception.message"), ex);<NEW_LINE>}<NEW_LINE>}
ASN1Sequence) publicKeyAndChallenge.getObjectAt(0);
229,170
public static DescribePropertyScaDetailResponse unmarshall(DescribePropertyScaDetailResponse describePropertyScaDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePropertyScaDetailResponse.setRequestId(_ctx.stringValue("DescribePropertyScaDetailResponse.RequestId"));<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCount(_ctx.integerValue("DescribePropertyScaDetailResponse.PageInfo.Count"));<NEW_LINE>pageInfo.setPageSize(_ctx.integerValue("DescribePropertyScaDetailResponse.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotalCount(_ctx.integerValue("DescribePropertyScaDetailResponse.PageInfo.TotalCount"));<NEW_LINE>pageInfo.setCurrentPage(_ctx.integerValue("DescribePropertyScaDetailResponse.PageInfo.CurrentPage"));<NEW_LINE>describePropertyScaDetailResponse.setPageInfo(pageInfo);<NEW_LINE>List<PropertySca> propertys = new ArrayList<PropertySca>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePropertyScaDetailResponse.Propertys.Length"); i++) {<NEW_LINE>PropertySca propertySca = new PropertySca();<NEW_LINE>propertySca.setInstanceName(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].InstanceName"));<NEW_LINE>propertySca.setIp(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Ip"));<NEW_LINE>propertySca.setCreate(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Create"));<NEW_LINE>propertySca.setCreateTimestamp(_ctx.longValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].CreateTimestamp"));<NEW_LINE>propertySca.setUuid(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Uuid"));<NEW_LINE>propertySca.setInstanceId(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].InstanceId"));<NEW_LINE>propertySca.setIntranetIp(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].IntranetIp"));<NEW_LINE>propertySca.setInternetIp(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].InternetIp"));<NEW_LINE>propertySca.setName(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Name"));<NEW_LINE>propertySca.setType(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Type"));<NEW_LINE>propertySca.setVersion(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Version"));<NEW_LINE>propertySca.setPid(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Pid"));<NEW_LINE>propertySca.setBizType(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].BizType"));<NEW_LINE>propertySca.setBizTypeDispaly(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].BizTypeDispaly"));<NEW_LINE>propertySca.setPort(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Port"));<NEW_LINE>propertySca.setContainerName(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].ContainerName"));<NEW_LINE>propertySca.setPath(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Path"));<NEW_LINE>propertySca.setPpid(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Ppid"));<NEW_LINE>propertySca.setProcessUser(_ctx.stringValue<MASK><NEW_LINE>propertySca.setListenIp(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].ListenIp"));<NEW_LINE>propertySca.setListenStatus(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].ListenStatus"));<NEW_LINE>propertySca.setListenProtocol(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].ListenProtocol"));<NEW_LINE>propertySca.setProcessStarted(_ctx.longValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].ProcessStarted"));<NEW_LINE>propertySca.setCmdline(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Cmdline"));<NEW_LINE>propertySca.setConfigPath(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].ConfigPath"));<NEW_LINE>propertySca.setWebPath(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].WebPath"));<NEW_LINE>propertySca.setProof(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].Proof"));<NEW_LINE>propertySca.setImageName(_ctx.stringValue("DescribePropertyScaDetailResponse.Propertys[" + i + "].ImageName"));<NEW_LINE>propertys.add(propertySca);<NEW_LINE>}<NEW_LINE>describePropertyScaDetailResponse.setPropertys(propertys);<NEW_LINE>return describePropertyScaDetailResponse;<NEW_LINE>}
("DescribePropertyScaDetailResponse.Propertys[" + i + "].ProcessUser"));
427,027
public int compare(ClusterModelStats stats1, ClusterModelStats stats2) {<NEW_LINE>// Number of balanced brokers in the highest priority resource cannot be more than the pre-optimized<NEW_LINE>// stats. This constraint is applicable for the rest of the resources, if their higher priority resources<NEW_LINE>// have the same number of balanced brokers in their corresponding pre- and post-optimized stats.<NEW_LINE>int numBalancedBroker1 = stats1.numBalancedBrokersByResource().get(resource());<NEW_LINE>int numBalancedBroker2 = stats2.numBalancedBrokersByResource(<MASK><NEW_LINE>// First compare the number of balanced brokers<NEW_LINE>if (numBalancedBroker2 > numBalancedBroker1) {<NEW_LINE>// If the number of balanced brokers has increased, the standard deviation of utilization for the resource<NEW_LINE>// must decrease. Otherwise, the goal is producing a worse cluster state.<NEW_LINE>double afterUtilizationStd = stats1.resourceUtilizationStats().get(Statistic.ST_DEV).get(resource());<NEW_LINE>double beforeUtilizationStd = stats2.resourceUtilizationStats().get(Statistic.ST_DEV).get(resource());<NEW_LINE>if (Double.compare(beforeUtilizationStd, afterUtilizationStd) < 0) {<NEW_LINE>_reasonForLastNegativeResult = String.format("Violated %s. [Number of Balanced Brokers] for resource %s. post-optimization:%d pre-optimization:%d " + "without improving the standard dev. of utilization. post-optimization:%.2f pre-optimization:%.2f", name(), resource(), numBalancedBroker1, numBalancedBroker2, afterUtilizationStd, beforeUtilizationStd);<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}
).get(resource());
408,552
private HttpURLConnection connect0(final URI ipUri, final String method, final byte[] entity, final Map<String, List<String>> headers, final String endpointHost) throws IOException {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("req: {} {} {} {} {} {}", method, ipUri, headers.size(), Joiner.on(',').withKeyValueSeparator("=").join(headers), entity.length, Json.asPrettyStringUnchecked(entity));<NEW_LINE>} else {<NEW_LINE>log.debug("req: {} {} {} {}", method, ipUri, headers.size(), entity.length);<NEW_LINE>}<NEW_LINE>final HttpURLConnection connection = (HttpURLConnection) ipUri.toURL().openConnection();<NEW_LINE>handleHttps(connection, endpointHost, hostnameVerifierProvider, extraHttpsHandler);<NEW_LINE>connection.setRequestProperty("Accept-Encoding", "gzip");<NEW_LINE>connection.setInstanceFollowRedirects(false);<NEW_LINE>connection.setConnectTimeout(httpTimeoutMillis);<NEW_LINE>connection.setReadTimeout(httpTimeoutMillis);<NEW_LINE>for (final Map.Entry<String, List<String>> header : headers.entrySet()) {<NEW_LINE>for (final String value : header.getValue()) {<NEW_LINE>connection.addRequestProperty(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (entity.length > 0) {<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>connection.getOutputStream().write(entity);<NEW_LINE>}<NEW_LINE>setRequestMethod(connection, method, connection instanceof HttpsURLConnection);<NEW_LINE>return connection;<NEW_LINE>}
header.getKey(), value);
921,678
private static Constraint parseQualifiedValueShape(Graph g, Node s, Node p, Node o, Map<Node, Shape> parsed, Set<Node> traversed) {<NEW_LINE>Shape sub = ShapesParser.parseShapeStep(traversed, parsed, g, o);<NEW_LINE>// [PARSE] Syntax check needed<NEW_LINE>Node qMin = G.getZeroOrOneSP(g, s, SHACL.qualifiedMinCount);<NEW_LINE>Node qMax = G.getZeroOrOneSP(g, s, SHACL.qualifiedMaxCount);<NEW_LINE>int vMin = intValue(qMin, -1);<NEW_LINE>int vMax = intValue(qMax, -1);<NEW_LINE>Node qDisjoint = G.getZeroOrOneSP(<MASK><NEW_LINE>if (vMin < 0 && vMax < 0)<NEW_LINE>throw new ShaclParseException("At least one of sh:qualifiedMinCount and sh:qualifiedMaxCount required");<NEW_LINE>return new QualifiedValueShape(sub, intValue(qMin, -1), intValue(qMax, -1), booleanValueStrict(qDisjoint));<NEW_LINE>}
g, s, SHACL.qualifiedValueShapesDisjoint);
1,270,918
public void removeACL(Collection<String> listIPs, int from, int to) {<NEW_LINE>AmazonEC2 client = null;<NEW_LINE>try {<NEW_LINE>client = getEc2Client();<NEW_LINE>List<IpPermission> ipPermissions = new ArrayList<>();<NEW_LINE>ipPermissions.add(new IpPermission().withFromPort(from).withIpProtocol("tcp").withIpRanges(listIPs).withToPort(to));<NEW_LINE>if (isClassic()) {<NEW_LINE>client.revokeSecurityGroupIngress(new RevokeSecurityGroupIngressRequest(config.getACLGroupName(), ipPermissions));<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Done removing from ACL within classic env for running instance: " + StringUtils.join(listIPs, ","));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>RevokeSecurityGroupIngressRequest req = new RevokeSecurityGroupIngressRequest();<NEW_LINE>// fetch SG group id for vpc account of the running instance.<NEW_LINE>req.withGroupId(getVpcGoupId());<NEW_LINE>// Adding peers' IPs as ingress to the running instance SG<NEW_LINE>client.revokeSecurityGroupIngress(req.withIpPermissions(ipPermissions));<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Done removing from ACL within vpc env for running instance: " + StringUtils<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (client != null)<NEW_LINE>client.shutdown();<NEW_LINE>}<NEW_LINE>}
.join(listIPs, ","));
609,421
public static long createAuditRecord(String userId, String filename) {<NEW_LINE>DotConnect db = new DotConnect();<NEW_LINE>db.setSQL("SELECT max(id) as max FROM import_audit");<NEW_LINE>ArrayList<Map<String, String>> ret;<NEW_LINE>try {<NEW_LINE>ret = db.loadResults();<NEW_LINE>} catch (DotDataException e1) {<NEW_LINE>Logger.error(ImportAuditUtil.class, e1.getMessage(), e1);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>Long maximum = null;<NEW_LINE>if (ret != null && ret.size() > 0 && UtilMethods.isSet(ret.get(0).get("max"))) {<NEW_LINE>maximum = Long.parseLong(ret.get(0)<MASK><NEW_LINE>} else {<NEW_LINE>maximum = Long.parseLong("1");<NEW_LINE>}<NEW_LINE>db.setSQL("INSERT INTO import_audit( id, start_date, userid, filename, status, serverid)VALUES (?, ?, ?, ?, ?,?)");<NEW_LINE>db.addParam(maximum);<NEW_LINE>db.addParam(new Date());<NEW_LINE>db.addParam(userId);<NEW_LINE>db.addParam(filename);<NEW_LINE>db.addParam(STATUS_PENDING);<NEW_LINE>db.addParam(APILocator.getReindexQueueAPI().getServerId());<NEW_LINE>try {<NEW_LINE>db.loadResult();<NEW_LINE>} catch (DotDataException e) {<NEW_LINE>Logger.error(ImportAuditUtil.class, e.getMessage(), e);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>return maximum;<NEW_LINE>}
.get("max")) + 1;
953,963
private void fixIndentOfMovedNode(NodeText nodeText, int index) {<NEW_LINE>if (index <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TextElement currentSpaceCandidate = null;<NEW_LINE>for (int i = index - 1; i >= 0; i--) {<NEW_LINE>TextElement spaceCandidate = nodeText.getTextElement(i);<NEW_LINE>if (spaceCandidate.isSpaceOrTab()) {<NEW_LINE>// save the current indentation char<NEW_LINE>currentSpaceCandidate = nodeText.getTextElement(i);<NEW_LINE>}<NEW_LINE>if (!spaceCandidate.isSpaceOrTab()) {<NEW_LINE>if (spaceCandidate.isNewline() && i != index - 1) {<NEW_LINE>for (int j = 0; j < (index - 1) - i; j++) {<NEW_LINE>if (currentSpaceCandidate != null) {<NEW_LINE>// use the current (or last) indentation character<NEW_LINE>nodeText.addElement(index, new TokenTextElement(JavaToken.Kind.SPACE.getKind(), currentSpaceCandidate.expand()));<NEW_LINE>} else {<NEW_LINE>// use the default indentation character<NEW_LINE>nodeText.addElement(index, new TokenTextElement(JavaToken.Kind<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.SPACE.getKind()));
1,596,794
protected FieldMetadata createExplicitEnumerationIndividualOptionField(ProductOption option, int order) {<NEW_LINE>BasicFieldMetadata metadata = new BasicFieldMetadata();<NEW_LINE>List<ProductOptionValue> allowedValues = option.getAllowedValues();<NEW_LINE>if (CollectionUtils.isNotEmpty(allowedValues)) {<NEW_LINE>metadata.setFieldType(SupportedFieldType.EXPLICIT_ENUMERATION);<NEW_LINE>metadata.setMutable(true);<NEW_LINE>metadata.setInheritedFromType(SkuImpl.class.getName());<NEW_LINE>metadata.setAvailableToTypes(getPolymorphicClasses(SkuImpl.class, em, skuMetadataCacheService.useCache()));<NEW_LINE>metadata.setForeignKeyCollection(false);<NEW_LINE>metadata.setMergedPropertyType(MergedPropertyType.PRIMARY);<NEW_LINE>// Set up the enumeration based on the product option values<NEW_LINE>String[][] optionValues = new String[allowedValues.size()][2];<NEW_LINE>for (int i = 0; i < allowedValues.size(); i++) {<NEW_LINE>ProductOptionValue value = option.getAllowedValues().get(i);<NEW_LINE>optionValues[i][0] = value.getId().toString();<NEW_LINE>optionValues[i][<MASK><NEW_LINE>}<NEW_LINE>metadata.setEnumerationValues(optionValues);<NEW_LINE>metadata.setName(PRODUCT_OPTION_FIELD_PREFIX + option.getId());<NEW_LINE>metadata.setFriendlyName(option.getLabel());<NEW_LINE>metadata.setGroup("productOption_group");<NEW_LINE>metadata.setGroupOrder(-1);<NEW_LINE>metadata.setOrder(order);<NEW_LINE>metadata.setExplicitFieldType(SupportedFieldType.UNKNOWN);<NEW_LINE>metadata.setProminent(false);<NEW_LINE>metadata.setVisibility(VisibilityEnum.FORM_EXPLICITLY_SHOWN);<NEW_LINE>metadata.setBroadleafEnumeration("");<NEW_LINE>metadata.setReadOnly(false);<NEW_LINE>metadata.setRequiredOverride(BooleanUtils.isFalse(option.getRequired()));<NEW_LINE>return metadata;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
1] = value.getAttributeValue();
971,518
public boolean verifyColumnMasterKeyMetadata(String masterKeyPath, boolean allowEnclaveComputations, byte[] signature) throws SQLServerException {<NEW_LINE>if (!allowEnclaveComputations) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>KeyStoreProviderCommon.validateNonEmptyMasterKeyPath(masterKeyPath);<NEW_LINE>CMKMetadataSignatureInfo key = new <MASK><NEW_LINE>if (cmkMetadataSignatureVerificationCache.contains(key)) {<NEW_LINE>return cmkMetadataSignatureVerificationCache.get(key);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>MessageDigest md = MessageDigest.getInstance("SHA-256");<NEW_LINE>md.update(name.toLowerCase().getBytes(java.nio.charset.StandardCharsets.UTF_16LE));<NEW_LINE>md.update(masterKeyPath.toLowerCase().getBytes(java.nio.charset.StandardCharsets.UTF_16LE));<NEW_LINE>// value of allowEnclaveComputations is always true here<NEW_LINE>md.update("true".getBytes(java.nio.charset.StandardCharsets.UTF_16LE));<NEW_LINE>byte[] dataToVerify = md.digest();<NEW_LINE>if (null == dataToVerify) {<NEW_LINE>throw new SQLServerException(SQLServerException.getErrString("R_HashNull"), null);<NEW_LINE>}<NEW_LINE>// Sign the hash<NEW_LINE>byte[] signedHash = AzureKeyVaultSignHashedData(dataToVerify, masterKeyPath);<NEW_LINE>if (null == signedHash) {<NEW_LINE>throw new SQLServerException(SQLServerException.getErrString("R_SignedHashLengthError"), null);<NEW_LINE>}<NEW_LINE>// Validate the signature<NEW_LINE>boolean isValid = AzureKeyVaultVerifySignature(dataToVerify, signature, masterKeyPath);<NEW_LINE>cmkMetadataSignatureVerificationCache.put(key, isValid);<NEW_LINE>return isValid;<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new SQLServerException(SQLServerException.getErrString("R_NoSHA256Algorithm"), e);<NEW_LINE>}<NEW_LINE>}
CMKMetadataSignatureInfo(masterKeyPath, allowEnclaveComputations, signature);
824,426
private boolean sameScalar(ScalarValue want, JsonObject parent, String name) throws Exception {<NEW_LINE>trace("comparing object scalar property " + name);<NEW_LINE>String regexp = want.getRegexp();<NEW_LINE>if (want instanceof StringValue) {<NEW_LINE>return sameString(((StringValue) want).getValue(), regexp<MASK><NEW_LINE>}<NEW_LINE>if (want instanceof LongValue) {<NEW_LINE>return sameString(longToString(((LongValue) want).getValue()), regexp, longToString(parent.getJsonNumber(name).longValue()));<NEW_LINE>}<NEW_LINE>if (want instanceof IntValue) {<NEW_LINE>return sameString(intToString(((IntValue) want).getValue()), regexp, intToString(parent.getInt(name)));<NEW_LINE>}<NEW_LINE>if (want instanceof DoubleValue) {<NEW_LINE>return sameString(doubleToString(((DoubleValue) want).getValue()), regexp, doubleToString(parent.getJsonNumber(name).doubleValue()));<NEW_LINE>}<NEW_LINE>if (want instanceof BooleanValue) {<NEW_LINE>return sameString(booleanToString(((BooleanValue) want).getValue()), regexp, booleanToString(parent.getBoolean(name)));<NEW_LINE>}<NEW_LINE>throw new AssertionError(want + " is not a valid scalar type. Valid types are string, long, int, double, boolean");<NEW_LINE>}
, parent.getString(name));
1,084,970
public static Action<MapProperty<String, String>> bundleDefaults(Project project) {<NEW_LINE>return properties -> {<NEW_LINE>project.getPlugins().withType(PublishingPlugin.class).configureEach(publishingPlugin -> {<NEW_LINE>project.getExtensions().getByType(PublishingExtension.class).getPublications().withType(MavenPublication.class).stream().findAny().ifPresent(publication -> {<NEW_LINE>properties.put(Constants.BUNDLE_NAME, publication.getPom().getName());<NEW_LINE>properties.put(Constants.BUNDLE_DESCRIPTION, publication.getPom().getDescription());<NEW_LINE>});<NEW_LINE>});<NEW_LINE>properties.put(Constants.BUNDLE_SYMBOLICNAME, project.getGroup() + <MASK><NEW_LINE>properties.put(Constants.BUNDLE_DOCURL, "http://ehcache.org");<NEW_LINE>properties.put(Constants.BUNDLE_LICENSE, "LICENSE");<NEW_LINE>properties.put(Constants.BUNDLE_VENDOR, "Terracotta Inc., a wholly-owned subsidiary of Software AG USA, Inc.");<NEW_LINE>properties.put(Constants.BUNDLE_VERSION, osgiFixedVersion(project.getVersion().toString()));<NEW_LINE>properties.put(Constants.SERVICE_COMPONENT, "OSGI-INF/*.xml");<NEW_LINE>};<NEW_LINE>}
"." + project.getName());
195,702
private void visitGeneratedElements(RoundEnvironment roundEnv, TypeElement generatedElement) {<NEW_LINE>for (Element ae : roundEnv.getElementsAnnotatedWith(generatedElement)) {<NEW_LINE>String comments = getGeneratedComments(ae, generatedElement);<NEW_LINE>if (comments == null || !comments.startsWith(Metadata.ANNOTATION_COMMENT_PREFIX)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String annotationFile = comments.substring(Metadata.ANNOTATION_COMMENT_PREFIX.length());<NEW_LINE>if (ae instanceof ClassSymbol) {<NEW_LINE>ClassSymbol cs = (ClassSymbol) ae;<NEW_LINE>try {<NEW_LINE>String annotationPath = cs.sourcefile.toUri().resolve(annotationFile).getPath();<NEW_LINE>for (JavaFileObject file : fileManager.getJavaFileForSources(Arrays.asList(annotationPath))) {<NEW_LINE>((<MASK><NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>logger.atWarning().withCause(ex).log("Bad annotationFile: %s", annotationFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
UsageAsInputReportingJavaFileObject) file).markUsed();
1,852,404
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {<NEW_LINE>final Optional<SwaggerFileType> maybeFileType = swaggerIndexService.getFileType(parameters);<NEW_LINE>maybeFileType.ifPresent(fileType -> {<NEW_LINE>final PathResolver pathResolver = PathResolverFactory.fromSwaggerFileType(fileType);<NEW_LINE>final PsiElement psiElement = parameters.getPosition();<NEW_LINE>final SwaggerCompletionHelper completionHelper = new SwaggerCompletionHelper(psiElement, yamlTraversal, pathResolver);<NEW_LINE>SwaggerFieldCompletionFactory.from(completionHelper, result<MASK><NEW_LINE>SwaggerValueCompletionFactory.from(completionHelper, CompletionResultSetFactory.forValue(parameters, result)).ifPresent(ValueCompletion::fill);<NEW_LINE>for (SwaggerCustomFieldCompletionFactory ep : SwaggerCustomFieldCompletionFactory.EP_NAME.getExtensions()) {<NEW_LINE>ep.from(completionHelper, result).ifPresent(FieldCompletion::fill);<NEW_LINE>}<NEW_LINE>for (SwaggerCustomValueCompletionFactory ep : SwaggerCustomValueCompletionFactory.EP_NAME.getExtensions()) {<NEW_LINE>ep.from(completionHelper, result).ifPresent(ValueCompletion::fill);<NEW_LINE>}<NEW_LINE>result.stopHere();<NEW_LINE>});<NEW_LINE>}
).ifPresent(FieldCompletion::fill);
1,067,173
public void test2(Tester arg) {<NEW_LINE>Tester local = new Tester();<NEW_LINE>// Do we correctly distinguish checkArgument from checkState?<NEW_LINE>// BUG: Suggestion includes "checkArgument(arg.hasId())"<NEW_LINE>checkNotNull(arg.hasId());<NEW_LINE>// BUG: Suggestion includes "checkState(field.hasId())"<NEW_LINE>checkNotNull(field.hasId());<NEW_LINE>// BUG: Suggestion includes "checkState(local.hasId())"<NEW_LINE>checkNotNull(local.hasId());<NEW_LINE>// BUG: Suggestion includes "checkState(!local.hasId())"<NEW_LINE>checkNotNull<MASK><NEW_LINE>// BUG: Suggestion includes "checkState(!(arg instanceof Tester))"<NEW_LINE>checkNotNull(!(arg instanceof Tester));<NEW_LINE>// BUG: Suggestion includes "remove this line"<NEW_LINE>checkNotNull(arg.getId());<NEW_LINE>// BUG: Suggestion includes "id = arg.getId()"<NEW_LINE>int id = checkNotNull(arg.getId());<NEW_LINE>// BUG: Suggestion includes "boolean b = arg.hasId();"<NEW_LINE>boolean b = checkNotNull(arg.hasId());<NEW_LINE>// Do we handle long chains of method calls?<NEW_LINE>// BUG: Suggestion includes "checkArgument(arg.getTester().getTester().hasId())"<NEW_LINE>checkNotNull(arg.getTester().getTester().hasId());<NEW_LINE>// BUG: Suggestion includes "checkArgument(arg.tester.getTester().hasId())"<NEW_LINE>checkNotNull(arg.tester.getTester().hasId());<NEW_LINE>}
(!local.hasId());
1,854,467
void readExternal(Element element) {<NEW_LINE>myId = element.getAttributeValue(ATTRIBUTE_ID);<NEW_LINE>myTipFileName = element.getAttributeValue(ATTRIBUTE_TIP_FILE);<NEW_LINE><MASK><NEW_LINE>myDaysBeforeFirstShowUp = Integer.parseInt(element.getAttributeValue(ATTRIBUTE_FIRST_SHOW));<NEW_LINE>myDaysBetweenSuccesiveShowUps = Integer.parseInt(element.getAttributeValue(ATTRIBUTE_SUCCESSIVE_SHOW));<NEW_LINE>String minUsageCount = element.getAttributeValue(ATTRIBUTE_MIN_USAGE_COUNT);<NEW_LINE>myMinUsageCount = minUsageCount == null ? 1 : Integer.parseInt(minUsageCount);<NEW_LINE>List dependencies = element.getChildren(ELEMENT_DEPENDENCY);<NEW_LINE>if (dependencies != null && !dependencies.isEmpty()) {<NEW_LINE>myDependencies = new HashSet<String>();<NEW_LINE>for (Object dependency : dependencies) {<NEW_LINE>Element dependencyElement = (Element) dependency;<NEW_LINE>myDependencies.add(dependencyElement.getAttributeValue(ATTRIBUTE_ID));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
myDisplayName = FeatureStatisticsBundle.message(myId);
101,317
final BatchGetCustomDataIdentifiersResult executeBatchGetCustomDataIdentifiers(BatchGetCustomDataIdentifiersRequest batchGetCustomDataIdentifiersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchGetCustomDataIdentifiersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchGetCustomDataIdentifiersRequest> request = null;<NEW_LINE>Response<BatchGetCustomDataIdentifiersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchGetCustomDataIdentifiersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchGetCustomDataIdentifiersRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchGetCustomDataIdentifiers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchGetCustomDataIdentifiersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchGetCustomDataIdentifiersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "Macie2");
1,259,242
public void run(RegressionEnvironment env) {<NEW_LINE>ConditionHandlerFactoryContext conditionHandlerFactoryContext = SupportConditionHandlerFactory.getFactoryContexts().get(0);<NEW_LINE>assertEquals(conditionHandlerFactoryContext.getRuntimeURI(), env.runtimeURI());<NEW_LINE>handler = SupportConditionHandlerFactory.getLastHandler();<NEW_LINE>String[] fields = "c0".split(",");<NEW_LINE>String epl = "@name('s0') select * from SupportBean " + "match_recognize (" + " partition by theString " + " measures P1.theString as c0" + " pattern (P1 P2) " + " define " + " P1 as P1.intPrimitive = 1," + " P2 as P2.intPrimitive = 2" + ")";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("A", 1));<NEW_LINE>env.sendEventBean(new SupportBean("B", 1));<NEW_LINE>env.sendEventBean(new SupportBean("C", 1));<NEW_LINE>assertTrue(handler.getContexts().isEmpty());<NEW_LINE>// overflow<NEW_LINE>env.sendEventBean(new SupportBean("D", 1));<NEW_LINE>RowRecogMaxStatesEngineWide3Instance.assertContextEnginePool(env, "s0", handler.getAndResetContexts(), 3, RowRecogMaxStatesEngineWide3Instance.getExpectedCountMap(env, "s0", 3));<NEW_LINE>env.sendEventBean(new SupportBean("E", 1));<NEW_LINE>RowRecogMaxStatesEngineWide3Instance.assertContextEnginePool(env, "s0", handler.getAndResetContexts(), 3, RowRecogMaxStatesEngineWide3Instance.getExpectedCountMap(env, "s0", 4));<NEW_LINE>// D gone<NEW_LINE>env.sendEventBean(new SupportBean("D", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "D" });<NEW_LINE>// A gone<NEW_LINE>env.sendEventBean(new SupportBean("A", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "A" });<NEW_LINE>// C gone<NEW_LINE>env.sendEventBean(new SupportBean("C", 2));<NEW_LINE>env.assertPropsNew("s0", fields, <MASK><NEW_LINE>env.sendEventBean(new SupportBean("F", 1));<NEW_LINE>assertTrue(handler.getContexts().isEmpty());<NEW_LINE>env.sendEventBean(new SupportBean("G", 1));<NEW_LINE>RowRecogMaxStatesEngineWide3Instance.assertContextEnginePool(env, "s0", handler.getAndResetContexts(), 3, RowRecogMaxStatesEngineWide3Instance.getExpectedCountMap(env, "s0", 3));<NEW_LINE>env.undeployAll();<NEW_LINE>}
new Object[] { "C" });
1,727,652
static private // the ValueWithPath instance itself should not be.<NEW_LINE>ResultWithPath findInObject(AbstractConfigObject obj, ResolveContext context, Path path) throws NotPossibleToResolve {<NEW_LINE>// resolve ONLY portions of the object which are along our path<NEW_LINE>if (ConfigImpl.traceSubstitutionsEnabled())<NEW_LINE>ConfigImpl.trace("*** finding '" + path + "' in " + obj);<NEW_LINE>Path restriction = context.restrictToChild();<NEW_LINE>ResolveResult<? extends AbstractConfigValue> partiallyResolved = context.restrict(path).resolve(obj, new ResolveSource(obj));<NEW_LINE>ResolveContext newContext = <MASK><NEW_LINE>if (partiallyResolved.value instanceof AbstractConfigObject) {<NEW_LINE>ValueWithPath pair = findInObject((AbstractConfigObject) partiallyResolved.value, path);<NEW_LINE>return new ResultWithPath(ResolveResult.make(newContext, pair.value), pair.pathFromRoot);<NEW_LINE>} else {<NEW_LINE>throw new ConfigException.BugOrBroken("resolved object to non-object " + obj + " to " + partiallyResolved);<NEW_LINE>}<NEW_LINE>}
partiallyResolved.context.restrict(restriction);
153,358
protected void allocateInputBuffers(int numInputBuffers) {<NEW_LINE>if (!this.isHWEncoderInitialized()) {<NEW_LINE>System.err.println("Encoder intialization failed");<NEW_LINE>}<NEW_LINE>// for MEOnly mode we need to allocate seperate set of buffers for reference frame<NEW_LINE>int numCount = this.motionEstimationOnly ? 2 : 1;<NEW_LINE>for (int count = 0; count < numCount; count++) {<NEW_LINE>try {<NEW_LINE>checkCudaApiCall(cuCtxPushCurrent(this.cudaContext));<NEW_LINE>} catch (CudaException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>Vector<Pointer> inputFrames = new Vector<>();<NEW_LINE>int pixelFormat = this.getPixelFormat();<NEW_LINE>for (int index = 0; index < numInputBuffers; index++) {<NEW_LINE>final <MASK><NEW_LINE>int chromaHeight = getNumChromaPlanes(pixelFormat) * getChromaHeight(pixelFormat, this.getMaxEncodedHeight());<NEW_LINE>if (pixelFormat == NV_ENC_BUFFER_FORMAT_YV12 || pixelFormat == NV_ENC_BUFFER_FORMAT_IYUV) {<NEW_LINE>chromaHeight = getChromaHeight(pixelFormat, getMaxEncodedHeight());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>checkCudaApiCall(cuMemAllocPitch(deviceFramePointer, this.cudaPitch, getWidthInBytes(pixelFormat, getMaxEncodeWidth()), getMaxEncodedHeight() + chromaHeight, 16));<NEW_LINE>} catch (CudaException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>inputFrames.add(new Pointer() {<NEW_LINE><NEW_LINE>{<NEW_LINE>address = deviceFramePointer.get();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>checkCudaApiCall(cuCtxPopCurrent(null));<NEW_LINE>} catch (CudaException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>this.registerInputResources(inputFrames, NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR, this.getMaxEncodeWidth(), this.getMaxEncodedHeight(), (int) this.cudaPitch.get(), pixelFormat, count == 1);<NEW_LINE>}<NEW_LINE>}
LongPointer deviceFramePointer = new LongPointer(1);
8,184
private void layoutVertical(int left, int top, int right, int bottom) {<NEW_LINE>int paddingLeft = this.getPaddingLeft();<NEW_LINE>int paddingRight = this.getPaddingRight();<NEW_LINE>int paddingTop = this.getPaddingTop();<NEW_LINE><MASK><NEW_LINE>int childTop = 0;<NEW_LINE>int childLeft = paddingLeft;<NEW_LINE>int childRight = right - left - paddingRight;<NEW_LINE>int gravity = LayoutBase.getGravity(this);<NEW_LINE>final int verticalGravity = gravity & Gravity.VERTICAL_GRAVITY_MASK;<NEW_LINE>switch(verticalGravity) {<NEW_LINE>case Gravity.CENTER_VERTICAL:<NEW_LINE>childTop = (bottom - top - this._totalLength) / 2 + paddingTop;<NEW_LINE>break;<NEW_LINE>case Gravity.BOTTOM:<NEW_LINE>childTop = bottom - top - this._totalLength + paddingTop;<NEW_LINE>break;<NEW_LINE>case Gravity.TOP:<NEW_LINE>case Gravity.FILL_VERTICAL:<NEW_LINE>default:<NEW_LINE>childTop = paddingTop;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>for (int i = 0, count = this.getChildCount(); i < count; i++) {<NEW_LINE>View child = this.getChildAt(i);<NEW_LINE>if (child.getVisibility() == View.GONE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int childHeight = CommonLayoutParams.getDesiredHeight(child);<NEW_LINE>CommonLayoutParams.layoutChild(child, childLeft, childTop, childRight, childTop + childHeight);<NEW_LINE>childTop += childHeight;<NEW_LINE>}<NEW_LINE>}
int paddingBottom = this.getPaddingBottom();
1,060,886
protected void validateAndUpdateUsernameIfNeeded(UpdateUserCmd updateUserCmd, UserVO user, Account account) {<NEW_LINE>String userName = updateUserCmd.getUsername();<NEW_LINE>if (userName == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(userName)) {<NEW_LINE>throw new InvalidParameterValueException("Username cannot be empty.");<NEW_LINE>}<NEW_LINE>List<UserVO> duplicatedUsers = _userDao.findUsersByName(userName);<NEW_LINE>for (UserVO duplicatedUser : duplicatedUsers) {<NEW_LINE>if (duplicatedUser.getId() == user.getId()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Account duplicatedUserAccountWithUserThatHasTheSameUserName = _accountDao.findById(duplicatedUser.getAccountId());<NEW_LINE>if (duplicatedUserAccountWithUserThatHasTheSameUserName.getDomainId() == account.getDomainId()) {<NEW_LINE>DomainVO domain = _domainDao.<MASK><NEW_LINE>throw new InvalidParameterValueException(String.format("Username [%s] already exists in domain [id=%s,name=%s]", duplicatedUser.getUsername(), domain.getUuid(), domain.getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>user.setUsername(userName);<NEW_LINE>}
findById(duplicatedUserAccountWithUserThatHasTheSameUserName.getDomainId());
812,635
public void insertString(int offset, String str, AttributeSet attributeSet) throws BadLocationException {<NEW_LINE>final int off;<NEW_LINE>final int docLen = getLength();<NEW_LINE>// start of input<NEW_LINE>final int inputOff = docLen - inBuffer.length();<NEW_LINE>if (inputOff != lastInputOff) {<NEW_LINE>// output written since last input<NEW_LINE>lastInputOff = inputOff;<NEW_LINE>off = docLen;<NEW_LINE>} else if (offset < inputOff) {<NEW_LINE>// cursor before start of input<NEW_LINE>off = inputOff;<NEW_LINE>} else {<NEW_LINE>off = Math.min(offset, inBuffer.length() + inputOff);<NEW_LINE>}<NEW_LINE>inBuffer.insert(off - inputOff, str);<NEW_LINE>final int len = str.length();<NEW_LINE>DocumentEvent ev = new DocumentEvent() {<NEW_LINE><NEW_LINE>public int getOffset() {<NEW_LINE>return off;<NEW_LINE>}<NEW_LINE><NEW_LINE>public int getLength() {<NEW_LINE>return len;<NEW_LINE>}<NEW_LINE><NEW_LINE>public Document getDocument() {<NEW_LINE>return OutputDocument.this;<NEW_LINE>}<NEW_LINE><NEW_LINE>public EventType getType() {<NEW_LINE>return EventType.INSERT;<NEW_LINE>}<NEW_LINE><NEW_LINE>public ElementChange getChange(Element arg0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (getLines() instanceof AbstractLines) {<NEW_LINE>AbstractLines lines = (AbstractLines) getLines();<NEW_LINE>int start = lines.getLineStart(lines.getLineCount() - 1);<NEW_LINE><MASK><NEW_LINE>lines.lineUpdated(2 * start, 2 * length, length, false);<NEW_LINE>}<NEW_LINE>fireDocumentEvent(ev);<NEW_LINE>}
int length = getLength() - start;
1,608,834
public void onConnectionWrapped(ConnectionInformation connectionInformation) {<NEW_LINE>final Metric2Registry metricRegistry = corePlugin.getMetricRegistry();<NEW_LINE>// at the moment stagemonitor only supports monitoring connections initiated via a DataSource<NEW_LINE>if (connectionInformation.getDataSource() instanceof DataSource && corePlugin.isInitialized()) {<NEW_LINE>DataSource dataSource = (DataSource) connectionInformation.getDataSource();<NEW_LINE>ensureUrlExistsForDataSource(dataSource, connectionInformation.getConnection());<NEW_LINE>MetaData metaData = dataSourceUrlMap.get(dataSource);<NEW_LINE>metricRegistry.timer(getConnectionTemplate.build(metaData.serviceName)).update(connectionInformation.getTimeToGetConnectionNs(), TimeUnit.NANOSECONDS);<NEW_LINE>final Span span = TracingPlugin.getCurrentSpan();<NEW_LINE>final Long connectionWrappedCountSum = incrementAndGetContextValue(span, CONNECTION_WRAPPED_COUNT_ATTRIBUTE, 1L);<NEW_LINE>span.setTag("jdbc_get_connection_count", connectionWrappedCountSum);<NEW_LINE>final double timeToGetConnectionMs = connectionInformation.getTimeToGetConnectionNs() / MILLISECOND_IN_NANOS;<NEW_LINE>final Double connectionWaitTimeMsSum = <MASK><NEW_LINE>span.setTag("jdbc_connection_wait_time_ms", connectionWaitTimeMsSum);<NEW_LINE>}<NEW_LINE>}
incrementAndGetContextValue(span, TIME_TO_GET_CONNECTION_MS_ATTRIBUTE, timeToGetConnectionMs);
742,300
public void createUsersWithListInput(List<User> body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {<NEW_LINE>Object postBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"));<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/user/createWithList";<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams <MASK><NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>String[] contentTypes = {};<NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] {};<NEW_LINE>try {<NEW_LINE>String localVarResponse = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames);<NEW_LINE>if (localVarResponse != null) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>if (ex.getCause() instanceof VolleyError) {<NEW_LINE>VolleyError volleyError = (VolleyError) ex.getCause();<NEW_LINE>if (volleyError.networkResponse != null) {<NEW_LINE>throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}
= new ArrayList<Pair>();
460,962
public void visit(BLangBinaryExpr binaryExpr) {<NEW_LINE>BLangExpression lhsExpr = binaryExpr.lhsExpr;<NEW_LINE>BLangExpression rhsExpr = binaryExpr.rhsExpr;<NEW_LINE>OperatorKind opKind = binaryExpr.opKind;<NEW_LINE>if (opKind == OperatorKind.EQUAL || opKind == OperatorKind.NOT_EQUAL) {<NEW_LINE>// eg a == 5, a == (), a == ONE, a == b : One side should be a variable and other side should be an expr<NEW_LINE><MASK><NEW_LINE>// eg 5 == a, () == a, ONE == a, b == a<NEW_LINE>narrowTypeForEqualOrNotEqual(binaryExpr, rhsExpr, lhsExpr);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<BVarSymbol, NarrowedTypes> t1 = getNarrowedTypes(lhsExpr, env);<NEW_LINE>Map<BVarSymbol, NarrowedTypes> t2 = getNarrowedTypes(rhsExpr, env);<NEW_LINE>Set<BVarSymbol> updatedSymbols = new LinkedHashSet<>(t1.keySet());<NEW_LINE>updatedSymbols.addAll(t2.keySet());<NEW_LINE>if (opKind == OperatorKind.AND || opKind == OperatorKind.OR) {<NEW_LINE>for (BVarSymbol symbol : updatedSymbols) {<NEW_LINE>binaryExpr.narrowedTypeInfo.put(getOriginalVarSymbol(symbol), getNarrowedTypesForBinaryOp(t1, t2, getOriginalVarSymbol(symbol), binaryExpr.opKind));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
narrowTypeForEqualOrNotEqual(binaryExpr, lhsExpr, rhsExpr);
902,957
public void onStyleLoaded(@NonNull Style style) {<NEW_LINE>// Use Turf to calculate the coordinates for the outer ring of the final Polygon<NEW_LINE>Polygon outerCirclePolygon = getTurfPolygon(OUTER_CIRCLE_MILE_RADIUS, centerPoint);<NEW_LINE>// Use Turf to calculate the coordinates for the inner ring of the final Polygon<NEW_LINE>Polygon innerCirclePolygon = getTurfPolygon(OUTER_CIRCLE_MILE_RADIUS - MILE_DIFFERENCE_BETWEEN_CIRCLES, centerPoint);<NEW_LINE>GeoJsonSource outerCircleSource = style.getSourceAs(CIRCLE_GEOJSON_SOURCE_ID);<NEW_LINE>if (outerCircleSource != null) {<NEW_LINE>// Use the two Polygon objects above to create the final Polygon that visually represents the ring.<NEW_LINE>outerCircleSource.setGeoJson(// Create outer LineString<NEW_LINE>Polygon.// Create outer LineString<NEW_LINE>fromOuterInner(// Create inter LineString<NEW_LINE>LineString.fromLngLats(TurfMeta.coordAll(outerCirclePolygon, false)), LineString.fromLngLats(TurfMeta.coordAll<MASK><NEW_LINE>}<NEW_LINE>}
(innerCirclePolygon, false))));
1,555,067
protected void registerInterceptors(final IModelValidationEngine engine) {<NEW_LINE>// Role and included roles<NEW_LINE>engine.addModelValidator(de.metas.security.model.interceptor.AD_Role.instance);<NEW_LINE>engine.addModelValidator(de.metas.security.model.interceptor.AD_Role_Included.instance);<NEW_LINE>engine.addModelValidator(AD_Document_Action_Access.instance);<NEW_LINE>// Source tables<NEW_LINE>engine.addModelValidator(de.metas.security.model.interceptor.AD_Org.instance);<NEW_LINE>engine.addModelValidator(de.metas.security.model.interceptor.AD_Window.instance);<NEW_LINE>engine.addModelValidator(de.metas.security.<MASK><NEW_LINE>engine.addModelValidator(de.metas.security.model.interceptor.AD_Form.instance);<NEW_LINE>engine.addModelValidator(de.metas.security.model.interceptor.AD_Workflow.instance);<NEW_LINE>//<NEW_LINE>// Trigger permissions cache reset if any of permissions table was changed<NEW_LINE>{<NEW_LINE>// TableNames which shall trigger a full permissions reset<NEW_LINE>// role table itself<NEW_LINE>ImmutableSet.<String>builder().// role table itself<NEW_LINE>add(// all role dependent table name<NEW_LINE>I_AD_Role.Table_Name).// all role dependent table name<NEW_LINE>addAll(Services.get(IUserRolePermissionsDAO.class).getRoleDependentTableNames()).build().forEach(triggeringTableName -> {<NEW_LINE>engine.addModelValidator(new PermissionsCacheResetInterceptor(triggeringTableName));<NEW_LINE>logger.debug("Registered permissions cache reset on {}", triggeringTableName);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
model.interceptor.AD_Process.instance);
278,652
public JSONObject view(String packageName) {<NEW_LINE>List<String> params = new ArrayList<>();<NEW_LINE>// NOI18N<NEW_LINE>params.add("view");<NEW_LINE>// NOI18N<NEW_LINE>params.add("--json");<NEW_LINE>params.add(packageName);<NEW_LINE>JSONObject info = null;<NEW_LINE>try {<NEW_LINE>StringBuilderInputProcessorFactory factory = new StringBuilderInputProcessorFactory();<NEW_LINE>Integer exitCode = // NOI18N<NEW_LINE>getExecutable("npm view").additionalParameters(getParams(params)).redirectErrorStream(false).// NOI18N<NEW_LINE>runAndWait(// NOI18N<NEW_LINE>getSilentDescriptor(), // NOI18N<NEW_LINE>factory, "");<NEW_LINE>String result = factory.getResult();<NEW_LINE>if (exitCode != null && exitCode == 0) {<NEW_LINE>info = (JSONObject) new JSONParser().parse(result);<NEW_LINE>}<NEW_LINE>} catch (ExecutionException | ParseException ex) {<NEW_LINE>LOGGER.log(<MASK><NEW_LINE>}<NEW_LINE>return info;<NEW_LINE>}
Level.INFO, null, ex);
1,535,754
public synchronized Map<String, String> loadCache(int entrySize) throws IOException {<NEW_LINE>Map<String, String> <MASK><NEW_LINE>try (BufferedReader reader = new BufferedReader(new FileReader(cacheFile))) {<NEW_LINE>int count = 1;<NEW_LINE>String line = reader.readLine();<NEW_LINE>while (line != null && count <= entrySize) {<NEW_LINE>// content has '=' need to be encoded before write<NEW_LINE>if (!line.startsWith("#") && line.contains("=")) {<NEW_LINE>String[] pairs = line.split("=");<NEW_LINE>properties.put(pairs[0], pairs[1]);<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>line = reader.readLine();<NEW_LINE>}<NEW_LINE>if (count > entrySize) {<NEW_LINE>logger.warn("Cache file was truncated for exceeding the maximum entry size " + entrySize);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn("Load cache failed ", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return properties;<NEW_LINE>}
properties = new HashMap<>();
937,498
final CreateActivationResult executeCreateActivation(CreateActivationRequest createActivationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createActivationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateActivationRequest> request = null;<NEW_LINE>Response<CreateActivationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateActivationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createActivationRequest));<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, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateActivation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateActivationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateActivationResultJsonUnmarshaller());<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);
7,213
public static void main(String[] args) throws java.lang.Exception {<NEW_LINE>EventQueue.invokeAndWait(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>canvasFrame = new GLCanvasFrame("Some Title");<NEW_LINE>canvasFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<NEW_LINE>// canvasFrame.setCanvasSize(640, 480);<NEW_LINE>canvasFrame.showColor(Color.BLUE);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final JavaCVCL context = new JavaCVCL(canvasFrame.getGLCanvas().getContext());<NEW_LINE>final IplImage image = cvLoadImageBGRA("/usr/share/opencv/samples/c/lena.jpg");<NEW_LINE>// final IplImage image = cvLoadImage("/usr/share/opencv/samples/c/lena.jpg"/*args[0]*/, 0);<NEW_LINE>// final IplImage image = IplImage.create(640, 480, IPL_DEPTH_32F, 4);<NEW_LINE>final CLGLImage2d imageCLGL = context.createCLGLImageFrom(image);<NEW_LINE>// final CLImage2d imageCL = context.createCLImageFrom(image);<NEW_LINE>context.acquireGLObject(imageCLGL);<NEW_LINE>context.writeImage(imageCLGL, image, true);<NEW_LINE>context.releaseGLObject(imageCLGL);<NEW_LINE>// System.out.println(imageCLGL.getFormat());<NEW_LINE>// System.exit(0);<NEW_LINE>canvasFrame.setCanvasScale(0.5);<NEW_LINE>for (int i = 0; i < 1000; i++) {<NEW_LINE>canvasFrame.showImage(imageCLGL.getGLObjectID());<NEW_LINE>Thread.sleep(10);<NEW_LINE><MASK><NEW_LINE>Thread.sleep(10);<NEW_LINE>}<NEW_LINE>canvasFrame.waitKey();<NEW_LINE>context.release();<NEW_LINE>System.exit(0);<NEW_LINE>}
canvasFrame.showColor(Color.RED);
1,287,632
public static WritableComparable convertToWritableComparable(Object value, FieldSpec.DataType dataType) {<NEW_LINE>if (value instanceof Number) {<NEW_LINE>Number numberValue = (Number) value;<NEW_LINE>switch(dataType) {<NEW_LINE>case INT:<NEW_LINE>return new IntWritable(numberValue.intValue());<NEW_LINE>case LONG:<NEW_LINE>return new <MASK><NEW_LINE>case FLOAT:<NEW_LINE>return new FloatWritable(numberValue.floatValue());<NEW_LINE>case DOUBLE:<NEW_LINE>return new DoubleWritable(numberValue.doubleValue());<NEW_LINE>case STRING:<NEW_LINE>return new Text(numberValue.toString());<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unsupported data type: " + dataType);<NEW_LINE>}<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>String stringValue = (String) value;<NEW_LINE>switch(dataType) {<NEW_LINE>case INT:<NEW_LINE>return new IntWritable(Integer.parseInt(stringValue));<NEW_LINE>case LONG:<NEW_LINE>return new LongWritable(Long.parseLong(stringValue));<NEW_LINE>case FLOAT:<NEW_LINE>return new FloatWritable(Float.parseFloat(stringValue));<NEW_LINE>case DOUBLE:<NEW_LINE>return new DoubleWritable(Double.parseDouble(stringValue));<NEW_LINE>case STRING:<NEW_LINE>return new Text(stringValue);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unsupported data type: " + dataType);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(String.format("Value: %s must be either a Number or a String, found: %s", value, value.getClass()));<NEW_LINE>}<NEW_LINE>}
LongWritable(numberValue.longValue());
365,303
public boolean validateTableStatusFunction(Properties props, Logger log, RefExecutionAction action) {<NEW_LINE>if (jobDS == null) {<NEW_LINE>jobDS = DataDruidFactory.getJobInstance(props, log);<NEW_LINE>if (jobDS == null) {<NEW_LINE>log.error("Error getting Druid DataSource instance");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bdpDS == null) {<NEW_LINE>bdpDS = DataDruidFactory.getBDPInstance(props, log);<NEW_LINE>if (bdpDS == null) {<NEW_LINE>log.warn("Error getting Druid DataSource instance");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>removeBlankSpace(props);<NEW_LINE>log.info("=============================Data Check Start==========================================");<NEW_LINE>String dataCheckerInfo = props.getProperty(DataChecker.DATA_OBJECT);<NEW_LINE>if (null != action.getExecutionRequestRefContext()) {<NEW_LINE>action.getExecutionRequestRefContext().appendLog("Database table partition info : " + dataCheckerInfo);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>long waitTime = Long.valueOf(props.getProperty(DataChecker.WAIT_TIME, "1")) * 3600 * 1000;<NEW_LINE>int queryFrequency = Integer.valueOf(props.getProperty(DataChecker.QUERY_FREQUENCY, "30000"));<NEW_LINE>log.info("(DataChecker info) wait time : " + waitTime);<NEW_LINE>log.info("(DataChecker info) query frequency : " + queryFrequency);<NEW_LINE>List<Map<String, String>> dataObjectList = extractProperties(props);<NEW_LINE>try (Connection jobConn = jobDS.getConnection();<NEW_LINE>Connection bdpConn = bdpDS.getConnection()) {<NEW_LINE>boolean flag = dataObjectList.stream().allMatch(proObjectMap -> getDataCheckResult(proObjectMap, jobConn, bdpConn, props, log));<NEW_LINE>if (flag) {<NEW_LINE>log.info("=============================Data Check End==========================================");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new RuntimeException("get DataChecker result failed", e);<NEW_LINE>}<NEW_LINE>log.info("=============================Data Check End==========================================");<NEW_LINE>return false;<NEW_LINE>}
log.info("(DataChecker info) database table partition info : " + dataCheckerInfo);
83,408
final DescribeIdentityResult executeDescribeIdentity(DescribeIdentityRequest describeIdentityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeIdentityRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeIdentityRequest> request = null;<NEW_LINE>Response<DescribeIdentityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeIdentityRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeIdentityRequest));<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, "Cognito Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeIdentity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeIdentityResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeIdentityResultJsonUnmarshaller());<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);
258,471
protected void collectAdditionalElementsToRename(List<Pair<PsiElement, TextRange>> stringUsages) {<NEW_LINE>if (isReplaceAllOccurrences()) {<NEW_LINE>for (E expression : getOccurrences()) {<NEW_LINE>LOG.assertTrue(expression.isValid(), expression.getText());<NEW_LINE>stringUsages.add(Pair.<PsiElement, TextRange>create(expression, new TextRange(0, expression.getTextLength())));<NEW_LINE>}<NEW_LINE>} else if (getExpr() != null) {<NEW_LINE>correctExpression();<NEW_LINE>final E expr = getExpr();<NEW_LINE>LOG.assertTrue(expr.isValid(<MASK><NEW_LINE>stringUsages.add(Pair.<PsiElement, TextRange>create(expr, new TextRange(0, expr.getTextLength())));<NEW_LINE>}<NEW_LINE>final V localVariable = getLocalVariable();<NEW_LINE>if (localVariable != null) {<NEW_LINE>final PsiElement nameIdentifier = localVariable.getNameIdentifier();<NEW_LINE>if (nameIdentifier != null) {<NEW_LINE>int length = nameIdentifier.getTextLength();<NEW_LINE>stringUsages.add(Pair.<PsiElement, TextRange>create(nameIdentifier, new TextRange(0, length)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), expr.getText());
386,507
public static void horizontal(GrayU16 src, GrayF32 dst) {<NEW_LINE>if (src.width < dst.width)<NEW_LINE>throw new IllegalArgumentException("src width must be >= dst width");<NEW_LINE>if (src.height != dst.height)<NEW_LINE>throw new IllegalArgumentException("src height must equal dst height");<NEW_LINE>float scale = src.width / (float) dst.width;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, dst.height, y -> {<NEW_LINE>for (int y = 0; y < dst.height; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int x = 0; x < dst.width - 1; x++, indexDst++) {<NEW_LINE>float srcX0 = x * scale;<NEW_LINE>float srcX1 = (x + 1) * scale;<NEW_LINE>int isrcX0 = (int) srcX0;<NEW_LINE>int isrcX1 = (int) srcX1;<NEW_LINE>int index = src.getIndex(isrcX0, y);<NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcX0 - isrcX0));<NEW_LINE>int start = src.data[index++] & 0xFFFF;<NEW_LINE>int middle = 0;<NEW_LINE>for (int i = isrcX0 + 1; i < isrcX1; i++) {<NEW_LINE>middle += src.data[index++] & 0xFFFF;<NEW_LINE>}<NEW_LINE>float endWeight = (srcX1 % 1);<NEW_LINE>int end = src.data[index] & 0xFFFF;<NEW_LINE>dst.data[indexDst] = (start * startWeight + middle + end * endWeight) / scale;<NEW_LINE>}<NEW_LINE>// handle the last area as a special case<NEW_LINE>int x = dst.width - 1;<NEW_LINE>float srcX0 = x * scale;<NEW_LINE>int isrcX0 = (int) srcX0;<NEW_LINE>int isrcX1 = src.width - 1;<NEW_LINE>int index = <MASK><NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcX0 - isrcX0));<NEW_LINE>int start = src.data[index++] & 0xFFFF;<NEW_LINE>int middle = 0;<NEW_LINE>for (int i = isrcX0 + 1; i < isrcX1; i++) {<NEW_LINE>middle += src.data[index++] & 0xFFFF;<NEW_LINE>}<NEW_LINE>int end = isrcX1 != isrcX0 ? src.data[index] & 0xFFFF : 0;<NEW_LINE>dst.data[indexDst] = (start * startWeight + middle + end) / scale;<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
src.getIndex(isrcX0, y);
1,452,704
public void axpy(long n, double alpha, INDArray x, INDArray y) {<NEW_LINE>if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)<NEW_LINE>OpProfiler.getInstance().processBlasCall(false, x, y);<NEW_LINE>if (x.data().dataType() == DataType.DOUBLE) {<NEW_LINE>DefaultOpExecutioner.validateDataType(<MASK><NEW_LINE>daxpy(n, alpha, x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y));<NEW_LINE>} else if (x.data().dataType() == DataType.FLOAT) {<NEW_LINE>DefaultOpExecutioner.validateDataType(DataType.FLOAT, x, y);<NEW_LINE>saxpy(n, (float) alpha, x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y));<NEW_LINE>} else {<NEW_LINE>DefaultOpExecutioner.validateDataType(DataType.HALF, x, y);<NEW_LINE>haxpy(n, (float) alpha, x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y));<NEW_LINE>}<NEW_LINE>}
DataType.DOUBLE, x, y);
265,437
private void encodeUtf8ComponentSlow(CharSequence s, int start, int len) {<NEW_LINE>for (int i = start; i < len; i++) {<NEW_LINE>char c = s.charAt(i);<NEW_LINE>if (c < 0x80) {<NEW_LINE>if (dontNeedEncoding(c)) {<NEW_LINE>uriBuilder.append(c);<NEW_LINE>} else {<NEW_LINE>appendEncoded(c);<NEW_LINE>}<NEW_LINE>} else if (c < 0x800) {<NEW_LINE>appendEncoded(0xc0 | (c >> 6));<NEW_LINE>appendEncoded(0x80 | (c & 0x3f));<NEW_LINE>} else if (StringUtil.isSurrogate(c)) {<NEW_LINE>if (!Character.isHighSurrogate(c)) {<NEW_LINE>appendEncoded(WRITE_UTF_UNKNOWN);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Surrogate Pair consumes 2 characters.<NEW_LINE>if (++i == s.length()) {<NEW_LINE>appendEncoded(WRITE_UTF_UNKNOWN);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Extra method to allow inlining the rest of writeUtf8 which is the most likely code path.<NEW_LINE>writeUtf8Surrogate(c<MASK><NEW_LINE>} else {<NEW_LINE>appendEncoded(0xe0 | (c >> 12));<NEW_LINE>appendEncoded(0x80 | ((c >> 6) & 0x3f));<NEW_LINE>appendEncoded(0x80 | (c & 0x3f));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, s.charAt(i));
1,754,180
/*TODO readd<NEW_LINE>@Override<NEW_LINE>public void openManual()<NEW_LINE>{<NEW_LINE>if(improveReadability())<NEW_LINE>{<NEW_LINE>((IEItemFontRender)this.fontRenderer).spacingModifier = -.5f;<NEW_LINE>((IEItemFontRender)this.fontRenderer).customSpaceWidth = 1f;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void titleRenderPre()<NEW_LINE>{<NEW_LINE>if(improveReadability())<NEW_LINE>{<NEW_LINE>((IEItemFontRender)this.fontRenderer).spacingModifier = .5f;<NEW_LINE>((IEItemFontRender)this.fontRenderer).customSpaceWidth = 4f;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void titleRenderPost()<NEW_LINE>{<NEW_LINE>if(improveReadability())<NEW_LINE>{<NEW_LINE>((IEItemFontRender)this.fontRenderer).spacingModifier = -.5f;<NEW_LINE>((IEItemFontRender)this.fontRenderer).customSpaceWidth = 1f;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void entryRenderPre()<NEW_LINE>{<NEW_LINE>if(improveReadability())<NEW_LINE>((IEItemFontRender)this.fontRenderer).verticalBoldness = true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void entryRenderPost()<NEW_LINE>{<NEW_LINE>if(improveReadability())<NEW_LINE>((IEItemFontRender)<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void tooltipRenderPre()<NEW_LINE>{<NEW_LINE>if(improveReadability())<NEW_LINE>{<NEW_LINE>((IEItemFontRender)this.fontRenderer).spacingModifier = 0f;<NEW_LINE>((IEItemFontRender)this.fontRenderer).customSpaceWidth = 4f;<NEW_LINE>((IEItemFontRender)this.fontRenderer).verticalBoldness = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void tooltipRenderPost()<NEW_LINE>{<NEW_LINE>if(improveReadability())<NEW_LINE>{<NEW_LINE>((IEItemFontRender)this.fontRenderer).spacingModifier = -.5f;<NEW_LINE>((IEItemFontRender)this.fontRenderer).customSpaceWidth = 1f;<NEW_LINE>((IEItemFontRender)this.fontRenderer).verticalBoldness = true;<NEW_LINE>}<NEW_LINE>}*/<NEW_LINE>@Override<NEW_LINE>public Font fontRenderer() {<NEW_LINE>return /*TODO new IEItemFontRender()*/<NEW_LINE>ClientUtils.unicodeFontRender();<NEW_LINE>}
this.fontRenderer).verticalBoldness = false;
515,732
public List<TextRange> select(final PsiElement e, final CharSequence editorText, final int cursorOffset, final Editor editor) {<NEW_LINE>final VirtualFile file = e.getContainingFile().getVirtualFile();<NEW_LINE>final FileType fileType = file == null ? null : file.getFileType();<NEW_LINE>if (fileType == null)<NEW_LINE>return super.select(e, editorText, cursorOffset, editor);<NEW_LINE>final int textLength = editorText.length();<NEW_LINE>final TextRange totalRange = e.getTextRange();<NEW_LINE>final HighlighterIterator iterator = ((EditorEx) editor).getHighlighter().createIterator(totalRange.getStartOffset());<NEW_LINE>final BraceMatcher braceMatcher = BraceMatchingUtil.getBraceMatcher(fileType, iterator);<NEW_LINE>final ArrayList<TextRange> result = new ArrayList<TextRange>();<NEW_LINE>final LinkedList<Trinity<Integer, Integer, IElementType>> stack = new LinkedList<Trinity<Integer, Integer, IElementType>>();<NEW_LINE>while (!iterator.atEnd() && iterator.getStart() < totalRange.getEndOffset()) {<NEW_LINE>final Trinity<Integer, Integer, IElementType> last;<NEW_LINE>if (braceMatcher.isLBraceToken(iterator, editorText, fileType)) {<NEW_LINE>stack.addLast(Trinity.create(iterator.getStart(), iterator.getEnd(), iterator.getTokenType()));<NEW_LINE>} else if (braceMatcher.isRBraceToken(iterator, editorText, fileType) && !stack.isEmpty() && braceMatcher.isPairBraces((last = stack.getLast()).third, iterator.getTokenType())) {<NEW_LINE>stack.removeLast();<NEW_LINE>result.addAll(expandToWholeLine(editorText, new TextRange(last.first, iterator.getEnd())));<NEW_LINE>int bodyStart = last.second;<NEW_LINE>int bodyEnd = iterator.getStart();<NEW_LINE>while (bodyStart < textLength && Character.isWhitespace(editorText.charAt(bodyStart))) bodyStart++;<NEW_LINE>while (bodyEnd > 0 && Character.isWhitespace(editorText.charAt(bodyEnd - 1))) bodyEnd--;<NEW_LINE>result.addAll(expandToWholeLine(editorText, new TextRange(bodyStart, bodyEnd)));<NEW_LINE>}<NEW_LINE>iterator.advance();<NEW_LINE>}<NEW_LINE>result.<MASK><NEW_LINE>return result;<NEW_LINE>}
add(e.getTextRange());
37,770
// /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>// TradeProtocol implementation<NEW_LINE>// /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>@Override<NEW_LINE>protected void onAckMessage(AckMessage ackMessage, NodeAddress peer) {<NEW_LINE>// We handle the ack for CounterCurrencyTransferStartedMessage and DepositTxAndDelayedPayoutTxMessage<NEW_LINE>// as we support automatic re-send of the msg in case it was not ACKed after a certain time<NEW_LINE>if (ackMessage.getSourceMsgClassName().equals(CounterCurrencyTransferStartedMessage.class.getSimpleName())) {<NEW_LINE>processModel.setPaymentStartedAckMessage(ackMessage);<NEW_LINE>} else if (ackMessage.getSourceMsgClassName().equals(DepositTxAndDelayedPayoutTxMessage.class.getSimpleName())) {<NEW_LINE>processModel.setDepositTxSentAckMessage(ackMessage);<NEW_LINE>}<NEW_LINE>if (ackMessage.isSuccess()) {<NEW_LINE>log.info("Received AckMessage for {} from {} with tradeId {} and uid {}", ackMessage.getSourceMsgClassName(), peer, tradeModel.getId(), ackMessage.getSourceUid());<NEW_LINE>} else {<NEW_LINE>log.warn("Received AckMessage with error state for {} from {} with tradeId {} and errorMessage={}", ackMessage.getSourceMsgClassName(), peer, tradeModel.getId(<MASK><NEW_LINE>}<NEW_LINE>}
), ackMessage.getErrorMessage());
748,612
public boolean hasPlayerFaceImage(String playername, FaceType facetype) {<NEW_LINE>String baseKey = prefix + "tiles/faces/" + facetype.id + "/" + playername + ".png";<NEW_LINE>boolean exists = false;<NEW_LINE>S3Client s3 = getConnection();<NEW_LINE>try {<NEW_LINE>ListObjectsV2Request req = ListObjectsV2Request.builder().bucketName(bucketname).prefix(baseKey).<MASK><NEW_LINE>ListObjectsV2Response rslt = s3.listObjectsV2(req);<NEW_LINE>if ((rslt != null) && (rslt.getKeyCount() > 0))<NEW_LINE>exists = true;<NEW_LINE>} catch (S3Exception x) {<NEW_LINE>if (!x.getCode().equals("SignatureDoesNotMatch")) {<NEW_LINE>// S3 behavior when no object match....<NEW_LINE>Log.severe("AWS Exception", x);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releaseConnection(s3);<NEW_LINE>}<NEW_LINE>return exists;<NEW_LINE>}
maxKeys(1).build();
673,185
private void loadSegment() throws IOException {<NEW_LINE>// Try filling the ciphertextSegment<NEW_LINE>while (!endOfCiphertext && ciphertextSegment.remaining() > 0) {<NEW_LINE>int read = in.read(ciphertextSegment.array(), ciphertextSegment.position(), ciphertextSegment.remaining());<NEW_LINE>if (read > 0) {<NEW_LINE>ciphertextSegment.position(ciphertextSegment.position() + read);<NEW_LINE>} else if (read == -1) {<NEW_LINE>endOfCiphertext = true;<NEW_LINE>} else if (read == 0) {<NEW_LINE>// We expect that read returns at least one byte.<NEW_LINE>throw new IOException("Could not read bytes from the ciphertext stream");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte lastByte = 0;<NEW_LINE>if (!endOfCiphertext) {<NEW_LINE>lastByte = ciphertextSegment.get(ciphertextSegment.position() - 1);<NEW_LINE>ciphertextSegment.position(ciphertextSegment.position() - 1);<NEW_LINE>}<NEW_LINE>ciphertextSegment.flip();<NEW_LINE>plaintextSegment.clear();<NEW_LINE>try {<NEW_LINE>decrypter.decryptSegment(ciphertextSegment, segmentNr, endOfCiphertext, plaintextSegment);<NEW_LINE>} catch (GeneralSecurityException ex) {<NEW_LINE>// The current segment did not validate.<NEW_LINE>// Currently this means that decryption cannot resume.<NEW_LINE>setDecryptionErrorOccured();<NEW_LINE>throw new IOException(ex.getMessage() + "\n" + toString() + "\nsegmentNr:" + <MASK><NEW_LINE>}<NEW_LINE>segmentNr += 1;<NEW_LINE>plaintextSegment.flip();<NEW_LINE>ciphertextSegment.clear();<NEW_LINE>if (!endOfCiphertext) {<NEW_LINE>ciphertextSegment.clear();<NEW_LINE>ciphertextSegment.limit(ciphertextSegmentSize + 1);<NEW_LINE>ciphertextSegment.put(lastByte);<NEW_LINE>}<NEW_LINE>}
segmentNr + " endOfCiphertext:" + endOfCiphertext, ex);
135,314
private List<LogisticalForm> findPendingLogisticalForms(LogisticalForm logisticalForm) {<NEW_LINE>Preconditions.checkNotNull(logisticalForm);<NEW_LINE>Preconditions.checkNotNull(logisticalForm.getDeliverToCustomerPartner());<NEW_LINE>QueryBuilder<LogisticalForm> queryBuilder = QueryBuilder.of(LogisticalForm.class);<NEW_LINE>queryBuilder.add("self.deliverToCustomerPartner = :deliverToCustomerPartner");<NEW_LINE>queryBuilder.bind("deliverToCustomerPartner", logisticalForm.getDeliverToCustomerPartner());<NEW_LINE>queryBuilder.add("self.statusSelect < :statusSelect");<NEW_LINE>queryBuilder.bind("statusSelect", LogisticalFormRepository.STATUS_COLLECTED);<NEW_LINE>if (logisticalForm.getId() != null) {<NEW_LINE>queryBuilder.add("self.id != :id");<NEW_LINE>queryBuilder.bind("id", logisticalForm.getId());<NEW_LINE>}<NEW_LINE>List<LogisticalForm> logisticalFormList = queryBuilder<MASK><NEW_LINE>logisticalFormList.add(logisticalForm);<NEW_LINE>return logisticalFormList;<NEW_LINE>}
.build().fetch();
1,707,954
public void actionMove(int pointerId, long time, float x, float y) {<NEW_LINE>float jmeX = iosInput.getJmeX(x);<NEW_LINE>float jmeY = iosInput.invertY(iosInput.getJmeY(y));<NEW_LINE>Vector2f lastPos = lastPositions.get(pointerId);<NEW_LINE>if (lastPos == null) {<NEW_LINE>lastPos = new Vector2f(jmeX, jmeY);<NEW_LINE>lastPositions.put(pointerId, lastPos);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>float dY = jmeY - lastPos.y;<NEW_LINE>if (dX != 0 || dY != 0) {<NEW_LINE>TouchEvent touch = iosInput.getFreeTouchEvent();<NEW_LINE>touch.set(TouchEvent.Type.MOVE, jmeX, jmeY, dX, dY);<NEW_LINE>touch.setPointerId(pointerId);<NEW_LINE>touch.setTime(time);<NEW_LINE>touch.setPressure(1.0f);<NEW_LINE>// touch.setPressure(event.getPressure(p));<NEW_LINE>lastPos.set(jmeX, jmeY);<NEW_LINE>processEvent(touch);<NEW_LINE>}<NEW_LINE>}
float dX = jmeX - lastPos.x;
121,012
static Geometry calculateConvexHull_(Geometry geom, ProgressTracker progress_tracker) {<NEW_LINE>if (geom.isEmpty())<NEW_LINE>return geom.createInstance();<NEW_LINE>Geometry.Type type = geom.getType();<NEW_LINE>if (Geometry.isSegment(type.value())) {<NEW_LINE>// Segments are always returned either as a Point or Polyline<NEW_LINE>Segment segment = (Segment) geom;<NEW_LINE>if (segment.getStartXY().equals(segment.getEndXY())) {<NEW_LINE>Point point = new Point();<NEW_LINE>segment.queryStart(point);<NEW_LINE>return point;<NEW_LINE>} else {<NEW_LINE>Point pt = new Point();<NEW_LINE>Polyline polyline = new Polyline(geom.getDescription());<NEW_LINE>segment.queryStart(pt);<NEW_LINE>polyline.startPath(pt);<NEW_LINE>segment.queryEnd(pt);<NEW_LINE>polyline.lineTo(pt);<NEW_LINE>return polyline;<NEW_LINE>}<NEW_LINE>} else if (type == Geometry.Type.Envelope) {<NEW_LINE>Envelope envelope = (Envelope) geom;<NEW_LINE>Envelope2D env = new Envelope2D();<NEW_LINE>envelope.queryEnvelope2D(env);<NEW_LINE>if (env.xmin == env.xmax && env.ymin == env.ymax) {<NEW_LINE>Point point = new Point();<NEW_LINE>envelope.queryCornerByVal(0, point);<NEW_LINE>return point;<NEW_LINE>} else if (env.xmin == env.xmax || env.ymin == env.ymax) {<NEW_LINE>Point pt = new Point();<NEW_LINE>Polyline polyline = new <MASK><NEW_LINE>envelope.queryCornerByVal(0, pt);<NEW_LINE>polyline.startPath(pt);<NEW_LINE>envelope.queryCornerByVal(1, pt);<NEW_LINE>polyline.lineTo(pt);<NEW_LINE>return polyline;<NEW_LINE>} else {<NEW_LINE>Polygon polygon = new Polygon(geom.getDescription());<NEW_LINE>polygon.addEnvelope(envelope, false);<NEW_LINE>return polygon;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isConvex_(geom, progress_tracker)) {<NEW_LINE>if (type == Geometry.Type.MultiPoint) {<NEW_LINE>// Downgrade to a Point for simplistic output<NEW_LINE>MultiPoint multi_point = (MultiPoint) geom;<NEW_LINE>Point point = new Point();<NEW_LINE>multi_point.getPointByVal(0, point);<NEW_LINE>return point;<NEW_LINE>}<NEW_LINE>return geom;<NEW_LINE>}<NEW_LINE>assert (Geometry.isMultiVertex(type.value()));<NEW_LINE>Geometry convex_hull = ConvexHull.construct((MultiVertexGeometry) geom);<NEW_LINE>return convex_hull;<NEW_LINE>}
Polyline(geom.getDescription());
211,719
public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestInfos, Set<Integer> requestsToDrop, int pollTimeoutMs) {<NEW_LINE>if (closed) {<NEW_LINE>throw new IllegalStateException("The client is closed.");<NEW_LINE>}<NEW_LINE>// TODO: do anything with requestsToDrop?<NEW_LINE>// The AmbryRequest sessions run in a thread pool, and each thread knows when the response is back so we can poll it<NEW_LINE><MASK><NEW_LINE>for (RequestInfo requestInfo : requestInfos) {<NEW_LINE>// Request is sent and received as it is without serializing to stream since they are handled in same process via<NEW_LINE>// local queues.<NEW_LINE>try {<NEW_LINE>channel.sendRequest(new LocalChannelRequest(requestInfo, processorId));<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Received an unexpected error during sendAndPoll(): ", e);<NEW_LINE>// release related bytebuf<NEW_LINE>requestInfo.getRequest().release();<NEW_LINE>networkMetrics.networkClientException.inc();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ResponseInfo> responses = channel.receiveResponses(processorId, pollTimeoutMs);<NEW_LINE>networkMetrics.networkClientSendAndPollTime.update(time.milliseconds() - startTime, TimeUnit.MILLISECONDS);<NEW_LINE>return responses;<NEW_LINE>}
long startTime = time.milliseconds();
313,361
public Dataset deleteDatasetTags(String datasetId, List<String> datasetTagList, Boolean deleteAll) {<NEW_LINE>try (var session = modelDBHibernateUtil.getSessionFactory().openSession()) {<NEW_LINE>var transaction = session.beginTransaction();<NEW_LINE>var stringQueryBuilder = new StringBuilder("delete from TagsMapping tm WHERE ");<NEW_LINE>if (deleteAll) {<NEW_LINE>stringQueryBuilder.append(" tm.datasetEntity." + ModelDBConstants.ID + DATASET_ID_POST_QUERY_PARAM);<NEW_LINE>var query = session.createQuery(stringQueryBuilder.toString()).setLockOptions(new LockOptions().setLockMode(LockMode.PESSIMISTIC_WRITE));<NEW_LINE>query.setParameter(ModelDBConstants.DATASET_ID_STR, datasetId);<NEW_LINE>query.executeUpdate();<NEW_LINE>} else {<NEW_LINE>stringQueryBuilder.append(" tm." + ModelDBConstants.TAGS + " in (:tags)");<NEW_LINE>stringQueryBuilder.append(" AND tm.datasetEntity." + ModelDBConstants.ID + DATASET_ID_POST_QUERY_PARAM);<NEW_LINE>var query = session.createQuery(stringQueryBuilder.toString()).setLockOptions(new LockOptions()<MASK><NEW_LINE>query.setParameter("tags", datasetTagList);<NEW_LINE>query.setParameter(ModelDBConstants.DATASET_ID_STR, datasetId);<NEW_LINE>query.executeUpdate();<NEW_LINE>}<NEW_LINE>DatasetEntity datasetObj = session.get(DatasetEntity.class, datasetId);<NEW_LINE>datasetObj.setTime_updated(Calendar.getInstance().getTimeInMillis());<NEW_LINE>session.update(datasetObj);<NEW_LINE>transaction.commit();<NEW_LINE>LOGGER.debug("Dataset tags deleted successfully");<NEW_LINE>return datasetObj.getProtoObject(mdbRoleService);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ModelDBUtils.needToRetry(ex)) {<NEW_LINE>return deleteDatasetTags(datasetId, datasetTagList, deleteAll);<NEW_LINE>} else {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.setLockMode(LockMode.PESSIMISTIC_WRITE));
1,086,246
protected byte[] engineSign() throws SignatureException {<NEW_LINE>if (key == null) {<NEW_LINE>// This can't actually happen, but you never know...<NEW_LINE>throw new SignatureException("No key provided");<NEW_LINE>}<NEW_LINE>int output_size = NativeCrypto.ECDSA_size(key.getNativeRef());<NEW_LINE>byte[] outputBuffer = new byte[output_size];<NEW_LINE>try {<NEW_LINE>int bytes_written = NativeCrypto.ECDSA_sign(buffer.toByteArray(), <MASK><NEW_LINE>if (bytes_written < 0) {<NEW_LINE>throw new SignatureException("Could not compute signature.");<NEW_LINE>}<NEW_LINE>// There's no guarantee that the signature will be ECDSA_size bytes long,<NEW_LINE>// that's just the maximum possible length of a signature. Only return the bytes<NEW_LINE>// that were actually produced.<NEW_LINE>if (bytes_written != output_size) {<NEW_LINE>byte[] newBuffer = new byte[bytes_written];<NEW_LINE>System.arraycopy(outputBuffer, 0, newBuffer, 0, bytes_written);<NEW_LINE>outputBuffer = newBuffer;<NEW_LINE>}<NEW_LINE>return outputBuffer;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new SignatureException(ex);<NEW_LINE>} finally {<NEW_LINE>buffer.reset();<NEW_LINE>}<NEW_LINE>}
outputBuffer, key.getNativeRef());
430,745
protected void drawLineWithText(Canvas canvas, int startX, int startY, int endX, int endY, int endPointSpace) {<NEW_LINE>if (startX == endX && startY == endY) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (startX > endX) {<NEW_LINE>int tempX = startX;<NEW_LINE>startX = endX;<NEW_LINE>endX = tempX;<NEW_LINE>}<NEW_LINE>if (startY > endY) {<NEW_LINE>int tempY = startY;<NEW_LINE>startY = endY;<NEW_LINE>endY = tempY;<NEW_LINE>}<NEW_LINE>if (startX == endX) {<NEW_LINE>drawLineWithEndPoint(canvas, startX, startY + endPointSpace, endX, endY - endPointSpace);<NEW_LINE>String text = px2dip(endY - startY, true);<NEW_LINE>drawText(canvas, text, startX + textLineDistance, startY + (endY - startY) / 2 + getTextHeight(text) / 2);<NEW_LINE>} else if (startY == endY) {<NEW_LINE>drawLineWithEndPoint(canvas, startX + endPointSpace, startY, endX - endPointSpace, endY);<NEW_LINE>String text = px2dip(endX - startX, true);<NEW_LINE>drawText(canvas, text, startX + (endX - startX) / 2 - getTextWidth(text<MASK><NEW_LINE>}<NEW_LINE>}
) / 2, startY - textLineDistance);