Compare commits

...

2 Commits

Author SHA1 Message Date
Zhiwei Xue
1a7dd8c9d5 fix(TUP-34109):[7.3.1] slow project export compared to studio 6.5.1 2022-04-26 15:03:10 +08:00
Zhiwei Xue
ccfea7cfa1 fix(TUP-35219):Nullpointer exception with building job on
commandline-script mode
2022-04-26 15:03:09 +08:00
3 changed files with 28 additions and 2 deletions

View File

@@ -101,6 +101,7 @@ import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.process.ReplaceNodesInProcessProvider;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Property;
import org.talend.core.model.relationship.RelationshipItemBuilder;
@@ -2521,6 +2522,13 @@ public class ProcessorUtilities {
ExceptionHandler.process(e);
}
}
// TUP-35219 avoid resource unload
if (property != null && property.getItem() != null
&& property.getItem() instanceof JobletProcessItem) {
((JobletProcessItem) property.getItem()).getJobletProcess();
}
JobInfo jobInfo = new JobInfo(property, jobletProcess.getDefaultContext());
if (!jobInfos.contains(jobInfo)) {
jobInfos.add(jobInfo);

View File

@@ -1035,6 +1035,9 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
if (localMavenUri == null) {
localMavenUri = mvnUriStatusKey.replace("mvn:", "mvn:" + MavenConstants.LOCAL_RESOLUTION_URL + "!"); //$NON-NLS-1$ //$NON-NLS-2$
}
if (!isResolveAllowed(localMavenUri)) {
return null;
}
try {
File resolvedJar = TalendMavenResolver.resolve(localMavenUri);
if (resolvedJar != null) {

View File

@@ -42,7 +42,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.m2e.core.MavenPlugin;
import org.junit.Assert;
import org.junit.Before;
@@ -60,6 +59,7 @@ import org.talend.core.language.ECodeLanguage;
import org.talend.core.model.components.IComponentsService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
import org.talend.core.model.general.ModuleStatusProvider;
import org.talend.core.model.general.Project;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.nexus.NexusServerUtils;
@@ -67,7 +67,6 @@ import org.talend.core.nexus.TalendLibsServerManager;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.librariesmanager.emf.librariesindex.LibrariesIndex;
import org.talend.librariesmanager.maven.MavenArtifactsHandler;
import org.talend.librariesmanager.prefs.LibrariesManagerUtils;
import org.talend.repository.ProjectManager;
@@ -532,6 +531,22 @@ public class LocalLibraryManagerTest {
assertFalse(lm.isResolveAllowed("a")); //$NON-NLS-1$
}
@Test
public void testResolveLocallySnapshotNoUpdate() {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(NexusServerUtils.ORG_TALEND_DESIGNER_CORE);
int bak = node.getInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, 0);
String mvnUrl = "mvn:a.b.c/d/1.0/jar";
try {
ModuleStatusProvider.putDeployStatus(mvnUrl, ELibraryInstallStatus.DEPLOYED);
node.putInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, -1);
LocalLibraryManager lm = new LocalLibraryManager();
assertNull(lm.resolveStatusLocally(mvnUrl));
} finally {
node.putInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, bak);
ModuleStatusProvider.putDeployStatus(mvnUrl, ELibraryInstallStatus.NOT_INSTALLED);
}
}
@Test
@Ignore
public void testNexusUpdateJar() throws Exception {