idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,516,441
private Map<String, Object> updateDagSchedule(User loginUser, long projectCode, long processDefinitionCode, String scheduleJson) {<NEW_LINE>Map<String, Object> result = new HashMap<>();<NEW_LINE>Schedule schedule = JSONUtils.parseObject(scheduleJson, Schedule.class);<NEW_LINE>if (schedule == null) {<NEW_LINE>putMsg(result, Status.DATA_IS_NOT_VALID, scheduleJson);<NEW_LINE>throw new ServiceException(Status.DATA_IS_NOT_VALID);<NEW_LINE>}<NEW_LINE>// set default value<NEW_LINE>FailureStrategy failureStrategy = schedule.getFailureStrategy() == null ? FailureStrategy<MASK><NEW_LINE>WarningType warningType = schedule.getWarningType() == null ? WarningType.NONE : schedule.getWarningType();<NEW_LINE>Priority processInstancePriority = schedule.getProcessInstancePriority() == null ? Priority.MEDIUM : schedule.getProcessInstancePriority();<NEW_LINE>int warningGroupId = schedule.getWarningGroupId() == 0 ? 1 : schedule.getWarningGroupId();<NEW_LINE>String workerGroup = schedule.getWorkerGroup() == null ? "default" : schedule.getWorkerGroup();<NEW_LINE>long environmentCode = schedule.getEnvironmentCode() == null ? -1 : schedule.getEnvironmentCode();<NEW_LINE>ScheduleParam param = new ScheduleParam();<NEW_LINE>param.setStartTime(schedule.getStartTime());<NEW_LINE>param.setEndTime(schedule.getEndTime());<NEW_LINE>param.setCrontab(schedule.getCrontab());<NEW_LINE>param.setTimezoneId(schedule.getTimezoneId());<NEW_LINE>return schedulerService.updateScheduleByProcessDefinitionCode(loginUser, projectCode, processDefinitionCode, JSONUtils.toJsonString(param), warningType, warningGroupId, failureStrategy, processInstancePriority, workerGroup, environmentCode);<NEW_LINE>}
.CONTINUE : schedule.getFailureStrategy();
1,828,317
public UserSession createSession(UUID sessionId, User user, Locale locale, boolean system, String securityScope) {<NEW_LINE>List<RoleDefinition> roles = new ArrayList<>();<NEW_LINE>for (RoleDefinition role : rolesHelper.getRoleDefinitionsForUser(user, false)) {<NEW_LINE>if (role != null) {<NEW_LINE>String expectedScope = securityScope == null ? SecurityScope.DEFAULT_SCOPE_NAME : securityScope;<NEW_LINE>String actualScope = role.getSecurityScope() == null ? SecurityScope.DEFAULT_SCOPE_NAME : role.getSecurityScope();<NEW_LINE>if (Objects.equals(expectedScope, actualScope)) {<NEW_LINE>roles.add(role);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UserSession session = new UserSession(sessionId, user, roles, locale, system);<NEW_LINE>compilePermissions(session, roles);<NEW_LINE>if (user.getGroup() == null && Strings.isNullOrEmpty(user.getGroupNames())) {<NEW_LINE>throw new IllegalStateException("User is not in a Group");<NEW_LINE>}<NEW_LINE>AccessGroupDefinition groupDefinition = compileGroupDefinition(user.getGroup(), user.getGroupNames());<NEW_LINE>compileConstraints(session, groupDefinition);<NEW_LINE>compileSessionAttributes(session, groupDefinition);<NEW_LINE>session.<MASK><NEW_LINE>return session;<NEW_LINE>}
setPermissionUndefinedAccessPolicy(rolesHelper.getPermissionUndefinedAccessPolicy());
474,249
private void addSpinner() {<NEW_LINE>if (spinner == null) {<NEW_LINE>spinner = new QuranSpinner(context, null, R.attr.actionDropDownStyle);<NEW_LINE>spinner.setDropDownVerticalOffset(spinnerPadding);<NEW_LINE>spinner.setAdapter(adapter);<NEW_LINE>spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>if (position != currentQari) {<NEW_LINE>sharedPreferences.edit().putInt(Constants.PREF_DEFAULT_QARI, adapter.getItem(position).getId()).apply();<NEW_LINE>currentQari = position;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNothingSelected(AdapterView<?> parent) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>spinner.setSelection(currentQari);<NEW_LINE>// in RTL, because this is currently an LTR LinearLayout, this shows<NEW_LINE>// the spinner and then the play button, so we can't match parent. this<NEW_LINE>// is less efficient than the LTR version. this should be fixed by making<NEW_LINE>// the parent a vanilla LinearLayout and setting the direction.<NEW_LINE>final LayoutParams params;<NEW_LINE>if (isRtl || isRecitationEnabled) {<NEW_LINE>params = new LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);<NEW_LINE>params.weight = 1;<NEW_LINE>} else {<NEW_LINE>params = new LayoutParams(ViewGroup.LayoutParams.<MASK><NEW_LINE>}<NEW_LINE>if (isRtl) {<NEW_LINE>ViewCompat.setLayoutDirection(spinner, ViewCompat.LAYOUT_DIRECTION_RTL);<NEW_LINE>params.leftMargin = spinnerPadding;<NEW_LINE>} else {<NEW_LINE>params.rightMargin = spinnerPadding;<NEW_LINE>}<NEW_LINE>addView(spinner, params);<NEW_LINE>}
MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
1,502,272
protected void recoverVolume(Completion completion) {<NEW_LINE>final VolumeInventory vol = getSelfInventory();<NEW_LINE>List<RecoverDataVolumeExtensionPoint> exts = pluginRgty.getExtensionList(RecoverDataVolumeExtensionPoint.class);<NEW_LINE>CollectionUtils.safeForEach(exts, new ForEachFunction<RecoverDataVolumeExtensionPoint>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(RecoverDataVolumeExtensionPoint ext) {<NEW_LINE>ext.preRecoverDataVolume(vol);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>CollectionUtils.safeForEach(exts, new ForEachFunction<RecoverDataVolumeExtensionPoint>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(RecoverDataVolumeExtensionPoint ext) {<NEW_LINE>ext.beforeRecoverDataVolume(vol);<NEW_LINE>}<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>if (self.getInstallPath() != null) {<NEW_LINE>self.setStatus(VolumeStatus.Ready);<NEW_LINE>} else {<NEW_LINE>self.setStatus(VolumeStatus.NotInstantiated);<NEW_LINE>}<NEW_LINE>self = dbf.updateAndRefresh(self);<NEW_LINE>new FireVolumeCanonicalEvent().fireVolumeStatusChangedEvent(oldStatus, getSelfInventory());<NEW_LINE>CollectionUtils.safeForEach(exts, new ForEachFunction<RecoverDataVolumeExtensionPoint>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(RecoverDataVolumeExtensionPoint ext) {<NEW_LINE>ext.afterRecoverDataVolume(vol);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>completion.success();<NEW_LINE>}
VolumeStatus oldStatus = self.getStatus();
193,386
// leg initial notional, which is the same for all scenarios<NEW_LINE>// package-scoped for testing<NEW_LINE>LegAmounts legInitialNotional(ResolvedSwapTrade trade) {<NEW_LINE>List<Pair<ResolvedSwapLeg, CurrencyAmount>> notionals = trade.getProduct().getLegs().stream().map(leg -> Pair.of(leg, buildLegNotional(leg))<MASK><NEW_LINE>CurrencyAmount firstNotional = notionals.stream().filter(pair -> pair.getSecond() != NOT_FOUND).map(pair -> pair.getSecond()).findFirst().orElseThrow(() -> new IllegalArgumentException("No notional found on any swap leg"));<NEW_LINE>notionals = notionals.stream().map(pair -> pair.getSecond() != NOT_FOUND ? pair : Pair.of(pair.getFirst(), firstNotional)).collect(toList());<NEW_LINE>ImmutableList<LegAmount> legAmounts = notionals.stream().map(pair -> SwapLegAmount.of(pair.getFirst(), pair.getSecond())).collect(toImmutableList());<NEW_LINE>return LegAmounts.of(legAmounts);<NEW_LINE>}
).collect(toList());
631,956
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>FullHttpRequest request = (FullHttpRequest) msg;<NEW_LINE>QueryStringDecoder decoder = new QueryStringDecoder(request.uri());<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, decoder.parameters().get("UserName").get(0));<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Parser parser = new Parser(PATTERN, decoder.parameters().get("LOC").get(0));<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.setTime(parser.nextDateTime(Parser.DateTimeFormat.DMY_HMS));<NEW_LINE>position.setValid(true);<NEW_LINE>position.setLatitude(parser.nextDouble(0));<NEW_LINE>position.setLongitude(parser.nextDouble(0));<NEW_LINE>position.setAltitude(parser.nextDouble(0));<NEW_LINE>position.setSpeed(parser.nextDouble(0));<NEW_LINE>position.setCourse(parser.nextDouble(0));<NEW_LINE>if (channel != null) {<NEW_LINE>FullHttpResponse response = new DefaultFullHttpResponse(<MASK><NEW_LINE>channel.writeAndFlush(new NetworkMessage(response, remoteAddress)).addListener(ChannelFutureListener.CLOSE);<NEW_LINE>}<NEW_LINE>return position;<NEW_LINE>}
HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
81,370
public static CoreLabel labelFromString(String str) {<NEW_LINE>CoreLabel label = new CoreLabel();<NEW_LINE>String[] parts = str.split(SEPARATOR_PATTERN);<NEW_LINE>for (String part : parts) {<NEW_LINE>if (part.startsWith("word:::")) {<NEW_LINE>label.setWord(part.substring<MASK><NEW_LINE>label.setValue(part.substring("word:::".length()));<NEW_LINE>} else if (part.startsWith("tag:::")) {<NEW_LINE>label.setTag(part.substring("tag:::".length()));<NEW_LINE>} else if (part.startsWith("lemma:::")) {<NEW_LINE>label.setLemma(part.substring("lemma:::".length()));<NEW_LINE>} else if (part.startsWith("idx:::")) {<NEW_LINE>label.setIndex(Integer.parseInt(part.substring("idx:::".length())));<NEW_LINE>} else if (part.startsWith("num:::")) {<NEW_LINE>label.set(CoreAnnotations.NumericValueAnnotation.class, Double.parseDouble(part.substring("num:::".length())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return label;<NEW_LINE>}
("word:::".length()));
439,612
private static boolean patchDexExtractViaDexDiff(Context context, String patchVersionDirectory, String meta, final File patchFile, PatchResult patchResult) {<NEW_LINE>String dir = patchVersionDirectory + "/" + DEX_PATH + "/";<NEW_LINE>if (!extractDexDiffInternals(context, dir, meta, patchFile, TYPE_DEX)) {<NEW_LINE>ShareTinkerLog.w(TAG, "patch recover, extractDiffInternals fail");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>File dexFiles = new File(dir);<NEW_LINE>File[] files = dexFiles.listFiles();<NEW_LINE>List<File> <MASK><NEW_LINE>if (files != null) {<NEW_LINE>for (File file : files) {<NEW_LINE>final String fileName = file.getName();<NEW_LINE>// may have directory in android o<NEW_LINE>if (file.isFile() && (fileName.endsWith(ShareConstants.DEX_SUFFIX) || fileName.endsWith(ShareConstants.JAR_SUFFIX) || fileName.endsWith(ShareConstants.PATCH_SUFFIX))) {<NEW_LINE>legalFiles.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ShareTinkerLog.i(TAG, "legal files to do dexopt: " + legalFiles);<NEW_LINE>final String optimizeDexDirectory = patchVersionDirectory + "/" + DEX_OPTIMIZE_PATH + "/";<NEW_LINE>return dexOptimizeDexFiles(context, legalFiles, optimizeDexDirectory, patchFile, patchResult);<NEW_LINE>}
legalFiles = new ArrayList<>();
152,451
protected void paintRaisedBevel(Component c, Graphics g, int x, int y, int width, int height) {<NEW_LINE>Color oldColor = g.getColor();<NEW_LINE>int h = height;<NEW_LINE>int w = width;<NEW_LINE>g.translate(x, y);<NEW_LINE>Shape saveClip = g.getClip();<NEW_LINE>Rectangle bounds = saveClip.getBounds();<NEW_LINE>g.setClip(bounds.x, bounds.y, bounds.<MASK><NEW_LINE>g.setColor(getShadowOuterColor(c));<NEW_LINE>// left outer<NEW_LINE>g.drawLine(0, 0, 0, h);<NEW_LINE>g.setColor(getHighlightOuterColor(c));<NEW_LINE>// upper outer<NEW_LINE>g.drawLine(1, 0, w - 2, 0);<NEW_LINE>g.setColor(getHighlightInnerColor(c));<NEW_LINE>// left inner<NEW_LINE>g.drawLine(1, 1, 1, h);<NEW_LINE>// upper inner<NEW_LINE>g.drawLine(2, 1, w - 3, 1);<NEW_LINE>// bottom outer<NEW_LINE>g.setColor(getShadowOuterColor(c));<NEW_LINE>// right outer<NEW_LINE>g.drawLine(w - 1, 0, w - 1, h);<NEW_LINE>// bottom inner<NEW_LINE>g.setColor(getShadowInnerColor(c));<NEW_LINE>// right inner<NEW_LINE>g.drawLine(w - 2, 1, w - 2, h);<NEW_LINE>g.setClip(saveClip);<NEW_LINE>g.translate(-x, -y);<NEW_LINE>g.setColor(oldColor);<NEW_LINE>}
width, getHeight() + 2);
870,283
protected List<QuerySource> visitQueryBody(QueryBody node, QueryState state) {<NEW_LINE>ArrayList<QuerySource> relations <MASK><NEW_LINE>if (node instanceof Table) {<NEW_LINE>String table = ((Table) node).getName().toString();<NEW_LINE>// resolve relations provided in dot notation (schema.index.type) and just get the type for now<NEW_LINE>String[] catIndexType = table.split("\\.");<NEW_LINE>if (catIndexType.length == 1) {<NEW_LINE>relations.add(new QuerySource(table));<NEW_LINE>} else {<NEW_LINE>relations.add(new QuerySource(catIndexType[catIndexType.length - 1]));<NEW_LINE>}<NEW_LINE>} else if (node instanceof TableSubquery) {<NEW_LINE>TableSubquery ts = (TableSubquery) node;<NEW_LINE>Object alias = state.getValue("table_alias");<NEW_LINE>Pattern queryRegex = Pattern.compile("from\\s*\\((.+)\\)\\s*(where|as|having|limit|$" + (alias == null ? "" : "|" + alias) + ")", Pattern.CASE_INSENSITIVE);<NEW_LINE>Matcher m = queryRegex.matcher(state.originalSql());<NEW_LINE>if (m.find()) {<NEW_LINE>relations.add(new QuerySource(m.group(1), ts.getQuery().getQueryBody()));<NEW_LINE>} else<NEW_LINE>state.addException("Unable to parse provided subquery in FROM clause");<NEW_LINE>} else<NEW_LINE>state.addException("Unable to parse FROM clause, " + node.getClass().getName() + " is not supported");<NEW_LINE>return relations;<NEW_LINE>}
= new ArrayList<QuerySource>();
535,259
SearchResponse searchJobs(QueryBuilder queryBuilder, PageRequest pageRequest) throws IOException {<NEW_LINE>SearchRequest searchRequest = new SearchRequest(jobIndexName);<NEW_LINE>SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();<NEW_LINE>searchSourceBuilder.query(queryBuilder);<NEW_LINE>searchSourceBuilder.from((int) pageRequest.getOffset());<NEW_LINE>searchSourceBuilder.size(pageRequest.getLimit());<NEW_LINE>searchSourceBuilder.storedField(Jobs.FIELD_JOB_AS_JSON);<NEW_LINE>if (pageRequest.getOrder().equals("updatedAt:ASC")) {<NEW_LINE>searchSourceBuilder.sort(Jobs.FIELD_UPDATED_AT, SortOrder.ASC);<NEW_LINE>} else if (pageRequest.getOrder().equals("updatedAt:DESC")) {<NEW_LINE>searchSourceBuilder.sort(Jobs.FIELD_UPDATED_AT, SortOrder.DESC);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown sort: " + pageRequest.getOrder());<NEW_LINE>}<NEW_LINE>searchRequest.source(searchSourceBuilder);<NEW_LINE>return client.<MASK><NEW_LINE>}
search(searchRequest, RequestOptions.DEFAULT);
1,580,659
public void visitConstantExpression(final ConstantExpression expression) {<NEW_LINE>if (!(expression.isNullExpression() || expression.isTrueExpression() || expression.isFalseExpression() || expression.isEmptyStringExpression())) {<NEW_LINE>if (expression instanceof AnnotationConstantExpression) {<NEW_LINE>// ex: @interface X { Y default @Y(...) } -- expression is "@Y(...)"<NEW_LINE>visitTypeReference(expression.getType(), true, true);<NEW_LINE>}<NEW_LINE>if (expression.getEnd() > 0 && ClassHelper.STRING_TYPE.equals(expression.getType())) {<NEW_LINE>char[] name = expression.getText().toCharArray();<NEW_LINE>if (Character.isJavaIdentifierStart(name[0])) {<NEW_LINE><MASK><NEW_LINE>requestor.acceptFieldReference(name, offset);<NEW_LINE>// we don't know how many arguments the method has, so go up to 7<NEW_LINE>for (int i = 0; i <= 7; i += 1) {<NEW_LINE>requestor.acceptMethodReference(name, i, offset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.visitConstantExpression(expression);<NEW_LINE>}
int offset = expression.getStart();
544,273
protected void generateStatementsImpl() throws CustomChangeException {<NEW_LINE>String userFederationProviderTableName = database.correctObjectName("USER_FEDERATION_PROVIDER", Table.class);<NEW_LINE>try {<NEW_LINE>PreparedStatement statement = jdbcConnection.prepareStatement("select REALM_ID, USERFEDERATIONPROVIDERS_ID from " + getTableName("FED_PROVIDERS"));<NEW_LINE>try {<NEW_LINE>ResultSet resultSet = statement.executeQuery();<NEW_LINE>try {<NEW_LINE>while (resultSet.next()) {<NEW_LINE>String <MASK><NEW_LINE>String userFederationProviderId = resultSet.getString(2);<NEW_LINE>UpdateStatement updateStatement = new UpdateStatement(null, null, userFederationProviderTableName).addNewColumnValue("REALM_ID", realmId).setWhereClause("ID='" + userFederationProviderId + "'");<NEW_LINE>statements.add(updateStatement);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>resultSet.close();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>statement.close();<NEW_LINE>}<NEW_LINE>confirmationMessage.append("Updated " + statements.size() + " records in USER_FEDERATION_PROVIDER table");<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new CustomChangeException(getTaskId() + ": Exception when updating data from previous version", e);<NEW_LINE>}<NEW_LINE>}
realmId = resultSet.getString(1);
1,036,253
public void init() {<NEW_LINE>model = new DefaultDiagramModel();<NEW_LINE>model.setMaxConnections(-1);<NEW_LINE>FlowChartConnector connector = new FlowChartConnector();<NEW_LINE>connector.setPaintStyle("{stroke:'#C7B097',strokeWidth:3}");<NEW_LINE>model.setDefaultConnector(connector);<NEW_LINE>Element start = new Element("Fight for your dream", "20em", "6em");<NEW_LINE>start.addEndPoint(new BlankEndPoint(EndPointAnchor.BOTTOM));<NEW_LINE>start.addEndPoint(new BlankEndPoint(EndPointAnchor.LEFT));<NEW_LINE>Element trouble = new Element("Do you meet some trouble?", "20em", "18em");<NEW_LINE>trouble.addEndPoint(new BlankEndPoint(EndPointAnchor.TOP));<NEW_LINE>trouble.addEndPoint(new BlankEndPoint(EndPointAnchor.BOTTOM));<NEW_LINE>trouble.addEndPoint(new BlankEndPoint(EndPointAnchor.RIGHT));<NEW_LINE>Element giveup = new Element("Do you give up?", "20em", "30em");<NEW_LINE>giveup.addEndPoint(new BlankEndPoint(EndPointAnchor.TOP));<NEW_LINE>giveup.addEndPoint(new BlankEndPoint(EndPointAnchor.LEFT));<NEW_LINE>giveup.addEndPoint(<MASK><NEW_LINE>Element succeed = new Element("Succeed", "50em", "18em");<NEW_LINE>succeed.addEndPoint(new BlankEndPoint(EndPointAnchor.LEFT));<NEW_LINE>succeed.setStyleClass("ui-diagram-success");<NEW_LINE>Element fail = new Element("Fail", "50em", "30em");<NEW_LINE>fail.addEndPoint(new BlankEndPoint(EndPointAnchor.LEFT));<NEW_LINE>fail.setStyleClass("ui-diagram-fail");<NEW_LINE>model.addElement(start);<NEW_LINE>model.addElement(trouble);<NEW_LINE>model.addElement(giveup);<NEW_LINE>model.addElement(succeed);<NEW_LINE>model.addElement(fail);<NEW_LINE>model.connect(createConnection(start.getEndPoints().get(0), trouble.getEndPoints().get(0), null));<NEW_LINE>model.connect(createConnection(trouble.getEndPoints().get(1), giveup.getEndPoints().get(0), "Yes"));<NEW_LINE>model.connect(createConnection(giveup.getEndPoints().get(1), start.getEndPoints().get(1), "No"));<NEW_LINE>model.connect(createConnection(trouble.getEndPoints().get(2), succeed.getEndPoints().get(0), "No"));<NEW_LINE>model.connect(createConnection(giveup.getEndPoints().get(2), fail.getEndPoints().get(0), "Yes"));<NEW_LINE>}
new BlankEndPoint(EndPointAnchor.RIGHT));
1,759,590
public static Set<String> tryParseMariaDb2xConnectionUri(String connectionUri) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, NoSuchFieldException, InstantiationException {<NEW_LINE>// these are a bit more complicated<NEW_LINE>Class<?> urlParserClass = Class.forName("org.mariadb.jdbc.UrlParser");<NEW_LINE>Class<?> optionsClass = Class.forName("org.mariadb.jdbc.util.Options");<NEW_LINE>Method parseUrl = urlParserClass.getMethod("parse", String.class);<NEW_LINE>Method <MASK><NEW_LINE>Object urlParser = parseUrl.invoke(null, connectionUri);<NEW_LINE>if (urlParser == null) {<NEW_LINE>throw new IAE("Invalid URL format for MariaDB: [%s]", connectionUri);<NEW_LINE>}<NEW_LINE>Object options = getOptions.invoke(urlParser);<NEW_LINE>Field nonMappedOptionsField = optionsClass.getField(MARIADB_EXTRAS);<NEW_LINE>Properties properties = (Properties) nonMappedOptionsField.get(options);<NEW_LINE>Field[] fields = optionsClass.getDeclaredFields();<NEW_LINE>Set<String> keys = Sets.newHashSetWithExpectedSize(properties.size() + fields.length);<NEW_LINE>properties.forEach((k, v) -> keys.add((String) k));<NEW_LINE>Object defaultOptions = optionsClass.getConstructor().newInstance();<NEW_LINE>for (Field field : fields) {<NEW_LINE>if (field.getName().equals(MARIADB_EXTRAS)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!Objects.equal(field.get(options), field.get(defaultOptions))) {<NEW_LINE>keys.add(field.getName());<NEW_LINE>}<NEW_LINE>} catch (IllegalAccessException ignored) {<NEW_LINE>// ignore stuff we aren't allowed to read<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return keys;<NEW_LINE>}
getOptions = urlParserClass.getMethod("getOptions");
574,968
private void referenceUnitDuty(Business business, WoIdentity woIdentity) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(UnitDuty.class);<NEW_LINE><MASK><NEW_LINE>CriteriaQuery<UnitDuty> cq = cb.createQuery(UnitDuty.class);<NEW_LINE>Root<UnitDuty> root = cq.from(UnitDuty.class);<NEW_LINE>Predicate p = cb.isMember(woIdentity.getId(), root.get(UnitDuty_.identityList));<NEW_LINE>List<UnitDuty> os = em.createQuery(cq.select(root).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<WoUnitDuty> wos = WoUnitDuty.copier.copy(os);<NEW_LINE>wos = business.unitDuty().sort(wos);<NEW_LINE>for (WoUnitDuty woUnitDuty : wos) {<NEW_LINE>this.referenceUnit(business, woUnitDuty);<NEW_LINE>}<NEW_LINE>woIdentity.setWoUnitDutyList(wos);<NEW_LINE>}
CriteriaBuilder cb = em.getCriteriaBuilder();
398,171
private void flushStripe(FlushReason flushReason) throws IOException {<NEW_LINE>List<OrcDataOutput> outputData = new ArrayList<>();<NEW_LINE>long stripeStartOffset = orcDataSink.size();<NEW_LINE>// add header to first stripe (this is not required but nice to have)<NEW_LINE>if (closedStripes.isEmpty()) {<NEW_LINE>outputData.add(createDataOutput(MAGIC));<NEW_LINE>stripeStartOffset += MAGIC.length();<NEW_LINE>}<NEW_LINE>// add stripe data<NEW_LINE>outputData.addAll(bufferStripeData(stripeStartOffset, flushReason));<NEW_LINE>// if the file is being closed, add the file footer<NEW_LINE>if (flushReason == CLOSED) {<NEW_LINE>outputData.addAll(bufferFileFooter());<NEW_LINE>}<NEW_LINE>// write all data<NEW_LINE>orcDataSink.write(outputData);<NEW_LINE>// open next stripe<NEW_LINE>columnWriters.forEach(ColumnWriter::reset);<NEW_LINE>dictionaryCompressionOptimizer.reset();<NEW_LINE>rowGroupRowCount = 0;<NEW_LINE>stripeRowCount = 0;<NEW_LINE>bufferedBytes = toIntExact(columnWriters.stream().mapToLong(ColumnWriter<MASK><NEW_LINE>}
::getBufferedBytes).sum());
705,637
public void deleteFileCommentReactionsId(Integer id) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling deleteFileCommentReactionsId");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/file_comment_reactions/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE><MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>}
final String[] localVarAccepts = {};
1,428,656
private void checkPreviewCollection(ResourceCollection collection) {<NEW_LINE>if (collection.hasRole(Roles.PREVIEW)) {<NEW_LINE>for (LinkedResource resource : collection.getResources().asList()) {<NEW_LINE>Optional<OPFItem> item = opfHandler.getItemByPath(resource.getPath());<NEW_LINE>if (!item.isPresent() || !("application/xhtml+xml".equals(item.get().getMimeType()) || "image/svg+xml".equals(item.get().getMimeType()))) {<NEW_LINE>report.message(MessageId.OPF_075, EPUBLocation.create(path));<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>URI uri = new URI(resource.getURI());<NEW_LINE>if (Optional.fromNullable(uri.getFragment()).or("").startsWith("epubcfi(")) {<NEW_LINE>report.message(MessageId.OPF_076<MASK><NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>report.message(MessageId.RSC_020, EPUBLocation.create(path));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, EPUBLocation.create(path));
473,553
public IRubyObject in_context(ThreadContext context, IRubyObject str, IRubyObject options) {<NEW_LINE>RubyClass klass;<NEW_LINE>XmlDomParserContext ctx;<NEW_LINE>InputStream istream;<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>XmlDocument document = document(runtime);<NEW_LINE>if (document == null) {<NEW_LINE>return context.nil;<NEW_LINE>}<NEW_LINE>if (document instanceof Html4Document) {<NEW_LINE>klass = getNokogiriClass(runtime, "Nokogiri::HTML4::Document");<NEW_LINE>ctx = new HtmlDomParserContext(runtime, options);<NEW_LINE>((HtmlDomParserContext) ctx).enableDocumentFragment();<NEW_LINE>ctx.setStringInputSource(context, str, context.nil);<NEW_LINE>} else {<NEW_LINE>klass = getNokogiriClass(runtime, "Nokogiri::XML::Document");<NEW_LINE>ctx = new XmlDomParserContext(runtime, options);<NEW_LINE>ctx.setStringInputSource(context, str, context.nil);<NEW_LINE>}<NEW_LINE>// TODO: for some reason, document.getEncoding() can be null or nil (don't know why)<NEW_LINE>// run `test_parse_with_unparented_html_text_context_node' few times to see this happen<NEW_LINE>if (document instanceof Html4Document && !(document.getEncoding() == null || document.getEncoding().isNil())) {<NEW_LINE>HtmlDomParserContext htmlCtx = (HtmlDomParserContext) ctx;<NEW_LINE>htmlCtx.setEncoding(document.<MASK><NEW_LINE>}<NEW_LINE>XmlDocument doc = ctx.parse(context, klass, context.nil);<NEW_LINE>RubyArray<?> documentErrors = getErrors(document);<NEW_LINE>RubyArray<?> docErrors = getErrors(doc);<NEW_LINE>if (checkNewErrors(documentErrors, docErrors)) {<NEW_LINE>for (int i = 0; i < docErrors.getLength(); i++) {<NEW_LINE>documentErrors.append(docErrors.entry(i));<NEW_LINE>}<NEW_LINE>document.setInstanceVariable("@errors", documentErrors);<NEW_LINE>return XmlNodeSet.newNodeSet(context.runtime, IRubyObject.NULL_ARRAY, this);<NEW_LINE>}<NEW_LINE>// The first child might be document type node (dtd declaration).<NEW_LINE>// XmlNodeSet to be return should not have dtd decl in its list.<NEW_LINE>Node first;<NEW_LINE>if (doc.node.getFirstChild().getNodeType() == Node.DOCUMENT_TYPE_NODE) {<NEW_LINE>first = doc.node.getFirstChild().getNextSibling();<NEW_LINE>} else {<NEW_LINE>first = doc.node.getFirstChild();<NEW_LINE>}<NEW_LINE>IRubyObject[] nodes = new IRubyObject[] { NokogiriHelpers.getCachedNodeOrCreate(runtime, first) };<NEW_LINE>return XmlNodeSet.newNodeSet(context.runtime, nodes, this);<NEW_LINE>}
getEncoding().asJavaString());
965,968
private void registerMessageHandlers() {<NEW_LINE>messageDispatcher.registerHandler(Message.Type.<MASK><NEW_LINE>messageDispatcher.registerHandler(Message.Type.MQTT_DISCONNECT, new MqttDisconnectMessageHandler(clientManager));<NEW_LINE>messageDispatcher.registerHandler(Message.Type.MQTT_PUBLISH, new MqttMessageForwarder(subscriptionStore));<NEW_LINE>// TODO qos 1/2 PUBLISH<NEW_LINE>// TODO qos 1: PUBACK<NEW_LINE>// TODO qos 2: PUBREC<NEW_LINE>// TODO qos 2: PUBREL<NEW_LINE>// TODO qos 2: PUBCOMP<NEW_LINE>messageDispatcher.registerHandler(Message.Type.MQTT_PINGREQ, new MqttPingreqMessageHandler());<NEW_LINE>messageDispatcher.registerHandler(Message.Type.MQTT_SUBSCRIBE, new MqttSubscribeMessageHandler(subscriptionStore));<NEW_LINE>messageDispatcher.registerHandler(Message.Type.MQTT_UNSUBSCRIBE, new MqttUnsubscribeMessagHandler(subscriptionStore));<NEW_LINE>}
MQTT_CONNECT, new MqttConnectMessageHandler(clientManager));
1,633,666
private ConsumerConfig createConsumerConfig() throws UnknownHostException {<NEW_LINE>Properties props = new Properties();<NEW_LINE>props.put("zookeeper.connect", mConfig.getZookeeperQuorum() + mConfig.getKafkaZookeeperPath());<NEW_LINE>props.put("group.id", mConfig.getKafkaGroup());<NEW_LINE>props.put("zookeeper.session.timeout.ms", Integer.toString(mConfig.getZookeeperSessionTimeoutMs()));<NEW_LINE>props.put("zookeeper.sync.time.ms", Integer.toString(mConfig.getZookeeperSyncTimeMs()));<NEW_LINE>props.put("auto.commit.enable", "false");<NEW_LINE>props.put("auto.offset.reset", mConfig.getConsumerAutoOffsetReset());<NEW_LINE>props.put("consumer.timeout.ms", Integer.toString(mConfig.getConsumerTimeoutMs()));<NEW_LINE>props.put("consumer.id", IdUtil.getConsumerId());<NEW_LINE>// Properties required to upgrade from kafka 0.8.x to 0.9.x<NEW_LINE>props.put("dual.commit.enabled", mConfig.getDualCommitEnabled());<NEW_LINE>props.put(<MASK><NEW_LINE>if (mConfig.getDualCommitEnabled().equals("false") && mConfig.getOffsetsStorage() == SecorConstants.KAFKA_OFFSETS_STORAGE_KAFKA) {<NEW_LINE>throw new RuntimeException("Legacy Kafka consumer does not support storing offsets only in Kafka!");<NEW_LINE>}<NEW_LINE>props.put("partition.assignment.strategy", mConfig.getPartitionAssignmentStrategy());<NEW_LINE>if (mConfig.getRebalanceMaxRetries() != null && !mConfig.getRebalanceMaxRetries().isEmpty()) {<NEW_LINE>props.put("rebalance.max.retries", mConfig.getRebalanceMaxRetries());<NEW_LINE>}<NEW_LINE>if (mConfig.getRebalanceBackoffMs() != null && !mConfig.getRebalanceBackoffMs().isEmpty()) {<NEW_LINE>props.put("rebalance.backoff.ms", mConfig.getRebalanceBackoffMs());<NEW_LINE>}<NEW_LINE>if (mConfig.getSocketReceiveBufferBytes() != null && !mConfig.getSocketReceiveBufferBytes().isEmpty()) {<NEW_LINE>props.put("socket.receive.buffer.bytes", mConfig.getSocketReceiveBufferBytes());<NEW_LINE>}<NEW_LINE>if (mConfig.getFetchMessageMaxBytes() != null && !mConfig.getFetchMessageMaxBytes().isEmpty()) {<NEW_LINE>props.put("fetch.message.max.bytes", mConfig.getFetchMessageMaxBytes());<NEW_LINE>}<NEW_LINE>if (mConfig.getFetchMinBytes() != null && !mConfig.getFetchMinBytes().isEmpty()) {<NEW_LINE>props.put("fetch.min.bytes", mConfig.getFetchMinBytes());<NEW_LINE>}<NEW_LINE>if (mConfig.getFetchWaitMaxMs() != null && !mConfig.getFetchWaitMaxMs().isEmpty()) {<NEW_LINE>props.put("fetch.wait.max.ms", mConfig.getFetchWaitMaxMs());<NEW_LINE>}<NEW_LINE>return new ConsumerConfig(props);<NEW_LINE>}
"offsets.storage", mConfig.getOffsetsStorage());
650,130
public static Props loadProps(final String[] args, final OptionParser parser) {<NEW_LINE>final OptionSpec<String> configDirectory = parser.acceptsAll(Arrays.asList("c", "conf"), "The conf directory for Azkaban.").withRequiredArg().describedAs("conf").ofType(String.class);<NEW_LINE>// Grabbing the azkaban settings from the conf directory.<NEW_LINE>Props azkabanSettings = null;<NEW_LINE>final OptionSet options = parser.parse(args);<NEW_LINE>if (options.has(configDirectory)) {<NEW_LINE>final String path = options.valueOf(configDirectory);<NEW_LINE><MASK><NEW_LINE>final File dir = new File(path);<NEW_LINE>if (!dir.exists()) {<NEW_LINE>logger.error("Conf directory " + path + " doesn't exist.");<NEW_LINE>} else if (!dir.isDirectory()) {<NEW_LINE>logger.error("Conf directory " + path + " isn't a directory.");<NEW_LINE>} else {<NEW_LINE>azkabanSettings = loadAzkabanConfigurationFromDirectory(dir);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.info("Conf parameter not set, attempting to get value from AZKABAN_HOME env.");<NEW_LINE>azkabanSettings = loadConfigurationFromAzkabanHome();<NEW_LINE>}<NEW_LINE>if (azkabanSettings != null) {<NEW_LINE>updateDerivedConfigs(azkabanSettings);<NEW_LINE>}<NEW_LINE>return azkabanSettings;<NEW_LINE>}
logger.info("Loading azkaban settings file from " + path);
1,046,274
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>if (args.length < 1 || args[0].length() < 2) {<NEW_LINE>throw new NotEnoughArgumentsException(tl("mobsAvailable", StringUtil.joinList(Mob.getMobList())));<NEW_LINE>}<NEW_LINE>final Location target = LocationUtil.getTarget(user.getBase());<NEW_LINE>if (target.getBlock().getType() != MOB_SPAWNER) {<NEW_LINE>throw new Exception(tl("mobSpawnTarget"));<NEW_LINE>}<NEW_LINE>final String name = args[0];<NEW_LINE>int delay = 0;<NEW_LINE>final Mob mob = Mob.fromName(name);<NEW_LINE>if (mob == null) {<NEW_LINE>throw new Exception(tl("invalidMob"));<NEW_LINE>}<NEW_LINE>if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) {<NEW_LINE>throw new Exception(tl("disabledToSpawnMob"));<NEW_LINE>}<NEW_LINE>if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase(Locale.ENGLISH))) {<NEW_LINE>throw new Exception(tl("noPermToSpawnMob"));<NEW_LINE>}<NEW_LINE>if (args.length > 1 && NumberUtil.isInt(args[1]) && user.isAuthorized("essentials.spawner.delay")) {<NEW_LINE>delay = Integer.parseInt(args[1]);<NEW_LINE>}<NEW_LINE>final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess);<NEW_LINE>charge.isAffordableFor(user);<NEW_LINE>try {<NEW_LINE>final CreatureSpawner spawner = (CreatureSpawner) target.getBlock().getState();<NEW_LINE>spawner.<MASK><NEW_LINE>if (delay > 0) {<NEW_LINE>final SpawnerBlockProvider spawnerBlockProvider = ess.getSpawnerBlockProvider();<NEW_LINE>spawnerBlockProvider.setMinSpawnDelay(spawner, 1);<NEW_LINE>spawnerBlockProvider.setMaxSpawnDelay(spawner, Integer.MAX_VALUE);<NEW_LINE>spawnerBlockProvider.setMinSpawnDelay(spawner, delay);<NEW_LINE>spawnerBlockProvider.setMaxSpawnDelay(spawner, delay);<NEW_LINE>}<NEW_LINE>spawner.setDelay(delay);<NEW_LINE>spawner.update();<NEW_LINE>} catch (final Throwable ex) {<NEW_LINE>throw new Exception(tl("mobSpawnError"), ex);<NEW_LINE>}<NEW_LINE>charge.charge(user);<NEW_LINE>user.sendMessage(tl("setSpawner", mob.name));<NEW_LINE>}
setSpawnedType(mob.getType());
764,493
private void init() {<NEW_LINE>synchronized (this) {<NEW_LINE>if (this.inited) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>inited = true;<NEW_LINE>}<NEW_LINE>Object fromValues = ctx.getVariable(fromAlias.getStringValue());<NEW_LINE>if (fromValues instanceof Iterable && !(fromValues instanceof OIdentifiable)) {<NEW_LINE>fromValues = ((Iterable) fromValues).iterator();<NEW_LINE>} else if (!(fromValues instanceof Iterator)) {<NEW_LINE>fromValues = Collections.singleton(fromValues).iterator();<NEW_LINE>}<NEW_LINE>if (fromValues instanceof OInternalResultSet) {<NEW_LINE>fromValues = ((<MASK><NEW_LINE>}<NEW_LINE>Object toValues = ctx.getVariable(toAlias.getStringValue());<NEW_LINE>if (toValues instanceof Iterable && !(toValues instanceof OIdentifiable)) {<NEW_LINE>toValues = ((Iterable) toValues).iterator();<NEW_LINE>} else if (!(toValues instanceof Iterator)) {<NEW_LINE>toValues = Collections.singleton(toValues).iterator();<NEW_LINE>}<NEW_LINE>if (toValues instanceof OInternalResultSet) {<NEW_LINE>toValues = ((OInternalResultSet) toValues).copy();<NEW_LINE>}<NEW_LINE>fromIter = (Iterator) fromValues;<NEW_LINE>if (fromIter instanceof OResultSet) {<NEW_LINE>try {<NEW_LINE>((OResultSet) fromIter).reset();<NEW_LINE>} catch (Exception ignore) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator toIter = (Iterator) toValues;<NEW_LINE>if (toIter instanceof OResultSet) {<NEW_LINE>try {<NEW_LINE>((OResultSet) toIter).reset();<NEW_LINE>} catch (Exception ignore) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (toIter != null && toIter.hasNext()) {<NEW_LINE>toList.add(toIter.next());<NEW_LINE>}<NEW_LINE>toIterator = toList.iterator();<NEW_LINE>currentFrom = fromIter != null && fromIter.hasNext() ? asVertex(fromIter.next()) : null;<NEW_LINE>if (uniqueIndexName != null) {<NEW_LINE>final ODatabaseDocumentInternal database = (ODatabaseDocumentInternal) ctx.getDatabase();<NEW_LINE>uniqueIndex = database.getMetadata().getIndexManagerInternal().getIndex(database, uniqueIndexName);<NEW_LINE>if (uniqueIndex == null) {<NEW_LINE>throw new OCommandExecutionException("Index not found for upsert: " + uniqueIndexName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
OInternalResultSet) fromValues).copy();
1,429,165
public final void switchRows(final int from, int to, final int sortColumn, final boolean ascending) {<NEW_LINE>log.debug("Row index={}->{}, sortColumn={}, ascending={}", from, to, sortColumn, ascending);<NEW_LINE>// nothing to do<NEW_LINE>if (from == to) {<NEW_LINE>log.trace("nothing to do - from == to");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check if lines are editable<NEW_LINE>if (!(m_mTable.isRowEditable(from) && m_mTable.isRowEditable(to))) {<NEW_LINE>log.trace("row not editable - return");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Row range check<NEW_LINE>to = verifyRow(to);<NEW_LINE>if (to == -1) {<NEW_LINE>log.trace("Row range check - return");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Check, if we have old uncommitted data<NEW_LINE><MASK><NEW_LINE>// find the line column<NEW_LINE>int lineCol = m_mTable.findColumn("Line");<NEW_LINE>if (lineCol == -1) {<NEW_LINE>lineCol = m_mTable.findColumn("SeqNo");<NEW_LINE>}<NEW_LINE>if (lineCol == -1) {<NEW_LINE>// no Line, no SeqNo<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// get the line/seq numbers<NEW_LINE>Integer lineNoCurrentRow = null;<NEW_LINE>Integer lineNoNextRow = null;<NEW_LINE>if (m_mTable.getValueAt(from, lineCol) instanceof Integer) {<NEW_LINE>lineNoCurrentRow = (Integer) m_mTable.getValueAt(from, lineCol);<NEW_LINE>lineNoNextRow = (Integer) m_mTable.getValueAt(to, lineCol);<NEW_LINE>} else if (m_mTable.getValueAt(from, lineCol) instanceof BigDecimal) {<NEW_LINE>lineNoCurrentRow = new Integer(((BigDecimal) m_mTable.getValueAt(from, lineCol)).intValue());<NEW_LINE>lineNoNextRow = new Integer(((BigDecimal) m_mTable.getValueAt(to, lineCol)).intValue());<NEW_LINE>} else {<NEW_LINE>log.debug("unknown value format - return");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// don't sort special lines like taxes<NEW_LINE>if (lineNoCurrentRow >= 9900 || lineNoNextRow >= 9900) {<NEW_LINE>log.debug("don't sort - might be special lines");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// switch the line numbers and save new values<NEW_LINE>m_mTable.setValueAt(lineNoCurrentRow, to, lineCol);<NEW_LINE>setCurrentRow(to, false);<NEW_LINE>m_mTable.dataSave(true);<NEW_LINE>m_mTable.setValueAt(lineNoNextRow, from, lineCol);<NEW_LINE>setCurrentRow(from, false);<NEW_LINE>m_mTable.dataSave(true);<NEW_LINE>// resort<NEW_LINE>if (sortColumn != -1) {<NEW_LINE>m_mTable.sort(sortColumn, ascending);<NEW_LINE>} else {<NEW_LINE>m_mTable.sort(lineCol, true);<NEW_LINE>}<NEW_LINE>navigate(to);<NEW_LINE>}
m_mTable.dataSave(to, false);
360,206
public void annotate(Annotation annotation) {<NEW_LINE>if (annotation.containsKey(CoreAnnotations.SentencesAnnotation.class)) {<NEW_LINE>// parse a tree for each sentence<NEW_LINE>for (CoreMap sentence : annotation.get(CoreAnnotations.SentencesAnnotation.class)) {<NEW_LINE>List<CoreLabel> words = sentence.<MASK><NEW_LINE>if (VERBOSE) {<NEW_LINE>log.info("Parsing: " + words);<NEW_LINE>}<NEW_LINE>int maxSentenceLength = parser.getMaxSentenceLength();<NEW_LINE>// generate the constituent tree<NEW_LINE>// initialized below<NEW_LINE>Tree tree;<NEW_LINE>if (maxSentenceLength <= 0 || words.size() < maxSentenceLength) {<NEW_LINE>tree = parser.getBestParse(words);<NEW_LINE>} else {<NEW_LINE>tree = ParserUtils.xTree(words);<NEW_LINE>}<NEW_LINE>List<Tree> trees = Generics.newArrayList(1);<NEW_LINE>trees.add(tree);<NEW_LINE>ParserAnnotatorUtils.fillInParseAnnotations(VERBOSE, BUILD_GRAPHS, gsf, sentence, trees, GrammaticalStructure.Extras.NONE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("unable to find sentences in: " + annotation);<NEW_LINE>}<NEW_LINE>}
get(CoreAnnotations.TokensAnnotation.class);
680,285
public static DescribePendingMaintenanceActionResponse unmarshall(DescribePendingMaintenanceActionResponse describePendingMaintenanceActionResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePendingMaintenanceActionResponse.setRequestId(_ctx.stringValue("DescribePendingMaintenanceActionResponse.RequestId"));<NEW_LINE>describePendingMaintenanceActionResponse.setTotalRecordCount(_ctx.integerValue("DescribePendingMaintenanceActionResponse.TotalRecordCount"));<NEW_LINE>describePendingMaintenanceActionResponse.setPageSize(_ctx.integerValue("DescribePendingMaintenanceActionResponse.PageSize"));<NEW_LINE>describePendingMaintenanceActionResponse.setPageNumber(_ctx.integerValue("DescribePendingMaintenanceActionResponse.PageNumber"));<NEW_LINE>List<ItemsItem> items = new ArrayList<ItemsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePendingMaintenanceActionResponse.Items.Length"); i++) {<NEW_LINE>ItemsItem itemsItem = new ItemsItem();<NEW_LINE>itemsItem.setStatus(_ctx.integerValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].Status"));<NEW_LINE>itemsItem.setPrepareInterval(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].PrepareInterval"));<NEW_LINE>itemsItem.setDeadline(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].Deadline"));<NEW_LINE>itemsItem.setDBType(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].DBType"));<NEW_LINE>itemsItem.setTaskType(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].TaskType"));<NEW_LINE>itemsItem.setStartTime(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].StartTime"));<NEW_LINE>itemsItem.setDBVersion(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].DBVersion"));<NEW_LINE>itemsItem.setModifiedTime(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].ModifiedTime"));<NEW_LINE>itemsItem.setDBClusterId(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].DBClusterId"));<NEW_LINE>itemsItem.setRegion(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].Region"));<NEW_LINE>itemsItem.setResultInfo(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].ResultInfo"));<NEW_LINE>itemsItem.setCreatedTime(_ctx.stringValue<MASK><NEW_LINE>itemsItem.setId(_ctx.integerValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].Id"));<NEW_LINE>itemsItem.setSwitchTime(_ctx.stringValue("DescribePendingMaintenanceActionResponse.Items[" + i + "].SwitchTime"));<NEW_LINE>items.add(itemsItem);<NEW_LINE>}<NEW_LINE>describePendingMaintenanceActionResponse.setItems(items);<NEW_LINE>return describePendingMaintenanceActionResponse;<NEW_LINE>}
("DescribePendingMaintenanceActionResponse.Items[" + i + "].CreatedTime"));
830,932
private Breakpoint added(JPDABreakpoint b) {<NEW_LINE>if (b instanceof LineBreakpoint) {<NEW_LINE>LineBreakpoint lb = (LineBreakpoint) b;<NEW_LINE>URL url;<NEW_LINE>try {<NEW_LINE>url = new URL(lb.getURL());<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String filePath = null;<NEW_LINE>FileObject fo = URLMapper.findFileObject(url);<NEW_LINE>for (FileObject root : GlobalPathRegistry.getDefault().getSourceRoots()) {<NEW_LINE>if (FileUtil.isParentOf(root, fo)) {<NEW_LINE>String path = FileUtil.getRelativePath(root, fo);<NEW_LINE>filePath = SOURCES_FOLDER + File.separator + path;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (filePath == null) {<NEW_LINE>try {<NEW_LINE>filePath = new File(url.toURI()).getAbsolutePath();<NEW_LINE>} catch (URISyntaxException ex) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NILineBreakpointDescriptor niBreakpointDescriptor = NILineBreakpointDescriptor.newBuilder(filePath, lb.getLineNumber()).condition(lb.getCondition()).enabled(lb.isEnabled()).hidden(true).build();<NEW_LINE>Object nativeBreakpoint = <MASK><NEW_LINE>return (Breakpoint) nativeBreakpoint;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
debugger.addLineBreakpoint(lb, niBreakpointDescriptor);
1,409,008
public Page[] sliceAndRetainPagesTo(long to) {<NEW_LINE>if (to > capacity) {<NEW_LINE>throw new IndexOutOfBoundsException("can't slice a channel buffer with capacity [" + capacity + "], with slice parameters to [" + to + "]");<NEW_LINE>} else if (to == 0) {<NEW_LINE>return EMPTY_BYTE_PAGE_ARRAY;<NEW_LINE>}<NEW_LINE>long indexWithOffset = to + offset;<NEW_LINE>int pageCount = pageIndex(indexWithOffset);<NEW_LINE>int finalLimit = indexInPage(indexWithOffset);<NEW_LINE>if (finalLimit != 0) {<NEW_LINE>pageCount += 1;<NEW_LINE>}<NEW_LINE>Page[] pages = new Page[pageCount];<NEW_LINE>Iterator<Page> pageIterator = this.pages.iterator();<NEW_LINE>Page firstPage = pageIterator.next().duplicate();<NEW_LINE>ByteBuffer firstBuffer = firstPage.byteBuffer();<NEW_LINE>firstBuffer.position(firstBuffer.position() + offset);<NEW_LINE>pages[0] = firstPage;<NEW_LINE>for (int i = 1; i < pages.length; i++) {<NEW_LINE>pages[i] = pageIterator.next().duplicate();<NEW_LINE>}<NEW_LINE>if (finalLimit != 0) {<NEW_LINE>pages[pages.length - 1].<MASK><NEW_LINE>}<NEW_LINE>return pages;<NEW_LINE>}
byteBuffer().limit(finalLimit);
1,365,818
public static void throwException(Throwable exception) {<NEW_LINE>thrownException = exception;<NEW_LINE>RuntimeObject exceptionPtr = Address.ofObject(exception).toStructure();<NEW_LINE>RuntimeClass exceptionClass = RuntimeClass.getClass(exceptionPtr);<NEW_LINE>Address stackFrame = ShadowStack.getStackTop();<NEW_LINE>int handlerId = 0;<NEW_LINE>stackLoop: while (stackFrame != null) {<NEW_LINE>int callSiteId = ShadowStack.getCallSiteId(stackFrame);<NEW_LINE>if (callSiteId >= 0) {<NEW_LINE>CallSite <MASK><NEW_LINE>ExceptionHandler handler = callSite.firstHandler;<NEW_LINE>while (handler != null) {<NEW_LINE>if (handler.exceptionClass == null || handler.exceptionClass.isSupertypeOf.apply(exceptionClass)) {<NEW_LINE>handlerId = handler.id;<NEW_LINE>if (!isJumpSupported()) {<NEW_LINE>ShadowStack.setExceptionHandlerId(stackFrame, handlerId);<NEW_LINE>}<NEW_LINE>break stackLoop;<NEW_LINE>}<NEW_LINE>handler = handler.next;<NEW_LINE>}<NEW_LINE>if (!isJumpSupported()) {<NEW_LINE>ShadowStack.setExceptionHandlerId(stackFrame, callSiteId - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stackFrame = ShadowStack.getNextStackFrame(stackFrame);<NEW_LINE>}<NEW_LINE>if (stackFrame == null) {<NEW_LINE>stackFrame = ShadowStack.getStackTop();<NEW_LINE>while (stackFrame != null) {<NEW_LINE>int callSiteId = ShadowStack.getCallSiteId(stackFrame);<NEW_LINE>if (callSiteId >= 0) {<NEW_LINE>ShadowStack.setExceptionHandlerId(stackFrame, callSiteId + 1);<NEW_LINE>}<NEW_LINE>stackFrame = ShadowStack.getNextStackFrame(stackFrame);<NEW_LINE>}<NEW_LINE>printStack();<NEW_LINE>abort();<NEW_LINE>} else if (isJumpSupported()) {<NEW_LINE>jumpToFrame(stackFrame, handlerId);<NEW_LINE>}<NEW_LINE>}
callSite = findCallSiteById(callSiteId, stackFrame);
834,901
protected void createPreViews() {<NEW_LINE>reflectionCam = new Camera(renderWidth, renderHeight);<NEW_LINE>refractionCam = new Camera(renderWidth, renderHeight);<NEW_LINE>// create a pre-view. a view that is rendered before the main view<NEW_LINE>reflectionView = new ViewPort("Reflection View", reflectionCam);<NEW_LINE>reflectionView.setClearFlags(true, true, true);<NEW_LINE><MASK><NEW_LINE>// create offscreen framebuffer<NEW_LINE>reflectionBuffer = new FrameBuffer(renderWidth, renderHeight, 1);<NEW_LINE>// setup framebuffer to use texture<NEW_LINE>reflectionBuffer.setDepthTarget(FrameBufferTarget.newTarget(Format.Depth));<NEW_LINE>reflectionBuffer.addColorTarget(FrameBufferTarget.newTarget(reflectionTexture));<NEW_LINE>// set viewport to render to offscreen framebuffer<NEW_LINE>reflectionView.setOutputFrameBuffer(reflectionBuffer);<NEW_LINE>reflectionView.addProcessor(new ReflectionProcessor(reflectionCam, reflectionBuffer, reflectionClipPlane));<NEW_LINE>// attach the scene to the viewport to be rendered<NEW_LINE>reflectionView.attachScene(reflectionScene);<NEW_LINE>// create a pre-view. a view that is rendered before the main view<NEW_LINE>refractionView = new ViewPort("Refraction View", refractionCam);<NEW_LINE>refractionView.setClearFlags(true, true, true);<NEW_LINE>refractionView.setBackgroundColor(ColorRGBA.Black);<NEW_LINE>// create offscreen framebuffer<NEW_LINE>refractionBuffer = new FrameBuffer(renderWidth, renderHeight, 1);<NEW_LINE>// setup framebuffer to use texture<NEW_LINE>refractionBuffer.addColorTarget(FrameBufferTarget.newTarget(refractionTexture));<NEW_LINE>refractionBuffer.setDepthTarget(FrameBufferTarget.newTarget(depthTexture));<NEW_LINE>// set viewport to render to offscreen framebuffer<NEW_LINE>refractionView.setOutputFrameBuffer(refractionBuffer);<NEW_LINE>refractionView.addProcessor(new RefractionProcessor());<NEW_LINE>// attach the scene to the viewport to be rendered<NEW_LINE>refractionView.attachScene(reflectionScene);<NEW_LINE>}
reflectionView.setBackgroundColor(ColorRGBA.Black);
444,560
public static String preprocessXhtmlNamespaceDeclaration(String value) {<NEW_LINE>if (value.charAt(0) != '<') {<NEW_LINE>value = DIV_OPEN_FIRST + value + "</div>";<NEW_LINE>}<NEW_LINE>boolean <MASK><NEW_LINE>int firstTagIndex = value.indexOf("<", hasProcessingInstruction ? 1 : 0);<NEW_LINE>if (firstTagIndex != -1) {<NEW_LINE>int firstTagEnd = value.indexOf(">", firstTagIndex);<NEW_LINE>int firstSlash = value.indexOf("/", firstTagIndex);<NEW_LINE>if (firstTagEnd != -1) {<NEW_LINE>if (firstSlash > firstTagEnd) {<NEW_LINE>String firstTag = value.substring(firstTagIndex, firstTagEnd);<NEW_LINE>if (!firstTag.contains(" xmlns")) {<NEW_LINE>value = value.substring(0, firstTagEnd) + DECL_XMLNS + value.substring(firstTagEnd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
hasProcessingInstruction = value.startsWith("<?");
747,518
public static Interval ofHoursMinutesNanos(long hours, int minutes, long nanos) {<NEW_LINE>// Interval is negative if any field is negative<NEW_LINE>boolean negative = (hours | minutes | nanos) < 0;<NEW_LINE>if (negative) {<NEW_LINE>// Ensure that all fields are negative or zero<NEW_LINE>if (hours > 0 || minutes > 0 || nanos > 0) {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>// Make them positive<NEW_LINE>hours = -hours;<NEW_LINE>minutes = -minutes;<NEW_LINE>nanos = -nanos;<NEW_LINE>if ((minutes | nanos) < 0) {<NEW_LINE>// Integer.MIN_VALUE, Long.MIN_VALUE<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>// hours = Long.MIN_VALUE will be rejected by constructor<NEW_LINE>}<NEW_LINE>// Check only nanoseconds.<NEW_LINE>// Overflow in hours or minutes will be detected by constructor<NEW_LINE>if (nanos >= NANOS_PER_MINUTE) {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>return new Interval(IntervalQualifier.HOUR_TO_SECOND, negative, <MASK><NEW_LINE>}
hours, minutes * NANOS_PER_MINUTE + nanos);
1,075,995
private static boolean allowInstantRename(CompilationInfo info, Element e, ElementUtilities eu) {<NEW_LINE>if (e.getKind() == ElementKind.FIELD) {<NEW_LINE>VariableElement variableElement = (VariableElement) e;<NEW_LINE>TypeElement typeElement = eu.enclosingTypeElement(e);<NEW_LINE>boolean isProperty = false;<NEW_LINE>try {<NEW_LINE>CodeStyle codeStyle = CodeStyle.<MASK><NEW_LINE>isProperty = eu.hasGetter(typeElement, variableElement, codeStyle);<NEW_LINE>isProperty = isProperty || (!variableElement.getModifiers().contains(Modifier.FINAL) && eu.hasSetter(typeElement, variableElement, codeStyle));<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>if (isProperty) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (org.netbeans.modules.java.editor.base.semantic.Utilities.isPrivateElement(e)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (isInaccessibleOutsideOuterClass(e, eu)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// #92160: check for local classes:<NEW_LINE>if (e.getKind() == ElementKind.CLASS) {<NEW_LINE>// only classes can be local<NEW_LINE>Element enclosing = e.getEnclosingElement();<NEW_LINE>final ElementKind enclosingKind = enclosing.getKind();<NEW_LINE>// #150352: parent is annonymous class<NEW_LINE>if (enclosingKind == ElementKind.CLASS) {<NEW_LINE>final Set<ElementKind> fm = EnumSet.of(ElementKind.METHOD, ElementKind.FIELD);<NEW_LINE>if (enclosing.getSimpleName().length() == 0 || fm.contains(enclosing.getEnclosingElement().getKind())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return LOCAL_CLASS_PARENTS.contains(enclosingKind);<NEW_LINE>}<NEW_LINE>if (e.getKind() == ElementKind.TYPE_PARAMETER) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getDefault(info.getDocument());
1,751,918
public static void main(String[] args) {<NEW_LINE>AWSCredentials credentials = null;<NEW_LINE>try {<NEW_LINE>credentials = new PropertiesCredentials(EmrHelper.class.getResourceAsStream("AwsCredentials.properties"));<NEW_LINE>} catch (IOException e1) {<NEW_LINE>System.out.println("Credentials were not properly entered into AwsCredentials.properties.");<NEW_LINE>System.out.println(e1.getMessage());<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>AmazonElasticMapReduce client = new AmazonElasticMapReduceClient(credentials);<NEW_LINE>// predefined steps. See StepFactory for list of predefined steps<NEW_LINE>StepConfig hive = new StepConfig("Hive", new StepFactory().newInstallHiveStep());<NEW_LINE>// A custom step<NEW_LINE>HadoopJarStepConfig hadoopConfig1 = // optional main class, this can be omitted if jar above has a manifest<NEW_LINE>new HadoopJarStepConfig().withJar("s3://mybucket/my-jar-location1").// optional main class, this can be omitted if jar above has a manifest<NEW_LINE>withMainClass(// optional list of arguments<NEW_LINE>"com.my.Main1").// optional list of arguments<NEW_LINE>withArgs("--verbose");<NEW_LINE>StepConfig customStep = new StepConfig("Step1", hadoopConfig1);<NEW_LINE>AddJobFlowStepsResult result = client.addJobFlowSteps(new AddJobFlowStepsRequest().withJobFlowId("j-1HTE8WKS7SODR").withSteps(hive, customStep));<NEW_LINE>System.out.<MASK><NEW_LINE>}
println(result.getStepIds());
1,651,526
public void updateAnomalyAlertConfigurationWithResponse() {<NEW_LINE>// BEGIN: com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.updateAlertConfigWithResponse#AnomalyAlertConfiguration-Context<NEW_LINE>String alertConfigId = "1p0f8er30-6e6e-4391-b78f-bpfdfee1e6f5";<NEW_LINE>String additionalHookId = "2gh8er30-6e6e-4391-b78f-bpfdfee1e6f5";<NEW_LINE>AnomalyAlertConfiguration existingAnomalyConfig = metricsAdvisorAdminClient.getAlertConfig(alertConfigId);<NEW_LINE>List<String> hookIds = new ArrayList<>(existingAnomalyConfig.getHookIdsToAlert());<NEW_LINE>hookIds.add(additionalHookId);<NEW_LINE>final Response<AnomalyAlertConfiguration> alertConfigurationResponse = metricsAdvisorAdminClient.updateAlertConfigWithResponse(existingAnomalyConfig.setHookIdsToAlert(hookIds).setDescription<MASK><NEW_LINE>System.out.printf("Update anomaly alert operation status: %s%n", alertConfigurationResponse.getStatusCode());<NEW_LINE>final AnomalyAlertConfiguration updatAnomalyAlertConfiguration = alertConfigurationResponse.getValue();<NEW_LINE>System.out.printf("Updated anomaly alert configuration Id: %s%n", updatAnomalyAlertConfiguration.getId());<NEW_LINE>System.out.printf("Updated anomaly alert configuration description: %s%n", updatAnomalyAlertConfiguration.getDescription());<NEW_LINE>System.out.printf("Updated anomaly alert configuration hook ids: %sf%n", updatAnomalyAlertConfiguration.getHookIdsToAlert());<NEW_LINE>// END: com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.updateAlertConfigWithResponse#AnomalyAlertConfiguration-Context<NEW_LINE>}
("updated to add more hook ids"), Context.NONE);
777,762
public Query toQuery(Class<?> clazz, String whereClause, Object[] params, String trxName) {<NEW_LINE>String tableName;<NEW_LINE>// Get Table_Name by Class<NEW_LINE>// TODO: refactor<NEW_LINE>try {<NEW_LINE>tableName = (String) clazz.getField("Table_Name").get(null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AdempiereException(e);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>Properties ctx = Env.getCtx();<NEW_LINE>MTable table = MTable.get(ctx, tableName);<NEW_LINE>ArrayList<Object> finalParams = new ArrayList<Object>();<NEW_LINE>StringBuffer finalWhereClause = new StringBuffer();<NEW_LINE>finalWhereClause.append(I_AD_Client.COLUMNNAME_AD_Client_ID + "=? ");<NEW_LINE>finalParams.add(this.AD_Client_ID);<NEW_LINE>finalWhereClause.append(" AND " + I_C_AcctSchema.COLUMNNAME_C_AcctSchema_ID + "=?");<NEW_LINE>finalParams.add(this.C_AcctSchema_ID);<NEW_LINE>finalWhereClause.append(" AND " + I_AD_Org.COLUMNNAME_AD_Org_ID + "=?");<NEW_LINE>finalParams.add(this.AD_Org_ID);<NEW_LINE>finalWhereClause.append(" AND (").append(I_M_Warehouse.COLUMNNAME_M_Warehouse_ID).append(" IS NULL OR ").append(I_M_Warehouse.COLUMNNAME_M_Warehouse_ID + "=? )");<NEW_LINE>finalParams.add(this.M_Warehouse_ID);<NEW_LINE>finalWhereClause.append(" AND " + I_M_Product.COLUMNNAME_M_Product_ID + "=?");<NEW_LINE>finalParams.add(this.M_Product_ID);<NEW_LINE>finalWhereClause.append(" AND " + I_M_AttributeInstance.COLUMNNAME_M_AttributeSetInstance_ID + "=?");<NEW_LINE>finalParams.add(this.M_AttributeSetInstance_ID);<NEW_LINE>if (this.M_CostElement_ID != ANY) {<NEW_LINE>finalWhereClause.append(" AND " + I_M_CostElement.COLUMNNAME_M_CostElement_ID + "=?");<NEW_LINE>finalParams.add(this.M_CostElement_ID);<NEW_LINE>}<NEW_LINE>if (this.M_CostType_ID != ANY && table.getColumn(I_M_CostType.COLUMNNAME_M_CostType_ID) != null) {<NEW_LINE>finalWhereClause.append(" AND " + I_M_CostType.COLUMNNAME_M_CostType_ID + "=?");<NEW_LINE>finalParams.add(this.M_CostType_ID);<NEW_LINE>}<NEW_LINE>if (!Util.isEmpty(whereClause, true)) {<NEW_LINE>finalWhereClause.append(" AND (").append(whereClause).append(")");<NEW_LINE>if (params != null && params.length > 0) {<NEW_LINE>for (Object p : params) {<NEW_LINE>finalParams.add(p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Query(ctx, tableName, finalWhereClause.toString()<MASK><NEW_LINE>}
, trxName).setParameters(finalParams);
508,949
private String lookupIdentifiers(List<BibEntry> bibEntries) {<NEW_LINE>String totalCount = Integer.toString(bibEntries.size());<NEW_LINE>NamedCompound namedCompound = new NamedCompound(Localization.lang("Look up %0", fetcher.getIdentifierName()));<NEW_LINE>int count = 0;<NEW_LINE>int foundCount = 0;<NEW_LINE>for (BibEntry bibEntry : bibEntries) {<NEW_LINE>count++;<NEW_LINE>final String statusMessage = Localization.lang("Looking up %0... - entry %1 out of %2 - found %3", fetcher.getIdentifierName(), Integer.toString(count), totalCount, Integer.toString(foundCount));<NEW_LINE>DefaultTaskExecutor.runInJavaFXThread(() -> frame.getDialogService().notify(statusMessage));<NEW_LINE>Optional<T> identifier = Optional.empty();<NEW_LINE>try {<NEW_LINE>identifier = fetcher.findIdentifier(bibEntry);<NEW_LINE>} catch (FetcherException e) {<NEW_LINE>LOGGER.error("Could not fetch " + fetcher.getIdentifierName(), e);<NEW_LINE>}<NEW_LINE>if (identifier.isPresent() && !bibEntry.hasField(identifier.get().getDefaultField())) {<NEW_LINE>Optional<FieldChange> fieldChange = bibEntry.setField(identifier.get().getDefaultField(), identifier.get().getNormalized());<NEW_LINE>if (fieldChange.isPresent()) {<NEW_LINE>namedCompound.addEdit(new UndoableFieldChange(fieldChange.get()));<NEW_LINE>foundCount++;<NEW_LINE>final String nextStatusMessage = Localization.lang("Looking up %0... - entry %1 out of %2 - found %3", fetcher.getIdentifierName(), Integer.toString(count), totalCount, Integer.toString(foundCount));<NEW_LINE>DefaultTaskExecutor.runInJavaFXThread(() -> frame.getDialogService<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>namedCompound.end();<NEW_LINE>if (foundCount > 0) {<NEW_LINE>undoManager.addEdit(namedCompound);<NEW_LINE>}<NEW_LINE>return Localization.lang("Determined %0 for %1 entries", fetcher.getIdentifierName(), Integer.toString(foundCount));<NEW_LINE>}
().notify(nextStatusMessage));
324,655
private void pretifyXml(String path) throws ReportException {<NEW_LINE>final String outputPath = path + ".pretty";<NEW_LINE>final File in = new File(path);<NEW_LINE>final File out = new File(outputPath);<NEW_LINE>try (OutputStream os = new FileOutputStream(out)) {<NEW_LINE>final TransformerFactory transformerFactory = SAXTransformerFactory.newInstance();<NEW_LINE>transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);<NEW_LINE>final Transformer transformer = transformerFactory.newTransformer();<NEW_LINE>transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");<NEW_LINE>transformer.setOutputProperty(OutputKeys.INDENT, "yes");<NEW_LINE><MASK><NEW_LINE>final SAXSource saxs = new SAXSource(new InputSource(path));<NEW_LINE>final XMLReader saxReader = XmlUtils.buildSecureSaxParser().getXMLReader();<NEW_LINE>saxs.setXMLReader(saxReader);<NEW_LINE>transformer.transform(saxs, new StreamResult(new OutputStreamWriter(os, "utf-8")));<NEW_LINE>} catch (ParserConfigurationException | TransformerConfigurationException ex) {<NEW_LINE>LOGGER.debug("Configuration exception when pretty printing", ex);<NEW_LINE>LOGGER.error("Unable to generate pretty report, caused by: {}", ex.getMessage());<NEW_LINE>} catch (TransformerException | SAXException | IOException ex) {<NEW_LINE>LOGGER.debug("Malformed XML?", ex);<NEW_LINE>LOGGER.error("Unable to generate pretty report, caused by: {}", ex.getMessage());<NEW_LINE>}<NEW_LINE>if (out.isFile() && in.isFile() && in.delete()) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>org.apache.commons.io.FileUtils.moveFile(out, in);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.error("Unable to generate pretty report, caused by: {}", ex.getMessage());<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>LOGGER.error("Unable to generate pretty report, caused by: {}", ex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
956,730
private void calculateEarliestAndLatestTimestamps(List<AccountType> accountTypeList) {<NEW_LINE>if (mReportPeriodStart != -1 && mReportPeriodEnd != -1) {<NEW_LINE>mEarliestTransactionTimestamp = mReportPeriodStart;<NEW_LINE>mLatestTransactionTimestamp = mReportPeriodEnd;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TransactionsDbAdapter dbAdapter = TransactionsDbAdapter.getInstance();<NEW_LINE>for (Iterator<AccountType> iter = accountTypeList.iterator(); iter.hasNext(); ) {<NEW_LINE>AccountType type = iter.next();<NEW_LINE>long earliest = dbAdapter.getTimestampOfEarliestTransaction(type, mCommodity.getCurrencyCode());<NEW_LINE>long latest = dbAdapter.getTimestampOfLatestTransaction(type, mCommodity.getCurrencyCode());<NEW_LINE>if (earliest > 0 && latest > 0) {<NEW_LINE>mEarliestTimestampsMap.put(type, earliest);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mEarliestTimestampsMap.isEmpty() || mLatestTimestampsMap.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Long> timestamps = new ArrayList<>(mEarliestTimestampsMap.values());<NEW_LINE>timestamps.addAll(mLatestTimestampsMap.values());<NEW_LINE>Collections.sort(timestamps);<NEW_LINE>mEarliestTransactionTimestamp = timestamps.get(0);<NEW_LINE>mLatestTransactionTimestamp = timestamps.get(timestamps.size() - 1);<NEW_LINE>}
mLatestTimestampsMap.put(type, latest);
1,488,175
/*<NEW_LINE>* Called by Declarative Services to activate service<NEW_LINE>*/<NEW_LINE>@Activate<NEW_LINE>protected void activate(ComponentContext cc) throws Exception {<NEW_LINE>RuntimeDelegate.setInstance(new RuntimeDelegateImpl());<NEW_LINE>// This is a workaroud to avoid invoking createWoodstoxFactory in org.apache.cxf.staxutils.StaxUtils.createXMLInputFactor<NEW_LINE>AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean run() throws Exception {<NEW_LINE>// sets the bla property without throwing an exception -> ok<NEW_LINE>System.setProperty(StaxUtils.ALLOW_INSECURE_PARSER, "1");<NEW_LINE>return Boolean.TRUE;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ClassLoader orignalClassLoader = THREAD_CONTEXT_ACCESSOR.getContextClassLoader(Thread.currentThread());<NEW_LINE>try {<NEW_LINE>// Make sure the current ThreadContextClassLoader is not an App classloader<NEW_LINE>THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), JaxRsServiceActivator.class.getClassLoader());<NEW_LINE>Map<String, Object> properties = new HashMap<String, Object>();<NEW_LINE><MASK><NEW_LINE>Bus defaultBus = LibertyApplicationBusFactory.getInstance().createBus(null, properties);<NEW_LINE>LibertyApplicationBusFactory.setDefaultBus(defaultBus);<NEW_LINE>} finally {<NEW_LINE>THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), orignalClassLoader);<NEW_LINE>}<NEW_LINE>}
properties.put("org.apache.cxf.bus.id", "Default Bus");
1,741,838
public // }<NEW_LINE>ByteString handleInvokeChaincode(String chaincodeName, String function, String[] args, String uuid) {<NEW_LINE>// Check if this is a transaction<NEW_LINE>if (!isTransaction.containsKey(uuid)) {<NEW_LINE>throw new RuntimeException("Cannot invoke chaincode in query context");<NEW_LINE>}<NEW_LINE>ChaincodeID id = ChaincodeID.newBuilder().setName(chaincodeName).build();<NEW_LINE>ChaincodeInput input = ChaincodeInput.newBuilder().setFunction(function).addAllArgs(Arrays.asList(args)).build();<NEW_LINE>ChaincodeSpec payload = ChaincodeSpec.newBuilder().setChaincodeID(id).<MASK><NEW_LINE>// Create the channel on which to communicate the response from validating peer<NEW_LINE>Channel<ChaincodeMessage> responseChannel;<NEW_LINE>try {<NEW_LINE>responseChannel = createChannel(uuid);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(String.format("[%s]Another state request pending for this Uuid. Cannot process.", shortUUID(uuid)));<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>// Defer<NEW_LINE>try {<NEW_LINE>// Send INVOKE_CHAINCODE message to validator chaincode support<NEW_LINE>ChaincodeMessage message = ChaincodeMessage.newBuilder().setType(INVOKE_CHAINCODE).setPayload(payload.toByteString()).setUuid(uuid).build();<NEW_LINE>logger.debug(String.format("[%s]Sending %s", shortUUID(message), INVOKE_CHAINCODE));<NEW_LINE>try {<NEW_LINE>serialSend(message);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("[" + shortUUID(message) + "]Error sending " + INVOKE_CHAINCODE + ": " + e.getMessage());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>// Wait on responseChannel for response<NEW_LINE>ChaincodeMessage response;<NEW_LINE>try {<NEW_LINE>response = receiveChannel(responseChannel);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(String.format("[%s]Received unexpected message type", shortUUID(message)));<NEW_LINE>throw new RuntimeException("Received unexpected message type");<NEW_LINE>}<NEW_LINE>if (response.getType() == RESPONSE) {<NEW_LINE>// Success response<NEW_LINE>logger.debug(String.format("[%s]Received %s. Successfully invoked chaincode", shortUUID(response.getUuid()), RESPONSE));<NEW_LINE>return response.getPayload();<NEW_LINE>}<NEW_LINE>if (response.getType() == ERROR) {<NEW_LINE>// Error response<NEW_LINE>logger.error(String.format("[%s]Received %s.", shortUUID(response.getUuid()), ERROR));<NEW_LINE>throw new RuntimeException(response.getPayload().toStringUtf8());<NEW_LINE>}<NEW_LINE>// Incorrect chaincode message received<NEW_LINE>logger.debug(String.format("[%s]Incorrect chaincode message %s received. Expecting %s or %s", shortUUID(response.getUuid()), response.getType(), RESPONSE, ERROR));<NEW_LINE>throw new RuntimeException("Incorrect chaincode message received");<NEW_LINE>} finally {<NEW_LINE>deleteChannel(uuid);<NEW_LINE>}<NEW_LINE>}
setCtorMsg(input).build();
940,464
public void awakeFromNib() {<NEW_LINE>// Reset<NEW_LINE>NSEnumerator items = tabView.tabViewItems().objectEnumerator();<NEW_LINE>NSObject object;<NEW_LINE>while ((object = items.nextObject()) != null) {<NEW_LINE>this.tabView.removeTabViewItem(Rococoa.cast(object, NSTabViewItem.class));<NEW_LINE>}<NEW_LINE>// Insert all panels into tab view<NEW_LINE>for (Map.Entry<Label, NSView> tab : this.getPanels().entrySet()) {<NEW_LINE>final NSTabViewItem item = NSTabViewItem.itemWithIdentifier(tab.getKey().identifier);<NEW_LINE>item.setView(tab.getValue());<NEW_LINE>item.setLabel(tab.getKey().label);<NEW_LINE>tabView.addTabViewItem(item);<NEW_LINE>}<NEW_LINE>// Set up toolbar properties: Allow customization, give a default display mode, and remember state in user defaults<NEW_LINE>toolbar.setAllowsUserCustomization(false);<NEW_LINE>toolbar.setSizeMode(this.getToolbarSize());<NEW_LINE>toolbar.setDisplayMode(this.getToolbarMode());<NEW_LINE>toolbar.setDelegate(this.id());<NEW_LINE>window.setToolbar(toolbar);<NEW_LINE>// Change selection to last selected item in preferences<NEW_LINE>final int index = preferences.getInteger(String.format("%s.selected", this.getToolbarName()));<NEW_LINE>this.setSelectedPanel(index < this.getPanels().<MASK><NEW_LINE>this.setTitle(this.getTitle(tabView.selectedTabViewItem()));<NEW_LINE>super.awakeFromNib();<NEW_LINE>}
size() ? index : 0);
1,651,828
void maybeCompileForWebMode(ModuleDef module, Set<String> userAgents) throws UnableToCompleteException {<NEW_LINE>compilerContext = compilerContextBuilder.module(module).build();<NEW_LINE>// Load any declared servlets.<NEW_LINE>for (String path : module.getServletPaths()) {<NEW_LINE>String servletClass = module.findServletForPath(path);<NEW_LINE>path = '/' + module.getName() + path;<NEW_LINE>if (!servletClass.equals(loadedServletsByPath.get(path))) {<NEW_LINE>try {<NEW_LINE>// We should load the class ourselves because otherwise if Jetty tries and fails to load<NEW_LINE>// by itself, it will be left in a broken state (looks like this is fixed in Jetty 9).<NEW_LINE>Class<? extends Servlet> clazz = wac.loadClass(servletClass).asSubclass(Servlet.class);<NEW_LINE>wac.addServlet(clazz, path);<NEW_LINE>loadedServletsByPath.put(path, servletClass);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>getTopLogger().log(TreeLogger.WARN, "Failed to load servlet class '" + servletClass + "' declared in '" + module.getName() + "'", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BindingProperty strictCspTestingEnabledProperty = module.getProperties().findBindingProp("gwt.strictCspTestingEnabled");<NEW_LINE>if (strictCspTestingEnabledProperty != null && "true".equals(strictCspTestingEnabledProperty.getConstrainedValue())) {<NEW_LINE>addCspFilter("/" + <MASK><NEW_LINE>}<NEW_LINE>if (developmentMode) {<NEW_LINE>// BACKWARDS COMPATIBILITY: many linkers currently fail in dev mode.<NEW_LINE>try {<NEW_LINE>Linker l = module.getActivePrimaryLinker().newInstance();<NEW_LINE>StandardLinkerContext context = new StandardLinkerContext(getTopLogger(), module, compilerContext.getPublicResourceOracle(), JsOutputOption.PRETTY);<NEW_LINE>if (!l.supportsDevModeInJunit(context)) {<NEW_LINE>if (module.getLinker("std") != null) {<NEW_LINE>// TODO: unfortunately, this could be race condition between dev/prod<NEW_LINE>module.addLinker("std");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>getTopLogger().log(TreeLogger.WARN, "Failed to instantiate linker: " + e);<NEW_LINE>}<NEW_LINE>super.link(getTopLogger(), module);<NEW_LINE>} else {<NEW_LINE>compileForWebMode(module, userAgents);<NEW_LINE>}<NEW_LINE>}
module.getName() + "/*");
817,664
public static void insertNewLineAtCaret(Editor editor) {<NEW_LINE>EditorUIUtil.hideCursorInEditor(editor);<NEW_LINE>Document document = editor.getDocument();<NEW_LINE>int caretLine = editor.getCaretModel().getLogicalPosition().line;<NEW_LINE>if (!editor.isInsertMode()) {<NEW_LINE>int lineCount = document.getLineCount();<NEW_LINE>if (caretLine < lineCount) {<NEW_LINE>if (caretLine == lineCount - 1) {<NEW_LINE>document.insertString(document.getTextLength(), "\n");<NEW_LINE>}<NEW_LINE>LogicalPosition pos = new LogicalPosition(caretLine + 1, 0);<NEW_LINE>editor.getCaretModel().moveToLogicalPosition(pos);<NEW_LINE>editor.getSelectionModel().removeSelection();<NEW_LINE>EditorModificationUtil.scrollToCaret(editor);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EditorModificationUtil.deleteSelectedText(editor);<NEW_LINE>// Smart indenting here:<NEW_LINE>CharSequence text = document.getCharsSequence();<NEW_LINE>int indentLineNum = caretLine;<NEW_LINE>int lineLength = 0;<NEW_LINE>if (document.getLineCount() > 0) {<NEW_LINE>for (; indentLineNum >= 0; indentLineNum--) {<NEW_LINE>lineLength = document.getLineEndOffset(indentLineNum<MASK><NEW_LINE>if (lineLength > 0)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>indentLineNum = -1;<NEW_LINE>}<NEW_LINE>int colNumber = editor.getCaretModel().getLogicalPosition().column;<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>if (indentLineNum >= 0) {<NEW_LINE>int lineStartOffset = document.getLineStartOffset(indentLineNum);<NEW_LINE>for (int i = 0; i < lineLength; i++) {<NEW_LINE>char c = text.charAt(lineStartOffset + i);<NEW_LINE>if (c != ' ' && c != '\t') {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (i >= colNumber) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>buf.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int caretOffset = editor.getCaretModel().getOffset();<NEW_LINE>String s = "\n" + buf;<NEW_LINE>document.insertString(caretOffset, s);<NEW_LINE>editor.getCaretModel().moveToOffset(caretOffset + s.length());<NEW_LINE>EditorModificationUtil.scrollToCaret(editor);<NEW_LINE>editor.getSelectionModel().removeSelection();<NEW_LINE>}
) - document.getLineStartOffset(indentLineNum);
450,414
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) {<NEW_LINE>mSenders = SenderCollection.getInstance(getActivity());<NEW_LINE>mDeviceGroupsHelper = new DeviceGroupsHelper(getActivity());<NEW_LINE>View view = inflater.inflate(R.layout.fragment_groups, container, false);<NEW_LINE>setHtmlMode(view, R.id.groups_description);<NEW_LINE>view.findViewById(R.id.groups_create_new).setOnClickListener(this);<NEW_LINE>if (savedState != null) {<NEW_LINE>mGroupToBeDeletedSenderId = savedState.getString(STATE_GROUP_TO_BE_DELETED_SENDER_ID);<NEW_LINE>mGroupToBeDeletedName = savedState.getString(STATE_GROUP_TO_BE_DELETED_NAME);<NEW_LINE>}<NEW_LINE>int[] attrs = new int[] { R.attr.selectableItemBackground };<NEW_LINE>TypedArray typedArray = getActivity().obtainStyledAttributes(attrs);<NEW_LINE>selectableBackgroundResource = <MASK><NEW_LINE>return view;<NEW_LINE>}
typedArray.getResourceId(0, 0);
406,031
public com.amazonaws.services.globalaccelerator.model.InternalServiceErrorException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.globalaccelerator.model.InternalServiceErrorException internalServiceErrorException = new com.amazonaws.services.globalaccelerator.model.InternalServiceErrorException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 internalServiceErrorException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
259,809
private static SinkRequest createKafkaRequest(StreamSink streamSink, InlongStreamInfo streamInfo) {<NEW_LINE>KafkaSinkRequest kafkaSinkRequest = new KafkaSinkRequest();<NEW_LINE>KafkaSink kafkaSink = (KafkaSink) streamSink;<NEW_LINE>kafkaSinkRequest.setSinkName(streamSink.getSinkName());<NEW_LINE>kafkaSinkRequest.setAddress(kafkaSink.getAddress());<NEW_LINE>kafkaSinkRequest.setTopicName(kafkaSink.getTopicName());<NEW_LINE>kafkaSinkRequest.setSinkType(kafkaSink.<MASK><NEW_LINE>kafkaSinkRequest.setInlongGroupId(streamInfo.getInlongGroupId());<NEW_LINE>kafkaSinkRequest.setInlongStreamId(streamInfo.getInlongStreamId());<NEW_LINE>kafkaSinkRequest.setSerializationType(kafkaSink.getDataFormat().name());<NEW_LINE>kafkaSinkRequest.setEnableCreateResource(kafkaSink.isNeedCreated() ? 1 : 0);<NEW_LINE>kafkaSinkRequest.setProperties(kafkaSink.getProperties());<NEW_LINE>if (CollectionUtils.isNotEmpty(kafkaSink.getSinkFields())) {<NEW_LINE>List<SinkFieldRequest> fieldRequests = createSinkFieldRequests(kafkaSink.getSinkFields());<NEW_LINE>kafkaSinkRequest.setFieldList(fieldRequests);<NEW_LINE>}<NEW_LINE>return kafkaSinkRequest;<NEW_LINE>}
getSinkType().name());
1,510,885
protected Optional<PlanNode> pushDownProjectOff(Context context, ApplyNode applyNode, Set<Symbol> referencedOutputs) {<NEW_LINE>// remove unused apply node<NEW_LINE>if (intersection(applyNode.getSubqueryAssignments().getSymbols(), referencedOutputs).isEmpty()) {<NEW_LINE>return Optional.of(applyNode.getInput());<NEW_LINE>}<NEW_LINE>// extract referenced assignments<NEW_LINE>ImmutableSet.Builder<Symbol<MASK><NEW_LINE>Assignments.Builder newSubqueryAssignments = Assignments.builder();<NEW_LINE>for (Map.Entry<Symbol, Expression> entry : applyNode.getSubqueryAssignments().entrySet()) {<NEW_LINE>if (referencedOutputs.contains(entry.getKey())) {<NEW_LINE>requiredAssignmentsSymbols.addAll(extractUnique(entry.getValue()));<NEW_LINE>newSubqueryAssignments.put(entry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// prune subquery symbols<NEW_LINE>Optional<PlanNode> newSubquery = restrictOutputs(context.getIdAllocator(), applyNode.getSubquery(), requiredAssignmentsSymbols.build());<NEW_LINE>// prune input symbols<NEW_LINE>Set<Symbol> requiredInputSymbols = ImmutableSet.<Symbol>builder().addAll(referencedOutputs).addAll(applyNode.getCorrelation()).addAll(requiredAssignmentsSymbols.build()).build();<NEW_LINE>Optional<PlanNode> newInput = restrictOutputs(context.getIdAllocator(), applyNode.getInput(), requiredInputSymbols);<NEW_LINE>boolean pruned = newSubquery.isPresent() || newInput.isPresent() || newSubqueryAssignments.build().size() < applyNode.getSubqueryAssignments().size();<NEW_LINE>if (pruned) {<NEW_LINE>return Optional.of(new ApplyNode(applyNode.getId(), newInput.orElse(applyNode.getInput()), newSubquery.orElse(applyNode.getSubquery()), newSubqueryAssignments.build(), applyNode.getCorrelation(), applyNode.getOriginSubquery()));<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
> requiredAssignmentsSymbols = ImmutableSet.builder();
1,484,073
public void genericNotify(Map<String, Set<WeakReference<ONetworkProtocolBinary>>> context, String database, OPushEventType pack) {<NEW_LINE>try {<NEW_LINE>executor.submit(() -> {<NEW_LINE>Set<WeakReference<ONetworkProtocolBinary>> clients = null;<NEW_LINE>synchronized (OPushManager.this) {<NEW_LINE>Set<WeakReference<ONetworkProtocolBinary>> cl = context.get(database);<NEW_LINE>if (cl != null) {<NEW_LINE>clients = new HashSet<>(cl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clients != null) {<NEW_LINE>Iterator<WeakReference<ONetworkProtocolBinary>> iter = clients.iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>WeakReference<ONetworkProtocolBinary<MASK><NEW_LINE>ONetworkProtocolBinary protocolBinary = ref.get();<NEW_LINE>if (protocolBinary != null) {<NEW_LINE>try {<NEW_LINE>OBinaryPushRequest<?> request = pack.getRequest(database);<NEW_LINE>if (request != null) {<NEW_LINE>OBinaryPushResponse response = protocolBinary.push(request);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>synchronized (OPushManager.this) {<NEW_LINE>context.get(database).remove(ref);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>synchronized (OPushManager.this) {<NEW_LINE>context.get(database).remove(ref);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (RejectedExecutionException e) {<NEW_LINE>OLogManager.instance().info(this, "Cannot send push request to client for database '%s'", database);<NEW_LINE>}<NEW_LINE>}
> ref = iter.next();
1,846,739
private List<NameValueCountPair> listCreatorUnit(Business business, EffectivePerson effectivePerson, Application application) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Work.class);<NEW_LINE><MASK><NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Work> root = cq.from(Work.class);<NEW_LINE>Predicate p = cb.equal(root.get(Work_.application), application.getId());<NEW_LINE>p = cb.and(p, cb.equal(root.get(Work_.creatorPerson), effectivePerson.getDistinguishedName()));<NEW_LINE>cq.select(root.get(Work_.creatorUnit)).where(p);<NEW_LINE>List<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<NameValueCountPair> wos = new ArrayList<>();<NEW_LINE>for (String str : os) {<NEW_LINE>NameValueCountPair o = new NameValueCountPair();<NEW_LINE>o.setValue(str);<NEW_LINE>o.setName(StringUtils.defaultString(StringUtils.substringBefore(str, "@"), str));<NEW_LINE>wos.add(o);<NEW_LINE>}<NEW_LINE>SortTools.asc(wos, "name");<NEW_LINE>return wos;<NEW_LINE>}
CriteriaBuilder cb = em.getCriteriaBuilder();
965,158
public static MessageData decode(JSONObject data, Map<String, String> userIds) throws ParseException {<NEW_LINE>if (data == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String topic = (String) data.get("topic");<NEW_LINE>String message = (String) data.get("message");<NEW_LINE>Debugging.println("pubsub-msg", "%s: %s", topic, message);<NEW_LINE>if (topic.startsWith("chat_moderator_actions")) {<NEW_LINE>return ModeratorActionData.decode(topic, message, userIds);<NEW_LINE>} else if (topic.startsWith("automod-queue.")) {<NEW_LINE>return ModeratorActionData.decodeAutoMod(topic, message, userIds);<NEW_LINE>} else if (topic.startsWith("channel-points-channel-v1") || topic.startsWith("community-points-channel-v1")) {<NEW_LINE>RewardRedeemedMessageData result = RewardRedeemedMessageData.decode(topic, message, userIds);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} else if (topic.startsWith("user-moderation-notifications")) {<NEW_LINE>UserModerationMessageData result = UserModerationMessageData.decode(topic, message, userIds);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
return new MessageData(topic, message);
863,606
private static String generateMessage(AttributeDescriber describer, AttributeContainerInternal fromConfigurationAttributes, AttributeMatcher attributeMatcher, final ComponentResolveMetadata targetComponent, boolean variantAware) {<NEW_LINE>Map<String, ConfigurationMetadata> configurations = new TreeMap<>();<NEW_LINE>Optional<ImmutableList<? extends ConfigurationMetadata>> variantsForGraphTraversal = targetComponent.getVariantsForGraphTraversal();<NEW_LINE>ImmutableList<? extends ConfigurationMetadata> variantsParticipatingInSelection = variantsForGraphTraversal.<MASK><NEW_LINE>for (ConfigurationMetadata configurationMetadata : variantsParticipatingInSelection) {<NEW_LINE>configurations.put(configurationMetadata.getName(), configurationMetadata);<NEW_LINE>}<NEW_LINE>TreeFormatter formatter = new TreeFormatter();<NEW_LINE>String targetVariantText = style(StyledTextOutput.Style.Info, targetComponent.getId().getDisplayName());<NEW_LINE>if (fromConfigurationAttributes.isEmpty()) {<NEW_LINE>formatter.node("Unable to find a matching " + (variantAware ? "variant" : "configuration") + " of " + targetVariantText);<NEW_LINE>} else {<NEW_LINE>formatter.node("No matching " + (variantAware ? "variant" : "configuration") + " of " + targetVariantText + " was found. The consumer was configured to find " + describer.describeAttributeSet(fromConfigurationAttributes.asMap()) + " but:");<NEW_LINE>}<NEW_LINE>formatter.startChildren();<NEW_LINE>if (configurations.isEmpty()) {<NEW_LINE>formatter.node("None of the " + (variantAware ? "variants" : "consumable configurations") + " have attributes.");<NEW_LINE>} else {<NEW_LINE>// We're sorting the names of the configurations and later attributes<NEW_LINE>// to make sure the output is consistently the same between invocations<NEW_LINE>for (ConfigurationMetadata configuration : configurations.values()) {<NEW_LINE>formatConfiguration(formatter, targetComponent, fromConfigurationAttributes, attributeMatcher, configuration, variantAware, false, describer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>formatter.endChildren();<NEW_LINE>return formatter.toString();<NEW_LINE>}
or(new LegacyConfigurationsSupplier(targetComponent));
1,619,947
private void clearMediaPlayerListeners() {<NEW_LINE>if (mediaPlayer instanceof VideoPlayer) {<NEW_LINE>VideoPlayer vp = (VideoPlayer) mediaPlayer;<NEW_LINE>vp.setOnCompletionListener(x -> {<NEW_LINE>});<NEW_LINE>vp.setOnSeekCompleteListener(x -> {<NEW_LINE>});<NEW_LINE>vp.setOnErrorListener((mediaPlayer, i, i1) -> false);<NEW_LINE>vp.setOnBufferingUpdateListener((mediaPlayer, i) -> {<NEW_LINE>});<NEW_LINE>vp.setOnInfoListener((mediaPlayer, i, i1) -> false);<NEW_LINE>} else if (mediaPlayer instanceof AudioPlayer) {<NEW_LINE>AudioPlayer ap = (AudioPlayer) mediaPlayer;<NEW_LINE>ap.setOnCompletionListener(x -> {<NEW_LINE>});<NEW_LINE>ap.setOnSeekCompleteListener(x -> {<NEW_LINE>});<NEW_LINE>ap.setOnErrorListener((x<MASK><NEW_LINE>ap.setOnBufferingUpdateListener((arg0, percent) -> {<NEW_LINE>});<NEW_LINE>ap.setOnInfoListener((arg0, what, extra) -> false);<NEW_LINE>} else if (mediaPlayer instanceof ExoPlayerWrapper) {<NEW_LINE>ExoPlayerWrapper ap = (ExoPlayerWrapper) mediaPlayer;<NEW_LINE>ap.setOnCompletionListener(x -> {<NEW_LINE>});<NEW_LINE>ap.setOnSeekCompleteListener(x -> {<NEW_LINE>});<NEW_LINE>ap.setOnBufferingUpdateListener((arg0, percent) -> {<NEW_LINE>});<NEW_LINE>ap.setOnErrorListener(x -> {<NEW_LINE>});<NEW_LINE>ap.setOnInfoListener((arg0, what, extra) -> false);<NEW_LINE>}<NEW_LINE>}
, y, z) -> false);
1,329,436
final UpdateReadinessCheckResult executeUpdateReadinessCheck(UpdateReadinessCheckRequest updateReadinessCheckRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateReadinessCheckRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateReadinessCheckRequest> request = null;<NEW_LINE>Response<UpdateReadinessCheckResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateReadinessCheckRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateReadinessCheckRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateReadinessCheck");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateReadinessCheckResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateReadinessCheckResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "Route53 Recovery Readiness");
1,618,034
public Response.NodeResponse calculateResult(RemoteClusterControllerTask.Context context) throws StateRestApiException {<NEW_LINE>Response.NodeResponse result = new Response.NodeResponse();<NEW_LINE>NodeInfo info = context.cluster.getNodeInfo(id.getNode());<NEW_LINE>if (info == null) {<NEW_LINE>throw new MissingResourceException("node " + id.getNode());<NEW_LINE>}<NEW_LINE>if (info.getGroup() != null) {<NEW_LINE>result.addAttribute("hierarchical-group", info.getGroup().getPath());<NEW_LINE>}<NEW_LINE>result.addState("generated", new Response.UnitStateImpl(context.currentConsolidatedState.getNodeState(id.getNode())));<NEW_LINE>result.addState("unit", new Response.UnitStateImpl(info.getReportedState()));<NEW_LINE>result.addState("user", new Response.UnitStateImpl<MASK><NEW_LINE>if (info.isStorage()) {<NEW_LINE>fillInMetrics(context.cluster.getNodeInfo(id.getNode()).getHostInfo().getMetrics(), result);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(info.getWantedState()));
926,849
// visible for testing<NEW_LINE>void processDatabase(Map<String, Object> databaseInfo) {<NEW_LINE>String name = databaseInfo.get("name").toString().replace(".tgz", "") + ".mmdb";<NEW_LINE>String md5 = (String) databaseInfo.get("md5_hash");<NEW_LINE>if (state.contains(name) && Objects.equals(md5, state.get(name).md5())) {<NEW_LINE>updateTimestamp(name<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.debug("downloading geoip database [{}]", name);<NEW_LINE>String url = databaseInfo.get("url").toString();<NEW_LINE>if (url.startsWith("http") == false) {<NEW_LINE>// relative url, add it after last slash (i.e resolve sibling) or at the end if there's no slash after http[s]://<NEW_LINE>int lastSlash = endpoint.substring(8).lastIndexOf('/');<NEW_LINE>url = (lastSlash != -1 ? endpoint.substring(0, lastSlash + 8) : endpoint) + "/" + url;<NEW_LINE>}<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>try (InputStream is = httpClient.get(url)) {<NEW_LINE>int firstChunk = state.contains(name) ? state.get(name).lastChunk() + 1 : 0;<NEW_LINE>int lastChunk = indexChunks(name, is, firstChunk, md5, start);<NEW_LINE>if (lastChunk > firstChunk) {<NEW_LINE>state = state.put(name, new Metadata(start, firstChunk, lastChunk - 1, md5, start));<NEW_LINE>updateTaskState();<NEW_LINE>stats = stats.successfulDownload(System.currentTimeMillis() - start).databasesCount(state.getDatabases().size());<NEW_LINE>logger.info("successfully downloaded geoip database [{}]", name);<NEW_LINE>deleteOldChunks(name, firstChunk);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>stats = stats.failedDownload();<NEW_LINE>logger.error((Supplier<?>) () -> new ParameterizedMessage("error downloading geoip database [{}]", name), e);<NEW_LINE>}<NEW_LINE>}
, state.get(name));
167,654
private static // [START monitoring_alert_update_channel]<NEW_LINE>Map<String, String> restoreNotificationChannels(String projectId, List<NotificationChannel> channels, boolean isSameProject) throws IOException {<NEW_LINE>Map<String, String> newChannelNames = Maps.newHashMap();<NEW_LINE>try (NotificationChannelServiceClient client = NotificationChannelServiceClient.create()) {<NEW_LINE>for (NotificationChannel channel : channels) {<NEW_LINE>// Update channel name if project ID is different.<NEW_LINE>boolean channelUpdated = false;<NEW_LINE>if (isSameProject) {<NEW_LINE>try {<NEW_LINE>NotificationChannel updatedChannel = client.updateNotificationChannel(NOTIFICATION_CHANNEL_UPDATE_MASK, channel);<NEW_LINE>newChannelNames.put(channel.getName(), updatedChannel.getName());<NEW_LINE>channelUpdated = true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>channelUpdated = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!channelUpdated) {<NEW_LINE>NotificationChannel newChannel = client.createNotificationChannel(ProjectName.of(projectId), channel.toBuilder().clearName().clearVerificationStatus().build());<NEW_LINE>newChannelNames.put(channel.getName(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newChannelNames;<NEW_LINE>}
), newChannel.getName());
1,811,138
public void scaleFeaturesGaussian() {<NEW_LINE>means = new double[this.numFeatures()];<NEW_LINE>// Arrays.fill(means, 0); // not needed; Java arrays zero initialized<NEW_LINE>for (int i = 0; i < this.size(); i++) {<NEW_LINE>for (int j = 0; j < data[i].length; j++) means[data[i][j]] += values[i][j];<NEW_LINE>}<NEW_LINE>ArrayMath.multiplyInPlace(means, 1.0 / this.size());<NEW_LINE>stdevs = new double[this.numFeatures()];<NEW_LINE>// Arrays.fill(stdevs, 0); // not needed; Java arrays zero initialized<NEW_LINE>double[] deltaX = new double[this.numFeatures()];<NEW_LINE>for (int i = 0; i < this.size(); i++) {<NEW_LINE>for (int f = 0; f < this.numFeatures(); f++) deltaX[f] = -means[f];<NEW_LINE>for (int j = 0; j < data[i].length; j++) deltaX[data[i][j]] <MASK><NEW_LINE>for (int f = 0; f < this.numFeatures(); f++) {<NEW_LINE>stdevs[f] += deltaX[f] * deltaX[f];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int f = 0; f < this.numFeatures(); f++) {<NEW_LINE>stdevs[f] /= (this.size() - 1);<NEW_LINE>stdevs[f] = Math.sqrt(stdevs[f]);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < this.size(); i++) {<NEW_LINE>for (int j = 0; j < data[i].length; j++) {<NEW_LINE>int fID = data[i][j];<NEW_LINE>if (stdevs[fID] != 0)<NEW_LINE>values[i][j] = (values[i][j] - means[fID]) / stdevs[fID];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+= values[i][j];
1,187,218
private ConformanceResult checkConformanceOnGetElement(Node node) {<NEW_LINE>Node key = node.getSecondChild();<NEW_LINE>if (key.isStringLit()) {<NEW_LINE>String keyName = key.getString().toLowerCase(Locale.ROOT);<NEW_LINE>if (!bannedAttrs.contains(keyName) && !isEventHandlerAttrName(keyName)) {<NEW_LINE>return ConformanceResult.CONFORMANCE;<NEW_LINE>} else if (hasElementType(node)) {<NEW_LINE>return ConformanceResult.VIOLATION;<NEW_LINE>}<NEW_LINE>} else if (hasElementType(node)) {<NEW_LINE>// key is not a string literal.<NEW_LINE><MASK><NEW_LINE>if (keyType == null) {<NEW_LINE>return ConformanceResult.CONFORMANCE;<NEW_LINE>}<NEW_LINE>// We have seen code using other types of keys (e.g., numbers) for element access. Only<NEW_LINE>// report<NEW_LINE>// violations if the key is explicitly typed as string or the union of string and other<NEW_LINE>// types.<NEW_LINE>if (keyType.isString()) {<NEW_LINE>return ConformanceResult.VIOLATION;<NEW_LINE>}<NEW_LINE>if (keyType.isUnionType()) {<NEW_LINE>for (JSType alternate : keyType.toMaybeUnionType().getAlternates()) {<NEW_LINE>if (alternate.isString()) {<NEW_LINE>return ConformanceResult.VIOLATION;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ConformanceResult.CONFORMANCE;<NEW_LINE>}
JSType keyType = key.getJSType();
556,514
public SMSMessageActivity unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SMSMessageActivity sMSMessageActivity = new SMSMessageActivity();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("MessageConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sMSMessageActivity.setMessageConfig(JourneySMSMessageJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextActivity", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sMSMessageActivity.setNextActivity(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TemplateName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sMSMessageActivity.setTemplateName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TemplateVersion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sMSMessageActivity.setTemplateVersion(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 sMSMessageActivity;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
216,660
private void createSimpleRoutingParameterButton(MapActivity mapActivity, final LocalRoutingParameter parameter, LinearLayout optionsContainer) {<NEW_LINE>OsmandApplication app = mapActivity.getMyApplication();<NEW_LINE>RoutingHelper routingHelper = app.getRoutingHelper();<NEW_LINE>final int colorActive = ContextCompat.getColor(app, ColorUtilities.getActiveColorId(nightMode));<NEW_LINE>final int colorDisabled = ContextCompat.getColor(app, R.color.description_font_and_bottom_sheet_icons);<NEW_LINE>int margin = AndroidUtils.dpToPx(app, 3);<NEW_LINE>final OsmandSettings settings = app.getSettings();<NEW_LINE>String text;<NEW_LINE>boolean active;<NEW_LINE>if (parameter.routingParameter != null) {<NEW_LINE>if (parameter.routingParameter.getId().equals(GeneralRouter.USE_SHORTEST_WAY)) {<NEW_LINE>// if short route settings - it should be inverse of fast_route_mode<NEW_LINE>active = !settings.FAST_ROUTE_MODE.getModeValue(routingHelper.getAppMode());<NEW_LINE>} else {<NEW_LINE>active = parameter.isSelected(settings);<NEW_LINE>}<NEW_LINE>text = parameter.getText(mapActivity);<NEW_LINE>View item = createToolbarOptionView(active, text, parameter.getActiveIconId(), parameter.getDisabledIconId(), v -> {<NEW_LINE>OsmandApplication app1 = getApp();<NEW_LINE>if (parameter.routingParameter != null && app1 != null) {<NEW_LINE>boolean selected = !parameter.isSelected(settings);<NEW_LINE>app1.getRoutingOptionsHelper().applyRoutingParameter(parameter, selected);<NEW_LINE>Drawable itemDrawable = app1.getUIUtilities().getIcon(selected ? parameter.getActiveIconId() : parameter.getDisabledIconId(), nightMode ? R.color.route_info_control_icon_color_dark : R.color.route_info_control_icon_color_light);<NEW_LINE>Drawable activeItemDrawable = app1.getUIUtilities().getIcon(selected ? parameter.getActiveIconId() : parameter.getDisabledIconId(), ColorUtilities.getActiveColorId(nightMode));<NEW_LINE>if (Build.VERSION.SDK_INT >= 21) {<NEW_LINE>itemDrawable = AndroidUtils.createPressedStateListDrawable(itemDrawable, activeItemDrawable);<NEW_LINE>}<NEW_LINE>((ImageView) v.findViewById(R.id.route_option_image_view)).setImageDrawable(selected ? activeItemDrawable : itemDrawable);<NEW_LINE>((TextView) v.findViewById(R.id.route_option_title)).setTextColor(selected ? colorActive : colorDisabled);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (item != null) {<NEW_LINE>LinearLayout.LayoutParams layoutParams = getContainerButtonLayoutParams(mapActivity, false);<NEW_LINE>AndroidUtils.setMargins(layoutParams, <MASK><NEW_LINE>optionsContainer.addView(item, layoutParams);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
margin, 0, margin, 0);
16,760
static void computeTBNNormalized(Vec3f pa, Vec3f pb, Vec3f pc, Vec2f ta, Vec2f tb, Vec2f tc, Vec3f[] norm) {<NEW_LINE>MeshTempState instance = MeshTempState.getInstance();<NEW_LINE>Vec3f n = instance.vec3f1;<NEW_LINE>Vec3f v1 = instance.vec3f2;<NEW_LINE>Vec3f v2 = instance.vec3f3;<NEW_LINE>// compute Normal |(v1-v0)X(v2-v0)|<NEW_LINE>v1.sub(pb, pa);<NEW_LINE>v2.sub(pc, pa);<NEW_LINE>n.cross(v1, v2);<NEW_LINE>norm[0].set(n);<NEW_LINE>// TODO: make sure each triangle area (size) will be considered<NEW_LINE>norm[0].normalize();<NEW_LINE>v1.set(0, tb.x - ta.x, tb.y - ta.y);<NEW_LINE>v2.set(0, tc.x - ta.x, tc.y - ta.y);<NEW_LINE>if (v1.y * v2.z == v1.z * v2.y) {<NEW_LINE>MeshUtil.generateTB(pa, pb, pc, norm);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// compute Tangent and Binomal<NEW_LINE>v1.x = pb.x - pa.x;<NEW_LINE>v2.x = pc.x - pa.x;<NEW_LINE>n.cross(v1, v2);<NEW_LINE>norm[1].x = -n.y / n.x;<NEW_LINE>norm[2].x = -n.z / n.x;<NEW_LINE>v1.x = pb.y - pa.y;<NEW_LINE>v2.x = pc.y - pa.y;<NEW_LINE>n.cross(v1, v2);<NEW_LINE>norm[1].y = -n.y / n.x;<NEW_LINE>norm[2].y = -n.z / n.x;<NEW_LINE>v1.x = pb.z - pa.z;<NEW_LINE>v2.x <MASK><NEW_LINE>n.cross(v1, v2);<NEW_LINE>norm[1].z = -n.y / n.x;<NEW_LINE>norm[2].z = -n.z / n.x;<NEW_LINE>norm[1].normalize();<NEW_LINE>norm[2].normalize();<NEW_LINE>}
= pc.z - pa.z;
859,828
public static void doRenderLaserWave(World world, TextureManager textureManager, LaserData laser, ResourceLocation texture) {<NEW_LINE>if (!laser.isVisible || texture == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GL11.glPushMatrix();<NEW_LINE>GL11.glTranslated(laser.head.xCoord, laser.head.<MASK><NEW_LINE>laser.update();<NEW_LINE>GL11.glRotatef((float) laser.angleZ, 0, 1, 0);<NEW_LINE>GL11.glRotatef((float) laser.angleY, 0, 0, 1);<NEW_LINE>textureManager.bindTexture(texture);<NEW_LINE>int indexList = 0;<NEW_LINE>initScaledBoxes(world);<NEW_LINE>double x1 = laser.wavePosition;<NEW_LINE>double x2 = x1 + scaledBoxes[0].length * STEP;<NEW_LINE>double x3 = laser.renderSize;<NEW_LINE>doRenderLaserLine(x1, laser.laserTexAnimation);<NEW_LINE>for (double i = x1; i <= x2 && i <= laser.renderSize; i += STEP) {<NEW_LINE>GL11.glCallList(scaledBoxes[(int) (laser.waveSize * 99F)][indexList]);<NEW_LINE>indexList = (indexList + 1) % scaledBoxes[0].length;<NEW_LINE>GL11.glTranslated(STEP, 0, 0);<NEW_LINE>}<NEW_LINE>if (x2 < x3) {<NEW_LINE>doRenderLaserLine(x3 - x2, laser.laserTexAnimation);<NEW_LINE>}<NEW_LINE>GL11.glPopMatrix();<NEW_LINE>}
yCoord, laser.head.zCoord);
653,019
public CreateScheduleResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateScheduleResult createScheduleResult = new CreateScheduleResult();<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 createScheduleResult;<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("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createScheduleResult.setName(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 createScheduleResult;<NEW_LINE>}
class).unmarshall(context));
812,481
protected void onContentViewCreated(View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>revealBottomSheet();<NEW_LINE><MASK><NEW_LINE>getNegativeButton().setOnClickListener((v) -> dismiss());<NEW_LINE>getPositiveButton().setOnClickListener((v) -> {<NEW_LINE>deliverFormatAndDismiss(mViewModel.getFormat().getValue().build());<NEW_LINE>});<NEW_LINE>RecyclerView recycler = view.findViewById(R.id.rv_name_builder);<NEW_LINE>FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(requireContext(), FlexDirection.ROW, FlexWrap.WRAP);<NEW_LINE>layoutManager.setJustifyContent(JustifyContent.SPACE_AROUND);<NEW_LINE>recycler.setLayoutManager(layoutManager);<NEW_LINE>BackupNameFormatBuilderPartsAdapter adapter = new BackupNameFormatBuilderPartsAdapter(mViewModel.getSelection(), this, requireContext());<NEW_LINE>adapter.setData(Arrays.asList(BackupNameFormatBuilder.Part.values()));<NEW_LINE>recycler.setAdapter(adapter);<NEW_LINE>TextView preview = view.findViewById(R.id.tv_name_builder_sample);<NEW_LINE>mViewModel.getSelection().asLiveData().observe(this, (selection) -> getPositiveButton().setEnabled(selection.hasSelection()));<NEW_LINE>mViewModel.getFormat().observe(this, (format) -> {<NEW_LINE>preview.setText(format.getParts().isEmpty() ? getString(R.string.name_format_builder_preview_empty) : getString(R.string.name_format_builder_preview, BackupNameFormat.format(format.build(), mViewModel.getOwnMeta())));<NEW_LINE>});<NEW_LINE>}
setTitle(R.string.name_format_builder_title);
1,261,211
public Server armeriaServer(ArmeriaSettings armeriaSettings, InternalServices internalService, Optional<MeterRegistry> meterRegistry, Optional<List<MetricCollectingServiceConfigurator>> metricCollectingServiceConfigurators, Optional<MeterIdPrefixFunction> meterIdPrefixFunction, Optional<List<ArmeriaServerConfigurator>> armeriaServerConfigurators, Optional<List<Consumer<ServerBuilder>>> armeriaServerBuilderConsumers, BeanFactory beanFactory) {<NEW_LINE>if (!armeriaServerConfigurators.isPresent() && !armeriaServerBuilderConsumers.isPresent()) {<NEW_LINE>throw new IllegalStateException("No services to register, " + "use ArmeriaServerConfigurator or Consumer<ServerBuilder> to configure an Armeria server.");<NEW_LINE>}<NEW_LINE>final ServerBuilder serverBuilder = Server.builder();<NEW_LINE>final List<Port> ports = armeriaSettings.getPorts();<NEW_LINE>if (ports.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>serverBuilder.port(new ServerPort(DEFAULT_PORT.getPort(), DEFAULT_PORT.getProtocols()));<NEW_LINE>}<NEW_LINE>configureServerWithArmeriaSettings(serverBuilder, armeriaSettings, internalService, armeriaServerConfigurators.orElse(ImmutableList.of()), armeriaServerBuilderConsumers.orElse(ImmutableList.of()), meterRegistry.orElse(Metrics.globalRegistry), meterIdPrefixFunction.orElse(MeterIdPrefixFunction.ofDefault("armeria.server")), metricCollectingServiceConfigurators.orElse(ImmutableList.of()), beanFactory);<NEW_LINE>return serverBuilder.build();<NEW_LINE>}
assert DEFAULT_PORT.getProtocols() != null;
689,670
protected void sendProxyRequest(HttpServletRequest clientRequest, HttpServletResponse proxyResponse, Request proxyRequest) {<NEW_LINE>if (_log.isDebugEnabled()) {<NEW_LINE>StringBuilder builder = new StringBuilder(clientRequest.getMethod());<NEW_LINE>builder.append(" ").append(clientRequest.getRequestURI());<NEW_LINE>String query = clientRequest.getQueryString();<NEW_LINE>if (query != null)<NEW_LINE>builder.append("?").append(query);<NEW_LINE>builder.append(" ").append(clientRequest.getProtocol()).append(System.lineSeparator());<NEW_LINE>for (Enumeration<String> headerNames = clientRequest.getHeaderNames(); headerNames.hasMoreElements(); ) {<NEW_LINE>String headerName = headerNames.nextElement();<NEW_LINE>builder.append(headerName).append(": ");<NEW_LINE>for (Enumeration<String> headerValues = clientRequest.getHeaders(headerName); headerValues.hasMoreElements(); ) {<NEW_LINE><MASK><NEW_LINE>if (headerValue != null)<NEW_LINE>builder.append(headerValue);<NEW_LINE>if (headerValues.hasMoreElements())<NEW_LINE>builder.append(",");<NEW_LINE>}<NEW_LINE>builder.append(System.lineSeparator());<NEW_LINE>}<NEW_LINE>builder.append(System.lineSeparator());<NEW_LINE>_log.debug("{} proxying to upstream:{}{}{}{}{}", getRequestId(clientRequest), System.lineSeparator(), builder, proxyRequest, System.lineSeparator(), proxyRequest.getHeaders().toString().trim());<NEW_LINE>}<NEW_LINE>proxyRequest.send(newProxyResponseListener(clientRequest, proxyResponse));<NEW_LINE>}
String headerValue = headerValues.nextElement();
792,306
public void afterTestStep(LoadTestRunner loadTestRunner, LoadTestRunContext context, TestCaseRunner testRunner, TestCaseRunContext runContext, TestStepResult testStepResult) {<NEW_LINE>if (loadTest.getUpdateStatisticsPerTestStep()) {<NEW_LINE>TestCase testCase = testRunner.getTestCase();<NEW_LINE>if (testStepResult == null) {<NEW_LINE>log.warn("Result is null in TestCase [" + testCase.getName() + "]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long[] samples = new long[testCase.getTestStepCount()];<NEW_LINE>long[] sizes = new long[samples.length];<NEW_LINE>long[] sampleCounts <MASK><NEW_LINE>int index = testCase.getIndexOfTestStep(testStepResult.getTestStep());<NEW_LINE>sampleCounts[index]++;<NEW_LINE>samples[index] += testStepResult.getTimeTaken();<NEW_LINE>sizes[index] += testStepResult.getSize();<NEW_LINE>pushSamples(samples, sizes, sampleCounts, testRunner.getStartTime(), testRunner.getTimeTaken(), false);<NEW_LINE>}<NEW_LINE>}
= new long[samples.length];
1,592,622
final GetTrustStoreResult executeGetTrustStore(GetTrustStoreRequest getTrustStoreRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTrustStoreRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetTrustStoreRequest> request = null;<NEW_LINE>Response<GetTrustStoreResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTrustStoreRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTrustStoreRequest));<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, "WorkSpaces Web");<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<GetTrustStoreResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTrustStoreResultJsonUnmarshaller());<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, "GetTrustStore");
1,418,354
private Mono<PagedResponse<PacketCaptureResultInner>> listSinglePageAsync(String resourceGroupName, String networkWatcherName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (networkWatcherName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.list(this.client.getEndpoint(), resourceGroupName, networkWatcherName, apiVersion, this.client.getSubscriptionId(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
305,370
public synchronized PinotResourceManagerResponse updateInstance(String instanceId, Instance newInstance, boolean updateBrokerResource) {<NEW_LINE>InstanceConfig instanceConfig = getHelixInstanceConfig(instanceId);<NEW_LINE>if (instanceConfig == null) {<NEW_LINE>throw new NotFoundException("Failed to find instance config for instance: " + instanceId);<NEW_LINE>}<NEW_LINE>List<String> newTags = newInstance.getTags();<NEW_LINE>List<String> oldTags = instanceConfig.getTags();<NEW_LINE>InstanceUtils.updateHelixInstanceConfig(instanceConfig, newInstance);<NEW_LINE>if (!_helixDataAccessor.setProperty(_keyBuilder.instanceConfig(instanceId), instanceConfig)) {<NEW_LINE>throw new RuntimeException("Failed to set instance config for instance: " + instanceId);<NEW_LINE>}<NEW_LINE>// Update broker resource if necessary<NEW_LINE>boolean shouldUpdateBrokerResource = false;<NEW_LINE>List<String> newBrokerTags = null;<NEW_LINE>if (instanceId.startsWith(Helix.PREFIX_OF_BROKER_INSTANCE) && updateBrokerResource) {<NEW_LINE>newBrokerTags = newTags != null ? newTags.stream().filter(TagNameUtils::isBrokerTag).sorted().collect(Collectors.toList()) : Collections.emptyList();<NEW_LINE>List<String> oldBrokerTags = oldTags.stream().filter(TagNameUtils::isBrokerTag).sorted().collect(Collectors.toList());<NEW_LINE>shouldUpdateBrokerResource = !newBrokerTags.equals(oldBrokerTags);<NEW_LINE>}<NEW_LINE>if (shouldUpdateBrokerResource) {<NEW_LINE>long startTimeMs = System.currentTimeMillis();<NEW_LINE>List<String> tablesAdded = new ArrayList<>();<NEW_LINE>List<String> tablesRemoved = new ArrayList<>();<NEW_LINE>HelixHelper.updateBrokerResource(_helixZkManager, instanceId, newBrokerTags, tablesAdded, tablesRemoved);<NEW_LINE>LOGGER.info("Updated broker resource for broker: {} with tags: {} in {}ms, tables added: {}, tables removed: {}", instanceId, newBrokerTags, System.currentTimeMillis() - startTimeMs, tablesAdded, tablesRemoved);<NEW_LINE>return PinotResourceManagerResponse.success(String.format("Updated instance: %s, and updated broker resource - tables added: %s, tables removed: %s"<MASK><NEW_LINE>} else {<NEW_LINE>return PinotResourceManagerResponse.success("Updated instance: " + instanceId);<NEW_LINE>}<NEW_LINE>}
, instanceId, tablesAdded, tablesRemoved));
1,150,263
public static ListRepositoryMemberResponse unmarshall(ListRepositoryMemberResponse listRepositoryMemberResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRepositoryMemberResponse.setRequestId(_ctx.stringValue("ListRepositoryMemberResponse.RequestId"));<NEW_LINE>listRepositoryMemberResponse.setErrorCode(_ctx.stringValue("ListRepositoryMemberResponse.ErrorCode"));<NEW_LINE>listRepositoryMemberResponse.setSuccess(_ctx.booleanValue("ListRepositoryMemberResponse.Success"));<NEW_LINE>listRepositoryMemberResponse.setErrorMessage(_ctx.stringValue("ListRepositoryMemberResponse.ErrorMessage"));<NEW_LINE>listRepositoryMemberResponse.setTotal<MASK><NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRepositoryMemberResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setAccessLevel(_ctx.integerValue("ListRepositoryMemberResponse.Result[" + i + "].AccessLevel"));<NEW_LINE>resultItem.setExternUserId(_ctx.stringValue("ListRepositoryMemberResponse.Result[" + i + "].ExternUserId"));<NEW_LINE>resultItem.setId(_ctx.longValue("ListRepositoryMemberResponse.Result[" + i + "].Id"));<NEW_LINE>resultItem.setState(_ctx.stringValue("ListRepositoryMemberResponse.Result[" + i + "].State"));<NEW_LINE>resultItem.setAvatarUrl(_ctx.stringValue("ListRepositoryMemberResponse.Result[" + i + "].AvatarUrl"));<NEW_LINE>resultItem.setEmail(_ctx.stringValue("ListRepositoryMemberResponse.Result[" + i + "].Email"));<NEW_LINE>resultItem.setName(_ctx.stringValue("ListRepositoryMemberResponse.Result[" + i + "].Name"));<NEW_LINE>resultItem.setUsername(_ctx.stringValue("ListRepositoryMemberResponse.Result[" + i + "].Username"));<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>listRepositoryMemberResponse.setResult(result);<NEW_LINE>return listRepositoryMemberResponse;<NEW_LINE>}
(_ctx.longValue("ListRepositoryMemberResponse.Total"));
560,517
public EventLogEntryEntity generateEventLogEntry(CommandContext commandContext) {<NEW_LINE>FlowableEntityEvent entityEvent = (FlowableEntityEvent) event;<NEW_LINE>TaskEntity task = (TaskEntity) entityEvent.getEntity();<NEW_LINE>Map<String, Object> data = handleCommonTaskFields(task);<NEW_LINE>long duration = timeStamp.getTime() - task.getCreateTime().getTime();<NEW_LINE>putInMapIfNotNull(data, Fields.DURATION, duration);<NEW_LINE>if (event instanceof FlowableEntityWithVariablesEvent) {<NEW_LINE>FlowableEntityWithVariablesEvent activitiEntityWithVariablesEvent = (FlowableEntityWithVariablesEvent) event;<NEW_LINE>if (activitiEntityWithVariablesEvent.getVariables() != null && !activitiEntityWithVariablesEvent.getVariables().isEmpty()) {<NEW_LINE>Map<String, Object> variableMap = new HashMap<>();<NEW_LINE>for (Object variableName : activitiEntityWithVariablesEvent.getVariables().keySet()) {<NEW_LINE>putInMapIfNotNull(variableMap, (String) variableName, activitiEntityWithVariablesEvent.getVariables().get(variableName));<NEW_LINE>}<NEW_LINE>if (activitiEntityWithVariablesEvent.isLocalScope()) {<NEW_LINE>putInMapIfNotNull(<MASK><NEW_LINE>} else {<NEW_LINE>putInMapIfNotNull(data, Fields.VARIABLES, variableMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return createEventLogEntry(task.getProcessDefinitionId(), task.getProcessInstanceId(), task.getExecutionId(), task.getId(), data);<NEW_LINE>}
data, Fields.LOCAL_VARIABLES, variableMap);
668,459
public static void write_default_rule(WriteScopeParameter p_par, int p_layer) throws java.io.IOException {<NEW_LINE>p_par.file.start_scope();<NEW_LINE>p_par.file.write("rule");<NEW_LINE>// write the trace width<NEW_LINE>double trace_width = 2 * p_par.coordinate_transform.board_to_dsn(p_par.board.rules.get_default_net_class<MASK><NEW_LINE>p_par.file.new_line();<NEW_LINE>p_par.file.write("(width ");<NEW_LINE>p_par.file.write((Double.valueOf(trace_width)).toString());<NEW_LINE>p_par.file.write(")");<NEW_LINE>// write the default clearance rule<NEW_LINE>int default_cl_no = app.freerouting.rules.BoardRules.default_clearance_class();<NEW_LINE>int default_board_clearance = p_par.board.rules.clearance_matrix.value(default_cl_no, default_cl_no, p_layer);<NEW_LINE>double default_clearance = p_par.coordinate_transform.board_to_dsn(default_board_clearance);<NEW_LINE>p_par.file.new_line();<NEW_LINE>p_par.file.write("(clear ");<NEW_LINE>p_par.file.write((Double.valueOf(default_clearance)).toString());<NEW_LINE>p_par.file.write(")");<NEW_LINE>// write the Smd_to_turn_gap<NEW_LINE>Double smd_to_turn_dist = p_par.coordinate_transform.board_to_dsn(p_par.board.rules.get_pin_edge_to_turn_dist());<NEW_LINE>p_par.file.new_line();<NEW_LINE>p_par.file.write("(clear ");<NEW_LINE>p_par.file.write(smd_to_turn_dist.toString());<NEW_LINE>p_par.file.write(" (type smd_to_turn_gap))");<NEW_LINE>int cl_count = p_par.board.rules.clearance_matrix.get_class_count();<NEW_LINE>for (int i = 1; i <= cl_count; ++i) {<NEW_LINE>write_clearance_rules(p_par, p_layer, i, cl_count, default_board_clearance);<NEW_LINE>}<NEW_LINE>p_par.file.end_scope();<NEW_LINE>}
().get_trace_half_width(0));
1,622,773
public static void updateStoryOrder(Context context, FeedSet fs, StoryOrder newOrder) {<NEW_LINE>if (fs.isAllNormal()) {<NEW_LINE>setStoryOrderForFolder(context, PrefConstants.ALL_STORIES_FOLDER_NAME, newOrder);<NEW_LINE>} else if (fs.getSingleFeed() != null) {<NEW_LINE>setStoryOrderForFeed(context, fs.getSingleFeed(), newOrder);<NEW_LINE>} else if (fs.getMultipleFeeds() != null) {<NEW_LINE>setStoryOrderForFolder(context, fs.getFolderName(), newOrder);<NEW_LINE>} else if (fs.isAllSocial()) {<NEW_LINE>setStoryOrderForFolder(context, PrefConstants.ALL_SHARED_STORIES_FOLDER_NAME, newOrder);<NEW_LINE>} else if (fs.getSingleSocialFeed() != null) {<NEW_LINE>setStoryOrderForFeed(context, fs.getSingleSocialFeed(<MASK><NEW_LINE>} else if (fs.getMultipleSocialFeeds() != null) {<NEW_LINE>throw new IllegalArgumentException("multiple social feeds not supported");<NEW_LINE>} else if (fs.isAllRead()) {<NEW_LINE>throw new IllegalArgumentException("AllRead FeedSet type has fixed ordering");<NEW_LINE>} else if (fs.isAllSaved()) {<NEW_LINE>setStoryOrderForFolder(context, PrefConstants.SAVED_STORIES_FOLDER_NAME, newOrder);<NEW_LINE>} else if (fs.getSingleSavedTag() != null) {<NEW_LINE>setStoryOrderForFolder(context, PrefConstants.SAVED_STORIES_FOLDER_NAME, newOrder);<NEW_LINE>} else if (fs.isGlobalShared()) {<NEW_LINE>throw new IllegalArgumentException("GlobalShared FeedSet type has fixed ordering");<NEW_LINE>} else if (fs.isInfrequent()) {<NEW_LINE>setStoryOrderForFolder(context, PrefConstants.INFREQUENT_FOLDER_NAME, newOrder);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("unknown type of feed set");<NEW_LINE>}<NEW_LINE>}
).getKey(), newOrder);
1,077,353
public T lexiconImpl(String name, InputStream data, long size) throws IOException {<NEW_LINE>long startTime = java.lang.System.nanoTime();<NEW_LINE>if (progress != null) {<NEW_LINE>progress.startBlock(name, startTime, Progress.Kind.INPUT);<NEW_LINE>}<NEW_LINE>TrackingInputStream tracker = new TrackingInputStream(data);<NEW_LINE>CSVParser parser = new CSVParser(new InputStreamReader<MASK><NEW_LINE>int line = 1;<NEW_LINE>while (true) {<NEW_LINE>List<String> fields = parser.getNextRecord();<NEW_LINE>if (fields == null)<NEW_LINE>break;<NEW_LINE>try {<NEW_LINE>CsvLexicon.WordEntry e = lexicon.parseLine(fields);<NEW_LINE>int wordId = lexicon.addEntry(e);<NEW_LINE>if (e.headword != null) {<NEW_LINE>index.add(e.headword, wordId);<NEW_LINE>}<NEW_LINE>line += 1;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InputFileException(line, fields.get(0), e);<NEW_LINE>}<NEW_LINE>if (progress != null) {<NEW_LINE>progress.progress(tracker.getPosition(), size);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long time = java.lang.System.nanoTime() - startTime;<NEW_LINE>if (progress != null) {<NEW_LINE>progress.endBlock(line, time);<NEW_LINE>}<NEW_LINE>inputs.add(new ModelOutput.Part(name, time, line));<NEW_LINE>return self();<NEW_LINE>}
(tracker, StandardCharsets.UTF_8));
712,737
public void handle(PSAttemptEvent event) {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Processing " + event.getPSAttemptId() + <MASK><NEW_LINE>}<NEW_LINE>writeLock.lock();<NEW_LINE>try {<NEW_LINE>final PSAttemptStateInternal oldState = getInternalState();<NEW_LINE>try {<NEW_LINE>stateMachine.doTransition(event.getType(), event);<NEW_LINE>} catch (InvalidStateTransitonException e) {<NEW_LINE>LOG.error("Can't handle this event at current state for " + this.attemptId, e);<NEW_LINE>context.getEventHandler().handle(new InternalErrorEvent(context.getApplicationId(), "Invalid event :" + event.getType()));<NEW_LINE>}<NEW_LINE>if (oldState != getInternalState()) {<NEW_LINE>LOG.info(attemptId + " PSAttempt Transitioned from " + oldState + " to " + getInternalState());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>writeLock.unlock();<NEW_LINE>}<NEW_LINE>}
" of type " + event.getType());
276,861
private void moveNamedFunctions(Node functionBody) {<NEW_LINE>checkState(functionBody.getParent().isFunction());<NEW_LINE>Node insertAfter = null;<NEW_LINE>Node current = functionBody.getFirstChild();<NEW_LINE>// Skip any declarations at the beginning of the function body, they<NEW_LINE>// are already in the right place.<NEW_LINE>while (current != null && NodeUtil.isFunctionDeclaration(current)) {<NEW_LINE>insertAfter = current;<NEW_LINE>current = current.getNext();<NEW_LINE>}<NEW_LINE>// Find any remaining declarations and move them.<NEW_LINE>while (current != null) {<NEW_LINE>// Save off the next node as the current node maybe removed.<NEW_LINE><MASK><NEW_LINE>if (NodeUtil.isFunctionDeclaration(current)) {<NEW_LINE>// Remove the declaration from the body.<NEW_LINE>current.detach();<NEW_LINE>// Read the function at the top of the function body (after any<NEW_LINE>// previous declarations).<NEW_LINE>insertAfter = addToFront(functionBody, current, insertAfter);<NEW_LINE>reportCodeChange("Move function declaration not at top of function", functionBody);<NEW_LINE>}<NEW_LINE>current = next;<NEW_LINE>}<NEW_LINE>}
Node next = current.getNext();
1,114,653
public void check(Path file, PageCursor cursor, Root root, GBPTreeConsistencyCheckVisitor<KEY> visitor, CursorContext cursorContext) throws IOException {<NEW_LINE>// TODO: limitation, can't run on an index larger than Integer.MAX_VALUE pages (which is fairly large)<NEW_LINE>long highId = lastId + 1;<NEW_LINE>BitSet seenIds = new BitSet(toIntExact(highId));<NEW_LINE>// Log ids in freelist together with ids occupied by freelist pages.<NEW_LINE>IdProvider.IdProviderVisitor freelistSeenIdsVisitor = new FreelistSeenIdsVisitor<>(<MASK><NEW_LINE>idProvider.visitFreelist(freelistSeenIdsVisitor, cursorContext);<NEW_LINE>// Check structure of GBPTree<NEW_LINE>long rootGeneration = root.goTo(cursor);<NEW_LINE>KeyRange<KEY> openRange = new KeyRange<>(-1, -1, comparator, null, null, layout, null);<NEW_LINE>checkSubtree(file, cursor, openRange, -1, rootGeneration, GBPTreePointerType.noPointer(), 0, visitor, seenIds, cursorContext);<NEW_LINE>// Assert that rightmost node on each level has empty right sibling.<NEW_LINE>rightmostPerLevel.forEach(rightmost -> rightmost.assertLast(visitor));<NEW_LINE>// Assert that all pages in file are either present as an active tree node or in freelist.<NEW_LINE>assertAllIdsOccupied(file, highId, seenIds, visitor);<NEW_LINE>root.goTo(cursor);<NEW_LINE>}
file, seenIds, lastId, visitor);
293,495
private void createAndWriteTraceFileHeader(Context context, long utglobaldataAddress, int bufferSize, PrintStream out) throws CorruptDataException, DDRInteractiveCommandException {<NEW_LINE>IProcess process = context.process;<NEW_LINE>boolean isBigEndian = process.getByteOrder().equals(ByteOrder.BIG_ENDIAN);<NEW_LINE>long j9rasAddress = CommandUtils.followPointerFromStructure(context, "J9JavaVM", context.vmAddress, "j9ras");<NEW_LINE>long cpuOffset = CommandUtils.getOffsetForField(StructureCommandUtil.getStructureDescriptor<MASK><NEW_LINE>int cpuCount = context.process.getIntAt(j9rasAddress + cpuOffset);<NEW_LINE>long archOffset = CommandUtils.getOffsetForField(StructureCommandUtil.getStructureDescriptor("J9RAS", context), "osarch");<NEW_LINE>String arch = getCStringAtAddress(process, j9rasAddress + archOffset, 16);<NEW_LINE>// We can't actually work this out.<NEW_LINE>String processorSubType = "";<NEW_LINE>long serviceInfoOffset = CommandUtils.getOffsetForField(StructureCommandUtil.getStructureDescriptor("UtGlobalData", context), "serviceInfo");<NEW_LINE>long serviceInfoAddress = process.getPointerAt(utglobaldataAddress + serviceInfoOffset);<NEW_LINE>String serviceLevel = getCStringAtAddress(process, serviceInfoAddress);<NEW_LINE>long propertiesOffset = CommandUtils.getOffsetForField(StructureCommandUtil.getStructureDescriptor("UtGlobalData", context), "properties");<NEW_LINE>long propertiesAddress = process.getPointerAt(utglobaldataAddress + propertiesOffset);<NEW_LINE>String startupOptions = getCStringAtAddress(process, propertiesAddress);<NEW_LINE>int wordSize = process.bytesPerPointer() * 8;<NEW_LINE>// The trace configuration options are in a list.<NEW_LINE>String traceConfig = "";<NEW_LINE>long commandOffset = CommandUtils.getOffsetForField(StructureCommandUtil.getStructureDescriptor("UtTraceCfg", context), "command");<NEW_LINE>long nextConfigAddress = CommandUtils.followPointerFromStructure(context, "UtGlobalData", utglobaldataAddress, "config");<NEW_LINE>while (nextConfigAddress != 0) {<NEW_LINE>traceConfig += getCStringAtAddress(process, nextConfigAddress + commandOffset);<NEW_LINE>nextConfigAddress = CommandUtils.followPointerFromStructure(context, "UtTraceCfg", nextConfigAddress, "next");<NEW_LINE>if (nextConfigAddress != 0) {<NEW_LINE>traceConfig += "\n";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long startPlatformOffset = CommandUtils.getOffsetForField(StructureCommandUtil.getStructureDescriptor("UtGlobalData", context), "startPlatform");<NEW_LINE>long startPlatform = context.process.getLongAt(utglobaldataAddress + startPlatformOffset);<NEW_LINE>long startSystemOffset = CommandUtils.getOffsetForField(StructureCommandUtil.getStructureDescriptor("UtGlobalData", context), "startSystem");<NEW_LINE>long startSystem = context.process.getLongAt(utglobaldataAddress + startSystemOffset);<NEW_LINE>long externalTraceOffset = CommandUtils.getOffsetForField(StructureCommandUtil.getStructureDescriptor("UtGlobalData", context), "externalTrace");<NEW_LINE>int type = context.process.getIntAt(utglobaldataAddress + externalTraceOffset);<NEW_LINE>long traceGenerationsOffset = CommandUtils.getOffsetForField(StructureCommandUtil.getStructureDescriptor("UtGlobalData", context), "traceGenerations");<NEW_LINE>int generations = context.process.getIntAt(utglobaldataAddress + traceGenerationsOffset);<NEW_LINE>TraceFileHeaderWriter headerWriter;<NEW_LINE>try {<NEW_LINE>headerWriter = new TraceFileHeaderWriter(fileName, isBigEndian, cpuCount, wordSize, bufferSize, arch, processorSubType, serviceLevel, startupOptions, traceConfig, startPlatform, startSystem, type, generations);<NEW_LINE>byte[] headerBytes = headerWriter.createAndWriteTraceFileHeader();<NEW_LINE>writeHeaderBytesToTrace(context, headerBytes, out);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
("J9RAS", context), "cpus");
1,319,383
// Note: see page 327.<NEW_LINE>public StandardizeApartResult standardizeApart(Sentence sentence, StandardizeApartIndexical standardizeApartIndexical) {<NEW_LINE>Set<Variable> toRename = variableCollector.collectAllVariables(sentence);<NEW_LINE>Map<Variable, Term> renameSubstitution = new HashMap<Variable, Term>();<NEW_LINE>Map<Variable, Term> reverseSubstitution = new HashMap<Variable, Term>();<NEW_LINE>for (Variable var : toRename) {<NEW_LINE>Variable v = null;<NEW_LINE>do {<NEW_LINE>v = new Variable(standardizeApartIndexical.getPrefix() + standardizeApartIndexical.getNextIndex());<NEW_LINE>// Ensure the new variable name is not already<NEW_LINE>// accidentally used in the sentence<NEW_LINE>} while (toRename.contains(v));<NEW_LINE><MASK><NEW_LINE>reverseSubstitution.put(v, var);<NEW_LINE>}<NEW_LINE>Sentence standardized = substVisitor.subst(renameSubstitution, sentence);<NEW_LINE>return new StandardizeApartResult(sentence, standardized, renameSubstitution, reverseSubstitution);<NEW_LINE>}
renameSubstitution.put(var, v);
373,470
ExportResult<PhotosContainerResource> exportOneDrivePhotos(TokensAndUrlAuthData authData, Optional<IdOnlyContainerResource> albumData, Optional<PaginationData> paginationData, UUID jobId) throws IOException {<NEW_LINE>Optional<String> albumId = Optional.empty();<NEW_LINE>if (albumData.isPresent()) {<NEW_LINE>albumId = Optional.of(albumData.get().getId());<NEW_LINE>}<NEW_LINE>Optional<String> paginationUrl = getDrivePaginationToken(paginationData);<NEW_LINE>MicrosoftDriveItemsResponse driveItemsResponse;<NEW_LINE>if (paginationData.isPresent() || albumData.isPresent()) {<NEW_LINE>driveItemsResponse = getOrCreatePhotosInterface(authData<MASK><NEW_LINE>} else {<NEW_LINE>driveItemsResponse = getOrCreatePhotosInterface(authData).getDriveItemsFromSpecialFolder(MicrosoftSpecialFolder.FolderType.photos);<NEW_LINE>}<NEW_LINE>PaginationData nextPageData = SetNextPageToken(driveItemsResponse);<NEW_LINE>ContinuationData continuationData = new ContinuationData(nextPageData);<NEW_LINE>PhotosContainerResource containerResource;<NEW_LINE>MicrosoftDriveItem[] driveItems = driveItemsResponse.getDriveItems();<NEW_LINE>List<PhotoAlbum> albums = new ArrayList<>();<NEW_LINE>List<PhotoModel> photos = new ArrayList<>();<NEW_LINE>if (driveItems != null && driveItems.length > 0) {<NEW_LINE>for (MicrosoftDriveItem driveItem : driveItems) {<NEW_LINE>PhotoAlbum album = tryConvertDriveItemToPhotoAlbum(driveItem, jobId);<NEW_LINE>if (album != null) {<NEW_LINE>albums.add(album);<NEW_LINE>continuationData.addContainerResource(new IdOnlyContainerResource(driveItem.id));<NEW_LINE>}<NEW_LINE>PhotoModel photo = tryConvertDriveItemToPhotoModel(albumId, driveItem, jobId);<NEW_LINE>if (photo != null) {<NEW_LINE>photos.add(photo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ExportResult.ResultType result = nextPageData == null ? ExportResult.ResultType.END : ExportResult.ResultType.CONTINUE;<NEW_LINE>containerResource = new PhotosContainerResource(albums, photos);<NEW_LINE>return new ExportResult<>(result, containerResource, continuationData);<NEW_LINE>}
).getDriveItems(albumId, paginationUrl);
1,668,329
public SQLConnection createDatabase(MariaDBGlobalState globalState) throws SQLException {<NEW_LINE>globalState.getState().logStatement("DROP DATABASE IF EXISTS " + globalState.getDatabaseName());<NEW_LINE>globalState.getState().logStatement("CREATE DATABASE " + globalState.getDatabaseName());<NEW_LINE>globalState.getState().logStatement("USE " + globalState.getDatabaseName());<NEW_LINE>String username = globalState.getOptions().getUserName();<NEW_LINE>String password = globalState.getOptions().getPassword();<NEW_LINE>String host = globalState.getOptions().getHost();<NEW_LINE>int port = globalState.getOptions().getPort();<NEW_LINE>if (host == null) {<NEW_LINE>host = MariaDBOptions.DEFAULT_HOST;<NEW_LINE>}<NEW_LINE>if (port == MainOptions.NO_SET_PORT) {<NEW_LINE>port = MariaDBOptions.DEFAULT_PORT;<NEW_LINE>}<NEW_LINE>String url = String.format("jdbc:mariadb://%s:%d", host, port);<NEW_LINE>Connection con = DriverManager.getConnection(url, username, password);<NEW_LINE>try (Statement s = con.createStatement()) {<NEW_LINE>s.execute(<MASK><NEW_LINE>}<NEW_LINE>try (Statement s = con.createStatement()) {<NEW_LINE>s.execute("CREATE DATABASE " + globalState.getDatabaseName());<NEW_LINE>}<NEW_LINE>try (Statement s = con.createStatement()) {<NEW_LINE>s.execute("USE " + globalState.getDatabaseName());<NEW_LINE>}<NEW_LINE>return new SQLConnection(con);<NEW_LINE>}
"DROP DATABASE IF EXISTS " + globalState.getDatabaseName());
1,378,948
/*<NEW_LINE>* Override system variables.<NEW_LINE>*/<NEW_LINE>public void updateSystemVariables(@Sensitive Map<String, LibertyVariable> newVariables) {<NEW_LINE>// Remove any variables that were removed from config. Replace with a defaultInstance value if it exists.<NEW_LINE>for (String variableName : configVariables.keySet()) {<NEW_LINE>if (!newVariables.containsKey(variableName)) {<NEW_LINE>LibertyVariable defaultInstanceVar = defaultConfigVariables.get(variableName);<NEW_LINE>if (defaultInstanceVar == null || defaultInstanceVar.getValue() == null)<NEW_LINE>registry.removeVariable(variableName);<NEW_LINE>else<NEW_LINE>registry.replaceVariable(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Replace values that have changed<NEW_LINE>for (Map.Entry<String, LibertyVariable> entry : newVariables.entrySet()) {<NEW_LINE>String variableName = entry.getKey();<NEW_LINE>String variableValue = entry.getValue().getValue();<NEW_LINE>if (variableValue != null)<NEW_LINE>registry.replaceVariable(variableName, variableValue);<NEW_LINE>else<NEW_LINE>registry.removeVariable(variableName);<NEW_LINE>}<NEW_LINE>configVariables = newVariables;<NEW_LINE>// Override with command line variables if necessary<NEW_LINE>for (CommandLineVariable clv : commandLineVariables) {<NEW_LINE>registry.replaceVariable(clv.getName(), clv.getValue());<NEW_LINE>}<NEW_LINE>// Add File System Variables ( if not present)<NEW_LINE>for (LibertyVariable v : fileSystemVariables.values()) {<NEW_LINE>registry.addVariable(v.getName(), v.getValue());<NEW_LINE>}<NEW_LINE>updateUserDefinedVariableMap();<NEW_LINE>updateUserDefinedVariableDefaultsMap();<NEW_LINE>}
variableName, defaultInstanceVar.getValue());
1,092,038
protected JsonNode callRemoteIdmService(String url, String username, String password) {<NEW_LINE>HttpGet httpGet = new HttpGet(url);<NEW_LINE>httpGet.setHeader(HttpHeaders.AUTHORIZATION, "Basic " + new String(Base64.getEncoder().encode((username + ":" + password).getBytes(StandardCharsets.UTF_8))));<NEW_LINE>HttpClientBuilder clientBuilder = HttpClientBuilder.create();<NEW_LINE>SSLConnectionSocketFactory sslsf = null;<NEW_LINE>try {<NEW_LINE>SSLContextBuilder builder = new SSLContextBuilder();<NEW_LINE>builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());<NEW_LINE>sslsf = new SSLConnectionSocketFactory(builder.build(), NoopHostnameVerifier.INSTANCE);<NEW_LINE>clientBuilder.setSSLSocketFactory(sslsf);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>CloseableHttpClient client = clientBuilder.build();<NEW_LINE>try {<NEW_LINE>HttpResponse response = client.execute(httpGet);<NEW_LINE>if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {<NEW_LINE>return objectMapper.readTree(response.getEntity().getContent());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Exception while getting token", e);<NEW_LINE>} finally {<NEW_LINE>if (client != null) {<NEW_LINE>try {<NEW_LINE>client.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warn("Exception while closing http client", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
LOGGER.warn("Could not configure SSL for http client", e);
228,342
// Visible for testing<NEW_LINE>static Resource buildResource(SimpleHttpClient httpClient, DockerHelper dockerHelper, String k8sTokenPath, String k8sKeystorePath) {<NEW_LINE>if (!isEks(k8sTokenPath, k8sKeystorePath, httpClient)) {<NEW_LINE>return Resource.empty();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>attrBuilders.put(ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.AWS);<NEW_LINE>attrBuilders.put(ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CloudPlatformValues.AWS_EKS);<NEW_LINE>String clusterName = getClusterName(httpClient);<NEW_LINE>if (clusterName != null && !clusterName.isEmpty()) {<NEW_LINE>attrBuilders.put(ResourceAttributes.K8S_CLUSTER_NAME, clusterName);<NEW_LINE>}<NEW_LINE>String containerId = dockerHelper.getContainerId();<NEW_LINE>if (containerId != null && !containerId.isEmpty()) {<NEW_LINE>attrBuilders.put(ResourceAttributes.CONTAINER_ID, containerId);<NEW_LINE>}<NEW_LINE>return Resource.create(attrBuilders.build(), ResourceAttributes.SCHEMA_URL);<NEW_LINE>}
AttributesBuilder attrBuilders = Attributes.builder();
585,171
final UpdateAppImageConfigResult executeUpdateAppImageConfig(UpdateAppImageConfigRequest updateAppImageConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateAppImageConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateAppImageConfigRequest> request = null;<NEW_LINE>Response<UpdateAppImageConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateAppImageConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAppImageConfigRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAppImageConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateAppImageConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateAppImageConfigResultJsonUnmarshaller());<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,285,989
public void marshall(CreateRecommendationTemplateRequest createRecommendationTemplateRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createRecommendationTemplateRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createRecommendationTemplateRequest.getAssessmentArn(), ASSESSMENTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createRecommendationTemplateRequest.getBucketName(), BUCKETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createRecommendationTemplateRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createRecommendationTemplateRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createRecommendationTemplateRequest.getRecommendationIds(), RECOMMENDATIONIDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createRecommendationTemplateRequest.getRecommendationTypes(), RECOMMENDATIONTYPES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createRecommendationTemplateRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createRecommendationTemplateRequest.getFormat(), FORMAT_BINDING);
203,699
public void onStreamPropertyChanged(Participant participant, Integer transactionId, Set<Participant> participants, String streamId, String property, JsonElement newValue, String reason) {<NEW_LINE>JsonObject params = new JsonObject();<NEW_LINE>params.addProperty(ProtocolElements.<MASK><NEW_LINE>params.addProperty(ProtocolElements.STREAMPROPERTYCHANGED_STREAMID_PARAM, streamId);<NEW_LINE>params.addProperty(ProtocolElements.STREAMPROPERTYCHANGED_PROPERTY_PARAM, property);<NEW_LINE>params.addProperty(ProtocolElements.STREAMPROPERTYCHANGED_NEWVALUE_PARAM, newValue.toString());<NEW_LINE>params.addProperty(ProtocolElements.STREAMPROPERTYCHANGED_REASON_PARAM, reason);<NEW_LINE>for (Participant p : participants) {<NEW_LINE>if (p.getParticipantPrivateId().equals(participant.getParticipantPrivateId())) {<NEW_LINE>rpcNotificationService.sendResponse(participant.getParticipantPrivateId(), transactionId, new JsonObject());<NEW_LINE>} else {<NEW_LINE>rpcNotificationService.sendNotification(p.getParticipantPrivateId(), ProtocolElements.STREAMPROPERTYCHANGED_METHOD, params);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
STREAMPROPERTYCHANGED_CONNECTIONID_PARAM, participant.getParticipantPublicId());
156,236
private void remove(Context context, DSpaceObject dso, DSpaceObjectService dsoService, MetadataField metadataField, String index) {<NEW_LINE>metadataPatchUtils.checkMetadataFieldNotNull(metadataField);<NEW_LINE>try {<NEW_LINE>if (index == null) {<NEW_LINE>// remove all metadata of this type<NEW_LINE>dsoService.clearMetadata(context, dso, metadataField.getMetadataSchema().getName(), metadataField.getElement(), metadataField.getQualifier(), Item.ANY);<NEW_LINE>} else {<NEW_LINE>// remove metadata at index<NEW_LINE>List<MetadataValue> metadataValues = dsoService.getMetadata(dso, metadataField.getMetadataSchema().getName(), metadataField.getElement(), metadataField.<MASK><NEW_LINE>int indexInt = Integer.parseInt(index);<NEW_LINE>if (indexInt >= 0 && metadataValues.size() > indexInt && metadataValues.get(indexInt) != null) {<NEW_LINE>// remove that metadata<NEW_LINE>dsoService.removeMetadataValues(context, dso, Arrays.asList(metadataValues.get(indexInt)));<NEW_LINE>} else {<NEW_LINE>throw new UnprocessableEntityException("UnprocessableEntityException - There is no metadata of " + "this type at that index");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new IllegalArgumentException("This index (" + index + ") is not valid number.", e);<NEW_LINE>} catch (ArrayIndexOutOfBoundsException e) {<NEW_LINE>throw new UnprocessableEntityException("There is no metadata of this type at that index");<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new DSpaceBadRequestException("SQLException in DspaceObjectMetadataRemoveOperation.remove " + "trying to remove metadata from dso.", e);<NEW_LINE>}<NEW_LINE>}
getQualifier(), Item.ANY);
859,248
private AvroMessageContentUnwrapperResult tryDeserializingUsingAnySchemaVersion(byte[] data, Topic topic, boolean online) {<NEW_LINE>if (online) {<NEW_LINE>if (!schemaOnlineChecksRateLimiter.tryAcquireOnlineCheckPermit()) {<NEW_LINE>logger.error("Could not match schema online for message of topic {} " + "due to too many schema repository requests", topic.getQualifiedName());<NEW_LINE>return AvroMessageContentUnwrapperResult.failure();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<SchemaVersion> versions = <MASK><NEW_LINE>for (SchemaVersion version : versions) {<NEW_LINE>try {<NEW_LINE>CompiledSchema<Schema> schema = online ? schemaRepository.getKnownAvroSchemaVersion(topic, version) : schemaRepository.getAvroSchema(topic, version);<NEW_LINE>return AvroMessageContentUnwrapperResult.success(avroMessageContentWrapper.unwrapContent(data, schema));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error("Failed to match schema for message for topic {}, schema version {}, fallback to previous version.", topic.getQualifiedName(), version.value(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>deserializationErrorsCounterForAnySchemaVersion(online).inc();<NEW_LINE>logger.error("Could not match schema {} for message of topic {} {}", online ? "online" : "from cache", topic.getQualifiedName(), SchemaVersion.toString(versions));<NEW_LINE>return AvroMessageContentUnwrapperResult.failure();<NEW_LINE>}
schemaRepository.getVersions(topic, online);
363,185
public void updateWeekGrid(int daysCount, List<CalendarDay> days, Date today, String[] realDayNames) {<NEW_LINE>weekGrid.setFirstHour(getFirstHourOfTheDay());<NEW_LINE>weekGrid.setLastHour(getLastHourOfTheDay());<NEW_LINE>weekGrid.getTimeBar().updateTimeBar(is24HFormat());<NEW_LINE>dayToolbar.clear();<NEW_LINE>dayToolbar.addBackButton();<NEW_LINE>dayToolbar.setVerticalSized(isHeightUndefined);<NEW_LINE>dayToolbar.setHorizontalSized(isWidthUndefined);<NEW_LINE>weekGrid.clearDates();<NEW_LINE>weekGrid.setDisabled(isDisabledOrReadOnly());<NEW_LINE>for (CalendarDay day : days) {<NEW_LINE><MASK><NEW_LINE>String localizedDateFormat = day.getLocalizedDateFormat();<NEW_LINE>Date d = dateformat_date.parse(date);<NEW_LINE>int dayOfWeek = day.getDayOfWeek();<NEW_LINE>if (dayOfWeek < getFirstDayNumber() || dayOfWeek > getLastDayNumber()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean isToday = false;<NEW_LINE>int dayOfMonth = d.getDate();<NEW_LINE>if (today.getDate() == dayOfMonth && today.getYear() == d.getYear() && today.getMonth() == d.getMonth()) {<NEW_LINE>isToday = true;<NEW_LINE>}<NEW_LINE>dayToolbar.add(realDayNames[dayOfWeek - 1], date, localizedDateFormat, isToday ? "today" : null);<NEW_LINE>weeklyLongEvents.addDate(d);<NEW_LINE>weekGrid.addDate(d);<NEW_LINE>if (isToday) {<NEW_LINE>weekGrid.setToday(d, today);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dayToolbar.addNextButton();<NEW_LINE>}
String date = day.getDate();
148,281
public ParsingResult<V> run(InputBuffer inputBuffer) {<NEW_LINE>checkArgNotNull(inputBuffer, "inputBuffer");<NEW_LINE>resetValueStack();<NEW_LINE>// first, run a basic match<NEW_LINE>ParsingResult<<MASK><NEW_LINE>// all good<NEW_LINE>if (result.matched)<NEW_LINE>return result;<NEW_LINE>// ok, we have a parse error, so determine the error location<NEW_LINE>resetValueStack();<NEW_LINE>result = runLocatingMatch(inputBuffer);<NEW_LINE>// we failed before so we should really be failing again<NEW_LINE>Preconditions.checkState(!result.matched);<NEW_LINE>// may be more than one in case of custom ActionExceptions<NEW_LINE>Preconditions.checkState(result.parseErrors.size() >= 1);<NEW_LINE>// finally perform a third, reporting run (now that we know the error location)<NEW_LINE>resetValueStack();<NEW_LINE>result = runReportingMatch(inputBuffer, result.parseErrors.get(0).getStartIndex());<NEW_LINE>// we failed before so we should really be failing again<NEW_LINE>Preconditions.checkState(!result.matched);<NEW_LINE>return result;<NEW_LINE>}
V> result = runBasicMatch(inputBuffer);
774,837
private static void configureBulkdata(Dcm2Xml dcm2xml, CommandLine cl) throws Exception {<NEW_LINE>if (cl.hasOption("b")) {<NEW_LINE>dcm2xml.setIncludeBulkData(IncludeBulkData.YES);<NEW_LINE>}<NEW_LINE>if (cl.hasOption("B")) {<NEW_LINE>dcm2xml.setIncludeBulkData(IncludeBulkData.NO);<NEW_LINE>}<NEW_LINE>if (cl.hasOption("blk-file-prefix")) {<NEW_LINE>dcm2xml.setBulkDataFilePrefix(cl.getOptionValue("blk-file-prefix"));<NEW_LINE>}<NEW_LINE>if (cl.hasOption("blk-file-suffix")) {<NEW_LINE>dcm2xml.setBulkDataFileSuffix<MASK><NEW_LINE>}<NEW_LINE>if (cl.hasOption("d")) {<NEW_LINE>File tempDir = new File(cl.getOptionValue("d"));<NEW_LINE>dcm2xml.setBulkDataDirectory(tempDir);<NEW_LINE>}<NEW_LINE>dcm2xml.setConcatenateBulkDataFiles(cl.hasOption("c"));<NEW_LINE>dcm2xml.setBulkDataNoDefaults(cl.hasOption("blk-nodefs"));<NEW_LINE>if (cl.hasOption("blk")) {<NEW_LINE>CLIUtils.addTagPaths(dcm2xml.bulkDataDescriptor, cl.getOptionValues("blk"));<NEW_LINE>}<NEW_LINE>if (cl.hasOption("blk-vr")) {<NEW_LINE>dcm2xml.setBulkDataLengthsThresholdsFromStrings(cl.getOptionValues("blk-vr"));<NEW_LINE>}<NEW_LINE>}
(cl.getOptionValue("blk-file-suffix"));
996,540
public void onNickChange(final NickMessage msg) {<NEW_LINE>if (msg == null || msg.getSource() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String oldNick = msg<MASK><NEW_LINE>final String newNick = msg.getNewNick();<NEW_LINE>if (oldNick == null || newNick == null) {<NEW_LINE>LOGGER.error("Incomplete nick change message. Old nick: '" + oldNick + "', new nick: '" + newNick + "'.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (BasicPollerPresenceWatcher.this.nickWatchList) {<NEW_LINE>if (BasicPollerPresenceWatcher.this.nickWatchList.contains(oldNick)) {<NEW_LINE>update(oldNick, IrcStatusEnum.OFFLINE);<NEW_LINE>}<NEW_LINE>if (BasicPollerPresenceWatcher.this.nickWatchList.contains(newNick)) {<NEW_LINE>update(newNick, IrcStatusEnum.ONLINE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getSource().getNick();
603,467
private void generateDOM4MultiByteExtras(Element parent, TTFFile ttf, boolean isCid) {<NEW_LINE>Element el;<NEW_LINE>Document doc = parent.getOwnerDocument();<NEW_LINE>Element mel = doc.createElement("multibyte-extras");<NEW_LINE>parent.appendChild(mel);<NEW_LINE>el = doc.createElement("cid-type");<NEW_LINE>mel.appendChild(el);<NEW_LINE>el.appendChild(doc.createTextNode("CIDFontType2"));<NEW_LINE>el = doc.createElement("default-width");<NEW_LINE>mel.appendChild(el);<NEW_LINE>el.appendChild(doc.createTextNode("0"));<NEW_LINE>el = doc.createElement("bfranges");<NEW_LINE>mel.appendChild(el);<NEW_LINE>for (CMapSegment ce : ttf.getCMaps()) {<NEW_LINE>Element el2 = doc.createElement("bf");<NEW_LINE>el.appendChild(el2);<NEW_LINE>el2.setAttribute("us", String.valueOf<MASK><NEW_LINE>el2.setAttribute("ue", String.valueOf(ce.getUnicodeEnd()));<NEW_LINE>el2.setAttribute("gi", String.valueOf(ce.getGlyphStartIndex()));<NEW_LINE>}<NEW_LINE>el = doc.createElement("cid-widths");<NEW_LINE>el.setAttribute("start-index", "0");<NEW_LINE>mel.appendChild(el);<NEW_LINE>int[] wx = ttf.getWidths();<NEW_LINE>for (int i = 0; i < wx.length; i++) {<NEW_LINE>Element wxel = doc.createElement("wx");<NEW_LINE>wxel.setAttribute("w", String.valueOf(wx[i]));<NEW_LINE>int[] bbox = ttf.getBBox(i);<NEW_LINE>wxel.setAttribute("xMin", String.valueOf(bbox[0]));<NEW_LINE>wxel.setAttribute("yMin", String.valueOf(bbox[1]));<NEW_LINE>wxel.setAttribute("xMax", String.valueOf(bbox[2]));<NEW_LINE>wxel.setAttribute("yMax", String.valueOf(bbox[3]));<NEW_LINE>el.appendChild(wxel);<NEW_LINE>}<NEW_LINE>}
(ce.getUnicodeStart()));
862,106
protected final JMenu createResizeMenu() {<NEW_LINE>// NOI18N<NEW_LINE>JMenu menu = new JMenu(BUNDLE<MASK><NEW_LINE>JMenuItem horizPlus = new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>JMenuItem(BUNDLE().getString("TextArea_HorizPlus")) {<NEW_LINE><NEW_LINE>protected void fireActionPerformed(ActionEvent e) {<NEW_LINE>changeSize(false, true);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>horizPlus.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, KeyEvent.CTRL_MASK));<NEW_LINE>menu.add(horizPlus);<NEW_LINE>JMenuItem horizMinus = new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>JMenuItem(BUNDLE().getString("TextArea_HorizMinus")) {<NEW_LINE><NEW_LINE>protected void fireActionPerformed(ActionEvent e) {<NEW_LINE>changeSize(false, false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>horizMinus.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, KeyEvent.CTRL_MASK));<NEW_LINE>menu.add(horizMinus);<NEW_LINE>JMenuItem vertPlus = new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>JMenuItem(BUNDLE().getString("TextArea_VertPlus")) {<NEW_LINE><NEW_LINE>protected void fireActionPerformed(ActionEvent e) {<NEW_LINE>changeSize(true, true);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>vertPlus.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK));<NEW_LINE>menu.add(vertPlus);<NEW_LINE>JMenuItem vertMinus = new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>JMenuItem(BUNDLE().getString("TextArea_VertMinus")) {<NEW_LINE><NEW_LINE>protected void fireActionPerformed(ActionEvent e) {<NEW_LINE>changeSize(true, false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>vertMinus.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK));<NEW_LINE>menu.add(vertMinus);<NEW_LINE>menu.addSeparator();<NEW_LINE>JMenuItem reset = new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>JMenuItem(BUNDLE().getString("TextArea_DefaultSize")) {<NEW_LINE><NEW_LINE>protected void fireActionPerformed(ActionEvent e) {<NEW_LINE>resetSize();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>reset.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_0, KeyEvent.CTRL_MASK));<NEW_LINE>menu.add(reset);<NEW_LINE>return menu;<NEW_LINE>}
().getString("TextArea_Resize"));
1,829,927
public static void deleteTable(TableId tableId, boolean insertDeletes, ServerContext context, ServiceLock lock) throws AccumuloException {<NEW_LINE>try (Scanner ms = new ScannerImpl(context, MetadataTable.ID, Authorizations.EMPTY);<NEW_LINE>BatchWriter bw = new BatchWriterImpl(context, MetadataTable.ID, new BatchWriterConfig().setMaxMemory(1000000).setMaxLatency(120000L, TimeUnit.MILLISECONDS).setMaxWriteThreads(2))) {<NEW_LINE>// scan metadata for our table and delete everything we find<NEW_LINE>Mutation m = null;<NEW_LINE>Ample ample = context.getAmple();<NEW_LINE>ms.setRange(new KeyExtent(tableId, null, null).toMetaRange());<NEW_LINE>// insert deletes before deleting data from metadata... this makes the code fault tolerant<NEW_LINE>if (insertDeletes) {<NEW_LINE>ms.fetchColumnFamily(DataFileColumnFamily.NAME);<NEW_LINE>ServerColumnFamily.DIRECTORY_COLUMN.fetch(ms);<NEW_LINE>for (Entry<Key, Value> cell : ms) {<NEW_LINE>Key key = cell.getKey();<NEW_LINE>if (key.getColumnFamily().equals(DataFileColumnFamily.NAME)) {<NEW_LINE>String ref = TabletFileUtil.validate(key.getColumnQualifierData().toString());<NEW_LINE>bw.addMutation(ample.createDeleteMutation(ref));<NEW_LINE>}<NEW_LINE>if (ServerColumnFamily.DIRECTORY_COLUMN.hasColumns(key)) {<NEW_LINE>String uri = GcVolumeUtil.getDeleteTabletOnAllVolumesUri(tableId, cell.getValue().toString());<NEW_LINE>bw.addMutation(ample.createDeleteMutation(uri));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bw.flush();<NEW_LINE>ms.clearColumns();<NEW_LINE>}<NEW_LINE>for (Entry<Key, Value> cell : ms) {<NEW_LINE>Key key = cell.getKey();<NEW_LINE>if (m == null) {<NEW_LINE>m = new Mutation(key.getRow());<NEW_LINE>if (lock != null)<NEW_LINE>putLockID(context, lock, m);<NEW_LINE>}<NEW_LINE>if (key.getRow().compareTo(m.getRow(), 0, m.getRow().length) != 0) {<NEW_LINE>bw.addMutation(m);<NEW_LINE>m = new Mutation(key.getRow());<NEW_LINE>if (lock != null)<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>m.putDelete(key.getColumnFamily(), key.getColumnQualifier());<NEW_LINE>}<NEW_LINE>if (m != null)<NEW_LINE>bw.addMutation(m);<NEW_LINE>}<NEW_LINE>}
putLockID(context, lock, m);