diff --git a/groovy-eclipse.setup b/groovy-eclipse.setup index 64346fe67a..bddbb71b9d 100644 --- a/groovy-eclipse.setup +++ b/groovy-eclipse.setup @@ -299,7 +299,7 @@ + url="https://download.eclipse.org/eclipse/updates/4.25-I-builds/I20220824-1800"/> diff --git a/jdt-patch/e425/org.eclipse.jdt.core/.settings/.api_filters b/jdt-patch/e425/org.eclipse.jdt.core/.settings/.api_filters index c8a090a690..209e256916 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/.settings/.api_filters +++ b/jdt-patch/e425/org.eclipse.jdt.core/.settings/.api_filters @@ -22,6 +22,20 @@ + + + + + + + + + + + + + + @@ -200,14 +214,6 @@ - - - - - - - - diff --git a/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java b/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java index c2c46c7fce..a6cf7b583a 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java @@ -327,13 +327,15 @@ private int resolveImports(int numberOfStatements, ImportBinding[] resolvedImpor // skip duplicates or imports of the current package for (int j = 0; j < index; j++) { ImportBinding resolved = resolvedImports[j]; - if (resolved.onDemand == ((importReference.bits & ASTNode.OnDemand) != 0) && resolved.isStatic() == importReference.isStatic()) + if (resolved.onDemand == ((importReference.bits & ASTNode.OnDemand) != 0) && resolved.isStatic() == importReference.isStatic()) { /* GROOVY edit - if (CharOperation.equals(compoundName, resolvedImports[j].compoundName)) + if (CharOperation.equals(compoundName, resolvedImports[j].compoundName)) { */ - if (CharOperation.equals(compoundName, resolvedImports[j].compoundName) && CharOperation.equals(importReference.getSimpleName(), resolvedImports[j].getSimpleName())) + if (CharOperation.equals(compoundName, resolvedImports[j].compoundName) && CharOperation.equals(importReference.getSimpleName(), resolvedImports[j].getSimpleName())) { // GROOVY end continue nextImport; + } + } } if ((importReference.bits & ASTNode.OnDemand) != 0) { diff --git a/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java b/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java index 33cc94e2de..4a4891a635 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java @@ -1876,14 +1876,15 @@ private void parseExternalSnippet(String content, Object snippetTag) { previousPosition = indexPos; tokenType = snippetScanner.getNextToken(); - if (tokenType == TokenNameEOF) + if (tokenType == TokenNameEOF) { + if (!resetTextStartPos) { + pushExternalSnippetText(snippetScanner.source, textStartPosition, textEndPosition, false, snippetTag); + } break; + } indexPos = snippetScanner.currentPosition; textEndPosition = indexPos; - if (tokenType == TerminalTokens.TokenNameEOF) { - break; - } if (resetTextStartPos) { textStartPosition = snippetScanner.getCurrentTokenStartPosition(); newLineStarted = true; @@ -1892,7 +1893,7 @@ private void parseExternalSnippet(String content, Object snippetTag) { switch (tokenType) { case TerminalTokens.TokenNameWHITESPACE: if (containsNewLine(snippetScanner.getCurrentTokenString())) { - pushSnippetText(snippetScanner.source, textStartPosition, textEndPosition, false, snippetTag); + pushExternalSnippetText(snippetScanner.source, textStartPosition, textEndPosition, false, snippetTag); resetTextStartPos = true; newLineStarted = false; } @@ -1928,7 +1929,7 @@ private void parseExternalSnippet(String content, Object snippetTag) { textStartPosition = previousPosition; } if (textStartPosition != -1 && textStartPosition < indexPos) { - pushSnippetText(snippetScanner.source, textStartPosition,(innerTag!=null && indexOfLastComment >=0) ? textPos+indexOfLastComment+2:textPos, true, snippetTag); + pushExternalSnippetText(snippetScanner.source, textStartPosition,(innerTag!=null && indexOfLastComment >=0) ? textPos+indexOfLastComment+2:textPos, true, snippetTag); resetTextStartPos = true; newLineStarted = false; if (handleNow) { @@ -3055,7 +3056,7 @@ protected void pushSnippetText(char[] text, int start, int end, boolean addNewLi protected abstract void closeJavaDocRegion(String name, Object snippetTag, int end); protected abstract boolean areRegionsClosed(); - protected void pushExternalSnippetText(String text, int start, int end) { + protected void pushExternalSnippetText(char[] text, int start, int end, boolean addNewLine, Object snippetTag) { // do not store text by default } diff --git a/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java b/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java index c5531c5985..52c2e1eeee 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java @@ -1017,7 +1017,7 @@ protected void closeJavaDocRegion(String name, Object snippetTag, int end){ } @Override - protected void pushExternalSnippetText(String text, int start, int end) { + protected void pushExternalSnippetText(char[] text, int start, int end, boolean addNewLine, Object snippetTag) { // The tag gets its description => clear the flag this.tagWaitingForDescription = TAG_SNIPPET_VALUE; } diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java index 0b0b6fb9b0..204afdeb87 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java @@ -2108,6 +2108,22 @@ public JavaDocRegion newJavaDocRegion() { return result; } + /** + * Creates and returns a new text element node. + * Initially the new node has an empty text string. + *

+ * Note that this node type is used only inside doc comments + * ({@link Javadoc Javadoc}). + *

+ * + * @return a new unparented JavaDoc text element node + * @since 3.31 + */ + public JavaDocTextElement newJavaDocTextElement() { + JavaDocTextElement result = new JavaDocTextElement(this); + return result; + } + /** * Creates a new unparented labeled statement node owned by this AST. * By default, the label and statement are both unspecified, but legal. diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java index 108c2472da..b47ccb0465 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java @@ -1318,6 +1318,29 @@ public boolean match(JavaDocRegion node, Object other) { && safeEquals(node.isDummyRegion(), o.isDummyRegion() && safeEquals(node.isValidSnippet(), o.isValidSnippet())); } + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + * @since 3.31 + */ + public boolean match(JavaDocTextElement node, Object other) { + if (!(other instanceof JavaDocTextElement)) { + return false; + } + JavaDocTextElement o = (JavaDocTextElement) other; + return safeEquals(node.getText(), o.getText()); + } + /** * Return whether the deprecated comment strings of the given java doc are equals. *

diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java index 0920dfb295..0fc2787096 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java @@ -1051,6 +1051,14 @@ public abstract class ASTNode { */ public static final int JAVADOC_REGION = 111; + /** + * Node type constant indicating a node of type + * TextElement. + * @see TextElement + * @since 3.31 + */ + public static final int JAVADOC_TEXT_ELEMENT = 112; + /** * Returns the node class for the corresponding node type. @@ -1152,6 +1160,8 @@ public static Class nodeClassForType(int nodeType) { return Javadoc.class; case JAVADOC_REGION : return JavaDocRegion.class; + case JAVADOC_TEXT_ELEMENT : + return JavaDocTextElement.class; case LABELED_STATEMENT : return LabeledStatement.class; case LAMBDA_EXPRESSION : diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java index 276191d47a..53fb21fae5 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java @@ -920,6 +920,23 @@ public boolean visit(JavaDocRegion node) { return this.visitDocTags; } + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + * @since 3.31 + */ + public boolean visit(JavaDocTextElement node) { + return true; + } + /** * Visits the given type-specific AST node. *

@@ -2580,6 +2597,19 @@ public void endVisit(JavaDocRegion node) { // default implementation: do nothing } + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @since 3.31 + */ + public void endVisit(JavaDocTextElement node) { + // default implementation: do nothing + } + /** * End of visit the given type-specific AST node. *

diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTextElement.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTextElement.java new file mode 100644 index 0000000000..a761ad3b9d --- /dev/null +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTextElement.java @@ -0,0 +1,159 @@ +/******************************************************************************* + * Copyright (c) 2022 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.jdt.core.dom; + +import org.eclipse.jdt.internal.compiler.util.Util; + +/** + * AST node for a text element within a doc comment. + *

+ * AbstractTextElement:
+ *     Sequence of characters not including a close comment delimiter */
+ * 
+ * + * @see TextElement + * @see JavaDocTextElement + * @since 3.31 + */ + +@SuppressWarnings("rawtypes") +public abstract class AbstractTextElement extends ASTNode implements IDocElement { + + /** + * The "text" structural property of this node type (type: {@link String}). + * + */ + public static final SimplePropertyDescriptor internalTextPropertyFactory(Class nodeClass) { + return new SimplePropertyDescriptor(nodeClass, "text", String.class, MANDATORY); //$NON-NLS-1$ + } + + + /** + * The text element; defaults to the empty string. + */ + String text = Util.EMPTY_STRING; + + + /** + * Creates a new AST node for a text element owned by the given AST. + *

+ * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare + * additional subclasses. + *

+ * + * @param ast the AST that is to own this node + */ + AbstractTextElement(AST ast) { + super(ast); + } + + /** + * Returns structural property descriptor for the "text" property + * of this node (element type: {@link String}). + * + * @return the property descriptor + */ + abstract SimplePropertyDescriptor internalTextPropertyFactory(); + + + /** + * Returns structural property descriptor for the "text" property + * of this node (child type: {@link String}). + * + * @return the property descriptor + */ + public final SimplePropertyDescriptor getTextNameProperty() { + return internalTextPropertyFactory(); + } + + @Override + final Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { + if (property == internalTextPropertyFactory()) { + if (get) { + return getText(); + } else { + setText((String) value); + return null; + } + } + // allow default implementation to flag the error + return super.internalGetSetObjectProperty(property, get, value); + } + /** + * Returns this node's tag name, or null if none. + * For top level doc tags such as parameter tags, the tag name + * includes the "@" character ("@param"). + * For inline doc tags such as link tags, the tag name + * includes the "@" character ("@link"). + * The tag name may also be null; this is used to + * represent the material at the start of a doc comment preceding + * the first explicit tag. + * + * @return the tag name, or null if none + */ + public String getText() { + return this.text; + } + + /** + * Sets the text of this node to the given value. + *

+ * The text element typically includes leading and trailing + * whitespace that separates it from the immediately preceding + * or following elements. + *

+ * + * @param text the text of this node + * @exception IllegalArgumentException if the text is null + */ + public void setText(String text) { + if (text == null) { + throw new IllegalArgumentException(); + } + } + + /** + * Returns whether this tag element is nested within another + * tag element. Nested tag elements appears enclosed in + * "{" and "}"; certain doc tags, including "@link" and + * "@linkplain" are only meaningful as nested tags. + * Top-level (i.e., non-nested) doc tags begin on a new line; + * certain doc tags, including "@param" and + * "@see" are only meaningful as top-level tags. + *

+ * This convenience methods checks to see whether the parent + * of this node is of type {@link org.eclipse.jdt.core.dom.AbstractTextElement}. + *

+ * + * @return true if this node is a nested tag element, + * and false if this node is either parented by a doc comment node + * ({@link Javadoc}), or is unparented + */ + public boolean isNested() { + return (getParent() instanceof AbstractTextElement); + } + + @Override + int memSize() { + int size = BASE_NODE_SIZE + 2 * 3 + stringSize(this.text); + return size; + } + + @Override + int treeSize() { + return memSize(); + } +} diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java index e26ff479f4..a13b002467 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java @@ -206,6 +206,10 @@ public void endVisit(JavaDocRegion node) { endVisitNode(node); } @Override + public void endVisit(JavaDocTextElement node) { + endVisitNode(node); + } + @Override public void endVisit(LabeledStatement node) { endVisitNode(node); } @@ -641,6 +645,10 @@ public boolean visit(JavaDocRegion node) { return visitNode(node); } @Override + public boolean visit(JavaDocTextElement node) { + return visitNode(node); + } + @Override public boolean visit(LabeledStatement node) { return visitNode(node); } diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java index d6aed9e03b..c7bab8a826 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java @@ -1090,18 +1090,26 @@ protected void pushText(int start, int end) { @Override protected void pushSnippetText(char[] text, int start, int end, boolean addNewLine, Object snippetTag) { - boolean isExternalSnippet = false; + pushSnippetText(text, start, end, addNewLine, snippetTag, false); + } + + private void pushSnippetText(char[] text, int start, int end, boolean addNewLine, Object snippetTag, boolean isExternalSnippet) { // Create text element - TextElement textElem = this.ast.newTextElement(); String textToBeAdded= new String( text, start, end-start); + AbstractTextElement textElem= null; + if (isExternalSnippet && textToBeAdded.indexOf("*/") > 0) { //$NON-NLS-1$ + textElem = this.ast.newJavaDocTextElement(); + } else { + textElem = this.ast.newTextElement(); + } + int iindex = textToBeAdded.indexOf('*'); if (iindex > -1 && textToBeAdded.substring(0, iindex+1).trim().equals("*")) { //$NON-NLS-1$ textToBeAdded = textToBeAdded.substring(iindex+1); if (addNewLine) { textToBeAdded += System.lineSeparator(); } - } else if (iindex == -1){ - isExternalSnippet = true; + } else if (isExternalSnippet){ if (addNewLine) { textToBeAdded += System.lineSeparator(); } @@ -1193,7 +1201,7 @@ protected void pushSnippetText(char[] text, int start, int end, boolean addNewLi endPos = end; } Object textVal = region.getProperty(TagProperty.TAG_PROPERTY_SNIPPET_REGION_TEXT); - if (!(textVal instanceof TextElement)) { + if (!(textVal instanceof AbstractTextElement)) { region.setProperty(TagProperty.TAG_PROPERTY_SNIPPET_REGION_TEXT, textElem); } region.setSourceRange(startPos, endPos-startPos); @@ -1242,38 +1250,8 @@ private void setRegionEnded(JavaDocRegion region, boolean value) { } @Override - protected void pushExternalSnippetText(String text,int start, int end) { - String snippetLangHeader = "
"; //$NON-NLS-1$ //the code snippets comes as preformatted so need to prefix them with 
 tag
-		String snipperLangFooter = "
"; //$NON-NLS-1$ - text = snippetLangHeader + text + snipperLangFooter; - TextElement textElement = this.ast.newTextElement(); - textElement.setText(text); - textElement.setSourceRange(start, end-start); - - // Search previous tag on which to add the text element - TagElement previousTag = null; - int previousStart = start; - int previousEnd = end; - if (this.astPtr == -1) { - previousTag = this.ast.newTagElement(); - previousTag.setSourceRange(start, end-start); - pushOnAstStack(previousTag, true); - } else { - previousTag = (TagElement) this.astStack[this.astPtr]; - previousStart = previousTag.getStartPosition(); - previousEnd = previousStart + previousTag.getLength(); - } - previousTag.fragments().add(textElement); - int curStart = previousStart; - int curEnd = previousEnd; - if (start < previousStart) { - curStart = start; - } - if (end > previousEnd) { - curEnd = end; - } - previousTag.setSourceRange(curStart, curEnd-curStart); - this.textStart = -1; + protected void pushExternalSnippetText(char[] text, int start, int end, boolean addNewLine, Object snippetTag) { + pushSnippetText(text, start, end, addNewLine, snippetTag, true); } diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/JavaDocTextElement.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/JavaDocTextElement.java new file mode 100644 index 0000000000..9e4bcee82d --- /dev/null +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/JavaDocTextElement.java @@ -0,0 +1,157 @@ +/******************************************************************************* + * Copyright (c) 2022 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.jdt.core.dom; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jdt.internal.compiler.util.Util; + +/** + * AST node for a text element within a doc comment. + *
+ * TextElement:
+ *     Sequence of characters including a close comment delimiter */
+ * 
+ * + * @see Javadoc + * @since 3.31 + * @noinstantiate This class is not intended to be instantiated by clients. + */ +@SuppressWarnings("rawtypes") +public final class JavaDocTextElement extends AbstractTextElement { + + /** + * The "text" structural property of this node type (type: {@link String}). + */ + + public static final SimplePropertyDescriptor TEXT_PROPERTY = + internalTextPropertyFactory(JavaDocTextElement.class); + + /** + * A list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}), + * or null if uninitialized. + */ + private static final List PROPERTY_DESCRIPTORS; + + static { + List propertyList = new ArrayList(2); + createPropertyList(JavaDocTextElement.class, propertyList); + addProperty(TEXT_PROPERTY, propertyList); + PROPERTY_DESCRIPTORS = reapPropertyList(propertyList); + } + + /** + * Returns a list of structural property descriptors for this node type. + * Clients must not modify the result. + * + * @param apiLevel the API level; one of the + * AST.JLS* constants + * @return a list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}) + */ + public static List propertyDescriptors(int apiLevel) { + return PROPERTY_DESCRIPTORS; + } + + + @Override + final SimplePropertyDescriptor internalTextPropertyFactory() { + return TEXT_PROPERTY; + } + + /** + * Creates a new AST node for a text element owned by the given AST. + * The new node has an empty text string. + *

+ * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare + * additional subclasses. + *

+ * + * @param ast the AST that is to own this node + */ + JavaDocTextElement(AST ast) { + super(ast); + } + + @Override + final List internalStructuralPropertiesForType(int apiLevel) { + return propertyDescriptors(apiLevel); + } + + + @Override + final int getNodeType0() { + return JAVADOC_TEXT_ELEMENT; + } + + @Override + ASTNode clone0(AST target) { + JavaDocTextElement result = new JavaDocTextElement(target); + result.setSourceRange(getStartPosition(), getLength()); + result.setText(getText()); + return result; + } + + @Override + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { + // dispatch to correct overloaded match method + return matcher.match(this, other); + } + + @Override + void accept0(ASTVisitor visitor) { + visitor.visit(this); + visitor.endVisit(this); + } + + /** + * Sets the text of this node to the given value. + *

+ * The text element typically includes leading and trailing + * whitespace that separates it from the immediately preceding + * or following elements. + *

+ * + * @param text the text of this node + * @exception IllegalArgumentException if the text is null + * or contains a block comment closing delimiter + */ + @Override + public void setText(String text) { + super.setText(text); + preValueChange(TEXT_PROPERTY); + this.text = text; + postValueChange(TEXT_PROPERTY); + } + + @Override + int memSize() { + int size = BASE_NODE_SIZE + 1 * 4; + if (this.text != Util.EMPTY_STRING) { + // everything but our empty string costs + size += stringSize(this.text); + } + return size; + } + + @Override + int treeSize() { + return memSize(); + } +} + diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Javadoc.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Javadoc.java index 96c9800319..1c56d89d47 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Javadoc.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Javadoc.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2022 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -270,7 +270,7 @@ public void setComment(String docComment) { * The first tag element of a typical doc comment represents * all the material before the first explicit doc tag; this * first tag element has a null tag name and - * generally contains 1 or more {@link TextElement}s, + * generally contains 1 or more {@link AbstractTextElement}s, * and possibly interspersed with tag elements for nested tags * like "{@link String String}". * Subsequent tag elements represent successive top-level doc diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java index 94fbe6ea89..5b83577b9a 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java @@ -453,10 +453,10 @@ public List tagRegionsContainingTextElement(ASTNode docElem) { public List tagRegionsStartingAtTextElement(ASTNode docElem) { unsupportedBelow18(); List regions = new ArrayList<>(); - if (docElem == null || !(docElem instanceof TextElement)) { + if (docElem == null || !(docElem instanceof AbstractTextElement)) { return regions; } else { - TextElement textElem= (TextElement) docElem; + AbstractTextElement textElem= (AbstractTextElement) docElem; List javaDocRegions = this.tagRegions(); for (JavaDocRegion region : javaDocRegions) { if (!region.isDummyRegion()) { diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextElement.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextElement.java index 737b0bcb23..896500a966 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextElement.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextElement.java @@ -31,15 +31,15 @@ * @noinstantiate This class is not intended to be instantiated by clients. */ @SuppressWarnings("rawtypes") -public final class TextElement extends ASTNode implements IDocElement { +public final class TextElement extends AbstractTextElement { + /** * The "text" structural property of this node type (type: {@link String}). - * - * @since 3.0 */ + public static final SimplePropertyDescriptor TEXT_PROPERTY = - new SimplePropertyDescriptor(TextElement.class, "text", String.class, MANDATORY); //$NON-NLS-1$ + internalTextPropertyFactory(TextElement.class); /** * A list of property descriptors (element type: @@ -70,10 +70,10 @@ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - /** - * The text element; defaults to the empty string. - */ - private String text = Util.EMPTY_STRING; + @Override + final SimplePropertyDescriptor internalTextPropertyFactory() { + return TEXT_PROPERTY; + } /** * Creates a new AST node for a text element owned by the given AST. @@ -95,19 +95,6 @@ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - @Override - final Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { - if (property == TEXT_PROPERTY) { - if (get) { - return getText(); - } else { - setText((String) value); - return null; - } - } - // allow default implementation to flag the error - return super.internalGetSetObjectProperty(property, get, value); - } @Override final int getNodeType0() { @@ -134,15 +121,6 @@ void accept0(ASTVisitor visitor) { visitor.endVisit(this); } - /** - * Returns this node's text. - * - * @return the text of this node - */ - public String getText() { - return this.text; - } - /** * Sets the text of this node to the given value. *

@@ -156,10 +134,9 @@ public String getText() { * @exception IllegalArgumentException if the text is null * or contains a block comment closing delimiter */ + @Override public void setText(String text) { - if (text == null) { - throw new IllegalArgumentException(); - } + super.setText(text); if (text.indexOf("*/") > 0) { //$NON-NLS-1$ throw new IllegalArgumentException(); } diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java index 5775a00de8..f445d0c612 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java @@ -934,6 +934,12 @@ public boolean visit(JavaDocRegion node) { return false; } + @Override + public boolean visit(JavaDocTextElement node) { + this.buffer.append(node.getText()); + return false; + } + @Override public boolean visit(LabeledStatement node) { printIndent(); diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java index e662bb11a2..ba2bbb89a4 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2021 IBM Corporation and others. + * Copyright (c) 2000, 2022 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -3229,6 +3229,17 @@ public boolean visit(Javadoc node) { return false; } + @Override + public boolean visit(JavaDocTextElement node) { + if (!hasChildrenChanges(node)) { + return doVisitUnchangedChildren(node); + } + String newText= (String) getNewValue(node, JavaDocTextElement.TEXT_PROPERTY); + TextEditGroup group = getEditGroup(node, JavaDocTextElement.TEXT_PROPERTY); + doTextReplace(node.getStartPosition(), node.getLength(), newText, group); + return false; + } + @Override public boolean visit(LabeledStatement node) { if (!hasChildrenChanges(node)) { diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java index 3f4d9a867b..6873d34afd 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2021 IBM Corporation and others. + * Copyright (c) 2000, 2022 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -679,6 +679,11 @@ public boolean visit(Javadoc node) { return false; } + @Override + public boolean visit(JavaDocTextElement node) { + this.result.append(getAttribute(node, JavaDocTextElement.TEXT_PROPERTY)); + return false; + } @Override public boolean visit(LabeledStatement node) { getChildNode(node, LabeledStatement.LABEL_PROPERTY).accept(this); diff --git a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java index f46bad84a2..5da51b2c1b 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java @@ -1,11 +1,11 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2022 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ - * + * * * SPDX-License-Identifier: EPL-2.0 * @@ -129,14 +129,14 @@ public NodeMarker[] getMarkers() { public ASTRewriteFormatter(NodeInfoStore placeholders, RewriteEventStore eventStore, Map options, String lineDelimiter) { this.placeholders= placeholders; this.eventStore= eventStore; - + this.options= options == null ? JavaCore.getOptions() : (Map) new HashMap(options); this.options.put( DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY, DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT)); this.lineDelimiter= lineDelimiter; - + this.tabWidth= IndentManipulation.getTabWidth(options); this.indentWidth= IndentManipulation.getIndentWidth(options); } @@ -348,6 +348,7 @@ private TextEdit formatNode(ASTNode node, String str, int indentationLevel) { case ASTNode.METHOD_REF_PARAMETER: case ASTNode.TAG_ELEMENT: case ASTNode.TEXT_ELEMENT: + case ASTNode.JAVADOC_TEXT_ELEMENT: // javadoc formatting disabled due to bug 93644 return null; @@ -569,12 +570,12 @@ public String[] getPrefixAndSuffix(int indent, ASTNode node, RewriteEventStore e public final Prefix VARARGS= new FormattingPrefix("void foo(A ... a) { }", "A ." , CodeFormatter.K_CLASS_BODY_DECLARATIONS); //$NON-NLS-1$ //$NON-NLS-2$ public final Prefix TRY_RESOURCES = new FormattingPrefix("try (A a = new A(); B b = new B()) {}", "; B" , CodeFormatter.K_STATEMENTS); //$NON-NLS-1$ //$NON-NLS-2$ public final Prefix TRY_RESOURCES_PAREN = new FormattingPrefix("try (A a = new A(); B b = new B()) {}", "y (" , CodeFormatter.K_STATEMENTS); //$NON-NLS-1$ //$NON-NLS-2$ - + public final BlockContext IF_BLOCK_WITH_ELSE= new BlockFormattingPrefixSuffix("if (true)", "else{}", 8); //$NON-NLS-1$ //$NON-NLS-2$ public final BlockContext IF_BLOCK_NO_ELSE= new BlockFormattingPrefix("if (true)", 8); //$NON-NLS-1$ public final BlockContext ELSE_AFTER_STATEMENT= new BlockFormattingPrefix("if (true) foo();else ", 15); //$NON-NLS-1$ public final BlockContext ELSE_AFTER_BLOCK= new BlockFormattingPrefix("if (true) {}else ", 11); //$NON-NLS-1$ - + public final Prefix CASE_SEPARATION= new FormattingPrefix("case A, B", "A" , CodeFormatter.K_EXPRESSION); //$NON-NLS-1$ //$NON-NLS-2$ public final BlockContext FOR_BLOCK= new BlockFormattingPrefix("for (;;) ", 7); //$NON-NLS-1$ diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ClasspathContainerInitializer.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ClasspathContainerInitializer.java index e70ca2a531..94c248d036 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ClasspathContainerInitializer.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ClasspathContainerInitializer.java @@ -137,7 +137,7 @@ public ClasspathContainerInitializer() { * Returns true if this container initializer can be requested to perform updates * on its own container values. If so, then an update request will be performed using * {@link #requestClasspathContainerUpdate(IPath, IJavaProject, IClasspathContainer)}. - *

+ * * @param containerPath the path of the container which requires to be updated * @param project the project for which the container is to be updated * @return returns true if the container can be updated @@ -159,10 +159,11 @@ public boolean canUpdateClasspathContainer(IPath containerPath, IJavaProject pro * container definition (after reconciling changes) at its earliest convenience, using * {@link JavaCore#setClasspathContainer(IPath, IJavaProject[], IClasspathContainer[], IProgressMonitor)}. * Until it does so, the update will not be reflected in the Java Model. + *

*

* In order to anticipate whether the container initializer allows to update its containers, the predicate * {@link #canUpdateClasspathContainer(IPath, IJavaProject)} should be used. - *

+ *

* @param containerPath the path of the container which requires to be updated * @param project the project for which the container is to be updated * @param containerSuggestion a suggestion to update the corresponding container definition @@ -244,7 +245,7 @@ public String toString() { * should ensure using its corresponding container initializer. Indeed, a random container * initializer cannot be held responsible for determining comparison IDs for arbitrary * containers. - *

+ * * @param containerPath the path of the container which is being checked * @param project the project for which the container is to being checked * @return returns an Object identifying the container for comparison diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathContainer.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathContainer.java index ba3afda8fb..6f097c8557 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathContainer.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathContainer.java @@ -25,20 +25,22 @@ * to a different container object. *

* The set of entries associated with a classpath container may contain any of the following: + *

*
    *
  • library entries (CPE_LIBRARY)
  • *
  • project entries (CPE_PROJECT)
  • *
* In particular, a classpath container can neither reference further classpath containers or classpath variables. - *

+ *

* A library entry can reference other libraries through the Class-Path section of the JAR's MANIFEST.MF file. If the * container wants such referenced entries to be part of the classpath, the container must explicitly add them to the * array returned from {@link #getClasspathEntries()}. + *

*

* Classpath container values are persisted locally to the workspace, but are not preserved from a * session to another. It is thus highly recommended to register a ClasspathContainerInitializer * for each referenced container (through the extension point "org.eclipse.jdt.core.ClasspathContainerInitializer"). - *

+ *

* @see IClasspathEntry * @since 2.0 */ @@ -135,7 +137,7 @@ public interface IClasspathContainer { * The container ID is also used to identify aClasspathContainerInitializer * registered on the extension point "org.eclipse.jdt.core.classpathContainerInitializer", which can * be invoked if needing to resolve the container before it is explicitly set. - *

+ *

* @return IPath - the container path that is associated with this container */ IPath getPath(); diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathEntry.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathEntry.java index 2edf8cce49..d0c4efbeea 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathEntry.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClasspathEntry.java @@ -463,11 +463,12 @@ public interface IClasspathEntry { * *

* Variable source attachment is also resolved and recorded in the resulting classpath entry. - *

+ *

+ * Note that this deprecated API doesn't handle CPE_CONTAINER entries. + * * @return the resolved library or project classpath entry, or null * if the given path could not be resolved to a classpath entry - *

- * Note that this deprecated API doesn't handle CPE_CONTAINER entries. + * * @deprecated Use {@link JavaCore#getResolvedClasspathEntry(IClasspathEntry)} instead */ diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java index 0e0a5f5954..a9c25caf0d 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java @@ -72,7 +72,6 @@ void codeComplete(int offset, ICompletionRequestor requestor) * is the 0-based index of the character, after which code assist is desired. * An offset of -1 indicates to code assist at the beginning of this * compilation unit. - *

* * @param offset the given offset position * @param requestor the given completion requestor @@ -87,7 +86,7 @@ void codeComplete(int offset, ICompletionRequestor requestor) */ void codeComplete(int offset, CompletionRequestor requestor) throws JavaModelException; - + /** * Performs code completion at the given offset position in this compilation unit, * reporting results to the given completion requestor. The offset @@ -99,7 +98,8 @@ void codeComplete(int offset, CompletionRequestor requestor) * can be very long to compute are proposed. To avoid that the code assist operation * take too much time a {@link IProgressMonitor} which automatically cancel the code * assist operation when a specified amount of time is reached could be used. - * + *

+ * *
 	 * new IProgressMonitor() {
 	 *     private final static int TIMEOUT = 500; //ms
@@ -113,7 +113,6 @@ void codeComplete(int offset, CompletionRequestor requestor)
 	 *     ...
 	 * };
 	 * 
- *

* * @param offset the given offset position * @param requestor the given completion requestor @@ -188,7 +187,7 @@ void codeComplete(int offset, ICompletionRequestor requestor, WorkingCopyOwner o */ void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner) throws JavaModelException; - + /** * Performs code completion at the given offset position in this compilation unit, * reporting results to the given completion requestor. The offset @@ -207,7 +206,8 @@ void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner ow * can be very long to compute are proposed. To avoid that the code assist operation * take too much time a {@link IProgressMonitor} which automatically cancel the code * assist operation when a specified amount of time is reached could be used. - * + *

+ * *
 	 * new IProgressMonitor() {
 	 *     private final static int TIMEOUT = 500; //ms
@@ -221,7 +221,6 @@ void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner ow
 	 *     ...
 	 * };
 	 * 
- *

* * @param offset the given offset position * @param requestor the given completion requestor diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJarEntryResource.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJarEntryResource.java index 6a169d2752..03f2889fb6 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJarEntryResource.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJarEntryResource.java @@ -24,7 +24,7 @@ * Files don't have any children and the returned array is always empty. *

* Jar entry resources that refer to the same element are guaranteed to be equal, but not necessarily identical. - *

+ *

* * @since 3.3 */ diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaElement.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaElement.java index 51eb0b9ee8..908849c40e 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaElement.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaElement.java @@ -211,7 +211,7 @@ public interface IJavaElement extends IAdaptable { * contained in an archive has no corresponding resource. Similarly, there * are no corresponding resources for IMethods, * IFields, etc. - *

+ *

* * @return the corresponding resource, or null if none * @exception JavaModelException if this element does not exist or if an diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModel.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModel.java index 7e7486df01..7a414bbe99 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModel.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModel.java @@ -224,10 +224,11 @@ public interface IJavaModel extends IJavaElement, IOpenable, IParent { *

In case an archive is used by multiple projects, the delta issued will account for * all of them. This means that even if a project was not part of the elements scope, it * may still be notified of changes if it is referencing a library comprised in the scope. + *

*

* Since 3.7, a project refresh automatically triggers a refresh of external archives. * Hence, this method doesn't need to be explicitly called after a project refresh. - *

+ *

* @param elementsScope - a collection of elements defining the scope of the refresh * @param monitor - a progress monitor used to report progress * @exception JavaModelException in one of the corresponding situation: diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java index a9ccc2afa3..3b7e74c03d 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java @@ -814,7 +814,7 @@ ITypeHierarchy newTypeHierarchy(IRegion region, IProgressMonitor monitor) *

* Note that if a working copy is empty, it will be as if the original compilation * unit had been deleted. - *

+ *

* * @param monitor the given progress monitor * @param region the given region @@ -859,7 +859,7 @@ ITypeHierarchy newTypeHierarchy( *

* Note that if a working copy is empty, it will be as if the original compilation * unit had been deleted. - *

+ *

* * @param type the given type * @param region the given region @@ -891,6 +891,7 @@ ITypeHierarchy newTypeHierarchy( * However, if the file is modified within an operation, where this change needs to be taken into account before the * operation ends, then the output location from disk can be read using this method, and further assigned to the project * using setRawClasspath(...). + *

*

* The default output location is where class files are ordinarily generated * (and resource files, copied). Each source classpath entry can also @@ -901,12 +902,12 @@ ITypeHierarchy newTypeHierarchy( * necessarily the default output folder. This means that the generated * class files for the project may end up scattered across several folders, * rather than all in the default output folder (which is more standard). - *

+ *

* In order to manually force a project classpath refresh, one can simply assign the project classpath using the result of this * method, as follows: * proj.setRawClasspath(proj.readRawClasspath(), proj.readOutputLocation(), monitor) * (note that the readRawClasspath/readOutputLocation methods could return null). - *

+ *

* @return the workspace-relative absolute path of the default output folder * @see #getOutputLocation() * @since 3.0 diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOpenable.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOpenable.java index 40f9d6545d..22513a2491 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOpenable.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IOpenable.java @@ -118,10 +118,10 @@ public interface IOpenable { boolean isConsistent() throws JavaModelException; /** * Returns whether this openable is open. This is a handle-only method. - * + * *

Note: This method doesn't tell whether an {@link IJavaProject}'s {@link IJavaProject#getProject() getProject()} is open. * It is not equivalent to {@link IProject#isOpen()}!

- * + * *

Note: Although {@link #isOpen} is exposed in the API, clients * rarely have a need to rely on this internal state of the Java model.

@@ -138,7 +138,7 @@ public interface IOpenable { * {@link ICompilationUnit#reconcile(int, boolean, boolean, WorkingCopyOwner, IProgressMonitor)} * operation will not account for changes which occurred before an * explicit use of {@link #makeConsistent(IProgressMonitor)} - *

+ *

* @param progress the given progress monitor * @exception JavaModelException if the element is unable to access the contents * of its underlying resource. Reasons include: diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IType.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IType.java index 1ec8d70c98..3e2aa59fbf 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IType.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IType.java @@ -178,6 +178,7 @@ void codeComplete( * can be very long to compute are proposed. To avoid that the code assist operation * take too much time a {@link IProgressMonitor} which automatically cancel the code * assist operation when a specified amount of time is reached could be used. + *

* *
 	 * new IProgressMonitor() {
@@ -192,7 +193,6 @@ void codeComplete(
 	 *     ...
 	 * };
 	 * 
- *

* * @param snippet the code snippet * @param insertion the position with in source where the snippet @@ -288,6 +288,7 @@ void codeComplete( * can be very long to compute are proposed. To avoid that the code assist operation * take too much time a {@link IProgressMonitor} which automatically cancel the code * assist operation when a specified amount of time is reached could be used. + *

* *
 	 * new IProgressMonitor() {
@@ -302,7 +303,6 @@ void codeComplete(
 	 *     ...
 	 * };
 	 * 
- *

* * @param snippet the code snippet * @param insertion the position with in source where the snippet @@ -1104,7 +1104,7 @@ ITypeHierarchy newSupertypeHierarchy(IWorkingCopy[] workingCopies, IProgressMoni *

* Note that if a working copy is empty, it will be as if the original compilation * unit had been deleted. - *

+ *

* * @param owner the owner of working copies that take precedence over their original compilation units * @param monitor the given progress monitor @@ -1141,7 +1141,7 @@ ITypeHierarchy newSupertypeHierarchy(WorkingCopyOwner owner, IProgressMonitor mo *

* Note that if a working copy is empty, it will be as if the original compilation * unit had been deleted. - *

+ *

* * @param project the given project * @param owner the owner of working copies that take precedence over their original compilation units @@ -1215,7 +1215,7 @@ ITypeHierarchy newSupertypeHierarchy(WorkingCopyOwner owner, IProgressMonitor mo *

* Note that if a working copy is empty, it will be as if the original compilation * unit had been deleted. - *

+ *

* * @param owner the owner of working copies that take precedence over their original compilation units * @param monitor the given progress monitor diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java index 57bd852390..24004a2e04 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java @@ -446,7 +446,6 @@ public static IStatus validateImportDeclaration(String name, String sourceLevel, /** * Validate the given Java type name, either simple or qualified. * For example, "java.lang.Object", or "Object". - *

* * @param name the name of a type * @return a status object with code IStatus.OK if @@ -794,7 +793,7 @@ public static IStatus validateModuleName(String name, String sourceLevel, String *

* This validation is intended to anticipate classpath issues prior to assigning it to a project. In particular, it will automatically * be performed during the classpath setting operation (if validation fails, the classpath setting will not complete). - *

+ *

* @param javaProject the given java project * @param rawClasspath the given classpath * @param projectOutputLocation the given output location diff --git a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IEvaluationContext.java b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IEvaluationContext.java index 4f14cd522a..d3d1fb2090 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IEvaluationContext.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IEvaluationContext.java @@ -100,7 +100,7 @@ public interface IEvaluationContext { * reporting results to the given completion requestor. *

* Note that code completion does not involve evaluation. - *

+ *

* * @param codeSnippet the code snippet to complete in * @param position the character position in the code snippet to complete at, @@ -132,7 +132,7 @@ public void codeComplete( *

*

* Note that code completion does not involve evaluation. - *

+ *

* * @param codeSnippet the code snippet to complete in * @param position the character position in the code snippet to complete at, @@ -159,7 +159,7 @@ public void codeComplete( * reporting results to the given completion requestor. *

* Note that code completion does not involve evaluation. - *

+ *

* * @param codeSnippet the code snippet to complete in * @param position the character position in the code snippet to complete at, @@ -178,18 +178,19 @@ public void codeComplete( int position, CompletionRequestor requestor) throws JavaModelException; - + /** * Performs a code completion at the given position in the given code snippet, * reporting results to the given completion requestor. *

* Note that code completion does not involve evaluation. - *

+ *

* If {@link IProgressMonitor} is not null then some proposals which * can be very long to compute are proposed. To avoid that the code assist operation * take too much time a {@link IProgressMonitor} which automatically cancel the code * assist operation when a specified amount of time is reached could be used. - * + *

+ * *
 	 * new IProgressMonitor() {
 	 *     private final static int TIMEOUT = 500; //ms
@@ -203,7 +204,6 @@ public void codeComplete(
 	 *     ...
 	 * };
 	 * 
- *

* * @param codeSnippet the code snippet to complete in * @param position the character position in the code snippet to complete at, @@ -224,7 +224,7 @@ public void codeComplete( CompletionRequestor requestor, IProgressMonitor monitor) throws JavaModelException; - + /** * Performs a code completion at the given position in the given code snippet, * reporting results to the given completion requestor. @@ -237,7 +237,7 @@ public void codeComplete( *

*

* Note that code completion does not involve evaluation. - *

+ *

* * @param codeSnippet the code snippet to complete in * @param position the character position in the code snippet to complete at, @@ -258,7 +258,7 @@ public void codeComplete( CompletionRequestor requestor, WorkingCopyOwner owner) throws JavaModelException; - + /** * Performs a code completion at the given position in the given code snippet, * reporting results to the given completion requestor. @@ -271,12 +271,13 @@ public void codeComplete( *

*

* Note that code completion does not involve evaluation. - *

+ *

* If {@link IProgressMonitor} is not null then some proposals which * can be very long to compute are proposed. To avoid that the code assist operation * take too much time a {@link IProgressMonitor} which automatically cancel the code * assist operation when a specified amount of time is reached could be used. - * + *

+ * *
 	 * new IProgressMonitor() {
 	 *     private final static int TIMEOUT = 500; //ms
@@ -290,7 +291,6 @@ public void codeComplete(
 	 *     ...
 	 * };
 	 * 
- *

* * @param codeSnippet the code snippet to complete in * @param position the character position in the code snippet to complete at, @@ -313,14 +313,14 @@ public void codeComplete( WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException; - + /** * Resolves and returns a collection of Java elements corresponding to the source * code at the given positions in the given code snippet. *

* Note that code select does not involve evaluation, and problems are never * reported. - *

+ *

* * @param codeSnippet the code snippet to resolve in * @param offset the position in the code snippet of the first character @@ -349,7 +349,7 @@ public IJavaElement[] codeSelect(String codeSnippet, int offset, int length) *

* Note that code select does not involve evaluation, and problems are never * reported. - *

+ *

* * @param codeSnippet the code snippet to resolve in * @param offset the position in the code snippet of the first character @@ -542,7 +542,7 @@ public void validateImports(ICodeSnippetRequestor requestor) * reporting results to the given completion requestor. *

* Note that code completion does not involve evaluation. - *

+ *

* * @param codeSnippet the code snippet to complete in * @param position the character position in the code snippet to complete at, diff --git a/jdt-patch/e425/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java b/jdt-patch/e425/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java index 11f6a736ea..5a6b225e30 100644 --- a/jdt-patch/e425/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java +++ b/jdt-patch/e425/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java @@ -186,6 +186,7 @@ public abstract class SearchPattern { * Match rule: The search pattern contains a Camel Case expression. *

* Examples: + *

*
    *
  • 'NPE' type string pattern will match * 'NullPointerException' and 'NoPermissionException' types,
  • @@ -197,7 +198,7 @@ public abstract class SearchPattern { * of other match rule flags are combined with this one, then match rule validation * will return a modified rule in order to perform a better appropriate search request * (see {@link #validateMatchRule(String, int)} for more details). - *

    + * * @see #camelCaseMatch(String, String) for a detailed explanation of Camel * Case matching. * @@ -223,10 +224,10 @@ public abstract class SearchPattern { * of other match rule flags are combined with this one, then match rule validation * will return a modified rule in order to perform a better appropriate search request * (see {@link #validateMatchRule(String, int)} for more details). - *

    + * * @see CharOperation#camelCaseMatch(char[], char[], boolean) for a detailed * explanation of Camel Case matching. - *

    + * * @since 3.4 */ public static final int R_CAMELCASE_SAME_PART_COUNT_MATCH = 0x0100; @@ -1532,7 +1533,6 @@ private static SearchPattern createPackagePattern(String patternString, int limi *

  • /pack.X find in the unnamed module.
  • *
  • ALL-UNNAMED/pack.X find in the unnamed module.
  • *
- *

* *

  • Method patterns have the following syntax: *

    [declaringType '.'] ['<' typeArguments '>'] methodName ['(' parameterTypes ')'] [returnType]

    @@ -2717,7 +2717,6 @@ public boolean matchesName(char[] pattern, char[] name) { * that as soon as the string pattern contains one pattern character, the pattern * match flag will be set and all other match flags reset: validation of rule 2) * followed by rule 3)... - *

    * * @param stringPattern The string pattern * @param matchRule The match rule diff --git a/pom.xml b/pom.xml index 97e1bc3f60..4d6623f7be 100644 --- a/pom.xml +++ b/pom.xml @@ -124,7 +124,7 @@ milestone p2 - https://download.eclipse.org/eclipse/updates/4.25-I-builds/I20220817-1800 + https://download.eclipse.org/eclipse/updates/4.25-I-builds/I20220824-1800