private Deprecation parseDeprecation(JSONObject object) throws Exception { if (object.has("deprecation")) { JSONObject deprecationJsonObject = object.getJSONObject("deprecation"); Deprecation deprecation = new Deprecation(); deprecation.setLevel(parseDeprecationLevel( deprecationJsonObject.optString("level", null))); String reason = deprecationJsonObject.optString("reason", null); deprecation.setReason(reason); deprecation.setShortReason(this.sentenceExtractor.getFirstSentence(reason)); deprecation .setReplacement(deprecationJsonObject.optString("replacement", null)); return deprecation; } return object.optBoolean("deprecated") ? new Deprecation() : null; }
int end = value != null ? value.getIdxEnd() : key.getIdxEnd(); fixes.add(new DeletePropFix((StyledDocument) document, key.getText(), key.getIdxStart(), end)); if (deprecation.getReplacement() != null) { end = key.getIdxEnd(); fixes.add(new ReplacePropFix((StyledDocument) document, start, end, deprecation.getReplacement())); Deprecation.Level deprLevel = deprecation.getLevel(); ErrorDescription errDesc; if (deprLevel == ERROR) {
String reason = deprecation.getReason(); if (reason != null) { sb.append(": ").append(simpleHtmlEscape(reason)); String replacement = deprecation.getReplacement(); if (replacement != null) { sb.append("<i>Replaced by:</i> <tt>").append(replacement).append("</tt><br/>");
String reason = deprecation.getReason(); if (reason != null) { sb.append(":</i></b> ").append(simpleHtmlEscape(reason)); sb.append("</i></b>"); String replacement = deprecation.getReplacement(); if (replacement != null) { sb.append("<br/><i>Replaced by:</i> <code>").append(replacement).append("</code>");
/** * Checks if property is error deprecated. * * @param property the configuration property * @return if property is error deprecated */ private boolean isDeprecatedError(ConfigurationMetadataProperty property) { return property.getDeprecation() != null && property.getDeprecation().getLevel() == Level.ERROR; }
/** * Checks if property is error deprecated. * * @param property the configuration property * @return if property is error deprecated */ private boolean isDeprecatedError(ConfigurationMetadataProperty property) { return property.getDeprecation() != null && property.getDeprecation().getLevel() == Level.ERROR; }
|| !Deprecation.Level.ERROR.equals(p.getDeprecation().getLevel())) .collect(Collectors.toList());