From 9c68ebc30aaf0b45d56faea0bfd15916da4f375f Mon Sep 17 00:00:00 2001 From: Eric Milles Date: Fri, 6 Dec 2019 10:56:53 -0600 Subject: [PATCH] Eclipse 4.14 (RC2) JDT Patch for Groovy-Eclipse: JDT commit 9c0cf52 #963 #964 --- .../feature.xml | 2 +- .../.settings/org.eclipse.pde.api.tools.prefs | 189 +++++++++--------- .../antadapter/META-INF/eclipse.inf | 2 +- .../parser/AbstractCommentParser.java | 1 - .../compiler/parser/JavadocParser.java | 2 - .../DefaultCodeFormatterConstants.java | 4 +- .../org/eclipse/jdt/core/ToolFactory.java | 2 +- .../jdt/internal/core/ClasspathEntry.java | 30 ++- .../e414/org.eclipse.jdt.core/readme.txt | 1 + 9 files changed, 124 insertions(+), 109 deletions(-) diff --git a/jdt-patch/e414/Feature-org.codehaus.groovy.jdt.patch/feature.xml b/jdt-patch/e414/Feature-org.codehaus.groovy.jdt.patch/feature.xml index 9c5273ff13..afd25df32d 100644 --- a/jdt-patch/e414/Feature-org.codehaus.groovy.jdt.patch/feature.xml +++ b/jdt-patch/e414/Feature-org.codehaus.groovy.jdt.patch/feature.xml @@ -18,7 +18,7 @@ - + * FORMATTER / Indentation is not touched, it's preserved from original source. * - * @since 3.19 + * @since 3.20 */ public static final int INDENT_PRESERVE = 3; diff --git a/jdt-patch/e414/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ToolFactory.java b/jdt-patch/e414/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ToolFactory.java index 9479cd8a34..2ed3678dcd 100644 --- a/jdt-patch/e414/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ToolFactory.java +++ b/jdt-patch/e414/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ToolFactory.java @@ -582,7 +582,7 @@ public static IScanner createScanner(boolean tokenizeComments, boolean tokenizeW * @return a scanner * @see org.eclipse.jdt.core.compiler.IScanner * - * @since 3.14 + * @since 3.20 */ @SuppressWarnings("javadoc") // references deprecated TokenNameIdentifier public static IScanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean recordLineSeparator, String sourceLevel, String complianceLevel, boolean enablePreview) { diff --git a/jdt-patch/e414/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java b/jdt-patch/e414/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java index dc3de3704c..374d128034 100644 --- a/jdt-patch/e414/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java +++ b/jdt-patch/e414/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2018 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -31,6 +31,7 @@ import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -38,6 +39,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.zip.CRC32; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -122,6 +124,9 @@ public AssertionFailedException(String message) { public static final String TAG_DISCOURAGED = "discouraged"; //$NON-NLS-1$ public static final String TAG_IGNORE_IF_BETTER = "ignoreifbetter"; //$NON-NLS-1$ + // common index location for all workspaces + private static String SHARED_INDEX_LOCATION = System.getProperty("jdt.core.sharedIndexLocation"); //$NON-NLS-1$ + /** * Describes the kind of classpath entry - one of * CPE_PROJECT, CPE_LIBRARY, CPE_SOURCE, CPE_VARIABLE or CPE_CONTAINER @@ -1757,6 +1762,18 @@ public IClasspathEntry getResolvedEntry() { public URL getLibraryIndexLocation() { switch(getEntryKind()) { case IClasspathEntry.CPE_LIBRARY : + if (SHARED_INDEX_LOCATION != null) { + try { + String pathString = getPath().toPortableString(); + CRC32 checksumCalculator = new CRC32(); + checksumCalculator.update(pathString.getBytes()); + String fileName = Long.toString(checksumCalculator.getValue()) + ".index"; //$NON-NLS-1$ + return new URL("file", null, Paths.get(SHARED_INDEX_LOCATION, fileName).toString()); //$NON-NLS-1$ + } catch (MalformedURLException e1) { + Util.log(e1); // should not happen if protocol known (eg. 'file') + } + } + break; case IClasspathEntry.CPE_VARIABLE : break; default : @@ -2523,4 +2540,15 @@ private static IJavaModelStatus validateLibraryContents(IPath path, IJavaProject } return JavaModelStatus.VERIFIED_OK; } + + /* + * For testing shared index location in JavaIndexTests only + */ + public static void setSharedIndexLocation(String value, Class clazz) throws IllegalArgumentException{ + if (clazz != null && "org.eclipse.jdt.core.tests.model.JavaIndexTests".equals(clazz.getName())) { //$NON-NLS-1$ + SHARED_INDEX_LOCATION = value; + } else { + throw new IllegalArgumentException("Cannot set index location for specified test class"); //$NON-NLS-1$ + } + } } diff --git a/jdt-patch/e414/org.eclipse.jdt.core/readme.txt b/jdt-patch/e414/org.eclipse.jdt.core/readme.txt index 8219fba3f5..5570083339 100644 --- a/jdt-patch/e414/org.eclipse.jdt.core/readme.txt +++ b/jdt-patch/e414/org.eclipse.jdt.core/readme.txt @@ -2,3 +2,4 @@ 2019-11-09: 3106c52 (2019-12 M2) 2019-11-23: f44d4bd (2019-12 M3) 2019-11-29: 362b8a1 (2019-12 RC1) +2019-12-06: 9c0cf52 (2019-12 RC2)