idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,117,259 | public List<DataFetcherResult<MLModel>> batchLoad(final List<String> urns, final QueryContext context) throws Exception {<NEW_LINE>final List<Urn> mlModelUrns = urns.stream().map(UrnUtils::getUrn).collect(Collectors.toList());<NEW_LINE>try {<NEW_LINE>final Map<Urn, EntityResponse> mlModelMap = _entityClient.batchGetV2(ML_MODEL_ENTITY_NAME, new HashSet<>(mlModelUrns), null, context.getAuthentication());<NEW_LINE>final List<EntityResponse> gmsResults = mlModelUrns.stream().map(modelUrn -> mlModelMap.getOrDefault(modelUrn, null)).collect(Collectors.toList());<NEW_LINE>return gmsResults.stream().map(gmsMlModel -> gmsMlModel == null ? null : DataFetcherResult.<MLModel>newResult().data(MLModelMapper.map(gmsMlModel)).build()).<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Failed to batch load MLModels", e);<NEW_LINE>}<NEW_LINE>} | collect(Collectors.toList()); |
1,277,640 | private void checkOnColumnAlign(Token token, int index) {<NEW_LINE>// if some further tokens in a group are wrapped on column,<NEW_LINE>// the first one should be aligned on column even if it's not wrapped<NEW_LINE>WrapPolicy wrapPolicy = token.getWrapPolicy();<NEW_LINE>if (wrapPolicy == null || !wrapPolicy.indentOnColumn || !wrapPolicy.isFirstInGroup)<NEW_LINE>return;<NEW_LINE>int positionInLine = <MASK><NEW_LINE>if (this.tm2.toIndent(positionInLine, true) == positionInLine)<NEW_LINE>return;<NEW_LINE>Predicate<Token> aligner = t -> {<NEW_LINE>WrapPolicy wp = t.getWrapPolicy();<NEW_LINE>if (wp != null && wp.indentOnColumn && wp.wrapParentIndex == wrapPolicy.wrapParentIndex) {<NEW_LINE>this.currentIndent = this.tm2.toIndent(positionInLine, true);<NEW_LINE>token.setAlign(this.currentIndent);<NEW_LINE>this.stack.push(token);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>};<NEW_LINE>// check all future wraps<NEW_LINE>WrapInfo furtherWrap = this.nextWrap;<NEW_LINE>while (furtherWrap != null) {<NEW_LINE>if (aligner.test(this.tm2.get(furtherWrap.wrapTokenIndex)))<NEW_LINE>return;<NEW_LINE>furtherWrap = WrapExecutor.this.wrapSearchResults.get(furtherWrap).nextWrap;<NEW_LINE>}<NEW_LINE>// check all tokens that are already wrapped<NEW_LINE>for (int i = index; i <= wrapPolicy.groupEndIndex; i++) {<NEW_LINE>Token t = this.tm2.get(i);<NEW_LINE>if (t.getLineBreaksBefore() > 0 && aligner.test(t))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} | this.tm2.getPositionInLine(index); |
208,783 | public AsyncJobResponse queryJobResult(final QueryAsyncJobResultCmd cmd) {<NEW_LINE>final Account caller = CallContext.current().getCallingAccount();<NEW_LINE>final AsyncJob job = _entityMgr.findByIdIncludingRemoved(AsyncJob.class, cmd.getId());<NEW_LINE>if (job == null) {<NEW_LINE>throw new InvalidParameterValueException("Unable to find a job by id " + cmd.getId());<NEW_LINE>}<NEW_LINE>final User userJobOwner = _accountMgr.getUserIncludingRemoved(job.getUserId());<NEW_LINE>final Account jobOwner = _accountMgr.<MASK><NEW_LINE>// check permissions<NEW_LINE>if (_accountMgr.isNormalUser(caller.getId())) {<NEW_LINE>// regular users can see only jobs they own<NEW_LINE>if (caller.getId() != jobOwner.getId()) {<NEW_LINE>throw new PermissionDeniedException("Account " + caller + " is not authorized to see job id=" + job.getId());<NEW_LINE>}<NEW_LINE>} else if (_accountMgr.isDomainAdmin(caller.getId())) {<NEW_LINE>_accountMgr.checkAccess(caller, null, true, jobOwner);<NEW_LINE>}<NEW_LINE>return createAsyncJobResponse(_jobMgr.queryJob(cmd.getId(), true));<NEW_LINE>} | getAccount(userJobOwner.getAccountId()); |
249,101 | public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>// single-column constant<NEW_LINE>String stmtText = "@name('s0') select (select id from SupportBean_S1#length(1000) where p10='X') as ids1 from SupportBean_S0";<NEW_LINE>env.compileDeployAddListenerMile(stmtText, "s0", milestone.getAndIncrement());<NEW_LINE>env.sendEventBean(new SupportBean_S1(-1, "Y"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", null);<NEW_LINE>env.sendEventBean(new SupportBean_S1(1, "X"));<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.sendEventBean(new SupportBean_S1(3, "Z"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", 1);<NEW_LINE>env.sendEventBean(new SupportBean_S0(1));<NEW_LINE>env.assertEqualsNew("s0", "ids1", 1);<NEW_LINE>env.sendEventBean(new SupportBean_S1(2, "X"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(2));<NEW_LINE>env.assertEqualsNew("s0", "ids1", null);<NEW_LINE>env.undeployAll();<NEW_LINE>// two-column constant<NEW_LINE>stmtText = "@name('s0') select (select id from SupportBean_S1#length(1000) where p10='X' and p11='Y') as ids1 from SupportBean_S0";<NEW_LINE>env.compileDeployAddListenerMile(stmtText, "s0", milestone.getAndIncrement());<NEW_LINE>env.sendEventBean(new SupportBean_S1(1, "X", "Y"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", 1);<NEW_LINE>env.undeployAll();<NEW_LINE>// single range<NEW_LINE>stmtText = "@name('s0') select (select theString from SupportBean#lastevent where intPrimitive between 10 and 20) as ids1 from SupportBean_S0";<NEW_LINE>env.compileDeployAddListenerMile(stmtText, "s0", milestone.getAndIncrement());<NEW_LINE>env.sendEventBean(new SupportBean("E1", 15));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", "E1");<NEW_LINE>env.undeployAll();<NEW_LINE>} | new SupportBean_S1(2, "Y")); |
1,505,387 | public void processExternalTable(List<AlterClause> alterClauses, Database db, Table externalTable) throws UserException {<NEW_LINE>externalTable.writeLockOrDdlException();<NEW_LINE>try {<NEW_LINE>// copy the external table schema columns<NEW_LINE>List<Column> newSchema = Lists.newArrayList();<NEW_LINE>newSchema.addAll(externalTable.getBaseSchema(true));<NEW_LINE>for (AlterClause alterClause : alterClauses) {<NEW_LINE>if (alterClause instanceof AddColumnClause) {<NEW_LINE>// add column<NEW_LINE>processAddColumn((AddColumnClause) alterClause, externalTable, newSchema);<NEW_LINE>} else if (alterClause instanceof AddColumnsClause) {<NEW_LINE>// add columns<NEW_LINE>processAddColumns((<MASK><NEW_LINE>} else if (alterClause instanceof DropColumnClause) {<NEW_LINE>// drop column and drop indexes on this column<NEW_LINE>processDropColumn((DropColumnClause) alterClause, externalTable, newSchema);<NEW_LINE>} else if (alterClause instanceof ModifyColumnClause) {<NEW_LINE>// modify column<NEW_LINE>processModifyColumn((ModifyColumnClause) alterClause, externalTable, newSchema);<NEW_LINE>} else if (alterClause instanceof ReorderColumnsClause) {<NEW_LINE>// reorder column<NEW_LINE>processReorderColumn((ReorderColumnsClause) alterClause, externalTable, newSchema);<NEW_LINE>} else {<NEW_LINE>Preconditions.checkState(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// end for alter clauses<NEW_LINE>// replace the old column list<NEW_LINE>externalTable.setNewFullSchema(newSchema);<NEW_LINE>// refresh external table column in edit log<NEW_LINE>Env.getCurrentEnv().refreshExternalTableSchema(db, externalTable, newSchema);<NEW_LINE>} finally {<NEW_LINE>externalTable.writeUnlock();<NEW_LINE>}<NEW_LINE>} | AddColumnsClause) alterClause, externalTable, newSchema); |
1,058,201 | private void loadIssueTemplates() {<NEW_LINE>registerTemporarySubscription(getIssueTemplatesSingle("/.github").flatMap(opt -> opt.orOptionalSingle(() -> getIssueTemplatesSingle(""))).flatMap(opt -> opt.orOptionalSingle(() -> getIssueTemplatesSingle("/docs"))).compose(RxUtils.wrapWithProgressDialog(this, R.string.loading_msg)).subscribe(result -> {<NEW_LINE>if (result.isPresent() && !result.get().isEmpty()) {<NEW_LINE>List<IssueTemplate> templates = result.get();<NEW_LINE>if (templates.size() == 1) {<NEW_LINE>handleIssueTemplateSelected(templates.get(0));<NEW_LINE>} else {<NEW_LINE>List<IssueTemplate> namedTemplates = new ArrayList<>();<NEW_LINE>for (IssueTemplate t : templates) {<NEW_LINE>if (t.name != null) {<NEW_LINE>namedTemplates.add(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IssueTemplateSelectionDialogFragment f = IssueTemplateSelectionDialogFragment.newInstance(namedTemplates);<NEW_LINE>f.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>handleIssueTemplateSelected(null);<NEW_LINE>}<NEW_LINE>}, this::handleLoadFailure));<NEW_LINE>} | show(getSupportFragmentManager(), "template-selection"); |
692,635 | protected void doUpdate() {<NEW_LINE>postUpdate = new PostUpdateScripts();<NEW_LINE>try {<NEW_LINE>super.doUpdate();<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>postUpdateScripts.clear();<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (!postUpdate.getUpdates().isEmpty()) {<NEW_LINE>log.info(String.format("Execute '%s' post update actions", postUpdate.getUpdates().size()));<NEW_LINE>for (Closure closure : postUpdate.getUpdates()) {<NEW_LINE>ScriptResource <MASK><NEW_LINE>if (groovyFile != null) {<NEW_LINE>log.info("Execute post update from {}", getScriptName(groovyFile));<NEW_LINE>}<NEW_LINE>closure.call();<NEW_LINE>if (groovyFile != null && !postUpdateScripts.containsValue(groovyFile)) {<NEW_LINE>log.info("All post update actions completed for {}", getScriptName(groovyFile));<NEW_LINE>markScript(getScriptName(groovyFile), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | groovyFile = postUpdateScripts.remove(closure); |
1,169,655 | public static void copyView(final JFrame parent, final INaviProject project, final INaviView view) {<NEW_LINE><MASK><NEW_LINE>Preconditions.checkNotNull(project, "IE01836: Project argument can not be null");<NEW_LINE>Preconditions.checkNotNull(view, "IE01837: View argument can not be null");<NEW_LINE>if (!view.isLoaded()) {<NEW_LINE>try {<NEW_LINE>view.load();<NEW_LINE>} catch (final CouldntLoadDataException e) {<NEW_LINE>CUtilityFunctions.logException(e);<NEW_LINE>final String innerMessage = "E00138: " + "View could not be copied because it could not be loaded";<NEW_LINE>final String innerDescription = CUtilityFunctions.createDescription(String.format("The view '%s' could not be copied.", view.getName()), new String[] { "There was a problem with the database connection." }, new String[] { "The new view was not created." });<NEW_LINE>NaviErrorDialog.show(parent, innerMessage, innerDescription, e);<NEW_LINE>return;<NEW_LINE>} catch (final CPartialLoadException e) {<NEW_LINE>// TODO: This<NEW_LINE>CUtilityFunctions.logException(e);<NEW_LINE>return;<NEW_LINE>} catch (final LoadCancelledException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>project.getContent().createView(view, view.getName(), view.getConfiguration().getDescription());<NEW_LINE>view.close();<NEW_LINE>try {<NEW_LINE>view.save();<NEW_LINE>} catch (final CouldntSaveDataException exception) {<NEW_LINE>CUtilityFunctions.logException(exception);<NEW_LINE>final String innerMessage = "E00206: " + "Could not save view";<NEW_LINE>final String innerDescription = CUtilityFunctions.createDescription(String.format("The function '%s' could not be saved.", view.getName()), new String[] { "There was a problem with the database connection." }, new String[] { "The graph remains unsaved." });<NEW_LINE>NaviErrorDialog.show(parent, innerMessage, innerDescription, exception);<NEW_LINE>}<NEW_LINE>} | Preconditions.checkNotNull(parent, "IE01835: Parent argument can not be null"); |
1,057,497 | public static List<Mod> searchMod(String query) {<NEW_LINE>if (!loadKeywords())<NEW_LINE>return Collections.emptyList();<NEW_LINE>StringBuilder newQuery = query.chars().filter(ch -> !Character.isSpaceChar(ch)).collect(StringBuilder::new, (sb, value) -> sb.append((char) value), StringBuilder::append);<NEW_LINE>query = newQuery.toString();<NEW_LINE>StringUtils.LongestCommonSubsequence lcs = new StringUtils.LongestCommonSubsequence(query.length(), maxKeywordLength);<NEW_LINE>List<Pair<Integer, Mod>> modList = new ArrayList<>();<NEW_LINE>for (Pair<String, Mod> keyword : keywords) {<NEW_LINE>int value = lcs.calc(<MASK><NEW_LINE>if (value >= Math.max(1, query.length() - 3)) {<NEW_LINE>modList.add(pair(value, keyword.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return modList.stream().sorted((a, b) -> -a.getKey().compareTo(b.getKey())).map(Pair::getValue).collect(Collectors.toList());<NEW_LINE>} | query, keyword.getKey()); |
97,140 | public void updateConnectedControllers() {<NEW_LINE>logger.config("Updating connected controllers.");<NEW_LINE>if (environment != null) {<NEW_LINE>controllerCount = 0;<NEW_LINE>for (int i = 0; i < VR.k_unMaxTrackedDeviceCount; i++) {<NEW_LINE>int classCallback = VRSystem.VRSystem_GetTrackedDeviceClass(i);<NEW_LINE>if (classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_Controller || classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_GenericTracker) {<NEW_LINE>IntBuffer error = BufferUtils.createIntBuffer(1);<NEW_LINE>String controllerName = "Unknown";<NEW_LINE>String manufacturerName = "Unknown";<NEW_LINE>controllerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_TrackingSystemName_String, error);<NEW_LINE>manufacturerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_ManufacturerName_String, error);<NEW_LINE>if (error.get(0) != 0) {<NEW_LINE>logger.warning("Error getting controller information " + controllerName + " " + manufacturerName + "Code (" + error.get(0) + ")");<NEW_LINE>}<NEW_LINE>controllerIndex[controllerCount] = i;<NEW_LINE>// Adding tracked controller to control.<NEW_LINE>if (trackedControllers == null) {<NEW_LINE>trackedControllers = new ArrayList<VRTrackedController>(VR.k_unMaxTrackedDeviceCount);<NEW_LINE>}<NEW_LINE>trackedControllers.add(new LWJGLOpenVRTrackedController(i, this<MASK><NEW_LINE>// Send a Haptic pulse to the controller<NEW_LINE>triggerHapticPulse(controllerCount, 1.0f);<NEW_LINE>controllerCount++;<NEW_LINE>logger.config(" Tracked controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " " + controllerName + " (" + manufacturerName + ") attached.");<NEW_LINE>} else {<NEW_LINE>logger.config(" Controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " ignored.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("VR input is not attached to a VR environment.");<NEW_LINE>}<NEW_LINE>} | , controllerName, manufacturerName, environment)); |
435,541 | public int compareTo(Image other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetUri()).compareTo(other.isSetUri());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetUri()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uri, other.uri);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetTitle()).compareTo(other.isSetTitle());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTitle()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.title, other.title);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetWidth()).compareTo(other.isSetWidth());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetWidth()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.width, other.width);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetHeight()).compareTo(other.isSetHeight());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetHeight()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.height, other.height);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetSize()).<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSize()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.size, other.size);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | compareTo(other.isSetSize()); |
696,865 | private List<Folder> findContainersAssetsByContentType(final String contentTypeVarNameFileName) {<NEW_LINE>List<Contentlet> containers = null;<NEW_LINE>final List<Folder> folders = new ArrayList<>();<NEW_LINE>final User user = APILocator.systemUser();<NEW_LINE>final StringBuilder sqlQuery = new StringBuilder("select cvi.working_inode as inode from contentlet_version_info cvi, identifier id where" + " id.parent_path like ? and id.asset_name = ? and cvi.identifier = id.id");<NEW_LINE>final List<Object> parameters = new ArrayList<>();<NEW_LINE>parameters.add(Constants.CONTAINER_FOLDER_PATH + StringPool.FORWARD_SLASH + StringPool.PERCENT);<NEW_LINE>parameters.add(contentTypeVarNameFileName + StringPool.PERIOD + "vtl");<NEW_LINE>sqlQuery.append(" and cvi.deleted = " + DbConnectionFactory.getDBFalse());<NEW_LINE>final DotConnect dc = new DotConnect().setSQL(sqlQuery.toString());<NEW_LINE>parameters.forEach(param -> dc.addParam(param));<NEW_LINE>try {<NEW_LINE>final List<Map<String, String>> inodesMapList = dc.loadResults();<NEW_LINE>final List<String> <MASK><NEW_LINE>for (final Map<String, String> versionInfoMap : inodesMapList) {<NEW_LINE>inodes.add(versionInfoMap.get("inode"));<NEW_LINE>}<NEW_LINE>containers = APILocator.getContentletAPI().findContentlets(inodes);<NEW_LINE>for (final Contentlet container : containers) {<NEW_LINE>folders.add(this.folderAPI.find(container.getFolder(), user, false));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this.getClass(), e.getMessage(), e);<NEW_LINE>throw new DotRuntimeException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return folders;<NEW_LINE>} | inodes = new ArrayList<>(); |
450,910 | private Map<Enchantment, Integer> processMagicHunter(@NotNull ItemStack treasureDrop) {<NEW_LINE>Map<Enchantment, Integer> enchants = new HashMap<>();<NEW_LINE>List<EnchantmentTreasure> fishingEnchantments = null;<NEW_LINE>double diceRoll = Misc.getRandom().nextDouble() * 100;<NEW_LINE>for (Rarity rarity : Rarity.values()) {<NEW_LINE>double dropRate = FishingTreasureConfig.getInstance().<MASK><NEW_LINE>if (diceRoll <= dropRate) {<NEW_LINE>// Make sure enchanted books always get some kind of enchantment. --hoorigan<NEW_LINE>if (treasureDrop.getType() == Material.ENCHANTED_BOOK) {<NEW_LINE>diceRoll = dropRate + 1;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>fishingEnchantments = FishingTreasureConfig.getInstance().fishingEnchantments.get(rarity);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>diceRoll -= dropRate;<NEW_LINE>}<NEW_LINE>if (fishingEnchantments == null) {<NEW_LINE>return enchants;<NEW_LINE>}<NEW_LINE>List<Enchantment> validEnchantments = getPossibleEnchantments(treasureDrop);<NEW_LINE>List<EnchantmentTreasure> possibleEnchants = new ArrayList<>();<NEW_LINE>for (EnchantmentTreasure enchantmentTreasure : fishingEnchantments) {<NEW_LINE>if (validEnchantments.contains(enchantmentTreasure.getEnchantment())) {<NEW_LINE>possibleEnchants.add(enchantmentTreasure);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (possibleEnchants.isEmpty()) {<NEW_LINE>return enchants;<NEW_LINE>}<NEW_LINE>// This make sure that the order isn't always the same, for example previously Unbreaking had a lot more chance to be used than any other enchant<NEW_LINE>Collections.shuffle(possibleEnchants, Misc.getRandom());<NEW_LINE>int specificChance = 1;<NEW_LINE>for (EnchantmentTreasure enchantmentTreasure : possibleEnchants) {<NEW_LINE>Enchantment possibleEnchantment = enchantmentTreasure.getEnchantment();<NEW_LINE>if (treasureDrop.getItemMeta().hasConflictingEnchant(possibleEnchantment) || Misc.getRandom().nextInt(specificChance) != 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>enchants.put(possibleEnchantment, enchantmentTreasure.getLevel());<NEW_LINE>specificChance *= 2;<NEW_LINE>}<NEW_LINE>return enchants;<NEW_LINE>} | getEnchantmentDropRate(getLootTier(), rarity); |
1,417,777 | public static Map<String, Object> resolvedArtifactProps(Artifact artifact, Map<String, Object> props) {<NEW_LINE>props.putAll(artifact.getExtraProperties());<NEW_LINE>props.putAll(artifact.getResolvedExtraProperties());<NEW_LINE>String artifactFile = artifact.getEffectivePath().getFileName().toString();<NEW_LINE>String artifactFileName = getFilename(artifactFile, FileType.getSupportedExtensions());<NEW_LINE>props.put(KEY_ARTIFACT_FILE, artifactFile);<NEW_LINE>props.put(KEY_ARTIFACT_FILE_NAME, artifactFileName);<NEW_LINE>if (!artifactFile.equals(artifactFileName)) {<NEW_LINE>String artifactExtension = artifactFile.substring(artifactFileName.length());<NEW_LINE>String artifactFileFormat = artifactExtension.substring(1);<NEW_LINE>props.put(KEY_ARTIFACT_FILE_EXTENSION, artifactExtension);<NEW_LINE>props.put(KEY_ARTIFACT_FILE_FORMAT, artifactFileFormat);<NEW_LINE>}<NEW_LINE>String artifactName = "";<NEW_LINE>String projectVersion = (String) props.get(KEY_PROJECT_EFFECTIVE_VERSION);<NEW_LINE>if (isNotBlank(projectVersion) && artifactFileName.contains(projectVersion)) {<NEW_LINE>artifactName = artifactFileName.substring(0, artifactFileName.indexOf(projectVersion));<NEW_LINE>if (artifactName.endsWith("-")) {<NEW_LINE>artifactName = artifactName.substring(0, artifactName.length() - 1);<NEW_LINE>}<NEW_LINE>props.put(KEY_ARTIFACT_VERSION, projectVersion);<NEW_LINE>}<NEW_LINE>projectVersion = (String) props.get(KEY_PROJECT_VERSION);<NEW_LINE>if (isBlank(artifactName) && isNotBlank(projectVersion) && artifactFileName.contains(projectVersion)) {<NEW_LINE>artifactName = artifactFileName.substring(0, artifactFileName.indexOf(projectVersion));<NEW_LINE>if (artifactName.endsWith("-")) {<NEW_LINE>artifactName = artifactName.substring(0, artifactName.length() - 1);<NEW_LINE>}<NEW_LINE>props.put(KEY_ARTIFACT_VERSION, projectVersion);<NEW_LINE>}<NEW_LINE>props.put(KEY_ARTIFACT_NAME, artifactName);<NEW_LINE>String platform = artifact.getPlatform();<NEW_LINE>if (isNotBlank(platform)) {<NEW_LINE>props.put("platform", platform);<NEW_LINE>props.put(KEY_ARTIFACT_PLATFORM, platform);<NEW_LINE>if (platform.contains("-")) {<NEW_LINE>String[] <MASK><NEW_LINE>props.put(KEY_ARTIFACT_OS, parts[0]);<NEW_LINE>props.put(KEY_ARTIFACT_ARCH, parts[1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return props;<NEW_LINE>} | parts = platform.split("-"); |
1,155,771 | public static void main(String[] args) throws IOException {<NEW_LINE>Files.createParentDirs(DATA_FILE);<NEW_LINE>ImmutableHolidayCalendar[] calendars = { generateLondon(), generateParis(), generateFrankfurt(), generateZurich(), generateEuropeanTarget(), generateUsGovtSecurities(), generateUsNewYork(), generateNewYorkFed(), generateNewYorkStockExchange(), generateTokyo(), generateSydney(), generateBrazil(), generateMontreal(), generateToronto(), generatePrague(), generateCopenhagen(), generateBudapest(), generateMexicoCity(), generateOslo(), generateAuckland(), generateWellington(), generateNewZealand(), generateWarsaw(), generateStockholm(), generateJohannesburg() };<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(DATA_FILE)) {<NEW_LINE>try (DataOutputStream out = new DataOutputStream(fos)) {<NEW_LINE>out.writeByte('H');<NEW_LINE>out.writeByte('C');<NEW_LINE>out.writeByte('a');<NEW_LINE>out.writeByte('l');<NEW_LINE><MASK><NEW_LINE>for (ImmutableHolidayCalendar cal : calendars) {<NEW_LINE>cal.writeExternal(out);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | out.writeShort(calendars.length); |
1,395,822 | static Optional<io.swagger.models.parameters.Parameter> create(springfox.documentation.service.Parameter source) {<NEW_LINE>String safeSourceParamType = ofNullable(source.getParamType()).map(String::toLowerCase).orElse("");<NEW_LINE>SerializableParameterFactory factory = SerializableParameterFactories.FACTORY_MAP.getOrDefault(safeSourceParamType, new NullSerializableParameterFactory());<NEW_LINE>SerializableParameter toReturn = factory.create(source);<NEW_LINE>if (toReturn == null) {<NEW_LINE>return empty();<NEW_LINE>}<NEW_LINE>springfox.documentation.schema.ModelReference paramModel = source.getModelRef();<NEW_LINE>toReturn.setName(source.getName());<NEW_LINE>toReturn.setDescription(source.getDescription());<NEW_LINE>toReturn.setAccess(source.getParamAccess());<NEW_LINE>toReturn.setPattern(source.getPattern());<NEW_LINE>toReturn.setRequired(source.isRequired());<NEW_LINE>toReturn.setAllowEmptyValue(source.isAllowEmptyValue());<NEW_LINE>toReturn.getVendorExtensions().putAll(VENDOR_EXTENSIONS_MAPPER.mapExtensions(source.getVendorExtentions()));<NEW_LINE>Property property = springfox.documentation.swagger2.mappers.Properties.property(paramModel.getType());<NEW_LINE>maybeAddAllowableValuesToParameter(toReturn, property, source.getAllowableValues());<NEW_LINE>if (paramModel.isCollection()) {<NEW_LINE>if (paramModel.getItemType().equals("byte")) {<NEW_LINE>toReturn.setType("string");<NEW_LINE>toReturn.setFormat("byte");<NEW_LINE>} else {<NEW_LINE>toReturn.setCollectionFormat(collectionFormat(source));<NEW_LINE>toReturn.setType("array");<NEW_LINE>springfox.documentation.schema.ModelReference paramItemModelRef = paramModel.itemModel().orElseThrow(() -> new IllegalStateException("ModelRef that is a collection should have an itemModel"));<NEW_LINE>Property itemProperty = maybeAddAllowableValues(springfox.documentation.swagger2.mappers.Properties.itemTypeProperty(paramItemModelRef), paramItemModelRef.getAllowableValues());<NEW_LINE>toReturn.setItems(itemProperty);<NEW_LINE>maybeAddAllowableValuesToParameter(toReturn, itemProperty, paramItemModelRef.getAllowableValues());<NEW_LINE>}<NEW_LINE>} else if (paramModel.isMap()) {<NEW_LINE>springfox.documentation.schema.ModelReference paramItemModelRef = paramModel.itemModel().orElseThrow(() -> new IllegalStateException("ModelRef that is a map should have an itemModel"));<NEW_LINE>Property itemProperty = new MapProperty(springfox.documentation.swagger2.mappers.Properties.itemTypeProperty(paramItemModelRef));<NEW_LINE>toReturn.setItems(itemProperty);<NEW_LINE>} else {<NEW_LINE>((AbstractSerializableParameter) toReturn).<MASK><NEW_LINE>if (source.getScalarExample() != null) {<NEW_LINE>((AbstractSerializableParameter) toReturn).setExample(String.valueOf(source.getScalarExample()));<NEW_LINE>}<NEW_LINE>toReturn.setType(property.getType());<NEW_LINE>toReturn.setFormat(property.getFormat());<NEW_LINE>}<NEW_LINE>return of(toReturn);<NEW_LINE>} | setDefaultValue(source.getDefaultValue()); |
1,290,415 | public void init(JobProfile jobConf) {<NEW_LINE>super.init(jobConf);<NEW_LINE>metricTagName = SQL_READER_TAG_NAME + "_" + inlongGroupId + "_" + inlongStreamId;<NEW_LINE>int batchSize = jobConf.getInt(JOB_DATABASE_BATCH_SIZE, DEFAULT_JOB_DATABASE_BATCH_SIZE);<NEW_LINE>String userName = jobConf.get(JOB_DATABASE_USER);<NEW_LINE>String password = jobConf.get(JOB_DATABASE_PASSWORD);<NEW_LINE>String hostName = jobConf.get(JOB_DATABASE_HOSTNAME);<NEW_LINE>int <MASK><NEW_LINE>String driverClass = jobConf.get(JOB_DATABASE_DRIVER_CLASS, DEFAULT_JOB_DATABASE_DRIVER_CLASS);<NEW_LINE>separator = jobConf.get(JOB_DATABASE_SEPARATOR, STD_FIELD_SEPARATOR_SHORT);<NEW_LINE>finished = false;<NEW_LINE>try {<NEW_LINE>String databaseType = jobConf.get(JOB_DATABASE_TYPE, MYSQL);<NEW_LINE>String url = String.format("jdbc:%s://%s:%d", databaseType, hostName, port);<NEW_LINE>conn = AgentDbUtils.getConnectionFailover(driverClass, url, userName, password);<NEW_LINE>if (databaseType.equals(MYSQL)) {<NEW_LINE>statement = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);<NEW_LINE>statement.setFetchSize(Integer.MIN_VALUE);<NEW_LINE>resultSet = statement.executeQuery(sql);<NEW_LINE>} else {<NEW_LINE>// better performance in non-mysql server<NEW_LINE>preparedStatement = conn.prepareStatement(sql);<NEW_LINE>preparedStatement.setFetchSize(batchSize);<NEW_LINE>resultSet = preparedStatement.executeQuery();<NEW_LINE>}<NEW_LINE>initColumnMeta();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOGGER.error("error create statement", ex);<NEW_LINE>destroy();<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>} | port = jobConf.getInt(JOB_DATABASE_PORT); |
1,846,356 | public byte[] serialise(final TypeSubTypeValue typeSubTypeValue) throws SerialisationException {<NEW_LINE>String type = typeSubTypeValue.getType();<NEW_LINE><MASK><NEW_LINE>String value = typeSubTypeValue.getValue();<NEW_LINE>if ((null == type || type.isEmpty()) && (null == subType || subType.isEmpty()) && (null == value || value.isEmpty())) {<NEW_LINE>throw new SerialisationException("TypeSubTypeValue passed to serialiser is blank");<NEW_LINE>}<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>if (null != type) {<NEW_LINE>try {<NEW_LINE>out.write(ByteArrayEscapeUtils.escape(type.getBytes(CommonConstants.UTF_8)));<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new SerialisationException("Failed to serialise the Type from TypeSubTypeValue Object", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.write(ByteArrayEscapeUtils.DELIMITER);<NEW_LINE>if (null != subType) {<NEW_LINE>try {<NEW_LINE>out.write(ByteArrayEscapeUtils.escape(subType.getBytes(CommonConstants.UTF_8)));<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new SerialisationException("Failed to serialise the SubType from TypeSubTypeValue Object", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.write(ByteArrayEscapeUtils.DELIMITER);<NEW_LINE>if (null != value) {<NEW_LINE>try {<NEW_LINE>out.write(ByteArrayEscapeUtils.escape(value.getBytes(CommonConstants.UTF_8)));<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new SerialisationException("Failed to serialise the Value from TypeSubTypeValue Object", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return out.toByteArray();<NEW_LINE>} | String subType = typeSubTypeValue.getSubType(); |
1,641,700 | protected void decodeSingleSelection(FacesContext context, DataTable table, Set<String> rowKeys) {<NEW_LINE>if (rowKeys.size() > 1) {<NEW_LINE>throw new IllegalArgumentException("DataTable '" + table.getClientId(context) + "' is configured for single selection while multiple rows have been selected");<NEW_LINE>}<NEW_LINE>if (rowKeys.isEmpty()) {<NEW_LINE>setSelection(context, table, false, Collections.emptyList(), Collections.emptySet());<NEW_LINE>} else {<NEW_LINE>String rowKey = rowKeys.iterator().next();<NEW_LINE>Object <MASK><NEW_LINE>if (o != null) {<NEW_LINE>Map<String, Object> requestMap = context.getExternalContext().getRequestMap();<NEW_LINE>String var = table.getVar();<NEW_LINE>List<Object> selectionTmp = Collections.emptyList();<NEW_LINE>Set<String> rowKeysTmp = Collections.emptySet();<NEW_LINE>if (isSelectable(table, var, requestMap, o)) {<NEW_LINE>selectionTmp = new ArrayList(1);<NEW_LINE>selectionTmp.add(o);<NEW_LINE>rowKeysTmp = new HashSet(1);<NEW_LINE>rowKeysTmp.add(rowKey);<NEW_LINE>}<NEW_LINE>setSelection(context, table, false, selectionTmp, rowKeysTmp);<NEW_LINE>} else {<NEW_LINE>setSelection(context, table, false, Collections.emptyList(), Collections.emptySet());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | o = table.getRowData(rowKey); |
1,753,431 | private Dependency createDependency(Dependency parentDependency, String packageName, String version) {<NEW_LINE>final Dependency dep = new Dependency(parentDependency.getActualFile(), true);<NEW_LINE>final String identifier = String.format("%s:%s", packageName, version);<NEW_LINE>dep.setEcosystem(DEPENDENCY_ECOSYSTEM);<NEW_LINE>dep.setDisplayFileName(identifier);<NEW_LINE>dep.setName(packageName);<NEW_LINE>dep.setVersion(version);<NEW_LINE>dep.setPackagePath(identifier);<NEW_LINE>dep.setMd5sum(Checksum.getMD5Checksum(identifier));<NEW_LINE>dep.setSha1sum(Checksum.getSHA1Checksum(identifier));<NEW_LINE>dep.setSha256sum<MASK><NEW_LINE>dep.addEvidence(EvidenceType.VERSION, "mix_audit", "Version", version, Confidence.HIGHEST);<NEW_LINE>dep.addEvidence(EvidenceType.PRODUCT, "mix_audit", "Package", packageName, Confidence.HIGHEST);<NEW_LINE>try {<NEW_LINE>final PackageURL purl = PackageURLBuilder.aPackageURL().withType("hex").withName(packageName).withVersion(version).build();<NEW_LINE>dep.addSoftwareIdentifier(new PurlIdentifier(purl, Confidence.HIGHEST));<NEW_LINE>} catch (MalformedPackageURLException ex) {<NEW_LINE>LOGGER.debug("Unable to build package url for hex", ex);<NEW_LINE>final GenericIdentifier id = new GenericIdentifier("hex:" + packageName + "@" + version, Confidence.HIGHEST);<NEW_LINE>dep.addSoftwareIdentifier(id);<NEW_LINE>}<NEW_LINE>return dep;<NEW_LINE>} | (Checksum.getSHA256Checksum(identifier)); |
679,188 | public void initCache() throws QueryProcessException {<NEW_LINE>BitSet cacheSet = new BitSet(aggregations.size());<NEW_LINE>try {<NEW_LINE>while (cacheSet.cardinality() < aggregations.size() && dataSet.hasNextWithoutConstraint()) {<NEW_LINE>RowRecord record = dataSet.nextWithoutConstraint();<NEW_LINE>long timestamp = record.getTimestamp();<NEW_LINE>List<Field> fields = record.getFields();<NEW_LINE>for (int i = 0; i < fields.size(); i++) {<NEW_LINE>Field <MASK><NEW_LINE>if (field == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (ascending && timestamp < startTime) {<NEW_LINE>previousTimes[i] = timestamp;<NEW_LINE>previousValues[i] = field.getObjectValue(resultDataType[i]);<NEW_LINE>} else if (!ascending && timestamp >= endTime) {<NEW_LINE>previousTimes[i] = timestamp;<NEW_LINE>previousValues[i] = field.getObjectValue(resultDataType[i]);<NEW_LINE>} else {<NEW_LINE>nextTVLists.get(i).put(timestamp, field.getObjectValue(resultDataType[i]));<NEW_LINE>cacheSet.set(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("there has an exception while init: ", e);<NEW_LINE>throw new QueryProcessException(e.getMessage());<NEW_LINE>}<NEW_LINE>} | field = fields.get(i); |
241,298 | public com.amazonaws.services.iotevents.model.LimitExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.iotevents.model.LimitExceededException limitExceededException = new com.amazonaws.services.iotevents.model.LimitExceededException(null);<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>} 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 limitExceededException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
265,169 | public AttackResult sendPasswordResetLink(@RequestParam String email, HttpServletRequest request) {<NEW_LINE>String resetLink = UUID<MASK><NEW_LINE>ResetLinkAssignment.resetLinks.add(resetLink);<NEW_LINE>String host = request.getHeader("host");<NEW_LINE>if (ResetLinkAssignment.TOM_EMAIL.equals(email) && (host.contains(webWolfPort) || host.contains(webWolfHost))) {<NEW_LINE>// User indeed changed the host header.<NEW_LINE>ResetLinkAssignment.userToTomResetLink.put(getWebSession().getUserName(), resetLink);<NEW_LINE>fakeClickingLinkEmail(host, resetLink);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>sendMailToUser(email, host, resetLink);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return failed(this).output("E-mail can't be send. please try again.").build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return success(this).feedback("email.send").feedbackArgs(email).build();<NEW_LINE>} | .randomUUID().toString(); |
1,514,259 | public void marshall(UpdateAuthorizerRequest updateAuthorizerRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateAuthorizerRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getApiId(), APIID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerCredentialsArn(), AUTHORIZERCREDENTIALSARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerId(), AUTHORIZERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerPayloadFormatVersion(), AUTHORIZERPAYLOADFORMATVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerType(), AUTHORIZERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerUri(), AUTHORIZERURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getEnableSimpleResponses(), ENABLESIMPLERESPONSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getIdentitySource(), IDENTITYSOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getIdentityValidationExpression(), IDENTITYVALIDATIONEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getJwtConfiguration(), JWTCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getName(), NAME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateAuthorizerRequest.getAuthorizerResultTtlInSeconds(), AUTHORIZERRESULTTTLINSECONDS_BINDING); |
460,239 | private void writeMap(Map map, XMLWriter w, String wp) throws IOException {<NEW_LINE>// w.writeDocType("map", null, "http://mapeditor.org/dtd/1.0/map.dtd");<NEW_LINE>w.startElement("map");<NEW_LINE>w.writeAttribute("version", "1.2");<NEW_LINE>if (!map.getTiledversion().isEmpty()) {<NEW_LINE>w.writeAttribute("tiledversion", map.getTiledversion());<NEW_LINE>}<NEW_LINE>Orientation orientation = map.getOrientation();<NEW_LINE>w.writeAttribute("orientation", orientation.value());<NEW_LINE>w.writeAttribute("renderorder", map.getRenderorder().value());<NEW_LINE>w.writeAttribute("width", map.getWidth());<NEW_LINE>w.writeAttribute("height", map.getHeight());<NEW_LINE>w.writeAttribute("tilewidth", map.getTileWidth());<NEW_LINE>w.writeAttribute("tileheight", map.getTileHeight());<NEW_LINE>w.writeAttribute("infinite", map.getInfinite());<NEW_LINE>w.writeAttribute("nextlayerid", map.getNextlayerid());<NEW_LINE>w.writeAttribute("nextobjectid", map.getNextobjectid());<NEW_LINE>switch(orientation) {<NEW_LINE>case HEXAGONAL:<NEW_LINE>w.writeAttribute("hexsidelength", map.getHexSideLength());<NEW_LINE>case STAGGERED:<NEW_LINE>w.writeAttribute("staggeraxis", map.getStaggerAxis().value());<NEW_LINE>w.writeAttribute("staggerindex", map.getStaggerIndex().value());<NEW_LINE>}<NEW_LINE>writeProperties(map.getProperties(), w);<NEW_LINE>firstGidPerTileset = new HashMap<>();<NEW_LINE>int firstgid = 1;<NEW_LINE>for (TileSet tileset : map.getTileSets()) {<NEW_LINE>setFirstGidForTileset(tileset, firstgid);<NEW_LINE><MASK><NEW_LINE>firstgid += tileset.getMaxTileId() + 1;<NEW_LINE>}<NEW_LINE>for (MapLayer layer : map.getLayers()) {<NEW_LINE>if (layer instanceof TileLayer) {<NEW_LINE>writeMapLayer((TileLayer) layer, w, wp);<NEW_LINE>} else if (layer instanceof ObjectGroup) {<NEW_LINE>writeObjectGroup((ObjectGroup) layer, w, wp);<NEW_LINE>} else if (layer instanceof Group) {<NEW_LINE>writeGroup((Group) layer, w, wp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>firstGidPerTileset = null;<NEW_LINE>w.endElement();<NEW_LINE>} | writeTilesetReference(tileset, w, wp); |
388,764 | public void onMessageReceived(RemoteMessage message) {<NEW_LINE><MASK><NEW_LINE>AppLog.v(T.NOTIFS, "Received Message");<NEW_LINE>if (data == null) {<NEW_LINE>AppLog.v(T.NOTIFS, "No notification message content received. Aborting.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!mAccountStore.hasAccessToken()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (PUSH_TYPE_ZENDESK.equals(String.valueOf(data.get("type")))) {<NEW_LINE>String zendeskRequestId = String.valueOf(data.get(PUSH_ARG_ZENDESK_REQUEST_ID));<NEW_LINE>// Try to refresh the Zendesk request page if it's currently being displayed; otherwise show a notification<NEW_LINE>if (!mZendeskHelper.refreshRequest(this, zendeskRequestId)) {<NEW_LINE>mGCMMessageHandler.handleZendeskNotification(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronizedHandleDefaultPush(data);<NEW_LINE>} | Map data = message.getData(); |
1,741,514 | public GetFunctionCodeSigningConfigResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetFunctionCodeSigningConfigResult getFunctionCodeSigningConfigResult = new GetFunctionCodeSigningConfigResult();<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 getFunctionCodeSigningConfigResult;<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("CodeSigningConfigArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getFunctionCodeSigningConfigResult.setCodeSigningConfigArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("FunctionName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getFunctionCodeSigningConfigResult.setFunctionName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getFunctionCodeSigningConfigResult;<NEW_LINE>} | class).unmarshall(context)); |
427,081 | private void initializeClient() {<NEW_LINE>if (mConfiguration.getClientId() != null) {<NEW_LINE>Log.i(TAG, "Using static client ID: " + mConfiguration.getClientId());<NEW_LINE>// use a statically configured client ID<NEW_LINE>mClientId.set(mConfiguration.getClientId());<NEW_LINE>runOnUiThread(this::initializeAuthRequest);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RegistrationResponse lastResponse = mAuthStateManager.getCurrent().getLastRegistrationResponse();<NEW_LINE>if (lastResponse != null) {<NEW_LINE>Log.i(<MASK><NEW_LINE>// already dynamically registered a client ID<NEW_LINE>mClientId.set(lastResponse.clientId);<NEW_LINE>runOnUiThread(this::initializeAuthRequest);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// WrongThread inference is incorrect for lambdas<NEW_LINE>// noinspection WrongThread<NEW_LINE>runOnUiThread(() -> displayLoading("Dynamically registering client"));<NEW_LINE>Log.i(TAG, "Dynamically registering client");<NEW_LINE>RegistrationRequest registrationRequest = new RegistrationRequest.Builder(mAuthStateManager.getCurrent().getAuthorizationServiceConfiguration(), Collections.singletonList(mConfiguration.getRedirectUri())).setTokenEndpointAuthenticationMethod(ClientSecretBasic.NAME).build();<NEW_LINE>mAuthService.performRegistrationRequest(registrationRequest, this::handleRegistrationResponse);<NEW_LINE>} | TAG, "Using dynamic client ID: " + lastResponse.clientId); |
793,362 | public static boolean readXml(File xmlFile, List<Path> pathList) throws IllegalStateException {<NEW_LINE>boolean result = false;<NEW_LINE>InputStreamReader reader = null;<NEW_LINE>try {<NEW_LINE>// !PW FIXME what to do about entity resolvers? Timed out when<NEW_LINE>// looking up doctype for sun-resources.xml earlier today (Jul 10)<NEW_LINE>SAXParserFactory factory = SAXParserFactory.newInstance();<NEW_LINE>// !PW If namespace-aware is enabled, make sure localpart and<NEW_LINE>// qname are treated correctly in the handler code.<NEW_LINE>//<NEW_LINE>factory.setNamespaceAware(false);<NEW_LINE><MASK><NEW_LINE>DefaultHandler handler = new TreeParser(pathList);<NEW_LINE>reader = new FileReader(xmlFile);<NEW_LINE>InputSource source = new InputSource(reader);<NEW_LINE>saxParser.parse(source, handler);<NEW_LINE>result = true;<NEW_LINE>} catch (ParserConfigurationException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>} catch (SAXException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>} finally {<NEW_LINE>if (reader != null) {<NEW_LINE>try {<NEW_LINE>reader.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.log(Level.INFO, ex.getLocalizedMessage(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | SAXParser saxParser = factory.newSAXParser(); |
867,116 | private void loadNode446() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Writable, new QualifiedName(0, "Writable"), new LocalizedText("en", "Writable"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Boolean, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Writable, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Writable, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Writable, Identifiers.HasProperty, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList<MASK><NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), false)); |
1,439,483 | public static void renderOrder(Graphics2D g2, @Nullable Point2Transform2_F32 transform, double scale, List<PointIndex2D_F64> points) {<NEW_LINE>g2.setStroke(new BasicStroke(5));<NEW_LINE>Point2D_F32 adj0 = new Point2D_F32();<NEW_LINE>Point2D_F32 adj1 = new Point2D_F32();<NEW_LINE>Line2D.Double l = new Line2D.Double();<NEW_LINE>for (int i = 0, j = 1; j < points.size(); i = j, j++) {<NEW_LINE>double fraction = i / ((double) points.size() - 2);<NEW_LINE>// fraction = fraction * 0.8 + 0.1;<NEW_LINE>int red = (int) (0xFF * fraction) + (int) (0x00 * (1 - fraction));<NEW_LINE>int green = 0x00;<NEW_LINE>int blue = (int) (0x00 * fraction) + (int) (0xff * (1 - fraction));<NEW_LINE>int lineRGB = red << 16 | green << 8 | blue;<NEW_LINE>Point2D_F64 p0 = points.get(i).p;<NEW_LINE>Point2D_F64 p1 = points.get(j).p;<NEW_LINE>if (transform == null) {<NEW_LINE>l.setLine(scale * p0.x, scale * p0.y, scale * p1.x, scale * p1.y);<NEW_LINE>} else {<NEW_LINE>transform.compute((float) p0.x, (<MASK><NEW_LINE>transform.compute((float) p1.x, (float) p1.y, adj1);<NEW_LINE>l.setLine(scale * adj0.x, scale * adj0.y, scale * adj1.x, scale * adj1.y);<NEW_LINE>}<NEW_LINE>g2.setColor(new Color(lineRGB));<NEW_LINE>g2.draw(l);<NEW_LINE>}<NEW_LINE>} | float) p0.y, adj0); |
1,417,090 | public static ArrayList<double[]> forecast(int predictNum, double[] stdErrors, double[] estResidual, double[] arCoef, double[] maCoef, double intercept, double variance, double[][] diffData, int d, boolean isMean) {<NEW_LINE>double[] prediction = new double[predictNum];<NEW_LINE>if (isMean) {<NEW_LINE>Arrays.fill(prediction, TsMethod.<MASK><NEW_LINE>} else {<NEW_LINE>ArrayList<double[]> result = ArmaModel.forecast(predictNum, diffData[0], estResidual, arCoef, maCoef, intercept, variance);<NEW_LINE>double[][] predictions = new double[d + 1][predictNum];<NEW_LINE>predictions[d] = result.get(0);<NEW_LINE>for (int i = d - 1; i >= 0; i--) {<NEW_LINE>predictions[i] = TsMethod.diffReduction(diffData[i], predictions[i + 1]);<NEW_LINE>}<NEW_LINE>prediction = predictions[0];<NEW_LINE>}<NEW_LINE>double[] lower = new double[predictNum];<NEW_LINE>double[] upper = new double[predictNum];<NEW_LINE>for (int i = 0; i < predictNum; i++) {<NEW_LINE>lower[i] = prediction[i] - 1.96 * stdErrors[i];<NEW_LINE>upper[i] = prediction[i] + 1.96 * stdErrors[i];<NEW_LINE>}<NEW_LINE>ArrayList<double[]> out = new ArrayList<>();<NEW_LINE>out.add(prediction);<NEW_LINE>out.add(stdErrors);<NEW_LINE>out.add(lower);<NEW_LINE>out.add(upper);<NEW_LINE>return out;<NEW_LINE>} | mean(diffData[0])); |
870,336 | protected void updateAllMatchesWithStart(TrieMap<K, V> trie, List<Match<K, V>> matches, List<K> matched, List<K> list, int start, int end) {<NEW_LINE>if (start > end)<NEW_LINE>return;<NEW_LINE>if (trie.children != null && start < end) {<NEW_LINE>K key = list.get(start);<NEW_LINE>TrieMap<K, V> child = trie.children.get(key);<NEW_LINE>if (child != null) {<NEW_LINE>List<K> p = new ArrayList<>(matched.size() + 1);<NEW_LINE>p.addAll(matched);<NEW_LINE>p.add(key);<NEW_LINE>updateAllMatchesWithStart(child, matches, p, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (trie.isLeaf()) {<NEW_LINE>matches.add(new Match<>(matched, trie.value, start - matched.size(), start));<NEW_LINE>}<NEW_LINE>} | list, start + 1, end); |
778,810 | // </editor-fold>//GEN-END:initComponents<NEW_LINE>private void selectButtonActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_selectButtonActionPerformed<NEW_LINE>int returnVal = localFileChooser.showOpenDialog(this);<NEW_LINE>if (returnVal == JFileChooser.APPROVE_OPTION) {<NEW_LINE>File[] files = localFileChooser.getSelectedFiles();<NEW_LINE>StringBuilder allPaths = new StringBuilder();<NEW_LINE>for (File f : files) {<NEW_LINE>currentFiles.add(f);<NEW_LINE>}<NEW_LINE>for (File f : currentFiles) {<NEW_LINE>// loop over set of all files to ensure list is accurate<NEW_LINE>// update label<NEW_LINE>allPaths.append(f.getAbsolutePath()).append("\n");<NEW_LINE>}<NEW_LINE>this.selectedPaths.setText(allPaths.toString());<NEW_LINE>this.selectedPaths.setToolTipText(allPaths.toString());<NEW_LINE>}<NEW_LINE>enableNext = !currentFiles.isEmpty();<NEW_LINE>try {<NEW_LINE>firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, "LocalFilesPanel listener threw exception", e);<NEW_LINE>MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "LocalFilesPanel.moduleErr"), NbBundle.getMessage(this.getClass(), "LocalFilesPanel.moduleErr.msg"<MASK><NEW_LINE>}<NEW_LINE>} | ), MessageNotifyUtil.MessageType.ERROR); |
330,334 | public void addVertical(String typeCast, boolean divide) {<NEW_LINE>String typeOutput = imageOut.getSingleBandName();<NEW_LINE>String dataOutput = imageOut.getDataType();<NEW_LINE>String divideHeader = divide ? ", int divisor" : "";<NEW_LINE><MASK><NEW_LINE>String divideHalf = divide ? "\t\tfinal int halfDivisor = divisor/2;\n" : "";<NEW_LINE>out.print("\tpublic static void vertical(Kernel1D_" + typeKernel + " kernel, " + typeInput + " input, " + typeOutput + " output " + divideHeader + ") {\n" + "\t\tfinal " + dataOutput + "[] dataDst = output.data;\n" + "\t\tfinal " + dataKernel + "[] dataKer = kernel.data;\n" + "\n" + "\t\tfinal int offset = kernel.getOffset();\n" + "\t\tfinal int kernelWidth = kernel.getWidth();\n" + "\t\tfinal int width = output.getWidth();\n" + "\t\tfinal int height = output.getHeight();\n" + "\t\tfinal int borderBottom = kernelWidth-offset-1;\n" + divideHalf + "\n" + "\t\tfor ( int x = 0; x < width; x++ ) {\n" + "\t\t\tint indexDest = output.startIndex + x;\n" + "\n" + "\t\t\tfor (int y = 0; y < offset; y++, indexDest += output.stride) {\n" + "\t\t\t\t" + sumType + " total = 0;\n" + "\t\t\t\tfor (int k = 0; k < kernelWidth; k++) {\n" + "\t\t\t\t\ttotal += input.get(x,y+k-offset) * dataKer[k];\n" + "\t\t\t\t}\n" + "\t\t\t\tdataDst[indexDest] = " + typeCast + "" + strTotal + ";\n" + "\t\t\t}\n" + "\n" + "\t\t\tindexDest = output.startIndex + (height-borderBottom) * output.stride + x;\n" + "\t\t\tfor (int y = height-borderBottom; y < height; y++, indexDest += output.stride) {\n" + "\t\t\t\t" + sumType + " total = 0;\n" + "\t\t\t\tfor (int k = 0; k < kernelWidth; k++ ) {\n" + "\t\t\t\t\ttotal += input.get(x,y+k-offset) * dataKer[k];\n" + "\t\t\t\t}\n" + "\t\t\t\tdataDst[indexDest] = " + typeCast + "" + strTotal + ";\n" + "\t\t\t}\n" + "\t\t}\n" + "\t}\n\n");<NEW_LINE>} | String strTotal = divide ? "((total+halfDivisor)/divisor)" : "total"; |
105,372 | public ResourceDownloadOwnerSetting unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ResourceDownloadOwnerSetting resourceDownloadOwnerSetting = new ResourceDownloadOwnerSetting();<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("GroupOwner", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceDownloadOwnerSetting.setGroupOwner(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("GroupPermission", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceDownloadOwnerSetting.setGroupPermission(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resourceDownloadOwnerSetting;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
535,731 | public com.amazonaws.services.servicediscovery.model.RequestLimitExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.servicediscovery.model.RequestLimitExceededException requestLimitExceededException = new com.amazonaws.services.<MASK><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>} 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 requestLimitExceededException;<NEW_LINE>} | servicediscovery.model.RequestLimitExceededException(null); |
302,011 | public void uploadFromUrlWithResponse() throws NoSuchAlgorithmException {<NEW_LINE>// BEGIN: com.azure.storage.blob.specialized.BlockBlobClient.uploadFromUrlWithResponse#BlobUploadFromUrlOptions-Duration-Context<NEW_LINE>BlobHttpHeaders headers = new BlobHttpHeaders().setContentMd5("data".getBytes(StandardCharsets.UTF_8)).setContentLanguage("en-US").setContentType("binary");<NEW_LINE>Map<String, String> metadata = Collections.singletonMap("metadata", "value");<NEW_LINE>Map<String, String> tags = <MASK><NEW_LINE>byte[] md5 = MessageDigest.getInstance("MD5").digest("data".getBytes(StandardCharsets.UTF_8));<NEW_LINE>BlobRequestConditions requestConditions = new BlobRequestConditions().setLeaseId(leaseId).setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));<NEW_LINE>Context context = new Context("key", "value");<NEW_LINE>System.out.printf("Uploaded BlockBlob MD5 is %s%n", Base64.getEncoder().encodeToString(client.uploadFromUrlWithResponse(new BlobUploadFromUrlOptions(sourceUrl).setHeaders(headers).setTags(tags).setTier(AccessTier.HOT).setContentMd5(md5).setDestinationRequestConditions(requestConditions), timeout, context).getValue().getContentMd5()));<NEW_LINE>// END: com.azure.storage.blob.specialized.BlockBlobClient.uploadFromUrlWithResponse#BlobUploadFromUrlOptions-Duration-Context<NEW_LINE>} | Collections.singletonMap("tag", "value"); |
90,402 | public void marshall(DetectorModelConfiguration detectorModelConfiguration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (detectorModelConfiguration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(detectorModelConfiguration.getDetectorModelName(), DETECTORMODELNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(detectorModelConfiguration.getDetectorModelVersion(), DETECTORMODELVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(detectorModelConfiguration.getDetectorModelDescription(), DETECTORMODELDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(detectorModelConfiguration.getDetectorModelArn(), DETECTORMODELARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(detectorModelConfiguration.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(detectorModelConfiguration.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(detectorModelConfiguration.getLastUpdateTime(), LASTUPDATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(detectorModelConfiguration.getKey(), KEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(detectorModelConfiguration.getEvaluationMethod(), EVALUATIONMETHOD_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | detectorModelConfiguration.getStatus(), STATUS_BINDING); |
992,046 | public final void mREGEX(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {<NEW_LINE>int _ttype;<NEW_LINE>Token _token = null;<NEW_LINE><MASK><NEW_LINE>_ttype = REGEX;<NEW_LINE>int _saveIndex;<NEW_LINE>char delimiter = '\0';<NEW_LINE>char end = '\0';<NEW_LINE>if (((LA(1) == '/') && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe')) && (true)) && (!expectOperator(2))) {<NEW_LINE>delimiter = LA(1);<NEW_LINE>_saveIndex = text.length();<NEW_LINE>match('/');<NEW_LINE>text.setLength(_saveIndex);<NEW_LINE>{<NEW_LINE>_loop506: do {<NEW_LINE>if ((((LA(1) >= '\u0000' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) && (LA(1) != delimiter && !expressionSubstitutionIsNext())) {<NEW_LINE>mSTRING_CHAR(false);<NEW_LINE>} else {<NEW_LINE>break _loop506;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>}<NEW_LINE>end = LA(1);<NEW_LINE>_saveIndex = text.length();<NEW_LINE>matchNot(EOF_CHAR);<NEW_LINE>text.setLength(_saveIndex);<NEW_LINE>if (end != delimiter) {<NEW_LINE>_ttype = REGEX_BEFORE_EXPRESSION_SUBSTITUTION;<NEW_LINE>setCurrentSpecialStringDelimiter(delimiter, 1);<NEW_LINE>} else {<NEW_LINE>text.append("/");<NEW_LINE>mREGEX_MODIFIER(true);<NEW_LINE>}<NEW_LINE>} else if ((LA(1) == '/') && (LA(2) == '=') && (true)) {<NEW_LINE>match("/=");<NEW_LINE>_ttype = DIV_ASSIGN;<NEW_LINE>} else if ((LA(1) == '/') && (true)) {<NEW_LINE>match('/');<NEW_LINE>_ttype = DIV;<NEW_LINE>} else {<NEW_LINE>throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());<NEW_LINE>}<NEW_LINE>if (_createToken && _token == null && _ttype != Token.SKIP) {<NEW_LINE>_token = makeToken(_ttype);<NEW_LINE>_token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));<NEW_LINE>}<NEW_LINE>_returnToken = _token;<NEW_LINE>} | int _begin = text.length(); |
1,113,342 | protected void initialize() {<NEW_LINE>StringBuilder result = new StringBuilder(100);<NEW_LINE>String tmp;<NEW_LINE>int i = getMiosId();<NEW_LINE>String id = ((i == 0) ? "" : String.valueOf(i));<NEW_LINE>String stuff = getMiosStuff();<NEW_LINE>String unit = getUnitName();<NEW_LINE>// Normalize the Default MiOS Unit name, so it doesn't appear in the<NEW_LINE>// property String.<NEW_LINE>unit = (unit == null) ? "" : "unit:" + unit + ',';<NEW_LINE>if (stuff != null) {<NEW_LINE>result.append(unit).append(getMiosType()).append(':').append(id).append('/').append(stuff);<NEW_LINE>} else {<NEW_LINE>result.append(unit).append(getMiosType()).append(':').append(id);<NEW_LINE>}<NEW_LINE>cachedProperty = result.toString();<NEW_LINE>tmp = getCommandTransform();<NEW_LINE>if (tmp != null) {<NEW_LINE>result.append(",command:").append(tmp);<NEW_LINE>}<NEW_LINE>tmp = getInTransform();<NEW_LINE>if (tmp != null) {<NEW_LINE>result.append<MASK><NEW_LINE>}<NEW_LINE>tmp = getOutTransform();<NEW_LINE>if (tmp != null) {<NEW_LINE>result.append(",out:").append(tmp);<NEW_LINE>}<NEW_LINE>cachedBinding = result.toString();<NEW_LINE>} | (",in:").append(tmp); |
878,161 | final CreateServiceActionResult executeCreateServiceAction(CreateServiceActionRequest createServiceActionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createServiceActionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateServiceActionRequest> request = null;<NEW_LINE>Response<CreateServiceActionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateServiceActionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createServiceActionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateServiceAction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateServiceActionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateServiceActionResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint); |
1,350,473 | public static byte[] calculateMasterSecretSSL3(byte[] preMasterSecret, byte[] random) {<NEW_LINE>Digest md5 = TlsUtils.createHash(HashAlgorithm.md5);<NEW_LINE>Digest sha1 = TlsUtils.createHash(HashAlgorithm.sha1);<NEW_LINE>int md5Size = md5.getDigestSize();<NEW_LINE>byte[] shaTmp = new <MASK><NEW_LINE>byte[] rval = new byte[md5Size * 3];<NEW_LINE>int pos = 0;<NEW_LINE>for (int i = 0; i < 3; ++i) {<NEW_LINE>byte[] ssl3Const = SSL3_CONST[i];<NEW_LINE>sha1.update(ssl3Const, 0, ssl3Const.length);<NEW_LINE>sha1.update(preMasterSecret, 0, preMasterSecret.length);<NEW_LINE>sha1.update(random, 0, random.length);<NEW_LINE>sha1.doFinal(shaTmp, 0);<NEW_LINE>md5.update(preMasterSecret, 0, preMasterSecret.length);<NEW_LINE>md5.update(shaTmp, 0, shaTmp.length);<NEW_LINE>md5.doFinal(rval, pos);<NEW_LINE>pos += md5Size;<NEW_LINE>}<NEW_LINE>return rval;<NEW_LINE>} | byte[sha1.getDigestSize()]; |
1,456,944 | public void requestAd(final ReadableArguments additionalRequestParams, final Promise promise) {<NEW_LINE>new Handler(Looper.getMainLooper()).post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (mRewardedAd != null) {<NEW_LINE>promise.reject("E_AD_ALREADY_LOADED", "Ad is already loaded.", null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mRequestAdPromise = promise;<NEW_LINE>String testDeviceID = AdMobModule.getTestDeviceID();<NEW_LINE>@Nullable<NEW_LINE>List<String> testDevicesIds = testDeviceID == null ? null : new ArrayList<>(Collections.singletonList(testDeviceID));<NEW_LINE>RequestConfiguration requestConfiguration = new RequestConfiguration.Builder().setTestDeviceIds(testDevicesIds).build();<NEW_LINE>MobileAds.setRequestConfiguration(requestConfiguration);<NEW_LINE>AdRequest adRequest = new AdRequest.Builder().addNetworkExtrasBundle(AdMobAdapter.class, additionalRequestParams.toBundle()).build();<NEW_LINE>mRewardedAd = new RewardedAd(mActivityProvider.getCurrentActivity(), mAdUnitID);<NEW_LINE>mRewardedAd.loadAd(adRequest, new RewardedAdLoadCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRewardedAdLoaded() {<NEW_LINE>sendEvent(Event.DID_LOAD);<NEW_LINE>mRequestAdPromise.resolve(null);<NEW_LINE>mRequestAdPromise = null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRewardedAdFailedToLoad(LoadAdError loadAdError) {<NEW_LINE>sendEvent(Event.DID_FAIL_TO_LOAD<MASK><NEW_LINE>mRewardedAd = null;<NEW_LINE>mRequestAdPromise.reject("E_AD_REQUEST_FAILED", loadAdError.getMessage());<NEW_LINE>mRequestAdPromise = null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | , AdMobUtils.createEventForAdFailedToLoad(loadAdError)); |
1,617,333 | private void detectCandidateFeatures(T image, double sigma) {<NEW_LINE>// adjust corner intensity threshold based upon the current scale factor<NEW_LINE>float scaleThreshold = (float) (baseThreshold / Math.pow(sigma, scalePower));<NEW_LINE>detector.setThreshold(scaleThreshold);<NEW_LINE>computeDerivative.setInput(image);<NEW_LINE>D derivX = null, derivY = null;<NEW_LINE>D derivXX = null, derivYY = null, derivXY = null;<NEW_LINE>if (detector.getRequiresGradient()) {<NEW_LINE>derivX = computeDerivative.getDerivative(true);<NEW_LINE>derivY = computeDerivative.getDerivative(false);<NEW_LINE>}<NEW_LINE>if (detector.getRequiresHessian()) {<NEW_LINE>derivXX = computeDerivative.getDerivative(true, true);<NEW_LINE>derivYY = computeDerivative.getDerivative(false, false);<NEW_LINE>derivXY = computeDerivative.getDerivative(true, false);<NEW_LINE>}<NEW_LINE>detector.process(image, derivX, derivY, derivXX, derivYY, derivXY);<NEW_LINE>intensities[spaceIndex].reshape(image.width, image.height);<NEW_LINE>intensities[spaceIndex].setTo(detector.getIntensity());<NEW_LINE>List<<MASK><NEW_LINE>m.clear();<NEW_LINE>QueueCorner q = detector.getMaximums();<NEW_LINE>for (int i = 0; i < q.size; i++) {<NEW_LINE>m.add(q.get(i).copy());<NEW_LINE>}<NEW_LINE>spaceIndex++;<NEW_LINE>if (spaceIndex >= 3)<NEW_LINE>spaceIndex = 0;<NEW_LINE>} | Point2D_I16> m = maximums[spaceIndex]; |
539,665 | private Node delete(Node node, String key, int digit) {<NEW_LINE>if (node == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (digit == key.length() - 1) {<NEW_LINE>node.size = node.size - 1;<NEW_LINE>node.value = null;<NEW_LINE>} else {<NEW_LINE>char nextChar = key.charAt(digit);<NEW_LINE>if (nextChar < node.character) {<NEW_LINE>node.left = delete(node.left, key, digit);<NEW_LINE>} else if (nextChar > node.character) {<NEW_LINE>node.right = delete(node.right, key, digit);<NEW_LINE>} else {<NEW_LINE>node.size = node.size - 1;<NEW_LINE>node.middle = delete(node.middle, key, digit + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (node.size == 0) {<NEW_LINE>if (node.left == null && node.right == null) {<NEW_LINE>return null;<NEW_LINE>} else if (node.left == null) {<NEW_LINE>return node.right;<NEW_LINE>} else if (node.right == null) {<NEW_LINE>return node.left;<NEW_LINE>} else {<NEW_LINE>Node aux = node;<NEW_LINE>node = min(aux.right);<NEW_LINE>node.<MASK><NEW_LINE>node.left = aux.left;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>} | right = deleteMin(aux.right); |
253,670 | public boolean addResult(AbstractionAtSink resultAbs) {<NEW_LINE>// Check whether we need to filter a result in a system package<NEW_LINE>if (manager.getConfig().getIgnoreFlowsInSystemPackages() && SystemClassHandler.v().isClassInSystemPackage(manager.getICFG().getMethodOf(resultAbs.getSinkStmt()).getDeclaringClass().getName()))<NEW_LINE>return true;<NEW_LINE>// Construct the abstraction at the sink<NEW_LINE>Abstraction abs = resultAbs.getAbstraction();<NEW_LINE>abs = abs.deriveNewAbstraction(abs.getAccessPath(), resultAbs.getSinkStmt());<NEW_LINE>abs.setCorrespondingCallSite(resultAbs.getSinkStmt());<NEW_LINE>// Reduce the incoming abstraction<NEW_LINE>IMemoryManager<Abstraction, Unit> memoryManager = manager.getForwardSolver().getMemoryManager();<NEW_LINE>if (memoryManager != null) {<NEW_LINE>abs = memoryManager.handleMemoryObject(abs);<NEW_LINE>if (abs == null)<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Record the result<NEW_LINE>resultAbs = new AbstractionAtSink(resultAbs.getSinkDefinition(), abs, resultAbs.getSinkStmt());<NEW_LINE>Abstraction newAbs = this.results.putIfAbsentElseGet(<MASK><NEW_LINE>if (newAbs != resultAbs.getAbstraction())<NEW_LINE>newAbs.addNeighbor(resultAbs.getAbstraction());<NEW_LINE>// Notify the handlers<NEW_LINE>boolean continueAnalysis = true;<NEW_LINE>for (OnTaintPropagationResultAdded handler : resultAddedHandlers) if (!handler.onResultAvailable(resultAbs))<NEW_LINE>continueAnalysis = false;<NEW_LINE>return continueAnalysis;<NEW_LINE>} | resultAbs, resultAbs.getAbstraction()); |
633,075 | void createJNITrampoline(RegisterValue threadArg, int threadIsolateOffset, RegisterValue methodIdArg, int methodObjEntryPointOffset) {<NEW_LINE>builder.setFunctionAttribute(Attribute.Naked);<NEW_LINE>LLVMBasicBlockRef block = builder.appendBasicBlock("main");<NEW_LINE>builder.positionAtEnd(block);<NEW_LINE>long startPatchpointId = LLVMGenerator.nextPatchpointId.getAndIncrement();<NEW_LINE>builder.buildStackmap(builder.constantLong(startPatchpointId));<NEW_LINE>compilationResult.recordInfopoint(NumUtil.safeToInt(startPatchpointId), null, InfopointReason.METHOD_START);<NEW_LINE>LLVMValueRef jumpAddressAddress;<NEW_LINE>if (SubstrateOptions.SpawnIsolates.getValue()) {<NEW_LINE>LLVMValueRef thread = buildInlineGetRegister(threadArg.getRegister().name);<NEW_LINE>LLVMValueRef heapBaseAddress = builder.buildGEP(builder.buildIntToPtr(thread, builder.rawPointerType()), builder.constantInt(threadIsolateOffset));<NEW_LINE>LLVMValueRef heapBase = builder.buildLoad(heapBaseAddress, builder.rawPointerType());<NEW_LINE>LLVMValueRef methodId = buildInlineGetRegister(methodIdArg.getRegister().name);<NEW_LINE>LLVMValueRef methodBase = builder.buildGEP(builder.buildIntToPtr(heapBase, builder.rawPointerType()), builder.buildPtrToInt(methodId));<NEW_LINE>jumpAddressAddress = builder.buildGEP(methodBase<MASK><NEW_LINE>} else {<NEW_LINE>LLVMValueRef methodBase = buildInlineGetRegister(methodIdArg.getRegister().name);<NEW_LINE>jumpAddressAddress = builder.buildGEP(builder.buildIntToPtr(methodBase, builder.rawPointerType()), builder.constantInt(methodObjEntryPointOffset));<NEW_LINE>}<NEW_LINE>LLVMValueRef jumpAddress = builder.buildLoad(jumpAddressAddress, builder.rawPointerType());<NEW_LINE>buildInlineJump(jumpAddress);<NEW_LINE>builder.buildUnreachable();<NEW_LINE>} | , builder.constantInt(methodObjEntryPointOffset)); |
1,746,314 | protected void consumeEnumConstantHeaderName() {<NEW_LINE>if (this.currentElement != null) {<NEW_LINE>if (!(this.currentElement instanceof RecoveredType || (this.currentElement instanceof RecoveredField && ((RecoveredField) this.currentElement).fieldDeclaration.type == null)) || (this.lastIgnoredToken == TokenNameDOT)) {<NEW_LINE>this.lastCheckPoint = this.scanner.startPosition;<NEW_LINE>this.restartRecovery = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long namePosition = this.identifierPositionStack[this.identifierPtr];<NEW_LINE>char[] constantName = this.identifierStack[this.identifierPtr];<NEW_LINE>final int sourceEnd = (int) namePosition;<NEW_LINE>FieldDeclaration enumConstant = createFieldDeclaration(constantName, (int) (namePosition <MASK><NEW_LINE>this.identifierPtr--;<NEW_LINE>this.identifierLengthPtr--;<NEW_LINE>enumConstant.modifiersSourceStart = this.intStack[this.intPtr--];<NEW_LINE>enumConstant.modifiers = this.intStack[this.intPtr--];<NEW_LINE>enumConstant.declarationSourceStart = enumConstant.modifiersSourceStart;<NEW_LINE>// consume annotations<NEW_LINE>int length;<NEW_LINE>if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {<NEW_LINE>System.arraycopy(this.expressionStack, (this.expressionPtr -= length) + 1, enumConstant.annotations = new Annotation[length], 0, length);<NEW_LINE>enumConstant.bits |= ASTNode.HasTypeAnnotations;<NEW_LINE>}<NEW_LINE>pushOnAstStack(enumConstant);<NEW_LINE>if (this.currentElement != null) {<NEW_LINE>this.lastCheckPoint = enumConstant.sourceEnd + 1;<NEW_LINE>this.currentElement = this.currentElement.add(enumConstant, 0);<NEW_LINE>}<NEW_LINE>// javadoc<NEW_LINE>enumConstant.javadoc = this.javadoc;<NEW_LINE>this.javadoc = null;<NEW_LINE>} | >>> 32), sourceEnd); |
884,413 | public int hashElement(Object key, int fieldTypeIdx) {<NEW_LINE>switch(fieldTypes[fieldTypeIdx]) {<NEW_LINE>case BOOLEAN:<NEW_LINE>return key == null ? 0 : ((Boolean) key).booleanValue() ? 1231 : 1237;<NEW_LINE>case BYTES:<NEW_LINE>return key == null ? 0 : Arrays.hashCode((byte[]) key);<NEW_LINE>case DOUBLE:<NEW_LINE>long dVal = Double.doubleToRawLongBits(((Double) key).doubleValue());<NEW_LINE>return (int) (dVal ^ (dVal >>> 32));<NEW_LINE>case FLOAT:<NEW_LINE>return Float.floatToRawIntBits(((Float<MASK><NEW_LINE>case LONG:<NEW_LINE>long lVal = ((Long) key).longValue();<NEW_LINE>return (int) (lVal ^ (lVal >>> 32));<NEW_LINE>case INT:<NEW_LINE>return ((Integer) key).intValue();<NEW_LINE>case REFERENCE:<NEW_LINE>return ((Integer) key).intValue();<NEW_LINE>case STRING:<NEW_LINE>return key.hashCode();<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown field type: " + fieldTypes[fieldTypeIdx]);<NEW_LINE>}<NEW_LINE>} | ) key).floatValue()); |
480,282 | private static List<ServerInfo> parseServerInfos(List<?> rawServerConfigs, XdsLogger logger) throws XdsInitializationException {<NEW_LINE>logger.log(XdsLogLevel.INFO, "Configured with {0} xDS servers", rawServerConfigs.size());<NEW_LINE>ImmutableList.Builder<ServerInfo> servers = ImmutableList.builder();<NEW_LINE>List<Map<String, ?>> serverConfigList = JsonUtil.checkObjectList(rawServerConfigs);<NEW_LINE>for (Map<String, ?> serverConfig : serverConfigList) {<NEW_LINE>String serverUri = JsonUtil.getString(serverConfig, "server_uri");<NEW_LINE>if (serverUri == null) {<NEW_LINE>throw new XdsInitializationException("Invalid bootstrap: missing 'server_uri'");<NEW_LINE>}<NEW_LINE>logger.log(<MASK><NEW_LINE>List<?> rawChannelCredsList = JsonUtil.getList(serverConfig, "channel_creds");<NEW_LINE>if (rawChannelCredsList == null || rawChannelCredsList.isEmpty()) {<NEW_LINE>throw new XdsInitializationException("Invalid bootstrap: server " + serverUri + " 'channel_creds' required");<NEW_LINE>}<NEW_LINE>ChannelCredentials channelCredentials = parseChannelCredentials(JsonUtil.checkObjectList(rawChannelCredsList), serverUri);<NEW_LINE>if (channelCredentials == null) {<NEW_LINE>throw new XdsInitializationException("Server " + serverUri + ": no supported channel credentials found");<NEW_LINE>}<NEW_LINE>boolean useProtocolV3 = false;<NEW_LINE>List<String> serverFeatures = JsonUtil.getListOfStrings(serverConfig, "server_features");<NEW_LINE>if (serverFeatures != null) {<NEW_LINE>logger.log(XdsLogLevel.INFO, "Server features: {0}", serverFeatures);<NEW_LINE>useProtocolV3 = serverFeatures.contains(XDS_V3_SERVER_FEATURE);<NEW_LINE>}<NEW_LINE>servers.add(ServerInfo.create(serverUri, channelCredentials, useProtocolV3));<NEW_LINE>}<NEW_LINE>return servers.build();<NEW_LINE>} | XdsLogLevel.INFO, "xDS server URI: {0}", serverUri); |
505,243 | private static Map<String, MycatNodeConfig> loadNode(Element root, int port) {<NEW_LINE>Map<String, MycatNodeConfig> nodes = new <MASK><NEW_LINE>NodeList list = root.getElementsByTagName("node");<NEW_LINE>Set<String> hostSet = new HashSet<String>();<NEW_LINE>for (int i = 0, n = list.getLength(); i < n; i++) {<NEW_LINE>Node node = list.item(i);<NEW_LINE>if (node instanceof Element) {<NEW_LINE>Element element = (Element) node;<NEW_LINE>String name = element.getAttribute("name").trim();<NEW_LINE>if (nodes.containsKey(name)) {<NEW_LINE>throw new ConfigException("node name duplicated :" + name);<NEW_LINE>}<NEW_LINE>Map<String, Object> props = ConfigUtil.loadElements(element);<NEW_LINE>String host = (String) props.get("host");<NEW_LINE>if (null == host || "".equals(host)) {<NEW_LINE>throw new ConfigException("host empty in node: " + name);<NEW_LINE>}<NEW_LINE>if (hostSet.contains(host)) {<NEW_LINE>throw new ConfigException("node host duplicated :" + host);<NEW_LINE>}<NEW_LINE>String wei = (String) props.get("weight");<NEW_LINE>if (null == wei || "".equals(wei)) {<NEW_LINE>throw new ConfigException("weight should not be null in host:" + host);<NEW_LINE>}<NEW_LINE>int weight = Integer.parseInt(wei);<NEW_LINE>if (weight <= 0) {<NEW_LINE>throw new ConfigException("weight should be > 0 in host:" + host + " weight:" + weight);<NEW_LINE>}<NEW_LINE>MycatNodeConfig conf = new MycatNodeConfig(name, host, port, weight);<NEW_LINE>nodes.put(name, conf);<NEW_LINE>hostSet.add(host);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return nodes;<NEW_LINE>} | HashMap<String, MycatNodeConfig>(); |
937,281 | private Map<String, TravelArticle> readTravelArticles(SQLiteConnection conn, String whereCondition, List<String> articleIds) {<NEW_LINE>SQLiteCursor cursor;<NEW_LINE>StringBuilder bld = new StringBuilder();<NEW_LINE>bld.append(ARTICLES_TABLE_SELECT).append(whereCondition).append(" and ").append(ARTICLES_COL_TRIP_ID).append(" IN (");<NEW_LINE>for (int i = 0; i < articleIds.size(); i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>bld.append(", ");<NEW_LINE>}<NEW_LINE>bld.append(articleIds.get(i));<NEW_LINE>}<NEW_LINE>bld.append(")");<NEW_LINE>cursor = conn.rawQuery(bld.toString(), null);<NEW_LINE>Map<String, TravelArticle> ts = new <MASK><NEW_LINE>if (cursor != null) {<NEW_LINE>if (cursor.moveToFirst()) {<NEW_LINE>do {<NEW_LINE>TravelArticle travelArticle = readArticle(cursor);<NEW_LINE>ts.put(travelArticle.routeId, travelArticle);<NEW_LINE>} while (cursor.moveToNext());<NEW_LINE>}<NEW_LINE>cursor.close();<NEW_LINE>}<NEW_LINE>return ts;<NEW_LINE>} | HashMap<String, TravelArticle>(); |
1,072,970 | public VirtualGatewayListenerTlsSdsCertificate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>VirtualGatewayListenerTlsSdsCertificate virtualGatewayListenerTlsSdsCertificate = new VirtualGatewayListenerTlsSdsCertificate();<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("secretName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>virtualGatewayListenerTlsSdsCertificate.setSecretName(context.getUnmarshaller(String.<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 virtualGatewayListenerTlsSdsCertificate;<NEW_LINE>} | class).unmarshall(context)); |
363,052 | public <Req, Resp> StreamingClientCall<Req, Resp> newStreamingCall(final MethodDescriptor<Req, Resp> methodDescriptor, final BufferDecoderGroup decompressors) {<NEW_LINE>GrpcStreamingSerializer<Req> serializerIdentity = streamingSerializer(methodDescriptor);<NEW_LINE>GrpcStreamingDeserializer<Resp> deserializerIdentity = streamingDeserializer(methodDescriptor);<NEW_LINE>List<GrpcStreamingDeserializer<Resp>> deserializers = streamingDeserializers(methodDescriptor, decompressors.decoders());<NEW_LINE><MASK><NEW_LINE>CharSequence requestContentType = grpcContentType(methodDescriptor.requestDescriptor().serializerDescriptor().contentType());<NEW_LINE>CharSequence responseContentType = grpcContentType(methodDescriptor.responseDescriptor().serializerDescriptor().contentType());<NEW_LINE>return (metadata, request) -> {<NEW_LINE>Duration timeout = timeoutForRequest(metadata.timeout());<NEW_LINE>GrpcStreamingSerializer<Req> serializer = streamingSerializer(methodDescriptor, serializerIdentity, metadata.requestCompressor());<NEW_LINE>String mdPath = methodDescriptor.httpPath();<NEW_LINE>StreamingHttpRequest httpRequest = streamingHttpClient.post(UNKNOWN_PATH.equals(mdPath) ? metadata.path() : mdPath);<NEW_LINE>initRequest(httpRequest, requestContentType, serializer.messageEncoding(), acceptedEncoding, timeout);<NEW_LINE>httpRequest.payloadBody(serializer.serialize(request, streamingHttpClient.executionContext().bufferAllocator()));<NEW_LINE>assignStrategy(httpRequest, metadata);<NEW_LINE>return streamingHttpClient.request(httpRequest).flatMapPublisher(response -> validateResponseAndGetPayload(response, responseContentType, streamingHttpClient.executionContext().bufferAllocator(), readGrpcMessageEncodingRaw(response.headers(), deserializerIdentity, deserializers, GrpcStreamingDeserializer::messageEncoding))).onErrorMap(GrpcUtils::toGrpcException);<NEW_LINE>};<NEW_LINE>} | CharSequence acceptedEncoding = decompressors.advertisedMessageEncoding(); |
1,425,004 | final GetTagsResult executeGetTags(GetTagsRequest getTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTagsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetTagsRequest> request = null;<NEW_LINE>Response<GetTagsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTagsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTagsRequest));<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, "Cost Explorer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTags");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetTagsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTagsResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,404,965 | public Set instantiate() throws IOException {<NEW_LINE>Set result = new HashSet();<NEW_LINE>String displayName = (String) wizard.getProperty(PROP_DISPLAY_NAME);<NEW_LINE>WildflyPluginUtils.Version version = WildflyPluginUtils.getServerVersion(new File(installLocation));<NEW_LINE>String url = WildflyDeploymentFactory.URI_PREFIX;<NEW_LINE>if (version != null && "7".equals(version.getMajorNumber())) {<NEW_LINE>// NOI18N<NEW_LINE>url += "//" + host + ":" + port + "?targetType=as7";<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>url += host + ":" + port;<NEW_LINE>}<NEW_LINE>if (// NOI18N<NEW_LINE>server != null && !server.equals(""))<NEW_LINE>// NOI18N<NEW_LINE>url += "#" + server;<NEW_LINE>// NOI18N<NEW_LINE>url += "&" + installLocation;<NEW_LINE>try {<NEW_LINE>Map<String, String> initialProperties = new <MASK><NEW_LINE>initialProperties.put(WildflyPluginProperties.PROPERTY_SERVER, server);<NEW_LINE>initialProperties.put(WildflyPluginProperties.PROPERTY_DEPLOY_DIR, deployDir);<NEW_LINE>initialProperties.put(WildflyPluginProperties.PROPERTY_SERVER_DIR, serverPath);<NEW_LINE>initialProperties.put(WildflyPluginProperties.PROPERTY_ROOT_DIR, installLocation);<NEW_LINE>initialProperties.put(WildflyPluginProperties.PROPERTY_HOST, host);<NEW_LINE>initialProperties.put(WildflyPluginProperties.PROPERTY_PORT, port);<NEW_LINE>initialProperties.put(WildflyPluginProperties.PROPERTY_CONFIG_FILE, configFile);<NEW_LINE>initialProperties.put(WildflyPluginProperties.PROPERTY_ADMIN_PORT, adminPort);<NEW_LINE>initialProperties.put(WildflyPluginProperties.PROPERTY_JAVA_OPTS, WILDFLY_JAVA_OPTS);<NEW_LINE>InstanceProperties ip = InstanceProperties.createInstanceProperties(url, userName, password, displayName, initialProperties);<NEW_LINE>result.add(ip);<NEW_LINE>} catch (InstanceCreationException e) {<NEW_LINE>// NOI18N<NEW_LINE>showInformation(e.getLocalizedMessage(), NbBundle.getMessage(AddServerPropertiesVisualPanel.class, "MSG_INSTANCE_REGISTRATION_FAILED"));<NEW_LINE>Logger.getLogger("global").log(Level.SEVERE, e.getMessage());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | HashMap<String, String>(); |
1,378,502 | protected Statement withBeforeClasses(final Statement statement) {<NEW_LINE>ByteBuddyAgent.install();<NEW_LINE>Collection<String> classes = Sets.newHashSet(ENHANCEMENT_CLASSES);<NEW_LINE>byteBuddyAgent = new AgentBuilder.Default().with(new ByteBuddy().with(TypeValidation.ENABLED)).type(ElementMatchers.namedOneOf(ENHANCEMENT_CLASSES)).transform((builder, typeDescription, classLoader, module) -> {<NEW_LINE>if (classes.contains(typeDescription.getTypeName())) {<NEW_LINE>return builder.defineField(EXTRA_DATA, Object.class, Opcodes.ACC_PRIVATE | Opcodes.ACC_VOLATILE).implement(AdviceTargetObject.class).intercept(FieldAccessor.ofField(EXTRA_DATA));<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}).installOnByteBuddyAgent();<NEW_LINE>// load them into current classloader<NEW_LINE>classes.forEach(className -> {<NEW_LINE>try {<NEW_LINE>Class<?> <MASK><NEW_LINE>} catch (final ClassNotFoundException ignored) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return super.withBeforeClasses(statement);<NEW_LINE>} | klass = Class.forName(className); |
1,064,047 | public TransitGatewayMulticastDomainOptions unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>TransitGatewayMulticastDomainOptions transitGatewayMulticastDomainOptions = new TransitGatewayMulticastDomainOptions();<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 transitGatewayMulticastDomainOptions;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("igmpv2Support", targetDepth)) {<NEW_LINE>transitGatewayMulticastDomainOptions.setIgmpv2Support(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("staticSourcesSupport", targetDepth)) {<NEW_LINE>transitGatewayMulticastDomainOptions.setStaticSourcesSupport(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("autoAcceptSharedAssociations", targetDepth)) {<NEW_LINE>transitGatewayMulticastDomainOptions.setAutoAcceptSharedAssociations(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return transitGatewayMulticastDomainOptions;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
60,694 | public void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, int index, String... urlPatterns) throws IllegalStateException, IllegalArgumentException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "addMappingForUrlPatterns", "isMatchAfter -> " + isMatchAfter + " index -> " + index);<NEW_LINE>}<NEW_LINE>if (urlPatterns == null) {<NEW_LINE>throw new IllegalArgumentException(nls.getString("add.filter.mapping.to.null.url.patterns"));<NEW_LINE>} else if (urlPatterns.length == 0) {<NEW_LINE>throw new IllegalArgumentException(nls.getString("add.filter.mapping.to.empty.url.patterns"));<NEW_LINE>}<NEW_LINE>if (this.context != null && this.context.isInitialized()) {<NEW_LINE>throw new IllegalStateException(nls.getString("Not.in.servletContextCreated"));<NEW_LINE>}<NEW_LINE>if (this.urlPatternMappings == null) {<NEW_LINE>this.urlPatternMappings = new ArrayList<String>();<NEW_LINE>}<NEW_LINE>for (String urlPattern : urlPatterns) {<NEW_LINE>this.urlPatternMappings.add(urlPattern);<NEW_LINE>IFilterMapping fmapping = new FilterMapping(urlPattern, this, null);<NEW_LINE>if (dispatcherTypes != null) {<NEW_LINE>// will default to REQUEST<NEW_LINE>DispatcherType[] dispatcherType = {};<NEW_LINE>fmapping.setDispatchMode(dispatcherTypes.toArray(dispatcherType));<NEW_LINE>}<NEW_LINE>if (isMatchAfter) {<NEW_LINE>if (index < 0) {<NEW_LINE>this.webAppConfig.getFilterMappings().add(fmapping);<NEW_LINE>} else {<NEW_LINE>this.webAppConfig.getFilterMappings().add(index, fmapping);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int previous = this.webAppConfig.getLastIndexBeforeDeclaredFilters();<NEW_LINE>this.webAppConfig.getFilterMappings(<MASK><NEW_LINE>this.webAppConfig.setLastIndexBeforeDeclaredFilters(++previous);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "addMappingForUrlPatterns", "isMatchAfter -> " + isMatchAfter + " index -> " + index);<NEW_LINE>}<NEW_LINE>} | ).add(previous, fmapping); |
110,460 | final UpdateMultiplexProgramResult executeUpdateMultiplexProgram(UpdateMultiplexProgramRequest updateMultiplexProgramRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateMultiplexProgramRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateMultiplexProgramRequest> request = null;<NEW_LINE>Response<UpdateMultiplexProgramResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateMultiplexProgramRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateMultiplexProgramRequest));<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, "MediaLive");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateMultiplexProgram");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateMultiplexProgramResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateMultiplexProgramResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,517,583 | final DescribeAutoScalingNotificationTypesResult executeDescribeAutoScalingNotificationTypes(DescribeAutoScalingNotificationTypesRequest describeAutoScalingNotificationTypesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAutoScalingNotificationTypesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAutoScalingNotificationTypesRequest> request = null;<NEW_LINE>Response<DescribeAutoScalingNotificationTypesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAutoScalingNotificationTypesRequestMarshaller().marshall(super.beforeMarshalling(describeAutoScalingNotificationTypesRequest));<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, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAutoScalingNotificationTypes");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeAutoScalingNotificationTypesResult> responseHandler = new StaxResponseHandler<DescribeAutoScalingNotificationTypesResult>(new DescribeAutoScalingNotificationTypesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
183,687 | protected void updateNetbeansActionMapping(NetbeansActionMapping value, String xmlTag, Counter counter, Element element) {<NEW_LINE>Element root = element;<NEW_LINE>Counter innerCount = new Counter(<MASK><NEW_LINE>findAndReplaceSimpleElement(innerCount, root, "actionName", value.getActionName(), null);<NEW_LINE>findAndReplaceSimpleElement(innerCount, root, "displayName", value.getDisplayName(), null);<NEW_LINE>findAndReplaceSimpleElement(innerCount, root, "basedir", value.getBasedir(), null);<NEW_LINE>findAndReplaceSimpleElement(innerCount, root, "reactor", value.getReactor(), null);<NEW_LINE>findAndReplaceSimpleElement(innerCount, root, "preAction", value.getPreAction(), null);<NEW_LINE>findAndReplaceSimpleElement(innerCount, root, "recursive", value.isRecursive() == true ? null : String.valueOf(value.isRecursive()), "true");<NEW_LINE>findAndReplaceSimpleLists(innerCount, root, value.getPackagings(), "packagings", "packaging");<NEW_LINE>findAndReplaceSimpleLists(innerCount, root, value.getGoals(), "goals", "goal");<NEW_LINE>findAndReplaceProperties(innerCount, root, "properties", value.getProperties());<NEW_LINE>findAndReplaceSimpleLists(innerCount, root, value.getActivatedProfiles(), "activatedProfiles", "activatedProfile");<NEW_LINE>} | counter.getDepth() + 1); |
1,512,911 | final Object doOverloadedUncached(OverloadedMethod method, Object obj, Object[] args, HostContext hostContext, @Shared("toHost") @Cached HostToTypeNode toJavaNode, @Shared("toGuest") @Cached ToGuestValueNode toGuest, @Shared("varArgsProfile") @Cached ConditionProfile isVarArgsProfile, @Shared("hostMethodProfile") @Cached HostMethodProfileNode methodProfile, @Shared("errorBranch") @Cached BranchProfile errorBranch, @Shared("seenScope") @Cached BranchProfile seenScope, @Shared("cache") @Cached(value = "hostContext.getGuestToHostCache()", allowUncached = true) GuestToHostCodeCache cache) throws ArityException, UnsupportedTypeException {<NEW_LINE>SingleMethod overload = selectOverload(method, args, hostContext);<NEW_LINE>Object[] convertedArguments;<NEW_LINE>HostMethodScope scope = HostMethodScope.openDynamic(overload, args.length, seenScope);<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>convertedArguments = prepareArgumentsUncached(overload, args, hostContext, toJavaNode, scope, isVarArgsProfile);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>errorBranch.enter();<NEW_LINE>if (cache.language.access.isEngineException(e)) {<NEW_LINE>throw HostInteropErrors.unsupportedTypeException(args, cache.language.access.unboxEngineException(e));<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return doInvoke(methodProfile.execute(overload), obj, <MASK><NEW_LINE>} finally {<NEW_LINE>HostMethodScope.closeDynamic(scope, overload);<NEW_LINE>}<NEW_LINE>} | convertedArguments, cache, hostContext, toGuest); |
145,251 | private void addJAXWSServiceMapBinding(ProfileServiceMapMgr smgr, String appid, String className, Map<String, Object> classInfo) {<NEW_LINE>Collection<String> classPaths = new ArrayList<String>();<NEW_LINE>String classPath = null;<NEW_LINE>if (classInfo.containsKey("dyn")) {<NEW_LINE>Map<String, Object> classDynInfo = (Map<String, Object>) classInfo.get("dyn");<NEW_LINE>classPath = (String) classDynInfo.get("url");<NEW_LINE>if (StringHelper.isEmpty(classPath)) {<NEW_LINE>String[] serviceImplClsInfo = className.split("\\.");<NEW_LINE>classPath = serviceImplClsInfo[<MASK><NEW_LINE>}<NEW_LINE>} else if (classInfo.containsKey("des")) {<NEW_LINE>Map<String, Object> classDesInfo = (Map<String, Object>) classInfo.get("des");<NEW_LINE>classPath = (String) classDesInfo.get("address");<NEW_LINE>if (classPath == null) {<NEW_LINE>classPath = (String) classDesInfo.get("url-pattern");<NEW_LINE>}<NEW_LINE>} else if (classInfo.containsKey("anno")) {<NEW_LINE>Map<String, Object> classAnnoInfo = (Map<String, Object>) classInfo.get("anno");<NEW_LINE>Map<String, Object> annoWebService = (Map<String, Object>) classAnnoInfo.get("javax.jws.WebService");<NEW_LINE>if (null != annoWebService) {<NEW_LINE>classPath = (String) annoWebService.get("serviceName");<NEW_LINE>}<NEW_LINE>if (StringHelper.isEmpty(classPath)) {<NEW_LINE>String[] serviceImplClsInfo = className.split("\\.");<NEW_LINE>classPath = serviceImplClsInfo[serviceImplClsInfo.length - 1] + "Service";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>classPaths.add(formatRelativePath(classPath, false));<NEW_LINE>smgr.addServiceMapBinding(appid, className, null, classPaths, 0);<NEW_LINE>} | serviceImplClsInfo.length - 1] + "Service"; |
443,179 | public Contentlet translateContent(Contentlet src, Language translateTo, List<Field> fieldsToTranslate, User user) throws TranslationException {<NEW_LINE>Preconditions.checkNotNull(src, "Unable to translate null content.");<NEW_LINE>Preconditions.checkNotNull(fieldsToTranslate, "List of fields to translate can't be null");<NEW_LINE>Preconditions.checkArgument(!fieldsToTranslate.isEmpty(), "List of fields to translate can't be empty");<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>List<Field> filteredFields = // exclude fileAsset name from translation<NEW_LINE>fieldsToTranslate.stream().filter(// exclude null field values from translation<NEW_LINE>f -> !(srcSt.isFileAsset() && f.getVelocityVarName().equals("fileName"))).filter(f -> src.getStringProperty(f.getVelocityVarName()) != null).collect(Collectors.toList());<NEW_LINE>List<String> valuesToTranslate = filteredFields.stream().map(f -> src.getStringProperty(f.getVelocityVarName())).collect(Collectors.toList());<NEW_LINE>Language translateFrom = apiProvider.languageAPI().getLanguage(src.getLanguageId());<NEW_LINE>List<String> translatedValues = translateStrings(valuesToTranslate, translateFrom, translateTo);<NEW_LINE>Contentlet translated = apiProvider.contentletAPI().checkout(src.getInode(), user, false);<NEW_LINE>translated.setLanguageId(translateTo.getId());<NEW_LINE>int i = 0;<NEW_LINE>for (Field field : filteredFields) {<NEW_LINE>translated.setStringProperty(field.getVelocityVarName(), translatedValues.get(i));<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return translated;<NEW_LINE>} catch (DotContentletStateException | DotDataException | DotSecurityException e) {<NEW_LINE>throw new TranslationException("Error translating content", e);<NEW_LINE>}<NEW_LINE>} | Structure srcSt = src.getStructure(); |
1,517,227 | final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SecurityHub");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource"); |
767,028 | public void updateLookups(Node[] arr) {<NEW_LINE>if (arr == null) {<NEW_LINE>AbstractLookup.Content c = new AbstractLookup.Content();<NEW_LINE>AbstractLookup l = new AbstractLookup(c);<NEW_LINE>c.addPair(new NoNodesPair());<NEW_LINE>setLookups(new Lookup[] { l, actionMap });<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Lookup[] lookups = new Lookup[arr.length];<NEW_LINE>Map<Lookup, Lookup.Result> copy;<NEW_LINE>synchronized (this) {<NEW_LINE>if (attachedTo == null) {<NEW_LINE>copy = Collections.emptyMap();<NEW_LINE>} else {<NEW_LINE>copy = new HashMap<Lookup, Lookup.Result>(attachedTo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < arr.length; i++) {<NEW_LINE>lookups[i] = arr[i].getLookup();<NEW_LINE>if (copy != null) {<NEW_LINE>// node arr[i] remains there, so do not remove it<NEW_LINE>copy<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Iterator<Lookup.Result> it = copy.values().iterator(); it.hasNext(); ) {<NEW_LINE>Lookup.Result res = it.next();<NEW_LINE>res.removeLookupListener(listener);<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>attachedTo = null;<NEW_LINE>}<NEW_LINE>setLookups(new Lookup[] { new NoNodeLookup(new ProxyLookup(lookups), arr), Lookups.fixed((Object[]) arr), actionMap });<NEW_LINE>} | .remove(arr[i]); |
1,754,711 | public static GsonBuilder createGson() {<NEW_LINE>GsonFireBuilder fireBuilder = new GsonFireBuilder().registerTypeSelector(ThrottlePolicyDTO.class, new TypeSelector() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Class getClassForElement(JsonElement readElement) {<NEW_LINE>Map<String, Class> classByDiscriminatorValue = new <MASK><NEW_LINE>classByDiscriminatorValue.put("AdvancedThrottlePolicyInfo", AdvancedThrottlePolicyInfoDTO.class);<NEW_LINE>classByDiscriminatorValue.put("AdvancedThrottlePolicy", AdvancedThrottlePolicyDTO.class);<NEW_LINE>classByDiscriminatorValue.put("ApplicationThrottlePolicy", ApplicationThrottlePolicyDTO.class);<NEW_LINE>classByDiscriminatorValue.put("SubscriptionThrottlePolicy", SubscriptionThrottlePolicyDTO.class);<NEW_LINE>classByDiscriminatorValue.put("CustomRule", CustomRuleDTO.class);<NEW_LINE>classByDiscriminatorValue.put("ThrottlePolicy", ThrottlePolicyDTO.class);<NEW_LINE>return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "type"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>GsonBuilder builder = fireBuilder.createGsonBuilder();<NEW_LINE>return builder;<NEW_LINE>} | HashMap<String, Class>(); |
813,795 | private static SunWebApp createWebApp(DDParse parse) throws DDException {<NEW_LINE>SunWebApp webRoot = null;<NEW_LINE>String version = parse.getVersion();<NEW_LINE>if (SunWebApp.VERSION_3_0_1.equals(version)) {<NEW_LINE>return new org.netbeans.modules.j2ee.sun.dd.impl.web.model_3_0_1.GlassFishWebApp(parse.getDocument(), Common.NO_DEFAULT_VALUES);<NEW_LINE>} else if (SunWebApp.VERSION_3_0_0.equals(version)) {<NEW_LINE>return new org.netbeans.modules.j2ee.sun.dd.impl.web.model_3_0_0.SunWebApp(parse.getDocument(), Common.NO_DEFAULT_VALUES);<NEW_LINE>} else if (SunWebApp.VERSION_2_5_0.equals(version)) {<NEW_LINE>return new org.netbeans.modules.j2ee.sun.dd.impl.web.model_2_5_0.SunWebApp(parse.<MASK><NEW_LINE>} else if (SunWebApp.VERSION_2_4_1.equals(version)) {<NEW_LINE>return new org.netbeans.modules.j2ee.sun.dd.impl.web.model_2_4_1.SunWebApp(parse.getDocument(), Common.NO_DEFAULT_VALUES);<NEW_LINE>} else if (SunWebApp.VERSION_2_4_0.equals(version)) {<NEW_LINE>// ludo fix that!!!2_4_0 below<NEW_LINE>return new org.netbeans.modules.j2ee.sun.dd.impl.web.model_2_4_0.SunWebApp(parse.getDocument(), Common.NO_DEFAULT_VALUES);<NEW_LINE>} else if (SunWebApp.VERSION_2_3_0.equals(version)) {<NEW_LINE>return new org.netbeans.modules.j2ee.sun.dd.impl.web.model_2_3_0.SunWebApp(parse.getDocument(), Common.NO_DEFAULT_VALUES);<NEW_LINE>} else {<NEW_LINE>throw new DDException(MessageFormat.format(ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/dd/api/Bundle").getString("MSG_UnknownWebXml"), new Object[] { version }));<NEW_LINE>}<NEW_LINE>} | getDocument(), Common.NO_DEFAULT_VALUES); |
1,118,818 | public void onPlaceAutomaticallyClick(View v) {<NEW_LINE>if (mRequest.getRequestType() == PinItemRequest.REQUEST_TYPE_SHORTCUT) {<NEW_LINE><MASK><NEW_LINE>ItemInstallQueue.INSTANCE.get(this).queueItem(shortcutInfo);<NEW_LINE>logCommand(LAUNCHER_ADD_EXTERNAL_ITEM_PLACED_AUTOMATICALLY);<NEW_LINE>mRequest.accept();<NEW_LINE>CharSequence label = shortcutInfo.getLongLabel();<NEW_LINE>if (TextUtils.isEmpty(label)) {<NEW_LINE>label = shortcutInfo.getShortLabel();<NEW_LINE>}<NEW_LINE>sendWidgetAddedToScreenAccessibilityEvent(label.toString());<NEW_LINE>mSlideInView.close(/* animate= */<NEW_LINE>true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mPendingBindWidgetId = mAppWidgetHost.allocateAppWidgetId();<NEW_LINE>AppWidgetProviderInfo widgetProviderInfo = mRequest.getAppWidgetProviderInfo(this);<NEW_LINE>boolean success = mAppWidgetManager.bindAppWidgetIdIfAllowed(mPendingBindWidgetId, widgetProviderInfo, mWidgetOptions);<NEW_LINE>if (success) {<NEW_LINE>sendWidgetAddedToScreenAccessibilityEvent(widgetProviderInfo.label);<NEW_LINE>acceptWidget(mPendingBindWidgetId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// request bind widget<NEW_LINE>mAppWidgetHost.startBindFlow(this, mPendingBindWidgetId, mRequest.getAppWidgetProviderInfo(this), REQUEST_BIND_APPWIDGET);<NEW_LINE>} | ShortcutInfo shortcutInfo = mRequest.getShortcutInfo(); |
1,419,867 | static int isSimpleOGC(/* const */<NEW_LINE>Geometry geometry, /* const */<NEW_LINE>SpatialReference spatialReference, boolean bForce, NonSimpleResult result, ProgressTracker progressTracker) {<NEW_LINE>if (result != null) {<NEW_LINE>result.m_reason = NonSimpleResult.Reason.NotDetermined;<NEW_LINE>result.m_vertexIndex1 = -1;<NEW_LINE>result.m_vertexIndex2 = -1;<NEW_LINE>}<NEW_LINE>if (geometry.isEmpty())<NEW_LINE>return 1;<NEW_LINE>Geometry.<MASK><NEW_LINE>if (gt == Geometry.Type.Point)<NEW_LINE>return 1;<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(spatialReference, geometry, false);<NEW_LINE>if (gt == Geometry.Type.Envelope) {<NEW_LINE>Segment seg = (Segment) geometry;<NEW_LINE>Polyline polyline = new Polyline(seg.getDescription());<NEW_LINE>polyline.addSegment(seg, true);<NEW_LINE>return isSimpleAsFeature(polyline, spatialReference, bForce, result, progressTracker);<NEW_LINE>}<NEW_LINE>int knownSimpleResult = -1;<NEW_LINE>OperatorSimplifyLocalHelper helper = new OperatorSimplifyLocalHelper(geometry, spatialReference, knownSimpleResult, progressTracker, true);<NEW_LINE>if (gt == Geometry.Type.MultiPoint || gt == Geometry.Type.Polyline || gt == Geometry.Type.Polygon) {<NEW_LINE>knownSimpleResult = helper.isSimplePlanarImpl_();<NEW_LINE>} else {<NEW_LINE>// what else?<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>}<NEW_LINE>if (result != null)<NEW_LINE>result.Assign(helper.m_nonSimpleResult);<NEW_LINE>return knownSimpleResult;<NEW_LINE>} | Type gt = geometry.getType(); |
1,716,471 | public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {<NEW_LINE>if (!p.isExpectedStartArrayToken()) {<NEW_LINE>return ctxt.handleUnexpectedToken(EthSubscribeParams.class, p.currentToken(), p, "eth_subscribe parameters are expected to be arrays");<NEW_LINE>}<NEW_LINE>// skip '['<NEW_LINE>p.nextToken();<NEW_LINE><MASK><NEW_LINE>Class<? extends EthSubscribeParams> subscriptionTypeClass = subscriptionTypes.get(subscriptionType);<NEW_LINE>p.nextToken();<NEW_LINE>EthSubscribeParams params;<NEW_LINE>if (p.isExpectedStartObjectToken()) {<NEW_LINE>params = p.readValueAs(subscriptionTypeClass);<NEW_LINE>p.nextToken();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>params = subscriptionTypeClass.newInstance();<NEW_LINE>} catch (InstantiationException | IllegalAccessException e) {<NEW_LINE>return ctxt.handleInstantiationProblem(subscriptionTypeClass, null, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (p.currentToken() != JsonToken.END_ARRAY) {<NEW_LINE>return ctxt.handleUnexpectedToken(EthSubscribeParams.class, p.currentToken(), p, "eth_subscribe can only have one object to configure subscription");<NEW_LINE>}<NEW_LINE>return params;<NEW_LINE>} | String subscriptionType = p.getText(); |
1,198,348 | // closeIt<NEW_LINE>@Override<NEW_LINE>public boolean reverseCorrectIt() {<NEW_LINE>// Before reverseCorrect<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_REVERSECORRECT);<NEW_LINE>if (m_processMsg != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());<NEW_LINE>if (!MPeriod.isOpen(getCtx(), getMovementDate(), dt.getDocBaseType(), getAD_Org_ID())) {<NEW_LINE>m_processMsg = "@PeriodClosed@";<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Deep Copy<NEW_LINE>final MMovement reversal = new MMovement(getCtx(<MASK><NEW_LINE>copyValues(this, reversal, getAD_Client_ID(), getAD_Org_ID());<NEW_LINE>reversal.setDocStatus(DOCSTATUS_Drafted);<NEW_LINE>reversal.setDocAction(DOCACTION_Complete);<NEW_LINE>reversal.setIsApproved(false);<NEW_LINE>reversal.setIsInTransit(false);<NEW_LINE>reversal.setPosted(false);<NEW_LINE>reversal.setProcessed(false);<NEW_LINE>reversal.addDescription("{->" + getDocumentNo() + ")");<NEW_LINE>// FR [ 1948157 ]<NEW_LINE>reversal.setReversal(this);<NEW_LINE>InterfaceWrapperHelper.save(reversal);<NEW_LINE>// Reverse Line Qty<NEW_LINE>final MMovementLine[] oLines = getLines(true);<NEW_LINE>for (MMovementLine oLine : oLines) {<NEW_LINE>MMovementLine rLine = new MMovementLine(getCtx(), 0, get_TrxName());<NEW_LINE>copyValues(oLine, rLine, oLine.getAD_Client_ID(), oLine.getAD_Org_ID());<NEW_LINE>rLine.setM_Movement_ID(reversal.getM_Movement_ID());<NEW_LINE>// AZ Goodwill<NEW_LINE>// store original (voided/reversed) document line<NEW_LINE>rLine.setReversalLine_ID(oLine.getM_MovementLine_ID());<NEW_LINE>//<NEW_LINE>rLine.setMovementQty(rLine.getMovementQty().negate());<NEW_LINE>rLine.setTargetQty(BigDecimal.ZERO);<NEW_LINE>rLine.setScrappedQty(BigDecimal.ZERO);<NEW_LINE>rLine.setConfirmedQty(BigDecimal.ZERO);<NEW_LINE>rLine.setProcessed(false);<NEW_LINE>if (!rLine.save()) {<NEW_LINE>m_processMsg = "Could not create Movement Reversal Line";<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (!reversal.processIt(IDocument.ACTION_Complete)) {<NEW_LINE>m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>reversal.closeIt();<NEW_LINE>reversal.setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>reversal.setDocAction(DOCACTION_None);<NEW_LINE>InterfaceWrapperHelper.save(reversal);<NEW_LINE>m_processMsg = reversal.getDocumentNo();<NEW_LINE>// After reverseCorrect<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_REVERSECORRECT);<NEW_LINE>if (m_processMsg != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Update Reversed (this)<NEW_LINE>addDescription("(" + reversal.getDocumentNo() + "<-)");<NEW_LINE>// FR [ 1948157 ]<NEW_LINE>setReversal(reversal);<NEW_LINE>setProcessed(true);<NEW_LINE>// may come from void<NEW_LINE>setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>return true;<NEW_LINE>} | ), 0, get_TrxName()); |
1,823,182 | private BufferedImage watermarkImage(InputStream in) throws IOException {<NEW_LINE>final BufferedImage img = ImageIO.read(in);<NEW_LINE>if (img == null || img.getWidth() < 5 || img.getHeight() < 5) {<NEW_LINE>// no op<NEW_LINE>return img;<NEW_LINE>}<NEW_LINE>final Graphics2D g = (Graphics2D) img.getGraphics();<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>// Draw watermark image<NEW_LINE>BufferedImage watermark;<NEW_LINE>if (img.getHeight() >= img.getWidth()) {<NEW_LINE>watermark = resizeWatermark(application.quarkusIco(), 0, img.<MASK><NEW_LINE>} else {<NEW_LINE>watermark = resizeWatermark(application.quarkusIco(), img.getHeight() / 3, 0, 0.5f);<NEW_LINE>}<NEW_LINE>img.getGraphics().drawImage(watermark, img.getWidth() - watermark.getWidth(), img.getHeight() - watermark.getHeight(), null);<NEW_LINE>// Draw watermark text<NEW_LINE>final int wCenter = img.getWidth() / 2;<NEW_LINE>final int hCenter = img.getHeight();<NEW_LINE>final AffineTransform originalMatrix = g.getTransform();<NEW_LINE>final AffineTransform af = AffineTransform.getRotateInstance(Math.toRadians(4), wCenter, hCenter);<NEW_LINE>g.setColor(Color.PINK);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);<NEW_LINE>g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));<NEW_LINE>// Name of the font is not just the name of the file. It is baked in it.<NEW_LINE>// The size is hardcoded for brevity, some proportional scaling<NEW_LINE>// with getFontMetrics and getStringBounds might be in order.<NEW_LINE>g.setFont(new Font("MyFreeMono", Font.PLAIN, 30));<NEW_LINE>g.drawString("Mandrel", 20, 22);<NEW_LINE>g.transform(af);<NEW_LINE>g.setFont(new Font("MyFreeSerif", Font.PLAIN, 30));<NEW_LINE>g.drawString("Mandrel", 20, 72);<NEW_LINE>g.transform(af);<NEW_LINE>g.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 30));<NEW_LINE>g.drawString("Mandrel", 20, 122);<NEW_LINE>g.setTransform(originalMatrix);<NEW_LINE>g.dispose();<NEW_LINE>return img;<NEW_LINE>} | getWidth() / 3, 0.5f); |
191,905 | public void destroyObject(PooledObject<CassandraClient> client) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Attempting to close transport for client {} of host {}", UnsafeArg.of("client", client), SafeArg.of("cassandraClient", CassandraLogHelper.host(addr)));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>TaskContext<Void> taskContext = TaskContext.createRunnable(() -> client.getObject().close(), () -> {<NEW_LINE>});<NEW_LINE>timedRunner.run(taskContext);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Failed to close transport for client {} of host {}", UnsafeArg.of("client", client), SafeArg.of("cassandraClient", CassandraLogHelper.host(addr)), t);<NEW_LINE>}<NEW_LINE>throw new SafeRuntimeException("Threw while attempting to close transport for client", t);<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Closed transport for client {} of host {}", UnsafeArg.of("client", client), SafeArg.of("cassandraClient", <MASK><NEW_LINE>}<NEW_LINE>} | CassandraLogHelper.host(addr))); |
461,328 | public void layoutContainer(Container parent) {<NEW_LINE>int leftWidth = 0;<NEW_LINE>int rightWidth = 0;<NEW_LINE>JComponent jParent = (JComponent) parent;<NEW_LINE>JComponent left = (JComponent) jParent.getClientProperty(LightToolWindow.LEFT_MIN_KEY);<NEW_LINE>if (left != null) {<NEW_LINE>leftWidth = LightToolWindow.MINIMIZE_WIDTH;<NEW_LINE>}<NEW_LINE>JComponent right = (JComponent) jParent.getClientProperty(LightToolWindow.RIGHT_MIN_KEY);<NEW_LINE>if (right != null) {<NEW_LINE>rightWidth = LightToolWindow.MINIMIZE_WIDTH;<NEW_LINE>}<NEW_LINE>int extraWidth = leftWidth + rightWidth;<NEW_LINE>int width = parent.getWidth() - extraWidth;<NEW_LINE>int height = parent.getHeight();<NEW_LINE>Component toolbar = parent.getComponent(0);<NEW_LINE>Dimension toolbarSize = toolbar.isVisible() ? toolbar.getPreferredSize() : new Dimension();<NEW_LINE>toolbar.setBounds(leftWidth, <MASK><NEW_LINE>parent.getComponent(1).setBounds(leftWidth, toolbarSize.height, width, height - toolbarSize.height);<NEW_LINE>if (left != null) {<NEW_LINE>left.setBounds(0, 0, leftWidth, height);<NEW_LINE>}<NEW_LINE>if (right != null) {<NEW_LINE>right.setBounds(width + leftWidth, 0, rightWidth, height);<NEW_LINE>}<NEW_LINE>} | 0, width, toolbarSize.height); |
675,576 | private boolean isCertificateChainTrusted(X509AuthenticationToken token) {<NEW_LINE>if (trustManager == null) {<NEW_LINE>// No extra trust managers specified<NEW_LINE>// If the token is NOT delegated then it is authenticated, because the certificate chain has been validated by the TLS channel.<NEW_LINE>// Otherwise, if the token is delegated, then it cannot be authenticated without a trustManager<NEW_LINE>return token.isDelegated() == false;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>trustManager.checkClientTrusted(token.credentials(), AUTH_TYPE);<NEW_LINE>return true;<NEW_LINE>} catch (CertificateException e) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("failed certificate validation for Subject DN [" + token.dn() + "]", e);<NEW_LINE>} else if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | "failed certificate validation for Subject DN [{}]", token.dn()); |
1,376,203 | public boolean hasPermissionToCreateWorklog(java.lang.String in0, java.lang.String in1) throws java.rmi.RemoteException, com.atlassian.jira.rpc.exception.RemoteValidationException, com.atlassian.jira.rpc.exception.RemoteException {<NEW_LINE>if (super.cachedEndpoint == null) {<NEW_LINE>throw new org.apache.axis.NoEndPointException();<NEW_LINE>}<NEW_LINE>org.apache.axis.client.Call _call = createCall();<NEW_LINE>_call.setOperation(_operations[85]);<NEW_LINE>_call.setUseSOAPAction(true);<NEW_LINE>_call.setSOAPActionURI("");<NEW_LINE>_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);<NEW_LINE>_call.setOperationName(new javax.xml.namespace.QName("http://soap.rpc.jira.atlassian.com", "hasPermissionToCreateWorklog"));<NEW_LINE>setRequestHeaders(_call);<NEW_LINE>setAttachments(_call);<NEW_LINE>try {<NEW_LINE>java.lang.Object _resp = _call.invoke(new java.lang.Object[] { in0, in1 });<NEW_LINE>if (_resp instanceof java.rmi.RemoteException) {<NEW_LINE>throw (java.rmi.RemoteException) _resp;<NEW_LINE>} else {<NEW_LINE>extractAttachments(_call);<NEW_LINE>try {<NEW_LINE>return ((java.lang.Boolean) _resp).booleanValue();<NEW_LINE>} catch (java.lang.Exception _exception) {<NEW_LINE>return ((java.lang.Boolean) org.apache.axis.utils.JavaUtils.convert(_resp, boolean.class)).booleanValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (org.apache.axis.AxisFault axisFaultException) {<NEW_LINE>if (axisFaultException.detail != null) {<NEW_LINE>if (axisFaultException.detail instanceof java.rmi.RemoteException) {<NEW_LINE>throw (java<MASK><NEW_LINE>}<NEW_LINE>if (axisFaultException.detail instanceof com.atlassian.jira.rpc.exception.RemoteValidationException) {<NEW_LINE>throw (com.atlassian.jira.rpc.exception.RemoteValidationException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>if (axisFaultException.detail instanceof com.atlassian.jira.rpc.exception.RemoteException) {<NEW_LINE>throw (com.atlassian.jira.rpc.exception.RemoteException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw axisFaultException;<NEW_LINE>}<NEW_LINE>} | .rmi.RemoteException) axisFaultException.detail; |
1,195,483 | public void memberAccess() {<NEW_LINE>NativeTopLevel<String> topLevel = new NativeTopLevel<>("foo");<NEW_LINE>String <MASK><NEW_LINE>String fooStaticMethod = topLevel.staticMethod("foo");<NEW_LINE>String fooInstanceField = topLevel.instanceField;<NEW_LINE>topLevel.instanceField = "foo";<NEW_LINE>Object fooStaticField = topLevel.staticField;<NEW_LINE>topLevel.staticField = "foo";<NEW_LINE>int i1 = topLevel.fieldToRename;<NEW_LINE>int i2 = topLevel.methodToRename();<NEW_LINE>int i3 = topLevel.getMethodAsProperty();<NEW_LINE>int i4 = topLevel.nonGetMethodAsProperty();<NEW_LINE>int i5 = topLevel.methodToRenameAsProperty();<NEW_LINE>boolean i6 = topLevel.isFieldToRename;<NEW_LINE>boolean i7 = topLevel.isMethodAsProperty();<NEW_LINE>int i8 = topLevel.getstartingmethodAsProperty();<NEW_LINE>NativeTopLevel.Nested<String> nested = new NativeTopLevel.Nested<>("foo");<NEW_LINE>String nestedInstanceMethod = nested.instanceMethod("foo");<NEW_LINE>String nestedStaticMethod = nested.staticMethod("foo");<NEW_LINE>String nestedInstanceField = nested.instanceField;<NEW_LINE>nested.instanceField = "foo";<NEW_LINE>Object nestedStaticField = nested.staticField;<NEW_LINE>nested.staticField = "foo";<NEW_LINE>NativeTopLevel<String>.Inner<String> inner = topLevel.new Inner<String>("foo");<NEW_LINE>Subclass<String> subclass = new Subclass<>("foo");<NEW_LINE>int i9 = subclass.methodToRename();<NEW_LINE>int i10 = subclass.interfaceMethod();<NEW_LINE>int i11 = subclass.interfaceMethodToRename();<NEW_LINE>} | fooInstanceMethod = topLevel.instanceMethod("foo"); |
948,381 | public static ListAnsInstancesResponse unmarshall(ListAnsInstancesResponse listAnsInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAnsInstancesResponse.setRequestId(_ctx.stringValue("ListAnsInstancesResponse.RequestId"));<NEW_LINE>listAnsInstancesResponse.setHttpCode(_ctx.stringValue("ListAnsInstancesResponse.HttpCode"));<NEW_LINE>listAnsInstancesResponse.setTotalCount(_ctx.integerValue("ListAnsInstancesResponse.TotalCount"));<NEW_LINE>listAnsInstancesResponse.setMessage(_ctx.stringValue("ListAnsInstancesResponse.Message"));<NEW_LINE>listAnsInstancesResponse.setPageSize(_ctx.integerValue("ListAnsInstancesResponse.PageSize"));<NEW_LINE>listAnsInstancesResponse.setPageNumber(_ctx.integerValue("ListAnsInstancesResponse.PageNumber"));<NEW_LINE>listAnsInstancesResponse.setErrorCode(_ctx.stringValue("ListAnsInstancesResponse.ErrorCode"));<NEW_LINE>listAnsInstancesResponse.setSuccess(_ctx.booleanValue("ListAnsInstancesResponse.Success"));<NEW_LINE>List<NacosAnsInstance> data = new ArrayList<NacosAnsInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAnsInstancesResponse.Data.Length"); i++) {<NEW_LINE>NacosAnsInstance nacosAnsInstance = new NacosAnsInstance();<NEW_LINE>nacosAnsInstance.setDefaultKey(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].DefaultKey"));<NEW_LINE>nacosAnsInstance.setEphemeral(_ctx.booleanValue("ListAnsInstancesResponse.Data[" + i + "].Ephemeral"));<NEW_LINE>nacosAnsInstance.setMarked(_ctx.booleanValue("ListAnsInstancesResponse.Data[" + i + "].Marked"));<NEW_LINE>nacosAnsInstance.setIp(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].Ip"));<NEW_LINE>nacosAnsInstance.setInstanceId(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].InstanceId"));<NEW_LINE>nacosAnsInstance.setPort(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].Port"));<NEW_LINE>nacosAnsInstance.setLastBeat(_ctx.longValue("ListAnsInstancesResponse.Data[" + i + "].LastBeat"));<NEW_LINE>nacosAnsInstance.setOkCount(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].OkCount"));<NEW_LINE>nacosAnsInstance.setWeight(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].Weight"));<NEW_LINE>nacosAnsInstance.setInstanceHeartBeatInterval(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].InstanceHeartBeatInterval"));<NEW_LINE>nacosAnsInstance.setIpDeleteTimeout(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].IpDeleteTimeout"));<NEW_LINE>nacosAnsInstance.setApp(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].App"));<NEW_LINE>nacosAnsInstance.setFailCount(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].FailCount"));<NEW_LINE>nacosAnsInstance.setHealthy(_ctx.booleanValue<MASK><NEW_LINE>nacosAnsInstance.setEnabled(_ctx.booleanValue("ListAnsInstancesResponse.Data[" + i + "].Enabled"));<NEW_LINE>nacosAnsInstance.setDatumKey(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].DatumKey"));<NEW_LINE>nacosAnsInstance.setClusterName(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].ClusterName"));<NEW_LINE>nacosAnsInstance.setInstanceHeartBeatTimeOut(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].InstanceHeartBeatTimeOut"));<NEW_LINE>nacosAnsInstance.setServiceName(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].ServiceName"));<NEW_LINE>nacosAnsInstance.setMetadata(_ctx.mapValue("ListAnsInstancesResponse.Data[" + i + "].Metadata"));<NEW_LINE>data.add(nacosAnsInstance);<NEW_LINE>}<NEW_LINE>listAnsInstancesResponse.setData(data);<NEW_LINE>return listAnsInstancesResponse;<NEW_LINE>} | ("ListAnsInstancesResponse.Data[" + i + "].Healthy")); |
637,147 | public Map<String, Object> fetchFinalArgumentValues(ResolveOptions resOpt) {<NEW_LINE>Map<String, Object> finalArgs = new LinkedHashMap<>();<NEW_LINE>// get resolved traits does all the work, just clean up the answers<NEW_LINE>ResolvedTraitSet rts = this.fetchResolvedTraits(resOpt);<NEW_LINE>if (rts == null || rts.getSize() != 1) {<NEW_LINE>// well didn't get the traits. maybe imports are missing or maybe things are just not defined yet.<NEW_LINE>// this function will try to fake up some answers then from the arguments that are set on this reference only<NEW_LINE>if (this.getArguments() != null && this.getArguments().size() > 0) {<NEW_LINE>int unNamedCount = 0;<NEW_LINE>for (final CdmArgumentDefinition arg : this.getArguments()) {<NEW_LINE>// if no arg name given, use the position in the list.<NEW_LINE>String argName = arg.getName();<NEW_LINE>if (StringUtils.isNullOrTrimEmpty(argName)) {<NEW_LINE>argName = String.valueOf(unNamedCount);<NEW_LINE>}<NEW_LINE>finalArgs.put(argName, arg.getValue());<NEW_LINE>unNamedCount++;<NEW_LINE>}<NEW_LINE>return finalArgs;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// there is only one resolved trait<NEW_LINE>ResolvedTrait rt = rts.getFirst();<NEW_LINE>if (rt != null && rt.getParameterValues() != null && rt.getParameterValues().length() > 0) {<NEW_LINE>final int l = rt.getParameterValues().length();<NEW_LINE>for (int i = 0; i < l; i++) {<NEW_LINE>final CdmParameterDefinition p = rt.getParameterValues().fetchParameter(i);<NEW_LINE>final Object v = rt.getParameterValues().fetchValue(i);<NEW_LINE><MASK><NEW_LINE>if (name == null) {<NEW_LINE>name = Integer.toString(i);<NEW_LINE>}<NEW_LINE>finalArgs.put(name, v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return finalArgs;<NEW_LINE>} | String name = p.getName(); |
1,025,548 | final SendOTPMessageResult executeSendOTPMessage(SendOTPMessageRequest sendOTPMessageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(sendOTPMessageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SendOTPMessageRequest> request = null;<NEW_LINE>Response<SendOTPMessageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SendOTPMessageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(sendOTPMessageRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SendOTPMessage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SendOTPMessageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SendOTPMessageResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint); |
886,817 | public void visit(TextListLevelStyleBulletElement ele) {<NEW_LINE>Integer textLevel = ele.getTextLevelAttribute();<NEW_LINE>if (currentListPropertiesMap == null || textLevel == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StyleListProperties listProperties = new StyleListProperties();<NEW_LINE>currentListPropertiesMap.put(textLevel, listProperties);<NEW_LINE>// text style to apply to list item label<NEW_LINE><MASK><NEW_LINE>if (StringUtils.isNotEmpty(styleName)) {<NEW_LINE>// TODO what if this style is not computed yet?<NEW_LINE>Style style = getStyle(OdfStyleFamily.Text.getName(), styleName, null);<NEW_LINE>if (style != null) {<NEW_LINE>listProperties.setTextProperties(style.getTextProperties());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// bullet-char<NEW_LINE>String bulletChar = ele.getTextBulletCharAttribute();<NEW_LINE>if (StringUtils.isNotEmpty(bulletChar)) {<NEW_LINE>listProperties.setBulletChar(bulletChar);<NEW_LINE>}<NEW_LINE>// num-prefix<NEW_LINE>String numPrefix = ele.getStyleNumPrefixAttribute();<NEW_LINE>if (StringUtils.isNotEmpty(numPrefix)) {<NEW_LINE>listProperties.setNumPrefix(numPrefix);<NEW_LINE>}<NEW_LINE>// num-suffix<NEW_LINE>String numSuffix = ele.getStyleNumSuffixAttribute();<NEW_LINE>if (StringUtils.isNotEmpty(numSuffix)) {<NEW_LINE>listProperties.setNumSuffix(numSuffix);<NEW_LINE>}<NEW_LINE>currentListProperties = listProperties;<NEW_LINE>super.visit(ele);<NEW_LINE>currentListProperties = null;<NEW_LINE>} | String styleName = ele.getTextStyleNameAttribute(); |
1,405,435 | private void actOnJoinEvent(PlayerJoinEvent event) {<NEW_LINE>Player player = event.getPlayer();<NEW_LINE>UUID playerUUID = player.getUniqueId();<NEW_LINE>ServerUUID serverUUID = serverInfo.getServerUUID();<NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE>BukkitAFKListener.afkTracker.performedAction(playerUUID, time);<NEW_LINE>String world = player.getWorld().getName();<NEW_LINE>String gm = Optional.ofNullable(player.getGameMode()).map(gameMode -> gameMode.name()).orElse("Unknown");<NEW_LINE>Database database = dbSystem.getDatabase();<NEW_LINE>database.executeTransaction(new WorldNameStoreTransaction(serverUUID, world));<NEW_LINE>InetAddress address = player<MASK><NEW_LINE>Supplier<String> getHostName = () -> getHostname(player);<NEW_LINE>String playerName = player.getName();<NEW_LINE>String displayName = player.getDisplayName();<NEW_LINE>boolean gatheringGeolocations = config.isTrue(DataGatheringSettings.GEOLOCATIONS);<NEW_LINE>if (gatheringGeolocations) {<NEW_LINE>database.executeTransaction(new GeoInfoStoreTransaction(playerUUID, address, time, geolocationCache::getCountry));<NEW_LINE>}<NEW_LINE>database.executeTransaction(new PlayerServerRegisterTransaction(playerUUID, player::getFirstPlayed, playerName, serverUUID, getHostName));<NEW_LINE>database.executeTransaction(new OperatorStatusTransaction(playerUUID, serverUUID, player.isOp()));<NEW_LINE>ActiveSession session = new ActiveSession(playerUUID, serverUUID, time, world, gm);<NEW_LINE>session.getExtraData().put(PlayerName.class, new PlayerName(playerName));<NEW_LINE>session.getExtraData().put(ServerName.class, new ServerName(serverInfo.getServer().getIdentifiableName()));<NEW_LINE>sessionCache.cacheSession(playerUUID, session).ifPresent(previousSession -> database.executeTransaction(new SessionEndTransaction(previousSession)));<NEW_LINE>database.executeTransaction(new NicknameStoreTransaction(playerUUID, new Nickname(displayName, time, serverUUID), (uuid, name) -> nicknameCache.getDisplayName(playerUUID).map(name::equals).orElse(false)));<NEW_LINE>processing.submitNonCritical(() -> extensionService.updatePlayerValues(playerUUID, playerName, CallEvents.PLAYER_JOIN));<NEW_LINE>if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) {<NEW_LINE>processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName));<NEW_LINE>}<NEW_LINE>} | .getAddress().getAddress(); |
391,096 | private void watchGovernanceRepositoryConfiguration() {<NEW_LINE>PipelineAPIFactory.getGovernanceRepositoryAPI().watch(DataPipelineConstants.DATA_PIPELINE_ROOT, event -> {<NEW_LINE>Optional<JobConfigurationPOJO> jobConfigPOJOOptional = getJobConfigPOJO(event);<NEW_LINE>if (!jobConfigPOJOOptional.isPresent()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JobConfigurationPOJO jobConfigPOJO = jobConfigPOJOOptional.get();<NEW_LINE>if (DataChangedEvent.Type.DELETED == event.getType() || jobConfigPOJO.isDisabled()) {<NEW_LINE>RuleAlteredJobSchedulerCenter.stop(jobConfigPOJO.getJobName());<NEW_LINE>JobConfiguration jobConfig = YamlEngine.unmarshal(jobConfigPOJO.getJobParameter(), JobConfiguration.class, true);<NEW_LINE>ScalingReleaseSchemaNameLockEvent releaseLockEvent = new ScalingReleaseSchemaNameLockEvent(jobConfig.getWorkflowConfig().getSchemaName());<NEW_LINE>ShardingSphereEventBus.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(event.getType()) {<NEW_LINE>case ADDED:<NEW_LINE>case UPDATED:<NEW_LINE>JobConfiguration jobConfig = YamlEngine.unmarshal(jobConfigPOJO.getJobParameter(), JobConfiguration.class, true);<NEW_LINE>String schemaName = jobConfig.getWorkflowConfig().getSchemaName();<NEW_LINE>if (PipelineSimpleLock.getInstance().tryLock(schemaName, 1000)) {<NEW_LINE>execute(jobConfigPOJO);<NEW_LINE>} else {<NEW_LINE>log.info("tryLock failed, schemaName={}", schemaName);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getInstance().post(releaseLockEvent); |
1,747,483 | public static ListResourcesResponse unmarshall(ListResourcesResponse listResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listResourcesResponse.setRequestId(_ctx.stringValue("ListResourcesResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<ResourceItem> items = new ArrayList<ResourceItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListResourcesResponse.Data.Items.Length"); i++) {<NEW_LINE>ResourceItem resourceItem = new ResourceItem();<NEW_LINE>resourceItem.setAppId(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].AppId"));<NEW_LINE>resourceItem.setContent(_ctx.mapValue("ListResourcesResponse.Data.Items[" + i + "].Content"));<NEW_LINE>resourceItem.setCreateTime(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].CreateTime"));<NEW_LINE>resourceItem.setDescription(_ctx.stringValue<MASK><NEW_LINE>resourceItem.setModifiedTime(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].ModifiedTime"));<NEW_LINE>resourceItem.setModuleId(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].ModuleId"));<NEW_LINE>resourceItem.setResourceName(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].ResourceName"));<NEW_LINE>resourceItem.setResourceId(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].ResourceId"));<NEW_LINE>resourceItem.setRevision(_ctx.integerValue("ListResourcesResponse.Data.Items[" + i + "].Revision"));<NEW_LINE>resourceItem.setSchemaVersion(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].SchemaVersion"));<NEW_LINE>resourceItem.setResourceType(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].ResourceType"));<NEW_LINE>items.add(resourceItem);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>listResourcesResponse.setData(data);<NEW_LINE>return listResourcesResponse;<NEW_LINE>} | ("ListResourcesResponse.Data.Items[" + i + "].Description")); |
541,196 | private Path download(Terminal terminal, String pluginId, Path tmpDir, boolean isBatch) throws Exception {<NEW_LINE>if (OFFICIAL_PLUGINS.contains(pluginId)) {<NEW_LINE>final String url = getOpenSearchUrl(terminal, getStagingHash(), Version.CURRENT, isSnapshot(), pluginId, Platforms.PLATFORM_NAME);<NEW_LINE>terminal.<MASK><NEW_LINE>return downloadAndValidate(terminal, url, tmpDir, true, isBatch);<NEW_LINE>}<NEW_LINE>// now try as maven coordinates, a valid URL would only have a colon and slash<NEW_LINE>String[] coordinates = pluginId.split(":");<NEW_LINE>if (coordinates.length == 3 && pluginId.contains("/") == false && pluginId.startsWith("file:") == false) {<NEW_LINE>String mavenUrl = getMavenUrl(terminal, coordinates, Platforms.PLATFORM_NAME);<NEW_LINE>terminal.println("-> Downloading " + pluginId + " from maven central");<NEW_LINE>return downloadAndValidate(terminal, mavenUrl, tmpDir, false, isBatch);<NEW_LINE>}<NEW_LINE>// fall back to plain old URL<NEW_LINE>if (pluginId.contains(":") == false) {<NEW_LINE>// definitely not a valid url, so assume it is a plugin name<NEW_LINE>List<String> plugins = checkMisspelledPlugin(pluginId);<NEW_LINE>String msg = "Unknown plugin " + pluginId;<NEW_LINE>if (plugins.isEmpty() == false) {<NEW_LINE>msg += ", did you mean " + (plugins.size() == 1 ? "[" + plugins.get(0) + "]" : "any of " + plugins.toString()) + "?";<NEW_LINE>}<NEW_LINE>throw new UserException(ExitCodes.USAGE, msg);<NEW_LINE>}<NEW_LINE>terminal.println("-> Downloading " + URLDecoder.decode(pluginId, "UTF-8"));<NEW_LINE>return downloadZip(terminal, pluginId, tmpDir, isBatch);<NEW_LINE>} | println("-> Downloading " + pluginId + " from opensearch"); |
1,569,929 | public boolean showLookup() {<NEW_LINE>ApplicationManager<MASK><NEW_LINE>checkValid();<NEW_LINE>LOG.assertTrue(!myShown);<NEW_LINE>myShown = true;<NEW_LINE>myStampShown = System.currentTimeMillis();<NEW_LINE>fireLookupShown();<NEW_LINE>if (ApplicationManager.getApplication().isHeadlessEnvironment())<NEW_LINE>return true;<NEW_LINE>if (!myEditor.getContentComponent().isShowing()) {<NEW_LINE>hideLookup(false);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>myAdComponent.showRandomText();<NEW_LINE>if (Boolean.TRUE.equals(myEditor.getUserData(AutoPopupController.NO_ADS))) {<NEW_LINE>myAdComponent.clearAdvertisements();<NEW_LINE>}<NEW_LINE>// , myProject);<NEW_LINE>myUi = new LookupUi(this, myAdComponent, myList);<NEW_LINE>myUi.setCalculating(myCalculating);<NEW_LINE>Point p = myUi.calculatePosition().getLocation();<NEW_LINE>if (ScreenReader.isActive()) {<NEW_LINE>myList.setFocusable(true);<NEW_LINE>setFocusRequestor(myList);<NEW_LINE>AnActionEvent actionEvent = AnActionEvent.createFromDataContext(ActionPlaces.EDITOR_POPUP, null, ((DesktopEditorImpl) myEditor).getDataContext());<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_BACKSPACE, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_ESCAPE, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_TAB, () -> new ChooseItemAction.Replacing(), actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_ENTER, /* e.g. rename popup comes initially unfocused */<NEW_LINE>() -> getLookupFocusDegree() == LookupFocusDegree.UNFOCUSED ? new NextVariableAction() : new ChooseItemAction.FocusedOnly(), actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_MOVE_CARET_UP, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_MOVE_CARET_RIGHT, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_MOVE_CARET_LEFT, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_RENAME, null, actionEvent);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>HintManagerImpl.getInstanceImpl().showEditorHint(this, myEditor, p, HintManager.HIDE_BY_ESCAPE | HintManager.UPDATE_BY_SCROLLING, 0, false, HintManagerImpl.createHintHint(myEditor, p, this, HintManager.UNDER).setRequestFocus(ScreenReader.isActive()).setAwtTooltip(false));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>if (!isVisible() || !myList.isShowing()) {<NEW_LINE>hideLookup(false);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .getApplication().assertIsDispatchThread(); |
863,094 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>Card card = game.getCard(source.getSourceId());<NEW_LINE>if (player == null || card == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Permanent hauntedCreature = game.getPermanent(targetPointer.getFirst(game, source));<NEW_LINE>// haunting card will only be moved to exile, if<NEW_LINE>if (hauntedCreature == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!player.moveCards(card, Zone.EXILED, source, game)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// remember the haunted creature<NEW_LINE>String key = // in case it is blinked<NEW_LINE>new StringBuilder("Haunting_").append(source.getSourceId().toString()).append(card.getZoneChangeCounter(game) + hauntedCreature.getZoneChangeCounter(game)).toString();<NEW_LINE>game.getState().setValue(key, new FixedTarget(targetPointer.getFirst(game, source), game));<NEW_LINE>card.addInfo("hauntinfo", new StringBuilder("Haunting ").append(hauntedCreature.getLogName()).toString(), game);<NEW_LINE>hauntedCreature.addInfo("hauntinfo", new StringBuilder("Haunted by ").append(card.getLogName()).toString(), game);<NEW_LINE>game.informPlayers(new StringBuilder(card.getName()).append(" haunting ").append(hauntedCreature.getLogName<MASK><NEW_LINE>return true;<NEW_LINE>} | ()).toString()); |
1,797,880 | protected void addAttributesToMinimalView(MetaClass metaClass, View view, ViewLoader.ViewInfo info, Set<ViewLoader.ViewInfo> visited) {<NEW_LINE>Collection<MetaProperty> metaProperties = metadata.getTools().getNamePatternProperties(metaClass, true);<NEW_LINE>for (MetaProperty metaProperty : metaProperties) {<NEW_LINE>if (metadata.getTools().isPersistent(metaProperty)) {<NEW_LINE>addPersistentAttributeToMinimalView(metaClass, visited, info, view, metaProperty);<NEW_LINE>} else {<NEW_LINE>List<String> relatedProperties = metadata.getTools().getRelatedProperties(metaProperty);<NEW_LINE>for (String relatedPropertyName : relatedProperties) {<NEW_LINE>MetaProperty <MASK><NEW_LINE>if (metadata.getTools().isPersistent(relatedProperty)) {<NEW_LINE>addPersistentAttributeToMinimalView(metaClass, visited, info, view, relatedProperty);<NEW_LINE>} else {<NEW_LINE>log.warn("Transient attribute '{}' is listed in 'related' properties of another transient attribute '{}'", relatedPropertyName, metaProperty.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | relatedProperty = metaClass.getPropertyNN(relatedPropertyName); |
334,397 | public void write(long time, TsPrimitiveType[] points) {<NEW_LINE>valueIndex = 0;<NEW_LINE>for (TsPrimitiveType point : points) {<NEW_LINE>ValueChunkWriter writer = valueChunkWriterList.get(valueIndex++);<NEW_LINE>switch(writer.getDataType()) {<NEW_LINE>case INT64:<NEW_LINE>writer.write(time, point != null ? point.getLong() : Long.MAX_VALUE, point == null);<NEW_LINE>break;<NEW_LINE>case INT32:<NEW_LINE>writer.write(time, point != null ? point.getInt() : Integer.MAX_VALUE, point == null);<NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>writer.write(time, point != null ? point.getFloat() : <MASK><NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>writer.write(time, point != null ? point.getDouble() : Double.MAX_VALUE, point == null);<NEW_LINE>break;<NEW_LINE>case BOOLEAN:<NEW_LINE>writer.write(time, point != null ? point.getBoolean() : false, point == null);<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>writer.write(time, point != null ? point.getBinary() : new Binary("".getBytes(StandardCharsets.UTF_8)), point == null);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>write(time);<NEW_LINE>} | Float.MAX_VALUE, point == null); |
91,655 | private FileObject ensureDestinationFileExists(FileObject ejbBuildBase, String path, boolean isFolder) throws IOException {<NEW_LINE>FileObject current = ejbBuildBase;<NEW_LINE>StringTokenizer st = new StringTokenizer(path, "/");<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>String pathItem = st.nextToken();<NEW_LINE>FileObject newCurrent = current.getFileObject(pathItem);<NEW_LINE>if (newCurrent == null) {<NEW_LINE>// need to create it<NEW_LINE>if (isFolder || st.hasMoreTokens()) {<NEW_LINE>// create a folder<NEW_LINE>newCurrent = FileUtil.createFolder(current, pathItem);<NEW_LINE>assert newCurrent != null : "ejbBuildBase: " + ejbBuildBase + ", path: " + path + ", isFolder: " + isFolder;<NEW_LINE>} else {<NEW_LINE>newCurrent = FileUtil.createData(current, pathItem);<NEW_LINE>assert newCurrent != null : "ejbBuildBase: " + ejbBuildBase + ", path: " + path + ", isFolder: " + isFolder;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>current = newCurrent;<NEW_LINE>}<NEW_LINE>assert current != null : "ejbBuildBase: " + ejbBuildBase <MASK><NEW_LINE>return current;<NEW_LINE>} | + ", path: " + path + ", isFolder: " + isFolder; |
612,704 | protected ArrowBuf doCompress(BufferAllocator allocator, ArrowBuf uncompressedBuffer) {<NEW_LINE>Preconditions.checkArgument(uncompressedBuffer.writerIndex() <= Integer.MAX_VALUE, "The uncompressed buffer size exceeds the integer limit %s.", Integer.MAX_VALUE);<NEW_LINE>byte[] inBytes = new byte[(int) uncompressedBuffer.writerIndex()];<NEW_LINE>uncompressedBuffer.getBytes(/*index=*/<NEW_LINE>0, inBytes);<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>try (InputStream in = new ByteArrayInputStream(inBytes);<NEW_LINE>OutputStream out = new FramedLZ4CompressorOutputStream(baos)) {<NEW_LINE><MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>byte[] outBytes = baos.toByteArray();<NEW_LINE>ArrowBuf compressedBuffer = allocator.buffer(CompressionUtil.SIZE_OF_UNCOMPRESSED_LENGTH + outBytes.length);<NEW_LINE>compressedBuffer.setBytes(CompressionUtil.SIZE_OF_UNCOMPRESSED_LENGTH, outBytes);<NEW_LINE>compressedBuffer.writerIndex(CompressionUtil.SIZE_OF_UNCOMPRESSED_LENGTH + outBytes.length);<NEW_LINE>return compressedBuffer;<NEW_LINE>} | IOUtils.copy(in, out); |
1,539,037 | protected JComponent createCenterPanel() {<NEW_LINE>Splitter splitter = new Splitter(false, (float) 0.6);<NEW_LINE>JPanel result = new JPanel(new BorderLayout());<NEW_LINE>if (myTree == null) {<NEW_LINE>myTree = createTree();<NEW_LINE>} else {<NEW_LINE>final CheckedTreeNode root = (CheckedTreeNode) myTree.getModel().getRoot();<NEW_LINE>myRoot = (MethodNodeBase) root.getFirstChild();<NEW_LINE>}<NEW_LINE>myTreeSelectionListener = new TreeSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueChanged(TreeSelectionEvent e) {<NEW_LINE>final <MASK><NEW_LINE>if (path != null) {<NEW_LINE>final MethodNodeBase<M> node = (MethodNodeBase) path.getLastPathComponent();<NEW_LINE>myAlarm.cancelAllRequests();<NEW_LINE>myAlarm.addRequest(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>updateEditorTexts(node);<NEW_LINE>}<NEW_LINE>}, 300);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>myTree.getSelectionModel().addTreeSelectionListener(myTreeSelectionListener);<NEW_LINE>JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree);<NEW_LINE>splitter.setFirstComponent(scrollPane);<NEW_LINE>final JComponent callSitesViewer = createCallSitesViewer();<NEW_LINE>TreePath selectionPath = myTree.getSelectionPath();<NEW_LINE>if (selectionPath == null) {<NEW_LINE>selectionPath = new TreePath(myRoot.getPath());<NEW_LINE>myTree.getSelectionModel().addSelectionPath(selectionPath);<NEW_LINE>}<NEW_LINE>final MethodNodeBase<M> node = (MethodNodeBase) selectionPath.getLastPathComponent();<NEW_LINE>updateEditorTexts(node);<NEW_LINE>splitter.setSecondComponent(callSitesViewer);<NEW_LINE>result.add(splitter);<NEW_LINE>return result;<NEW_LINE>} | TreePath path = e.getPath(); |
1,105,963 | public void init() {<NEW_LINE>this.config = ProcessorConfig.getInstance();<NEW_LINE>files = Maps.newHashMap();<NEW_LINE>for (ReservationUtilization utilization : ReservationUtilization.values()) {<NEW_LINE>files.put(utilization, new File(config.localDir, "reservation_prices." + term.name() + "." + utilization.name()));<NEW_LINE>}<NEW_LINE>boolean fileExisted = false;<NEW_LINE>for (ReservationUtilization utilization : ReservationUtilization.values()) {<NEW_LINE>File file = files.get(utilization);<NEW_LINE>AwsUtils.downloadFileIfNotExist(config.workS3BucketName, config.workS3BucketPrefix, file);<NEW_LINE>fileExisted = file.exists();<NEW_LINE>}<NEW_LINE>if (!fileExisted) {<NEW_LINE>try {<NEW_LINE>pollAPI();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("failed to poll reservation prices", e);<NEW_LINE>throw new RuntimeException("failed to poll reservation prices for " + e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (ReservationUtilization utilization : ReservationUtilization.values()) {<NEW_LINE>try {<NEW_LINE>File file = files.get(utilization);<NEW_LINE>if (file.exists()) {<NEW_LINE>DataInputStream in = new DataInputStream(new FileInputStream(file));<NEW_LINE>ec2InstanceReservationPrices.put(utilization, Serializer.deserialize(in));<NEW_LINE>in.close();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("failed to load reservation prices " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>start(<MASK><NEW_LINE>} | 3600, 3600 * 24, true); |
174,942 | public void afterPropertiesSet() {<NEW_LINE>if (!CollectionUtils.isEmpty(this.jpaParameters)) {<NEW_LINE>if (this.parameterSourceFactory == null) {<NEW_LINE>ExpressionEvaluatingParameterSourceFactory expressionSourceFactory = new ExpressionEvaluatingParameterSourceFactory(this.beanFactory);<NEW_LINE>expressionSourceFactory.setParameters(this.jpaParameters);<NEW_LINE>this.parameterSourceFactory = expressionSourceFactory;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("The 'jpaParameters' and 'parameterSourceFactory' " + <MASK><NEW_LINE>}<NEW_LINE>if (this.usePayloadAsParameterSource == null) {<NEW_LINE>this.usePayloadAsParameterSource = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (this.parameterSourceFactory == null) {<NEW_LINE>this.parameterSourceFactory = new BeanPropertyParameterSourceFactory();<NEW_LINE>}<NEW_LINE>if (this.usePayloadAsParameterSource == null) {<NEW_LINE>this.usePayloadAsParameterSource = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.flushSize > 0) {<NEW_LINE>this.flush = true;<NEW_LINE>} else if (this.flush) {<NEW_LINE>this.flushSize = 1;<NEW_LINE>}<NEW_LINE>if (this.evaluationContext == null) {<NEW_LINE>this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.beanFactory);<NEW_LINE>}<NEW_LINE>} | "are mutually exclusive. Consider to configure parameters on the provided " + "'parameterSourceFactory': " + this.parameterSourceFactory); |
1,306,193 | private static String findJsonValueOrEmpty(String raw, String key) {<NEW_LINE>if (key == null || raw == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>key = '"' + key + '"';<NEW_LINE>raw = <MASK><NEW_LINE>if (!raw.contains(key)) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>int limit = raw.indexOf(key);<NEW_LINE>int start = raw.indexOf(':', limit);<NEW_LINE>int e1 = raw.indexOf(',', start);<NEW_LINE>int e2 = raw.indexOf('}', start);<NEW_LINE>int end;<NEW_LINE>if (e1 * e2 == 1) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>if (e1 * e2 < 0) {<NEW_LINE>if (e1 == -1) {<NEW_LINE>end = e2;<NEW_LINE>} else {<NEW_LINE>end = e1;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>end = Math.min(e1, e2);<NEW_LINE>}<NEW_LINE>String subseq = raw.substring(start + 1, end);<NEW_LINE>if (subseq.startsWith("\"")) {<NEW_LINE>int e3 = raw.indexOf('"', start);<NEW_LINE>int stop = indexMax(end, e3);<NEW_LINE>if ((raw.charAt(stop) == ',' || raw.charAt(stop) == '}') && raw.charAt(stop - 1) == '"') {<NEW_LINE>// exclude '"'<NEW_LINE>return raw.substring(start + 2, stop - 1);<NEW_LINE>} else {<NEW_LINE>return raw.substring(start + 1, stop);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return subseq;<NEW_LINE>}<NEW_LINE>} | raw.replace(" ", ""); |
1,451,860 | protected void processModulesAndArgs() {<NEW_LINE>super.processModulesAndArgs();<NEW_LINE>if (contains(argRepeat)) {<NEW_LINE>String[] x = getValue<MASK><NEW_LINE>if (x.length == 1) {<NEW_LINE>try {<NEW_LINE>repeatCount = Integer.parseInt(x[0]);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>throw new CmdException("Can't parse " + x[0] + " in arg " + getValue(argRepeat) + " as an integer");<NEW_LINE>}<NEW_LINE>} else if (x.length == 2) {<NEW_LINE>try {<NEW_LINE>warmupCount = Integer.parseInt(x[0]);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>throw new CmdException("Can't parse " + x[0] + " in arg " + getValue(argRepeat) + " as an integer");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>repeatCount = Integer.parseInt(x[1]);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>throw new CmdException("Can't parse " + x[1] + " in arg " + getValue(argRepeat) + " as an integer");<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>throw new CmdException("Wrong format for repeat count: " + getValue(argRepeat));<NEW_LINE>}<NEW_LINE>if (isVerbose())<NEW_LINE>ARQ.getContext().setTrue(ARQ.symLogExec);<NEW_LINE>if (hasArg(argExplain))<NEW_LINE>ARQ.setExecutionLogging(Explain.InfoLevel.ALL);<NEW_LINE>if (hasArg(argOptimize)) {<NEW_LINE>String x1 = getValue(argOptimize);<NEW_LINE>if (hasValueOfTrue(argOptimize) || x1.equalsIgnoreCase("on") || x1.equalsIgnoreCase("yes"))<NEW_LINE>queryOptimization = true;<NEW_LINE>else if (hasValueOfFalse(argOptimize) || x1.equalsIgnoreCase("off") || x1.equalsIgnoreCase("no"))<NEW_LINE>queryOptimization = false;<NEW_LINE>else<NEW_LINE>throw new CmdException("Optimization flag must be true/false/on/off/yes/no. Found: " + getValue(argOptimize));<NEW_LINE>}<NEW_LINE>} | (argRepeat).split(","); |
307,467 | public void output(List<TxnEventBase> bucket) throws IOException {<NEW_LINE>log.info(".output Feeding " + bucket.size() + " events");<NEW_LINE>long startTimeMSec = currentTimeMSec;<NEW_LINE>long timePeriodLength = FindMissingEventStmt.TIME_WINDOW_TXNC_IN_SEC * 1000;<NEW_LINE>long endTimeMSec = startTimeMSec + timePeriodLength;<NEW_LINE>sendTimerEvent(startTimeMSec);<NEW_LINE>int count = 0, total = 0;<NEW_LINE>for (TxnEventBase theEvent : bucket) {<NEW_LINE>runtime.sendEventBean(theEvent, theEvent.getClass().getSimpleName());<NEW_LINE>count++;<NEW_LINE>total++;<NEW_LINE>if (count % 1000 == 0) {<NEW_LINE>sendTimerEvent(startTimeMSec + timePeriodLength * <MASK><NEW_LINE>count = 0;<NEW_LINE>}<NEW_LINE>if (count == 10000) {<NEW_LINE>log.info(".output Completed " + total + " events");<NEW_LINE>count = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sendTimerEvent(endTimeMSec);<NEW_LINE>currentTimeMSec = endTimeMSec;<NEW_LINE>log.info(".output Completed bucket");<NEW_LINE>} | total / bucket.size()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.