source, and returns a text edit that correspond to the difference between the given
- * string and the formatted string.
- * - * It returns null if the given string cannot be formatted. - *
- *- * If the offset position is matching a whitespace, the result can include whitespaces. It would be up to - * the caller to get rid of preceding whitespaces. - *
- * - * @param kind - * Use to specify the kind of the code snippet to format. It can be any of these: - *null, then the platform
- * default one will be used.
- * @return the text edit
- * @throws IllegalArgumentException
- * if offset is lower than 0, length is lower than 0 or length is greater than source length.
- */
-
- LOG.debug("#starting to format by eclipse formatter");
- TextEdit edit = defaultCodeFormatter.format(
- CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, text, startOffset,
- endOffset - startOffset, 0, Settings.LINE_SEPARATOR);
- if (edit != null) {
- LOG.debug("reformatting done");
- edit.apply(doc);
- } else {
- throw new FormattingFailedException(getErrorMessage(level));
- }
- return doc.get();
- } catch (BadLocationException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/EclipseAdapter44/src/krasa/formatter/adapter/EclipseJsFormatterAdapter44.java b/EclipseAdapter44/src/krasa/formatter/adapter/EclipseJsFormatterAdapter44.java
deleted file mode 100644
index f3ed50c..0000000
--- a/EclipseAdapter44/src/krasa/formatter/adapter/EclipseJsFormatterAdapter44.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package krasa.formatter.adapter;
-
-import com.intellij.pom.java.LanguageLevel;
-import krasa.formatter.eclipse.EclipseFormatterAdapter;
-import krasa.formatter.exception.FileDoesNotExistsException;
-import krasa.formatter.exception.FormattingFailedException;
-import krasa.formatter.settings.Settings;
-import org.eclipse.jdt.core.formatter.CodeFormatter;
-import org.eclipse.jdt.internal.formatter.DefaultCodeFormatter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.text.edits.TextEdit;
-
-import java.util.Map;
-
-@SuppressWarnings("Duplicates")
-public class EclipseJsFormatterAdapter44 extends EclipseFormatterAdapter {
-
- protected DefaultCodeFormatter defaultCodeFormatter;
-
- @SuppressWarnings("unused")
- public EclipseJsFormatterAdapter44(Map options) {
- defaultCodeFormatter = new DefaultCodeFormatter(options);
- }
-
- @Override
- public String format(String text, int startOffset, int endOffset, LanguageLevel level)
- throws FileDoesNotExistsException {
-
- LOG.debug("#formatInternal");
- if (endOffset > text.length()) {
- endOffset = text.length();
- }
- IDocument doc = new Document();
- try {
- doc.set(text);
- /**
- * Format source, and returns a text edit that correspond to the difference between the given
- * string and the formatted string.
- * - * It returns null if the given string cannot be formatted. - *
- *- * If the offset position is matching a whitespace, the result can include whitespaces. It would be up to - * the caller to get rid of preceding whitespaces. - *
- * - * @param kind - * Use to specify the kind of the code snippet to format. It can be any of these: - *null, then the platform
- * default one will be used.
- * @return the text edit
- * @throws IllegalArgumentException
- * if offset is lower than 0, length is lower than 0 or length is greater than source length.
- */
-
- LOG.debug("#starting to format by eclipse formatter");
- TextEdit edit = defaultCodeFormatter.format(
- CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, text, startOffset,
- endOffset - startOffset, 0, Settings.LINE_SEPARATOR);
- if (edit != null) {
- LOG.debug("reformatting done");
- edit.apply(doc);
- } else {
- throw new FormattingFailedException(getErrorMessage(level));
- }
- return doc.get();
- } catch (BadLocationException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/EclipseAdapter44/src/krasa/formatter/adapter/JSCodeFormatterFacade.java b/EclipseAdapter44/src/krasa/formatter/adapter/JSCodeFormatterFacade.java
deleted file mode 100644
index 5e83ba1..0000000
--- a/EclipseAdapter44/src/krasa/formatter/adapter/JSCodeFormatterFacade.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package krasa.formatter.adapter;
-
-import krasa.formatter.common.ModifiableFile;
-import krasa.formatter.eclipse.CodeFormatterFacade;
-import krasa.formatter.exception.FileDoesNotExistsException;
-import krasa.formatter.exception.FormattingFailedException;
-import krasa.formatter.plugin.InvalidPropertyFile;
-import krasa.formatter.settings.Settings;
-import krasa.formatter.settings.provider.JSPropertiesProvider;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
-
-import com.intellij.psi.PsiFile;
-
-/**
- * @author Vojtech Krasa
- */
-public class JSCodeFormatterFacade extends CodeFormatterFacade {
- protected org.eclipse.wst.jsdt.core.formatter.CodeFormatter codeFormatter;
-
- private JSPropertiesProvider propertiesProvider;
- protected ModifiableFile.Monitor modifiedMonitor;
-
- public JSCodeFormatterFacade(JSPropertiesProvider propertiesProvider) {
- this.propertiesProvider = propertiesProvider;
- }
-
- private org.eclipse.wst.jsdt.core.formatter.CodeFormatter getCodeFormatter() throws FileDoesNotExistsException {
- if (codeFormatter == null || propertiesProvider.wasChanged(modifiedMonitor)) {
- return newCodeFormatter();
- }
- return codeFormatter;
- }
-
- private org.eclipse.wst.jsdt.core.formatter.CodeFormatter newCodeFormatter() throws InvalidPropertyFile {
- modifiedMonitor = propertiesProvider.getModifiedMonitor();
- codeFormatter = org.eclipse.wst.jsdt.core.ToolFactory.createCodeFormatter(propertiesProvider.get());
- return codeFormatter;
- }
-
- @Override
- public String format(String text, int startOffset, int endOffset, PsiFile psiFile)
- throws FileDoesNotExistsException {
- IDocument doc = new Document();
- try {
- // format the file (the meat and potatoes)
- doc.set(text);
- /**
- * Format source, and returns a text edit that correspond to the difference between the given
- * string and the formatted string.
- * - * It returns null if the given string cannot be formatted. - *
- * - *- * If the offset position is matching a whitespace, the result can include whitespaces. It would be up to - * the caller to get rid of preceeding whitespaces. - *
- * - * @param kind - * Use to specify the kind of the code snippet to format. It can be any of these: K_EXPRESSION, - * K_STATEMENTS, K_CLASS_BODY_DECLARATIONS, K_JAVASCRIPT_UNIT, K_UNKNOWN, K_SINGLE_LINE_COMMENT, - * K_MULTI_LINE_COMMENT, K_JAVA_DOC - * @param source - * the source to format - * @param offset - * the given offset to start recording the edits (inclusive). - * @param length - * the given length to stop recording the edits (exclusive). - * @param indentationLevel - * the initial indentation level, used to shift left/right the entire source fragment. An initial - * indentation level of zero or below has no effect. - * @param lineSeparator - * the line separator to use in formatted source, if set tonull, then the platform
- * default one will be used.
- * @return the text edit
- * @throws IllegalArgumentException
- * if offset is lower than 0, length is lower than 0 or length is greater than source length.
- */
- TextEdit edit = getCodeFormatter().format(CodeFormatter.K_JAVASCRIPT_UNIT, text, startOffset,
- endOffset - startOffset, 0, Settings.LINE_SEPARATOR);
- if (edit != null) {
- edit.apply(doc);
- } else {
- throw new FormattingFailedException();
- }
-
- return doc.get();
- } catch (BadLocationException e) {
- throw new RuntimeException(e);
- }
- }
-
- public String format(String text, int startOffset, int endOffset, int kJavascriptUnit)
- throws FileDoesNotExistsException {
- IDocument doc = new Document();
- try {
- // format the file (the meat and potatoes)
- doc.set(text);
- /**
- * Format source, and returns a text edit that correspond to the difference between the given
- * string and the formatted string.
- * - * It returns null if the given string cannot be formatted. - *
- * - *- * If the offset position is matching a whitespace, the result can include whitespaces. It would be up to - * the caller to get rid of preceeding whitespaces. - *
- * - * @param kind - * Use to specify the kind of the code snippet to format. It can be any of these: K_EXPRESSION, - * K_STATEMENTS, K_CLASS_BODY_DECLARATIONS, K_JAVASCRIPT_UNIT, K_UNKNOWN, K_SINGLE_LINE_COMMENT, - * K_MULTI_LINE_COMMENT, K_JAVA_DOC - * @param source - * the source to format - * @param offset - * the given offset to start recording the edits (inclusive). - * @param length - * the given length to stop recording the edits (exclusive). - * @param indentationLevel - * the initial indentation level, used to shift left/right the entire source fragment. An initial - * indentation level of zero or below has no effect. - * @param lineSeparator - * the line separator to use in formatted source, if set tonull, then the platform
- * default one will be used.
- * @return the text edit
- * @throws IllegalArgumentException
- * if offset is lower than 0, length is lower than 0 or length is greater than source length.
- */
- TextEdit edit = getCodeFormatter().format(kJavascriptUnit, text, startOffset, endOffset - startOffset, 0,
- Settings.LINE_SEPARATOR);
- if (edit != null) {
- edit.apply(doc);
- } else {
- throw new FormattingFailedException();
- }
-
- return doc.get();
- } catch (BadLocationException e) {
- throw new RuntimeException(e);
- }
- }
-
- public TextEdit format(int kind, String source, int offset, int length, int indentationLevel,
- String lineSeparator) {
- return getCodeFormatter().format(kind, source, offset, length, indentationLevel, lineSeparator);
- }
-}
diff --git a/EclipseAdapter44/src/krasa/formatter/adapter/JsniFormattingUtil.java b/EclipseAdapter44/src/krasa/formatter/adapter/JsniFormattingUtil.java
deleted file mode 100644
index 0584bf3..0000000
--- a/EclipseAdapter44/src/krasa/formatter/adapter/JsniFormattingUtil.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright 2011 Google Inc. All Rights Reserved.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
-package krasa.formatter.adapter;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import krasa.formatter.plugin.Range;
-import krasa.formatter.settings.Settings;
-
-import org.eclipse.jdt.core.formatter.IndentManipulation;
-import org.eclipse.jdt.internal.formatter.DefaultCodeFormatter;
-import org.eclipse.jface.text.*;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.ToolFactory;
-import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
-
-import com.google.gwt.eclipse.core.editors.java.GWTPartitions;
-import com.google.gwt.eclipse.core.validators.java.JsniParser;
-
-/**
- * Utility methods for formatting JSNI methods. This is not a full-blown JavaScript pretty-printer, but it does apply
- * the correct outer indentation to JSNI blocks, to correct the JDT bug which slides them to the right.
- */
-@SuppressWarnings("restriction")
-public class JsniFormattingUtil {
-
- private static class JsniJavaRefReplacementResult {
- private String jsni;
- private MapTHE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE + PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION + OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. +
+“Contribution” means:
+“Contributor” means any person or entity that Distributes the Program.
+“Licensed Patents” mean patent claims licensable by a Contributor which + are necessarily infringed by the use or sale of its Contribution alone + or when combined with the Program. +
+“Program” means the Contributions Distributed in accordance with this + Agreement. +
+“Recipient” means anyone who receives the Program under this Agreement + or any Secondary License (as applicable), including Contributors. +
+“Derivative Works” shall mean any work, whether in Source Code or other + form, that is based on (or derived from) the Program and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. +
+“Modified Works” shall mean any work in Source Code or other form that + results from an addition to, deletion from, or modification of the + contents of the Program, including, for purposes of clarity any new file + in Source Code form that contains any contents of the Program. Modified + Works shall not include works that contain only declarations, interfaces, + types, classes, structures, or files of the Program solely in each case + in order to link to, bind by name, or subclass the Program or Modified + Works thereof. +
+“Distribute” means the acts of a) distributing or b) making available + in any manner that enables the transfer of a copy. +
+“Source Code” means the form of a Program preferred for making + modifications, including but not limited to software source code, + documentation source, and configuration files. +
+“Secondary License” means either the GNU General Public License, + Version 2.0, or any later versions of that license, including any + exceptions or additional permissions as identified by the initial + Contributor. +
+3.1 If a Contributor Distributes the Program in any form, then:
+3.2 When the Program is Distributed as Source Code:
+3.3 Contributors may not remove or alter any copyright, patent, trademark, + attribution notices, disclaimers of warranty, or limitations of liability + (‘notices’) contained within the Program from any copy of the Program which + they Distribute, provided that Contributors may add their own appropriate + notices. +
+Commercial distributors of software may accept certain responsibilities + with respect to end users, business partners and the like. While this + license is intended to facilitate the commercial use of the Program, the + Contributor who includes the Program in a commercial product offering should + do so in a manner which does not create potential liability for other + Contributors. Therefore, if a Contributor includes the Program in a + commercial product offering, such Contributor (“Commercial Contributor”) + hereby agrees to defend and indemnify every other Contributor + (“Indemnified Contributor”) against any losses, damages and costs + (collectively “Losses”) arising from claims, lawsuits and other legal actions + brought by a third party against the Indemnified Contributor to the extent + caused by the acts or omissions of such Commercial Contributor in connection + with its distribution of the Program in a commercial product offering. + The obligations in this section do not apply to any claims or Losses relating + to any actual or alleged intellectual property infringement. In order to + qualify, an Indemnified Contributor must: a) promptly notify the + Commercial Contributor in writing of such claim, and b) allow the Commercial + Contributor to control, and cooperate with the Commercial Contributor in, + the defense and any related settlement negotiations. The Indemnified + Contributor may participate in any such claim at its own expense. +
+For example, a Contributor might include the Program + in a commercial product offering, Product X. That Contributor is then a + Commercial Contributor. If that Commercial Contributor then makes performance + claims, or offers warranties related to Product X, those performance claims + and warranties are such Commercial Contributor's responsibility alone. + Under this section, the Commercial Contributor would have to defend claims + against the other Contributors related to those performance claims and + warranties, and if a court requires any other Contributor to pay any damages + as a result, the Commercial Contributor must pay those damages. +
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED + BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, + WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is + solely responsible for determining the appropriateness of using and + distributing the Program and assumes all risks associated with its + exercise of rights under this Agreement, including but not limited to the + risks and costs of program errors, compliance with applicable laws, damage + to or loss of data, programs or equipment, and unavailability or + interruption of operations. +
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED + BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY + LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS + GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +
+If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of the + remainder of the terms of this Agreement, and without further action by the + parties hereto, such provision shall be reformed to the minimum extent + necessary to make such provision valid and enforceable. +
+If Recipient institutes patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Program itself + (excluding combinations of the Program with other software or hardware) + infringes such Recipient's patent(s), then such Recipient's rights granted + under Section 2(b) shall terminate as of the date such litigation is filed. +
+All Recipient's rights under this Agreement shall terminate if it fails to + comply with any of the material terms or conditions of this Agreement and + does not cure such failure in a reasonable period of time after becoming + aware of such noncompliance. If all Recipient's rights under this Agreement + terminate, Recipient agrees to cease use and distribution of the Program + as soon as reasonably practicable. However, Recipient's obligations under + this Agreement and any licenses granted by Recipient relating to the + Program shall continue and survive. +
+Everyone is permitted to copy and distribute copies of this Agreement, + but in order to avoid inconsistency the Agreement is copyrighted and may + only be modified in the following manner. The Agreement Steward reserves + the right to publish new versions (including revisions) of this Agreement + from time to time. No one other than the Agreement Steward has the right + to modify this Agreement. The Eclipse Foundation is the initial Agreement + Steward. The Eclipse Foundation may assign the responsibility to serve as + the Agreement Steward to a suitable separate entity. Each new version of + the Agreement will be given a distinguishing version number. The Program + (including Contributions) may always be Distributed subject to the version + of the Agreement under which it was received. In addition, after a new + version of the Agreement is published, Contributor may elect to Distribute + the Program (including its Contributions) under the new version. +
+Except as expressly stated in Sections 2(a) and 2(b) above, Recipient + receives no rights or licenses to the intellectual property of any + Contributor under this Agreement, whether expressly, by implication, + estoppel or otherwise. All rights in the Program not expressly granted + under this Agreement are reserved. Nothing in this Agreement is intended + to be enforceable by any entity that is not a Contributor or Recipient. + No third-party beneficiary rights are created under this Agreement. +
+“This Source Code may also be made available under the following + Secondary Licenses when the conditions for such availability set forth + in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), + version(s), and exceptions or additional permissions here}.” +
+++ + \ No newline at end of file diff --git a/lib/eclipse/README.md b/lib/eclipse/README.md new file mode 100644 index 0000000..75e8633 --- /dev/null +++ b/lib/eclipse/README.md @@ -0,0 +1,7 @@ +This directory contains a repackaged version of [`org.eclipse.jdt.core`](https://www.eclipse.org/jdt/core/) (sources can be found [here](https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt.core)), which is licensed under [EPL-2.0](https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html). + +The original version was changed as follows: +* It is repackaged together with all its dependencies into a single jar file ([`eclipse.jar`](eclipse.jar)) +* From all modules, the `META-INF/*.SF`, `META-INF/*.DSA`, `META-INF/*.RSA` and `plugin.xml` are removed + +The "modified" source code can be found in [`eclipse-sources.jar`](eclipse-sources.jar). diff --git a/lib/eclipse/adapter.jar b/lib/eclipse/adapter.jar index e25a973..87dfb7a 100644 Binary files a/lib/eclipse/adapter.jar and b/lib/eclipse/adapter.jar differ diff --git a/lib/eclipse44/eclipse44.jar b/lib/eclipse/eclipse-sources.jar similarity index 54% rename from lib/eclipse44/eclipse44.jar rename to lib/eclipse/eclipse-sources.jar index 1702b00..9cfba3f 100644 Binary files a/lib/eclipse44/eclipse44.jar and b/lib/eclipse/eclipse-sources.jar differ diff --git a/lib/eclipse/eclipse.jar b/lib/eclipse/eclipse.jar index aed1787..6ca7d0d 100644 Binary files a/lib/eclipse/eclipse.jar and b/lib/eclipse/eclipse.jar differ diff --git a/lib/eclipse44/adapter44.jar b/lib/eclipse44/adapter44.jar deleted file mode 100644 index 2d9be85..0000000 Binary files a/lib/eclipse44/adapter44.jar and /dev/null differ diff --git a/lib/test/cglib-nodep-2.2.2-sources.jar b/lib/test/cglib-nodep-2.2.2-sources.jar deleted file mode 100644 index ef9a73a..0000000 Binary files a/lib/test/cglib-nodep-2.2.2-sources.jar and /dev/null differ diff --git a/lib/test/cglib-nodep-2.2.2.jar b/lib/test/cglib-nodep-2.2.2.jar deleted file mode 100644 index 02d81e8..0000000 Binary files a/lib/test/cglib-nodep-2.2.2.jar and /dev/null differ diff --git a/lib/test/easymock-3.1-sources.jar b/lib/test/easymock-3.1-sources.jar deleted file mode 100644 index b10785a..0000000 Binary files a/lib/test/easymock-3.1-sources.jar and /dev/null differ diff --git a/lib/test/easymock-3.1.jar b/lib/test/easymock-3.1.jar deleted file mode 100644 index 4b79dd1..0000000 Binary files a/lib/test/easymock-3.1.jar and /dev/null differ diff --git a/lib/test/objenesis-1.2-sources.jar b/lib/test/objenesis-1.2-sources.jar deleted file mode 100644 index f332840..0000000 Binary files a/lib/test/objenesis-1.2-sources.jar and /dev/null differ diff --git a/lib/test/objenesis-1.2.jar b/lib/test/objenesis-1.2.jar deleted file mode 100644 index fb04d7f..0000000 Binary files a/lib/test/objenesis-1.2.jar and /dev/null differ diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..1215ddd --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,8 @@ +pluginManagement { + repositories { + maven("https://oss.sonatype.org/content/repositories/snapshots/") + gradlePluginPortal() + } +} + +rootProject.name = "EclipseFormatter" diff --git a/src/java/krasa/formatter/eclipse/ConfigurableEclipseLocation.java b/src/java/krasa/formatter/eclipse/ConfigurableEclipseLocation.java deleted file mode 100644 index f3828a4..0000000 --- a/src/java/krasa/formatter/eclipse/ConfigurableEclipseLocation.java +++ /dev/null @@ -1,96 +0,0 @@ -package krasa.formatter.eclipse; - -import krasa.formatter.exception.FormattingFailedException; - -import com.intellij.openapi.diagnostic.Logger; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.filefilter.FileFilterUtils; -import org.jetbrains.annotations.NotNull; - -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.*; - -public class ConfigurableEclipseLocation { - private static final Logger LOG = Logger.getInstance(ConfigurableEclipseLocation.class.getName()); - private static final int TIMEOUT = 5000; - - //@formatter:off - String[] JAR_NAMES = { - "org.eclipse.core.contenttype_", - "org.eclipse.core.jobs_", - "org.eclipse.core.resources_", - "org.eclipse.core.runtime_", - "org.eclipse.equinox.app_",//probably useless - "org.eclipse.equinox.common_", - "org.eclipse.equinox.preferences_", - "org.eclipse.jdt.core_", - "org.eclipse.osgi_", - "org.eclipse.text_" - }; - //@formatter:on - - public SetSimply including a copy of this Agreement, including this Exhibit A + is not sufficient to license the Source Code under Secondary Licenses. +
+If it is not possible or desirable to put the notice in a particular file, + then You may include the notice in a location (such as a LICENSE file in a + relevant directory) where a recipient would be likely to look for + such a notice. +
+You may add additional accurate notices of copyright ownership.
+
+ * public class Example {
+ * final int a = 1;
+ * final boolean b = true;
+ * }
+ *
+ *
+ * Descriptions of parameters and return values are best appended at end of
+ * the javadoc comment.
+ * @param first
+ * The first parameter. For an optimum result, this should be an
+ * odd number between 0 and 100.
+ * @param second
+ * The second parameter.
+ * @throws Exception
+ * when the foo operation cannot be performed for one reason or
+ * another.
+ * @return The result of the foo operation, usually an even number within 0
+ * and 1000.
+ */
+ int foo(int first, int second) throws Exception;
+}
+
+class Test {
+ void trailingCommented() {
+ System.out.println("indented"); // comment
+ System.out.println("indent"); // comment
+ }
+}
diff --git a/test/resources/format.xml b/src/test/resources/format.xml
similarity index 100%
rename from test/resources/format.xml
rename to src/test/resources/format.xml
diff --git a/src/test/resources/format2.xml b/src/test/resources/format2.xml
new file mode 100644
index 0000000..9160b85
--- /dev/null
+++ b/src/test/resources/format2.xml
@@ -0,0 +1,3447 @@
+
+