Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Jenkinsfile69
-rw-r--r--MOVED_TO_GITHUB.md5
-rw-r--r--bundles/org.eclipse.compare.core/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.compare.core/.settings/org.eclipse.pde.prefs64
-rw-r--r--bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF8
-rw-r--r--bundles/org.eclipse.compare.core/pom.xml4
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/CompareSettings.java (renamed from bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java)39
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java6
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/FileDiffResult.java23
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java8
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java7
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java5
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java4
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java8
-rw-r--r--bundles/org.eclipse.compare.win32/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.compare.win32/.settings/org.eclipse.pde.prefs64
-rw-r--r--bundles/org.eclipse.compare.win32/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.compare.win32/META-INF/p2.inf12
-rw-r--r--bundles/org.eclipse.compare.win32/pom.xml4
-rw-r--r--bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/AbstractMergeViewer.java15
-rw-r--r--bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/Activator.java2
-rw-r--r--bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordComparison.java3
-rw-r--r--bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordMergeViewer.java14
-rw-r--r--bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordViewerCreator.java1
-rw-r--r--bundles/org.eclipse.compare/.classpath6
-rw-r--r--bundles/org.eclipse.compare/.cvsignore1
-rw-r--r--bundles/org.eclipse.compare/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.compare/.settings/org.eclipse.jdt.core.prefs789
-rw-r--r--bundles/org.eclipse.compare/.settings/org.eclipse.pde.prefs64
-rw-r--r--bundles/org.eclipse.compare/META-INF/MANIFEST.MF10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java9
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java23
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java137
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java11
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java7
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java102
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java36
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java9
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java20
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareHandlerService.java7
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java9
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareResourceFilter.java52
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java7
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java101
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java31
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java14
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java28
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java15
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java75
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Worker.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java33
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java19
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java25
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java12
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IStructureCreator2.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureCreator.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java4
-rw-r--r--bundles/org.eclipse.compare/forceQualifierUpdate.txt3
-rw-r--r--bundles/org.eclipse.compare/icons/full/elcl16/view_menu.pngbin0 -> 409 bytes
-rw-r--r--bundles/org.eclipse.compare/icons/full/elcl16/view_menu@2x.pngbin0 -> 834 bytes
-rw-r--r--bundles/org.eclipse.compare/plugin.properties3
-rw-r--r--bundles/org.eclipse.compare/plugin.xml6
-rw-r--r--bundles/org.eclipse.compare/pom.xml4
-rw-r--r--bundles/org.eclipse.core.net.linux.x86_64/BUILD_INFO.txt10
-rw-r--r--bundles/org.eclipse.core.net.linux.x86_64/forceQualifierUpdate.txt3
-rw-r--r--bundles/org.eclipse.core.net.linux.x86_64/libgnomeproxy-1.0.0.sobin259848 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.net.linux.x86_64/pom.xml85
-rw-r--r--bundles/org.eclipse.core.net.linux.x86_64/src/org/eclipse/core/net/ProxyProvider.java19
-rw-r--r--bundles/org.eclipse.core.net.linux/.classpath7
-rw-r--r--bundles/org.eclipse.core.net.linux/.project (renamed from bundles/org.eclipse.core.net.linux.x86_64/.project)2
-rw-r--r--bundles/org.eclipse.core.net.linux/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--bundles/org.eclipse.core.net.linux/META-INF/MANIFEST.MF12
-rw-r--r--bundles/org.eclipse.core.net.linux/about.html (renamed from bundles/org.eclipse.core.net.linux.x86_64/about.html)0
-rw-r--r--bundles/org.eclipse.core.net.linux/build.properties19
-rw-r--r--bundles/org.eclipse.core.net.linux/fragment.properties15
-rw-r--r--bundles/org.eclipse.core.net.linux/pom.xml46
-rw-r--r--bundles/org.eclipse.core.net.linux/src/org/eclipse/core/net/ProxyProvider.java (renamed from bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java)170
-rw-r--r--bundles/org.eclipse.core.net.win32.x86_64/.classpath1
-rw-r--r--bundles/org.eclipse.core.net.win32.x86_64/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.core.net.win32.x86_64/META-INF/p2.inf2
-rw-r--r--bundles/org.eclipse.core.net.win32.x86_64/build.properties5
-rw-r--r--bundles/org.eclipse.core.net.win32.x86_64/jWinHttp-1.0.0.dllbin52736 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.net.win32.x86_64/pom.xml4
-rw-r--r--bundles/org.eclipse.core.net.win32.x86_64/src/org/eclipse/core/net/ProxyProvider.java19
-rw-r--r--bundles/org.eclipse.core.net.win32/.classpath (renamed from bundles/org.eclipse.core.net.linux.x86_64/.classpath)4
-rw-r--r--bundles/org.eclipse.core.net.win32/.project29
-rw-r--r--bundles/org.eclipse.core.net.win32/.settings/org.eclipse.core.runtime.prefs (renamed from bundles/org.eclipse.core.net.linux.x86_64/.settings/org.eclipse.core.runtime.prefs)0
-rw-r--r--bundles/org.eclipse.core.net.win32/.settings/org.eclipse.jdt.core.prefs (renamed from bundles/org.eclipse.core.net.linux.x86_64/.settings/org.eclipse.jdt.core.prefs)0
-rw-r--r--bundles/org.eclipse.core.net.win32/META-INF/MANIFEST.MF (renamed from bundles/org.eclipse.core.net.linux.x86_64/META-INF/MANIFEST.MF)10
-rw-r--r--bundles/org.eclipse.core.net.win32/about.html36
-rw-r--r--bundles/org.eclipse.core.net.win32/build.properties (renamed from bundles/org.eclipse.core.net.linux.x86_64/build.properties)6
-rw-r--r--bundles/org.eclipse.core.net.win32/fragment.properties (renamed from bundles/org.eclipse.core.net.linux.x86_64/fragment.properties)4
-rw-r--r--bundles/org.eclipse.core.net.win32/pom.xml45
-rw-r--r--bundles/org.eclipse.core.net.win32/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java (renamed from bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java)0
-rw-r--r--bundles/org.eclipse.core.net.win32/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java (renamed from bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java)4
-rw-r--r--bundles/org.eclipse.core.net.win32/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java (renamed from bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java)0
-rw-r--r--bundles/org.eclipse.core.net.win32/src/org/eclipse/core/net/ProxyProvider.java456
-rw-r--r--bundles/org.eclipse.core.net/.cvsignore1
-rw-r--r--bundles/org.eclipse.core.net/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.core.net/.settings/org.eclipse.pde.prefs6
-rw-r--r--bundles/org.eclipse.core.net/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.core.net/natives/unix/gnomeproxy.c227
-rw-r--r--bundles/org.eclipse.core.net/natives/unix/gnomeproxy.h38
-rw-r--r--bundles/org.eclipse.core.net/natives/unix/linux/makefile51
-rw-r--r--bundles/org.eclipse.core.net/natives/win32/jWinHttp.cpp482
-rw-r--r--bundles/org.eclipse.core.net/natives/win32/jWinHttp.h69
-rw-r--r--bundles/org.eclipse.core.net/natives/win32/x86/jWinHttp.vcproj234
-rw-r--r--bundles/org.eclipse.core.net/natives/win32/x86_64/jWinHttp.vcproj424
-rw-r--r--bundles/org.eclipse.core.net/pom.xml4
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/Activator.java3
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java20
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java49
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java51
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringMatcher.java398
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java2
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/WindowsProxyProvider.java81
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/AutoProxyHolder.java47
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttp.java95
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpAutoProxyOptions.java78
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpCurrentUserIEProxyConfig.java123
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyInfo.java59
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyProvider.java291
-rw-r--r--bundles/org.eclipse.cvs/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.cvs/about.properties4
-rw-r--r--bundles/org.eclipse.cvs/pom.xml6
-rw-r--r--bundles/org.eclipse.jsch.core/.cvsignore1
-rw-r--r--bundles/org.eclipse.jsch.core/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.jsch.core/pom.xml4
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/core/IJSchService.java2
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Messages.java19
-rw-r--r--bundles/org.eclipse.jsch.ui/.classpath4
-rw-r--r--bundles/org.eclipse.jsch.ui/.cvsignore1
-rw-r--r--bundles/org.eclipse.jsch.ui/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.jsch.ui/.settings/org.eclipse.jdt.core.prefs38
-rw-r--r--bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF6
-rw-r--r--bundles/org.eclipse.jsch.ui/pom.xml4
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java2
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/KeyboardInteractiveDialog.java2
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties2
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/ExportDialog.java5
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PassphraseDialog.java5
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java6
-rw-r--r--bundles/org.eclipse.team.core/.classpath4
-rw-r--r--bundles/org.eclipse.team.core/.cvsignore1
-rw-r--r--bundles/org.eclipse.team.core/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.team.core/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--bundles/org.eclipse.team.core/.settings/org.eclipse.pde.prefs64
-rw-r--r--bundles/org.eclipse.team.core/META-INF/MANIFEST.MF6
-rw-r--r--bundles/org.eclipse.team.core/forceQualifierUpdate.txt5
-rw-r--r--bundles/org.eclipse.team.core/pom.xml4
-rw-r--r--bundles/org.eclipse.team.core/schema/defaultFileModificationValidator.exsd192
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/IProjectSetSerializer.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetCapability.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetSerializationContext.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java21
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/FastDiffFilter.java3
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffTree.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffVisitor.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/DiffTree.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ChangeTracker.java17
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/IMergeContext.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ISynchronizationScopeManager.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/ResourceDiff.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/SynchronizationScopeManager.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ISubscriberChangeEvent.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java41
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberMergeContext.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberResourceMappingContext.java5
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java22
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/FastSyncInfoFilter.java6
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java9
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java18
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/CachedResourceVariant.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariant.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariantTree.java10
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/PersistantResourceVariantByteStore.java16
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantByteStore.java21
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWayResourceComparator.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySubscriber.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySynchronizer.java48
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java5
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java16
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/StringMatcher.java413
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/WildcardStringMatcher.java70
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/CompoundResourceTraversal.java27
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java15
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/ScopeManagerEventHandler.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutInputStream.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutOutputStream.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/BatchingLock.java6
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ChangeSetManager.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/DiffTreeStatistics.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncByteConverter.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncInfoTreeChangeEvent.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/.classpath4
-rw-r--r--bundles/org.eclipse.team.cvs.core/.cvsignore1
-rw-r--r--bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.pde.prefs64
-rw-r--r--bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF6
-rw-r--r--bundles/org.eclipse.team.cvs.core/forceQualifierUpdate.txt1
-rw-r--r--bundles/org.eclipse.team.cvs.core/pom.xml4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java16
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java24
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java48
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java14
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFileModificationValidator.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IUserAuthenticator.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java20
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NotifiedHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java15
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java9
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java36
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java23
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequestsHandler.java5
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/EditorsListener.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java15
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/ExtConnection.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/LogEntryCache.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/CVSCheckedInChangeSet.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/ChangeSetResourceMapping.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java24
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java12
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java48
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java10
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java5
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/.classpath4
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/.cvsignore1
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/pom.xml4
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Messages.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Method.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java29
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java15
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2Method.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/Policy.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/.classpath4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/.cvsignore2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.jdt.core.prefs10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history.gifbin142 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history.pngbin0 -> 317 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history@2x.pngbin582 -> 507 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history.gifbin219 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history.pngbin0 -> 356 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history@2x.pngbin655 -> 644 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/pom.xml4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilter.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilterDialog.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java39
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/EditorsView.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryTableProvider.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java44
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelSynchronizeParticipant.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CompareSubscriberContext.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/OpenChangeSetAction.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteOperation.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteProjectFolder.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/NewCVSRepositoryAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/PasteConnectionStringAction.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoriesViewContentHandler.java89
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java49
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OpenChangeSetAction.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardCommitPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java2
-rw-r--r--bundles/org.eclipse.team.genericeditor.diff.extension/.classpath2
-rw-r--r--bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.pde.prefs64
-rw-r--r--bundles/org.eclipse.team.genericeditor.diff.extension/META-INF/MANIFEST.MF7
-rw-r--r--bundles/org.eclipse.team.genericeditor.diff.extension/plugin.xml8
-rw-r--r--bundles/org.eclipse.team.genericeditor.diff.extension/pom.xml4
-rw-r--r--bundles/org.eclipse.team.ui/.classpath4
-rw-r--r--bundles/org.eclipse.team.ui/.cvsignore1
-rw-r--r--bundles/org.eclipse.team.ui/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.team.ui/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF6
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change.pngbin304 -> 317 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change@2x.pngbin582 -> 507 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history.pngbin304 -> 317 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history@2x.pngbin582 -> 507 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change.pngbin318 -> 356 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change@2x.pngbin655 -> 644 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history.pngbin318 -> 356 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history@2x.pngbin655 -> 644 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/eview16/compare_view.gifbin224 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/eview16/history_view.gifbin564 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/eview16/synch_synch.gifbin353 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/plugin.properties8
-rw-r--r--bundles/org.eclipse.team.ui/pom.xml4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetImporter.java14
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/PropertyChangeHandler.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/SWTUtils.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareAction.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenWithMenu.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java24
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PromptingDialog.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/DateHistoryCategory.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionTypedElement.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryTableProvider.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java11
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/AbstractCompareInput.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CompareInputChangeNotifier.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/FuzzFactorDialog.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/IgnoreLeadingPathSegmentsAction.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelCompareEditorInput.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelEnablementPreferencePage.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMarkAsMergedHandler.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMergeHandler.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/FileTypeTable.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java25
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderManager.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamDecoratorManager.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshModelParticipantJob.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java48
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement.java15
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java19
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchModelSynchronizeParticipant.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetLocationPage.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java26
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalSynchronizeWizard.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ImportProjectSetOperation.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PatchInaccessibleProjectsPage.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PsfStore.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/WorkingSetsDialog.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageCompareEditorInput.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageSaveablePart.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/SaveablePartDialog.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/ElementLocalHistoryPageSource.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPageCompareEditorInput.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareAdapter.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareInput.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamContentProviderDescriptor.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamStateProvider.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/MergeActionHandler.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationActionProvider.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationCompareAdapter.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationOperation.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationStateTester.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePage.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelMergeOperation.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelOperation.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipant.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipantActionGroup.java51
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SaveableCompareEditorInput.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java15
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberTeamStateProvider.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java6
-rw-r--r--bundles/org.eclipse.ui.net/.classpath4
-rw-r--r--bundles/org.eclipse.ui.net/.cvsignore1
-rw-r--r--bundles/org.eclipse.ui.net/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.ui.net/pom.xml4
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/Activator.java60
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java22
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java18
-rw-r--r--examples/org.eclipse.compare.examples.xml/.classpath4
-rw-r--r--examples/org.eclipse.compare.examples.xml/.cvsignore1
-rw-r--r--examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--examples/org.eclipse.compare.examples.xml/IdMaps/idmap.dtd16
-rw-r--r--examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF4
-rw-r--r--examples/org.eclipse.compare.examples.xml/pom.xml4
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java2
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/CreateNewIdMapAction.java2
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/Messages.java2
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLComparePreferencePage.java4
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java12
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java4
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ui/MessageLine.java3
-rw-r--r--examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/AllXMLCompareTests.java18
-rw-r--r--examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/TestXMLStructureCreator.java241
-rw-r--r--examples/org.eclipse.compare.examples/.classpath4
-rw-r--r--examples/org.eclipse.compare.examples/.cvsignore1
-rw-r--r--examples/org.eclipse.compare.examples/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--examples/org.eclipse.compare.examples/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--examples/org.eclipse.compare.examples/META-INF/MANIFEST.MF4
-rw-r--r--examples/org.eclipse.compare.examples/pom.xml4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/.classpath4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/.cvsignore1
-rw-r--r--examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.jdt.core.prefs38
-rw-r--r--examples/org.eclipse.team.examples.filesystem/META-INF/MANIFEST.MF4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/pom.xml4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java24
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemPlugin.java44
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProvider.java56
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProviderType.java2
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/Policy.java24
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemFileRevision.java11
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistory.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistoryProvider.java3
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemMergeContext.java6
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemRemoteTree.java6
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemResourceVariant.java26
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemSyncInfo.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ConfigurationWizard.java22
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/DisconnectAction.java6
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPage.java16
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPageSource.java2
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemPropertiesPage.java14
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemRevisionEditorInput.java13
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemSynchronizeParticipant.java2
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemTableProvider.java67
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetAction.java5
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetOperation.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/MergeAction.java3
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergeDialog.java10
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergePart.java11
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java8
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergePage.java2
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/OpenFileSystemRevisionAction.java7
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/PutAction.java5
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ReplaceAction.java2
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ShowHistoryAction.java3
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeAction.java3
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeWizard.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryParticipant.java33
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySyncInfo.java3
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySynchronizeWizard.java9
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariant.java9
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariantComparator.java3
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java7
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelFile.java3
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObject.java2
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObjectElementFile.java11
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelResource.java18
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelWorkspace.java6
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelContainerResourceMapping.java6
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelResourceMapping.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/MoeResourceMapping.java6
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/AdapterFactory.java8
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelNavigatorActionProvider.java13
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelSaveable.java10
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelWorkbenchAdapter.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java16
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncActionProvider.java2
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncLabelProvider.java14
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IPessimisticFilesystemConstants.java6
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IResourceStateListener.java2
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProvider.java15
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/BlankPage.java3
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckInAction.java10
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckOutAction.java8
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/ConfigurationWizard.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticDecorator.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticPreferencesPage.java80
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/UncheckOutAction.java2
-rw-r--r--features/org.eclipse.cvs-feature/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--features/org.eclipse.cvs-feature/feature.properties4
-rw-r--r--features/org.eclipse.cvs-feature/feature.xml2
-rw-r--r--features/org.eclipse.cvs-feature/pom.xml18
-rw-r--r--pom.xml14
-rw-r--r--tests/org.eclipse.compare.tests/.classpath8
-rw-r--r--tests/org.eclipse.compare.tests/.cvsignore1
-rw-r--r--tests/org.eclipse.compare.tests/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--tests/org.eclipse.compare.tests/.settings/org.eclipse.jdt.core.prefs270
-rw-r--r--tests/org.eclipse.compare.tests/META-INF/MANIFEST.MF4
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/bug150591_cr_crlf_cr/patch.txt40
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.patched.txt50
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.txt46
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/patch.txt40
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.patched.txt50
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.txt46
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/bug150591_lf_crlf_lf/patch.txt40
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/context_full.txt102
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/exp_addHunks.txt116
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/exp_createFilePatch.txt54
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/exp_modifyHunks.txt56
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/exp_removeHunks.txt100
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_addHunks.txt68
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_createHunk0.txt38
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_createHunk1.txt52
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_createHunk2.txt24
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_createHunk3.txt28
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_modifyHunks.txt48
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_removeHunks.txt110
-rw-r--r--tests/org.eclipse.compare.tests/pom.xml4
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AsyncExecTests.java25
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareFileRevisionEditorInputTest.java7
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareUIPluginTest.java45
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DiffTest.java110
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java217
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FilterTest.java28
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java131
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java25
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java221
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUITest.java29
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java15
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/RangeDifferencerThreeWayDiffTest.java64
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java127
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StructureCreatorTest.java37
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java33
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/WorkspaceTest.java2
-rw-r--r--tests/org.eclipse.core.tests.net/.classpath8
-rw-r--r--tests/org.eclipse.core.tests.net/.cvsignore1
-rw-r--r--tests/org.eclipse.core.tests.net/.project6
-rw-r--r--tests/org.eclipse.core.tests.net/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--tests/org.eclipse.core.tests.net/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--tests/org.eclipse.core.tests.net/META-INF/MANIFEST.MF5
-rw-r--r--tests/org.eclipse.core.tests.net/pom.xml4
-rw-r--r--tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/Activator.java44
-rw-r--r--tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/AllNetTests.java4
-rw-r--r--tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java2
-rw-r--r--tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/SystemProxyTest.java102
-rw-r--r--tests/org.eclipse.jsch.tests/.cvsignore1
-rw-r--r--tests/org.eclipse.jsch.tests/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--tests/org.eclipse.jsch.tests/META-INF/MANIFEST.MF4
-rw-r--r--tests/org.eclipse.jsch.tests/pom.xml4
-rw-r--r--tests/org.eclipse.team.tests.core/.classpath8
-rw-r--r--tests/org.eclipse.team.tests.core/.cvsignore1
-rw-r--r--tests/org.eclipse.team.tests.core/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--tests/org.eclipse.team.tests.core/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF6
-rw-r--r--tests/org.eclipse.team.tests.core/pom.xml4
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderBic.java5
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderNaish.java5
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderOtherSport.java3
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTests.java22
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTypeBic.java3
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TestStorageMerger.java2
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java8
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTestSubscriber.java10
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTests.java2
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/DoNotRemoveTest.java7
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java7
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java14
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/.classpath8
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/.cvsignore3
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.core.runtime.prefs4
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs268
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF4
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/benchmark/cvsui_benchmark.bat102
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/pom.xml4
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java45
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseCVSClient.java2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java7
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/TestConnection.java2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java14
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ResourceDeltaTest.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java9
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java3
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java20
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkUtils.java33
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/test.xml45
-rw-r--r--tests/pom.xml3
682 files changed, 6024 insertions, 7963 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 000000000..fe86e95fe
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,69 @@
+pipeline {
+ options {
+ timeout(time: 40, unit: 'MINUTES')
+ buildDiscarder(logRotator(numToKeepStr:'5'))
+ }
+ agent {
+ label "centos-latest"
+ }
+ tools {
+ maven 'apache-maven-latest'
+ jdk 'openjdk-jdk11-latest'
+ }
+ stages {
+ stage('initialize Gerrit review') {
+ steps {
+ gerritReview labels: [Verified: 0], message: "Build started $BUILD_URL"
+ }
+ }
+ stage('Build') {
+ steps {
+ wrap([$class: 'Xvnc', useXauthority: true]) {
+ sh """
+ mvn clean verify --batch-mode --fail-at-end -Dmaven.repo.local=$WORKSPACE/.m2/repository \
+ -Pbuild-individual-bundles -Pbree-libs -Papi-check \
+ -Dcompare-version-with-baselines.skip=false \
+ -Dproject.build.sourceEncoding=UTF-8
+ """
+ }
+ }
+ post {
+ always {
+ archiveArtifacts artifacts: '*.log,*/target/work/data/.metadata/*.log,*/tests/target/work/data/.metadata/*.log,apiAnalyzer-workspace/.metadata/*.log', allowEmptyArchive: true
+ junit '**/target/surefire-reports/TEST-*.xml'
+ publishIssues issues:[scanForIssues(tool: java()), scanForIssues(tool: mavenConsole())]
+ }
+ unstable {
+ gerritReview labels: [Verified: -1], message: "Build UNSTABLE (test failures) $BUILD_URL"
+ }
+ failure {
+ gerritReview labels: [Verified: -1], message: "Build FAILED $BUILD_URL"
+ }
+ }
+ }
+ stage('Check freeze period') {
+ when {
+ not {
+ branch 'master'
+ }
+ }
+ steps {
+ sh "wget https://raw.githubusercontent.com/eclipse-platform/eclipse.platform.releng.aggregator/master/scripts/verifyFreezePeriod.sh"
+ sh "chmod +x verifyFreezePeriod.sh"
+ withCredentials([string(credentialsId: 'google-api-key', variable: 'GOOGLE_API_KEY')]) {
+ sh './verifyFreezePeriod.sh'
+ }
+ }
+ post {
+ failure {
+ gerritReview labels: [Verified: -1], message: "Build and test are OK, but Eclipse project is currently in a code freeze period.\nPlease wait for end of code freeze period before merging.\n $BUILD_URL"
+ }
+ }
+ }
+ }
+ post {
+ success {
+ gerritReview labels: [Verified: 1], message: "Build Succcess $BUILD_URL"
+ }
+ }
+}
diff --git a/MOVED_TO_GITHUB.md b/MOVED_TO_GITHUB.md
new file mode 100644
index 000000000..64859eb98
--- /dev/null
+++ b/MOVED_TO_GITHUB.md
@@ -0,0 +1,5 @@
+This repository is now moved to GitHub: https://github.com/eclipse-platform/eclipse.platform.team
+If you see this message, perform GitHub migration by (assuming the legacy Gerrit repo is called `origin`)
+$ git reset --hard HEAD^
+$ git remote set origin git@github.com:eclipse-platform/eclipse.platform.team.git
+$ git pull origin master \ No newline at end of file
diff --git a/bundles/org.eclipse.compare.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.compare.core/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.compare.core/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.compare.core/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.compare.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.compare.core/.settings/org.eclipse.pde.prefs
index 78a1e14db..ba85338b1 100644
--- a/bundles/org.eclipse.compare.core/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.compare.core/.settings/org.eclipse.pde.prefs
@@ -1,32 +1,32 @@
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=0
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=0
-compilers.p.missing-version-export-package=2
-compilers.p.missing-version-import-package=2
-compilers.p.missing-version-require-bundle=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=0
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=0
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF
index 2c4329b52..7ae79e06e 100644
--- a/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF
@@ -2,16 +2,14 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare.core
-Bundle-Version: 3.6.600.qualifier
-Bundle-Activator: org.eclipse.compare.internal.core.ComparePlugin
+Bundle-Version: 3.6.1000.qualifier
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.compare.internal.core;x-friends:="org.eclipse.compare",
- org.eclipse.compare.internal.core.patch;x-friends:="org.eclipse.compare",
- org.eclipse.compare.patch; core="split"; mandatory:="core",
+ org.eclipse.compare.internal.core.patch;x-friends:="org.eclipse.compare,org.eclipse.team.ui",
+ org.eclipse.compare.patch;core=split;mandatory:=core,
org.eclipse.compare.rangedifferencer
-Import-Package: com.ibm.icu.text;version="3.6.1"
Bundle-Localization: plugin
Automatic-Module-Name: org.eclipse.compare.core
diff --git a/bundles/org.eclipse.compare.core/pom.xml b/bundles/org.eclipse.compare.core/pom.xml
index 3bf259ed3..0f8597c55 100644
--- a/bundles/org.eclipse.compare.core/pom.xml
+++ b/bundles/org.eclipse.compare.core/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.compare</groupId>
<artifactId>org.eclipse.compare.core</artifactId>
- <version>3.6.600-SNAPSHOT</version>
+ <version>3.6.1000-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/CompareSettings.java
index 37a7d91c9..444b32270 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/CompareSettings.java
@@ -13,64 +13,43 @@
*******************************************************************************/
package org.eclipse.compare.internal.core;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
/**
* The activator class controls the plug-in life cycle
*/
-public class ComparePlugin extends Plugin {
+public class CompareSettings {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.compare.core"; //$NON-NLS-1$
// The shared instance
- private static ComparePlugin plugin;
+ private static CompareSettings compareSettings;
private boolean cappingDisabled;
/**
* The constructor
*/
- public ComparePlugin() {
+ private CompareSettings() {
// nothing to do
}
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
/**
* Returns the shared instance
*
* @return the shared instance
*/
- public static ComparePlugin getDefault() {
- return plugin;
- }
-
- public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, 0, Messages.Activator_1, e));
- }
-
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
+ public static CompareSettings getDefault() {
+ if (compareSettings == null) {
+ compareSettings = new CompareSettings();
+ }
+ return compareSettings;
}
public void setCappingDisabled(boolean disable) {
this.cappingDisabled = disable;
}
+
public boolean isCappingDisabled() {
return this.cappingDisabled;
}
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java
index 480e3c08e..d8090cb13 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java
@@ -98,7 +98,7 @@ public abstract class LCS {
}
private boolean isCappingDisabled() {
- return ComparePlugin.getDefault().isCappingDisabled();
+ return CompareSettings.getDefault().isCappingDisabled();
}
/**
@@ -177,7 +177,7 @@ public abstract class LCS {
/**
* Helper function for Myers' LCS algorithm to find the middle snake for
- * l1[bottoml1..topl1] and l2[bottoml2..topl2] The x, y coodrdinates of the
+ * l1[bottoml1..topl1] and l2[bottoml2..topl2] The x, y coordinates of the
* start of the middle snake are saved in snake[0], snake[1] respectively
* and the length of the snake is saved in s[2].
*
@@ -191,7 +191,7 @@ public abstract class LCS {
* to store furthest reaching D-paths
* @param snake should be allocated as int[3], used to store the beginning
* x, y coordinates and the length of the middle snake
- * @subMonitor subMonitor
+ * @param subMonitor
*
* @return The number of differences (SES) between l1[bottoml1..topl1] and
* l2[bottoml2..topl2]
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/FileDiffResult.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/FileDiffResult.java
index 02f765fb8..34c10e311 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/FileDiffResult.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/FileDiffResult.java
@@ -13,23 +13,12 @@
*******************************************************************************/
package org.eclipse.compare.internal.core.patch;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.compare.internal.core.ComparePlugin;
+import java.io.*;
+import java.util.*;
+
import org.eclipse.compare.internal.core.Messages;
-import org.eclipse.compare.patch.IFilePatchResult;
-import org.eclipse.compare.patch.IHunk;
-import org.eclipse.compare.patch.PatchConfiguration;
-import org.eclipse.compare.patch.ReaderCreator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.compare.patch.*;
+import org.eclipse.core.runtime.*;
import org.eclipse.osgi.util.NLS;
public class FileDiffResult implements IFilePatchResult {
@@ -332,7 +321,7 @@ public class FileDiffResult implements IFilePatchResult {
try {
bytes = contents.getBytes(charSet);
} catch (UnsupportedEncodingException e) {
- ComparePlugin.log(e);
+ Platform.getLog(FileDiffResult.class).error(Messages.Activator_1, e);
}
}
if (bytes == null) {
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java
index 3a4f3dae8..a62f8e730 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java
@@ -17,9 +17,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.compare.patch.IFilePatchResult;
-import org.eclipse.compare.patch.IHunk;
-import org.eclipse.compare.patch.PatchConfiguration;
+import org.eclipse.compare.patch.*;
import org.eclipse.core.runtime.Assert;
/**
@@ -362,7 +360,7 @@ public class Hunk implements IHunk {
&& contextLines.size() >= fuzz
&& !checkPrecedingContextLines(configuration, lines,
fuzz, pos, contextLines))
- Assert.isTrue(false, "doPatch: preceding context lines don't match, even though fuzz factor has been used"); //$NON-NLS-1$;
+ Assert.isTrue(false, "doPatch: preceding context lines don't match, even though fuzz factor has been used"); //$NON-NLS-1$
// else if there is less or equal context line to the fuzz
// factor we ignore them all and treat as matching
@@ -381,7 +379,7 @@ public class Hunk implements IHunk {
&& contextLines.size() >= fuzz
&& !checkPrecedingContextLines(configuration, lines,
fuzz, pos, contextLines))
- Assert.isTrue(false, "doPatch: preceding context lines don't match, even though fuzz factor has been used"); //$NON-NLS-1$;
+ Assert.isTrue(false, "doPatch: preceding context lines don't match, even though fuzz factor has been used"); //$NON-NLS-1$
precedingLinesChecked = true;
contextLines.clear();
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java
index f7732e063..2192e0750 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java
@@ -18,10 +18,9 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.util.*;
-import org.eclipse.compare.internal.core.ComparePlugin;
+import org.eclipse.compare.internal.core.Messages;
import org.eclipse.compare.patch.ReaderCreator;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.*;
public class LineReader {
/**
@@ -36,7 +35,7 @@ public class LineReader {
bufferedReader = new BufferedReader(content.createReader());
lines = readLines(bufferedReader);
} catch (CoreException ex) {
- ComparePlugin.log(ex);
+ Platform.getLog(LineReader.class).error(Messages.Activator_1, ex);
} finally {
if (bufferedReader != null) {
try {
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
index 4ebb67735..8c259e333 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
@@ -15,16 +15,13 @@ package org.eclipse.compare.internal.core.patch;
import java.io.BufferedReader;
import java.io.IOException;
-import java.text.ParseException;
+import java.text.*;
import java.util.*;
import java.util.regex.Pattern;
import org.eclipse.compare.patch.IFilePatch2;
import org.eclipse.core.runtime.*;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
-
public class PatchReader {
private static final boolean DEBUG= false;
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java
index c648b5692..f342fa585 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java
@@ -16,7 +16,7 @@ package org.eclipse.compare.patch;
import java.io.BufferedReader;
import java.io.IOException;
-import org.eclipse.compare.internal.core.ComparePlugin;
+import org.eclipse.compare.internal.core.CompareSettings;
import org.eclipse.compare.internal.core.patch.PatchReader;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
@@ -48,7 +48,7 @@ public class PatchParser {
return patchReader.getAdjustedDiffs();
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR,
- ComparePlugin.PLUGIN_ID, 0, e.getMessage(), e));
+ CompareSettings.PLUGIN_ID, 0, e.getMessage(), e));
} finally {
try {
reader.close();
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
index 0035ef923..eb62f64e6 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
@@ -89,7 +89,7 @@ public final class RangeDifferencer {
* The differences are returned as an array of <code>RangeDifference</code>s.
* If no differences are detected an empty array is returned.
*
- * @param factory
+ * @param factory factory to instantiate new {@link RangeDifference}s
* @param pm if not <code>null</code> used to report progress
* @param left the left range comparator
* @param right the right range comparator
@@ -141,7 +141,7 @@ public final class RangeDifferencer {
* If the ancestor range comparator is <code>null</code>, a two-way
* comparison is performed.
*
- * @param factory
+ * @param factory factory to instantiate new {@link RangeDifference}s
* @param pm if not <code>null</code> used to report progress
* @param ancestor the ancestor range comparator or <code>null</code>
* @param left the left range comparator
@@ -278,7 +278,7 @@ public final class RangeDifferencer {
* In contrast to <code>findDifferences</code>, the result
* contains <code>RangeDifference</code> elements for non-differing ranges too.
*
- * @param factory
+ * @param factory factory to instantiate new {@link RangeDifference}s
* @param pm if not <code>null</code> used to report progress
* @param left the left range comparator
* @param right the right range comparator
@@ -352,7 +352,7 @@ public final class RangeDifferencer {
* If the ancestor range comparator is <code>null</code>, a two-way
* comparison is performed.
*
- * @param factory
+ * @param factory factory to instantiate new {@link RangeDifference}s
* @param pm if not <code>null</code> used to report progress
* @param ancestor the ancestor range comparator or <code>null</code>
* @param left the left range comparator
diff --git a/bundles/org.eclipse.compare.win32/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.compare.win32/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.compare.win32/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.compare.win32/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.compare.win32/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.compare.win32/.settings/org.eclipse.pde.prefs
index 78a1e14db..ba85338b1 100644
--- a/bundles/org.eclipse.compare.win32/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.compare.win32/.settings/org.eclipse.pde.prefs
@@ -1,32 +1,32 @@
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=0
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=0
-compilers.p.missing-version-export-package=2
-compilers.p.missing-version-import-package=2
-compilers.p.missing-version-require-bundle=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=0
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=0
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.compare.win32/META-INF/MANIFEST.MF b/bundles/org.eclipse.compare.win32/META-INF/MANIFEST.MF
index 1afabc30a..2ceeb4ba9 100644
--- a/bundles/org.eclipse.compare.win32/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.compare.win32/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare.win32;singleton:=true
-Bundle-Version: 1.2.600.qualifier
+Bundle-Version: 1.2.800.qualifier
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Eclipse-PlatformFilter: (osgi.os=win32)
diff --git a/bundles/org.eclipse.compare.win32/META-INF/p2.inf b/bundles/org.eclipse.compare.win32/META-INF/p2.inf
index 4237061a2..38feb8b0e 100644
--- a/bundles/org.eclipse.compare.win32/META-INF/p2.inf
+++ b/bundles/org.eclipse.compare.win32/META-INF/p2.inf
@@ -1,6 +1,6 @@
-# ensure that the applicable implementation fragment gets installed (bug 361901)
-requires.0.namespace = org.eclipse.equinox.p2.iu
-requires.0.name = org.eclipse.swt.win32.win32.x86_64
-#requires.0.range = [$version$,$version$]
-requires.0.filter = (&(osgi.os=win32)(osgi.ws=win32)(osgi.arch=x86_64))
-
+# ensure that the applicable implementation fragment gets installed (bug 361901)
+requires.0.namespace = org.eclipse.equinox.p2.iu
+requires.0.name = org.eclipse.swt.win32.win32.x86_64
+#requires.0.range = [$version$,$version$]
+requires.0.filter = (&(osgi.os=win32)(osgi.ws=win32)(osgi.arch=x86_64))
+
diff --git a/bundles/org.eclipse.compare.win32/pom.xml b/bundles/org.eclipse.compare.win32/pom.xml
index 62336430e..3316a9781 100644
--- a/bundles/org.eclipse.compare.win32/pom.xml
+++ b/bundles/org.eclipse.compare.win32/pom.xml
@@ -14,12 +14,12 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.compare</groupId>
<artifactId>org.eclipse.compare.win32</artifactId>
- <version>1.2.600-SNAPSHOT</version>
+ <version>1.2.800-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
diff --git a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/AbstractMergeViewer.java b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/AbstractMergeViewer.java
index c898d908c..001e39603 100644
--- a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/AbstractMergeViewer.java
+++ b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/AbstractMergeViewer.java
@@ -59,18 +59,22 @@ public abstract class AbstractMergeViewer extends Viewer {
this.configuration = configuration;
}
+ @Override
public Object getInput() {
return input;
}
+ @Override
public ISelection getSelection() {
return StructuredSelection.EMPTY;
}
+ @Override
public void refresh() {
// Nothing to do
}
+ @Override
public void setInput(Object input) {
this.input = input;
reset();
@@ -91,6 +95,7 @@ public abstract class AbstractMergeViewer extends Viewer {
resultFile = null;
}
+ @Override
public void setSelection(ISelection selection, boolean reveal) {
// Nothing to do
}
@@ -181,16 +186,13 @@ public abstract class AbstractMergeViewer extends Viewer {
private File createTempFile(InputStream contents) throws IOException {
File file = File.createTempFile("compare", ".doc"); //$NON-NLS-1$ //$NON-NLS-2$
file.deleteOnExit();
- OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
- try {
+ try (OutputStream out = new BufferedOutputStream(new FileOutputStream(file))) {
byte[] buffer = new byte[1024];
int length;
while ((length = contents.read(buffer)) != -1) {
out.write(buffer, 0, length);
}
return file;
- } finally {
- out.close();
}
}
@@ -270,8 +272,7 @@ public abstract class AbstractMergeViewer extends Viewer {
}
protected byte[] asBytes(File file) throws IOException {
- InputStream in = new BufferedInputStream(new FileInputStream(file));
- try {
+ try (InputStream in = new BufferedInputStream(new FileInputStream(file))) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length;
@@ -280,8 +281,6 @@ public abstract class AbstractMergeViewer extends Viewer {
}
out.close();
return out.toByteArray();
- } finally {
- in.close();
}
}
diff --git a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/Activator.java b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/Activator.java
index 142fec505..d28e8298d 100644
--- a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/Activator.java
+++ b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/Activator.java
@@ -36,6 +36,7 @@ public class Activator extends Plugin {
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -45,6 +46,7 @@ public class Activator extends Plugin {
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
diff --git a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordComparison.java b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordComparison.java
index a6cef6046..49c3ba21d 100644
--- a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordComparison.java
+++ b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordComparison.java
@@ -123,8 +123,7 @@ public class WordComparison {
*
* <p>An exception is thrown if the id cannot be retrieved</p>
*
- * Reference information for id assignment: <a href="
- * http://msdn.microsoft.com/en-us/library/w7a36sdf%28VS.80%29.aspx">http://msdn.microsoft.com/en-us/library/w7a36sdf%28VS.80%29.aspx</a>
+ * Reference information for id assignment: <a href="http://msdn.microsoft.com/en-us/library/w7a36sdf%28VS.80%29.aspx">http://msdn.microsoft.com/en-us/library/w7a36sdf%28VS.80%29.aspx</a>
*
* @param auto - object from which we want to get the property, must not be <code>null</code>
* @param reference - an reference object from which the property will be obtained.
diff --git a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordMergeViewer.java b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordMergeViewer.java
index 1ad9cbd9c..7a21bd98f 100644
--- a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordMergeViewer.java
+++ b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordMergeViewer.java
@@ -85,6 +85,7 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
super(configuration);
createContentArea(parent);
getControl().addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
handleDispose();
}
@@ -113,6 +114,7 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
if (configuration.isRightEditable() || configuration.isLeftEditable()
&& (configuration.isRightEditable() != configuration.isLeftEditable())) {
saveAction = new Action() {
+ @Override
public void run() {
saveDocument();
}
@@ -122,6 +124,7 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
}
inplaceAction = new Action(CompareWin32Messages.WordMergeViewer_2, Action.AS_CHECK_BOX) {
+ @Override
public void run() {
toggleInplaceExternalState();
}
@@ -268,8 +271,10 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
}
}
+ @Override
public void flush(IProgressMonitor monitor) {
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
if (isReallyDirty())
saveDocument();
@@ -280,6 +285,7 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
protected void toggleInplaceExternalState() {
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
+ @Override
public void run() {
try {
if (isReallyDirty()) {
@@ -379,10 +385,12 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
return CompareWin32Messages.WordMergeViewer_5;
}
+ @Override
public Control getControl() {
return composite;
}
+ @Override
public void setInput(Object input) {
super.setInput(input);
try {
@@ -395,6 +403,7 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
private void updateDirtyFlag() {
final Runnable dirtyFlagUpdater = new Runnable() {
+ @Override
public void run() {
if (wordArea.getFrame().isDisposed())
return;
@@ -441,6 +450,7 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
for (Object allListener : allListeners) {
final IPropertyChangeListener listener = (IPropertyChangeListener) allListener;
SafeRunner.run(new SafeRunnable() {
+ @Override
public void run() throws Exception {
listener.propertyChange(event);
}
@@ -448,16 +458,19 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
}
}
+ @Override
public void addPropertyChangeListener(IPropertyChangeListener listener) {
listeners.add(listener);
}
+ @Override
public void removePropertyChangeListener(IPropertyChangeListener listener) {
listeners.remove(listener);
}
private void handleDispose() {
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
+ @Override
public void run() {
wordArea.dispose();
formToolkit.dispose();
@@ -466,6 +479,7 @@ public class WordMergeViewer extends AbstractMergeViewer implements IFlushable,
});
}
+ @Override
protected void reset() {
if (wordArea.isOpen()) {
wordArea.close();
diff --git a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordViewerCreator.java b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordViewerCreator.java
index dcf1c2004..8e570d001 100644
--- a/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordViewerCreator.java
+++ b/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordViewerCreator.java
@@ -24,6 +24,7 @@ import org.eclipse.swt.widgets.Composite;
*/
public class WordViewerCreator implements IViewerCreator {
+ @Override
public Viewer createViewer(Composite parent, CompareConfiguration config) {
return new WordMergeViewer(parent, config);
}
diff --git a/bundles/org.eclipse.compare/.classpath b/bundles/org.eclipse.compare/.classpath
index 013075d7e..528bd5abe 100644
--- a/bundles/org.eclipse.compare/.classpath
+++ b/bundles/org.eclipse.compare/.classpath
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="compare"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
+ <attributes>
+ <attribute name="module" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.compare/.cvsignore b/bundles/org.eclipse.compare/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/bundles/org.eclipse.compare/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.compare/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.compare/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.compare/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.compare/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.compare/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.compare/.settings/org.eclipse.jdt.core.prefs
index b77effb95..15ebd71cd 100644
--- a/bundles/org.eclipse.compare/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.compare/.settings/org.eclipse.jdt.core.prefs
@@ -1,383 +1,406 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disable
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
-org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
-org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,NORMAL,NORMAL
-org.eclipse.jdt.core.compiler.taskTags=TODO,XXX,FIXME
-org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
-org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
-org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
-org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true
-org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=120
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
-org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
-org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
-org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
-org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
-org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
-org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
-org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
-org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
-org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
-org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disable
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,NORMAL,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,XXX,FIXME
+org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
+org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true
+org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
+org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/bundles/org.eclipse.compare/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.compare/.settings/org.eclipse.pde.prefs
index 78a1e14db..ba85338b1 100644
--- a/bundles/org.eclipse.compare/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.compare/.settings/org.eclipse.pde.prefs
@@ -1,32 +1,32 @@
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=0
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=0
-compilers.p.missing-version-export-package=2
-compilers.p.missing-version-import-package=2
-compilers.p.missing-version-require-bundle=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=0
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=0
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.compare/META-INF/MANIFEST.MF b/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
index c084edc0c..f11232346 100644
--- a/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
@@ -2,15 +2,15 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare; singleton:=true
-Bundle-Version: 3.7.700.qualifier
+Bundle-Version: 3.8.300.qualifier
Bundle-Activator: org.eclipse.compare.internal.CompareUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.compare,
org.eclipse.compare.contentmergeviewer,
- org.eclipse.compare.internal;x-internal:=true,
+ org.eclipse.compare.internal;x-friends:="org.eclipse.team.ui",
org.eclipse.compare.internal.merge;x-internal:=true,
- org.eclipse.compare.internal.patch;x-internal:=true,
+ org.eclipse.compare.internal.patch;x-friends:="org.eclipse.team.ui",
org.eclipse.compare.patch,
org.eclipse.compare.structuremergeviewer
Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
@@ -26,7 +26,5 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.compare.core;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)";resolution:=optional
Bundle-ActivationPolicy: lazy
-Import-Package: com.ibm.icu.util,
- com.ibm.icu.text
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.compare
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
index d8c155ac8..1f5d74475 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stefan Dirix (sdirix@eclipsesource.com) - Bug 473847: Minimum E4 Compatibility of Compare
*******************************************************************************/
package org.eclipse.compare;
@@ -562,7 +563,7 @@ public abstract class CompareEditorInput extends PlatformObject implements IEdit
}
control.addDisposeListener(ev -> handleDispose());
});
- if (fHelpContextId != null)
+ if (fHelpContextId != null && PlatformUI.isWorkbenchRunning())
PlatformUI.getWorkbench().getHelpSystem().setHelp(fComposite, fHelpContextId);
contentsCreated();
return fComposite;
@@ -1459,7 +1460,7 @@ public abstract class CompareEditorInput extends PlatformObject implements IEdit
private boolean saveChanges() {
try {
- PlatformUI.getWorkbench().getProgressService().run(true, true, monitor -> {
+ Utilities.executeRunnable(monitor -> {
try {
saveChanges(monitor);
} catch (CoreException e) {
@@ -1467,9 +1468,7 @@ public abstract class CompareEditorInput extends PlatformObject implements IEdit
}
});
return true;
- } catch (InterruptedException x) {
- // Ignore
- } catch (OperationCanceledException x) {
+ } catch (InterruptedException | OperationCanceledException x) {
// Ignore
} catch (InvocationTargetException x) {
ErrorDialog.openError(fComposite.getShell(), CompareMessages.CompareDialog_error_title, null,
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
index db2e4fa38..eeaf8fafd 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
@@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.compare;
+import java.text.MessageFormat;
+
import org.eclipse.compare.contentmergeviewer.IFlushable;
import org.eclipse.compare.internal.CompareMessages;
import org.eclipse.compare.internal.IFlushable2;
@@ -28,8 +30,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import com.ibm.icu.text.MessageFormat;
-
/**
* A custom <code>CompareViewerPane</code> that supports dynamic viewer switching.
*
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
index 0e6ae5aa2..b16fee95a 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
@@ -13,8 +13,11 @@
*******************************************************************************/
package org.eclipse.compare;
+import java.text.DateFormat;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -57,11 +60,6 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.MessageFormat;
-import com.ibm.icu.util.Calendar;
-
-
/**
* A dialog where one input element can be compared against
* a list of historic variants (editions) of the same input element.
@@ -1102,7 +1100,7 @@ public class EditionSelectionDialog extends ResizableDialog {
fEditionTree.removeAll();
String pattern= Utilities.getString(fBundle, "treeTitleFormat"); //$NON-NLS-1$
- String title= MessageFormat.format(pattern, new Object[] { ((Item)w).getText() });
+ String title= MessageFormat.format(pattern, ((Item)w).getText());
fEditionPane.setText(title);
Iterator<Object> iter= editions.iterator();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java
index 826bd9df2..e28f9446e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java
@@ -333,8 +333,8 @@ public class ZipFileStructureCreator implements IStructureCreator {
* additions and deletions.
* <p>
* Note: this method is for internal use only. Clients should not call this method.
- * @param differencer
- * @param root
+ * @param differencer the differencer used to rewrite
+ * @param root the root to rewrite
*/
public void rewriteTree(Differencer differencer, IDiffContainer root) {
// empty default implementation
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
index a856d1d7f..380cf98fd 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -359,8 +359,7 @@ public abstract class ContentMergeViewer extends ContentViewer
private ILabelProviderListener labelChangeListener = event -> {
Object[] elements = event.getElements();
- for (int i = 0; i < elements.length; i++) {
- Object object = elements[i];
+ for (Object object : elements) {
if (object == getInput())
updateHeader();
}
@@ -388,11 +387,11 @@ public abstract class ContentMergeViewer extends ContentViewer
fAncestorVisible= Utilities.getBoolean(cc, ICompareUIConstants.PROP_ANCESTOR_VISIBLE, fAncestorVisible);
fConfirmSave= Utilities.getBoolean(cc, CompareEditor.CONFIRM_SAVE_PROPERTY, fConfirmSave);
- fCompareInputChangeListener = (input) -> { if (input == getInput()) handleCompareInputChange(); };
+ fCompareInputChangeListener = input -> { if (input == getInput()) handleCompareInputChange(); };
// Make sure the compare configuration is not null
fCompareConfiguration = cc != null ? cc : new CompareConfiguration();
- fPropertyChangeListener = event -> handlePropertyChangeEvent(event);
+ fPropertyChangeListener = this::handlePropertyChangeEvent;
fCompareConfiguration.addPropertyChangeListener(fPropertyChangeListener);
fPreferenceChangeListener = event -> {
if (event.getProperty().equals(ComparePreferencePage.SWAPPED)) {
@@ -915,6 +914,17 @@ public abstract class ContentMergeViewer extends ContentViewer
fSwitchLeftAndRight = new Action() {
@Override
public void run() {
+ /*
+ * Bug 552352: When comparing .txt files with corresponding .txt file editors
+ * closed and user modifies the content of one of the .txt file in the compare
+ * view and the compare state becomes 'dirty' and if followed by a 'Swap'
+ * action, modifications get lost. This data loss is considered a severe
+ * problem, so to avoid this modified data loss in this scenario, show a
+ * confirmation dialog to 'save' the file before swapping and let user decide
+ * and take a call on this. Note: Issue not seen with .java & .properties files.
+ */
+ doSave(null, getInput());
+
IPreferenceStore preferences = getCompareConfiguration().getPreferenceStore();
preferences.setValue(ComparePreferencePage.SWAPPED, !getCompareConfiguration().isMirrored());
if (preferences instanceof IPersistentPreferenceStore) {
@@ -928,6 +938,7 @@ public abstract class ContentMergeViewer extends ContentViewer
};
Utilities.initAction(fSwitchLeftAndRight, getResourceBundle(), "action.SwitchLeftAndRight."); //$NON-NLS-1$
tbm.appendToGroup("modes", fSwitchLeftAndRight); //$NON-NLS-1$
+ fHandlerService.registerAction(fSwitchLeftAndRight, "org.eclipse.compare.switchLeftAndRight"); //$NON-NLS-1$
final ChangePropertyAction a= new ChangePropertyAction(fBundle, getCompareConfiguration(), "action.EnableAncestor.", ICompareUIConstants.PROP_ANCESTOR_VISIBLE); //$NON-NLS-1$
a.setChecked(fAncestorVisible);
@@ -1210,7 +1221,7 @@ public abstract class ContentMergeViewer extends ContentViewer
* Note: this method is for internal use only. Clients should not call this method.
*
* @param monitor a progress monitor
- * @throws CoreException
+ * @throws CoreException not thrown anymore
* @deprecated use {@link IFlushable#flush(IProgressMonitor)}.
*/
@Deprecated
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index e3e720a09..24c1af3cb 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -19,11 +19,14 @@
* Stephan Herrmann (stephan@cs.tu-berlin.de) - Bug 291695: Element compare fails to use source range
* Robin Stocker (robin@nibor.org) - Bug 398594: [Edit] Enable center arrow buttons when editable and for both sides
* Robin Stocker (robin@nibor.org) - Bug 399960: [Edit] Make merge arrow buttons easier to hit
+ * John Hendrikx (hjohn@xs4all.nl) - Bug 541401 - [regression] Vertical scrollbar thumb size is wrong in compare view
+ * Stefan Dirix (sdirix@eclipsesource.com) - Bug 473847: Minimum E4 Compatibility of Compare
*******************************************************************************/
package org.eclipse.compare.contentmergeviewer;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -43,7 +46,6 @@ import org.eclipse.compare.ISharedDocumentAdapter;
import org.eclipse.compare.IStreamContentAccessor;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.SharedDocumentAdapter;
-import org.eclipse.compare.internal.BufferedCanvas;
import org.eclipse.compare.internal.ChangeCompareFilterPropertyAction;
import org.eclipse.compare.internal.ChangePropertyAction;
import org.eclipse.compare.internal.CompareContentViewerSwitchingPane;
@@ -205,8 +207,6 @@ import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
-import com.ibm.icu.text.MessageFormat;
-
/**
* A text merge viewer uses the <code>RangeDifferencer</code> to perform a
* textual, line-by-line comparison of two (or three) input documents. It is
@@ -430,9 +430,9 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
// SWT widgets
- private BufferedCanvas fAncestorCanvas;
- private BufferedCanvas fLeftCanvas;
- private BufferedCanvas fRightCanvas;
+ private Canvas fAncestorCanvas;
+ private Canvas fLeftCanvas;
+ private Canvas fRightCanvas;
private Canvas fScrollCanvas;
private ScrollBar fVScrollBar;
private Canvas fBirdsEyeCanvas;
@@ -1374,7 +1374,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
@Override
public Point getSelection() {
- return Optional.ofNullable(getTarget()).map(target -> target.getSelection())
+ return Optional.ofNullable(getTarget()).map(IFindReplaceTarget::getSelection)
.orElse(new Point(-1, -1));
}
@@ -1519,7 +1519,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
public TextMergeViewer(Composite parent, int style, CompareConfiguration configuration) {
super(style, ResourceBundle.getBundle(BUNDLE_NAME), configuration);
- operationHistoryListener = event -> TextMergeViewer.this.historyNotification(event);
+ operationHistoryListener = TextMergeViewer.this::historyNotification;
OperationHistoryFactory.getOperationHistory()
.addOperationHistoryListener(operationHistoryListener);
@@ -1609,7 +1609,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fIsMac= Util.isMac();
- fPreferenceChangeListener= event -> TextMergeViewer.this.handlePropertyChangeEvent(event);
+ fPreferenceChangeListener= TextMergeViewer.this::handlePropertyChangeEvent;
fPreferenceStore= createChainedPreferenceStore();
if (fPreferenceStore != null) {
@@ -1990,8 +1990,8 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
disposeCompareFilterActions(false);
if (fSourceViewerDecorationSupport != null) {
- for (Iterator<SourceViewerDecorationSupport> iterator = fSourceViewerDecorationSupport.iterator(); iterator.hasNext();) {
- iterator.next().dispose();
+ for (SourceViewerDecorationSupport sourceViewerDecorationSupport : fSourceViewerDecorationSupport) {
+ sourceViewerDecorationSupport.dispose();
}
fSourceViewerDecorationSupport = null;
}
@@ -2008,12 +2008,6 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fRight = null;
if (fColors != null) {
- Iterator<Color> i= fColors.values().iterator();
- while (i.hasNext()) {
- Color color= i.next();
- if (!color.isDisposed())
- color.dispose();
- }
fColors= null;
}
// don't add anything here, disposing colors should be done last
@@ -2035,16 +2029,21 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
*/
@Override
protected void createControls(Composite composite) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.TEXT_MERGE_VIEW);
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.TEXT_MERGE_VIEW);
+ }
// 1st row
if (fMarginWidth > 0) {
- fAncestorCanvas= new BufferedCanvas(composite, SWT.NONE) {
+ fAncestorCanvas = new Canvas(composite, SWT.DOUBLE_BUFFERED);
+ fAncestorCanvas.addPaintListener(new PaintListener() {
+
@Override
- public void doPaint(GC gc) {
- paintSides(gc, fAncestor, fAncestorCanvas, false);
+ public void paintControl(PaintEvent e) {
+ paintSides(e.gc, fAncestor, fAncestorCanvas, false);
+
}
- };
+ });
fAncestorCanvas.addMouseListener(
new MouseAdapter() {
@Override
@@ -2072,12 +2071,15 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
// 2nd row
if (fMarginWidth > 0) {
- fLeftCanvas= new BufferedCanvas(composite, SWT.NONE) {
+ fLeftCanvas = new Canvas(composite, SWT.DOUBLE_BUFFERED);
+ fLeftCanvas.addPaintListener(new PaintListener() {
+
@Override
- public void doPaint(GC gc) {
- paintSides(gc, fLeft, fLeftCanvas, false);
+ public void paintControl(PaintEvent e) {
+ paintSides(e.gc, fLeft, fLeftCanvas, false);
+
}
- };
+ });
fLeftCanvas.addMouseListener(
new MouseAdapter() {
@Override
@@ -2095,6 +2097,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
public void getName(AccessibleEvent e) {
// Check for Mirrored status flag before returning the left label's text.
e.result = NLS.bind(CompareMessages.TextMergeViewer_accessible_left,
+ getControl().getData(CompareUI.COMPARE_VIEWER_TITLE),
getCompareConfiguration().isMirrored() ? getCompareConfiguration().getRightLabel(getInput())
: getCompareConfiguration().getLeftLabel(getInput()));
}
@@ -2108,6 +2111,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
public void getName(AccessibleEvent e) {
// Check for Mirrored status flag before returning the right label's text.
e.result = NLS.bind(CompareMessages.TextMergeViewer_accessible_right,
+ getControl().getData(CompareUI.COMPARE_VIEWER_TITLE),
getCompareConfiguration().isMirrored() ? getCompareConfiguration().getLeftLabel(getInput())
: getCompareConfiguration().getRightLabel(getInput()));
}
@@ -2130,12 +2134,15 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
hsynchViewport(fRight.getSourceViewer(), fAncestor.getSourceViewer(), fLeft.getSourceViewer());
if (fMarginWidth > 0) {
- fRightCanvas= new BufferedCanvas(composite, SWT.NONE) {
+ fRightCanvas = new Canvas(composite, SWT.DOUBLE_BUFFERED);
+ fRightCanvas.addPaintListener(new PaintListener() {
+
@Override
- public void doPaint(GC gc) {
- paintSides(gc, fRight, fRightCanvas, fSynchronizedScrolling);
+ public void paintControl(PaintEvent e) {
+ paintSides(e.gc, fRight, fRightCanvas, fSynchronizedScrolling);
+
}
- };
+ });
fRightCanvas.addMouseListener(
new MouseAdapter() {
@Override
@@ -2160,12 +2167,17 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
}
);
- fBirdsEyeCanvas= new BufferedCanvas(composite, SWT.NONE) {
+ fBirdsEyeCanvas = new Canvas(composite, SWT.DOUBLE_BUFFERED);
+ fBirdsEyeCanvas.addPaintListener(new PaintListener() {
+
@Override
- public void doPaint(GC gc) {
- paintBirdsEyeView(this, gc);
+ public void paintControl(PaintEvent e) {
+ updateVScrollBar(); // Update scroll bar here as initially viewport height is wrong
+ paintBirdsEyeView((Canvas) e.widget, e.gc);
+
}
- };
+ });
+
fBirdsEyeCanvas.addMouseListener(
new MouseAdapter() {
@Override
@@ -2441,12 +2453,18 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
@Override
protected final Control createCenterControl(Composite parent) {
if (fSynchronizedScrolling) {
- final Canvas canvas= new BufferedCanvas(parent, SWT.NONE) {
+
+
+ final Canvas canvas = new Canvas(parent, SWT.DOUBLE_BUFFERED);
+
+ canvas.addPaintListener(new PaintListener() {
+
@Override
- public void doPaint(GC gc) {
- paintCenter(this, gc);
+ public void paintControl(PaintEvent e) {
+ paintCenter((Canvas) e.widget, e.gc);
+
}
- };
+ });
new HoverResizer(canvas, HORIZONTAL);
Cursor normalCursor= canvas.getDisplay().getSystemCursor(SWT.CURSOR_ARROW);
@@ -2457,7 +2475,6 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fLeftToRightButton.setText(COPY_LEFT_TO_RIGHT_INDICATOR);
fLeftToRightButton.setToolTipText(
Utilities.getString(getResourceBundle(), "action.CopyDiffLeftToRight.tooltip")); //$NON-NLS-1$
- fLeftToRightButton.pack();
fLeftToRightButton.setVisible(false);
fLeftToRightButton.addSelectionListener(
new SelectionAdapter() {
@@ -2473,7 +2490,6 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fRightToLeftButton.setText(COPY_RIGHT_TO_LEFT_INDICATOR);
fRightToLeftButton.setToolTipText(
Utilities.getString(getResourceBundle(), "action.CopyDiffRightToLeft.tooltip")); //$NON-NLS-1$
- fRightToLeftButton.pack();
fRightToLeftButton.setVisible(false);
fRightToLeftButton.addSelectionListener(
new SelectionAdapter() {
@@ -3597,14 +3613,17 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
private boolean isNavigationButtonEnabled(boolean down, boolean deep) {
String value = fPreferenceStore
.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION);
- if (value.equals(ICompareUIConstants.PREF_VALUE_DO_NOTHING)) {
+ switch (value) {
+ case ICompareUIConstants.PREF_VALUE_DO_NOTHING:
return getNextVisibleDiff(down, deep) != null;
- } else if (value.equals(ICompareUIConstants.PREF_VALUE_LOOP)) {
+ case ICompareUIConstants.PREF_VALUE_LOOP:
return isNavigationPossible();
- } else if (value.equals(ICompareUIConstants.PREF_VALUE_NEXT)) {
+ case ICompareUIConstants.PREF_VALUE_NEXT:
return getNextVisibleDiff(down, deep) != null || hasNextElement(down);
- } else if (value.equals(ICompareUIConstants.PREF_VALUE_PROMPT)) {
+ case ICompareUIConstants.PREF_VALUE_PROMPT:
return isNavigationPossible() || hasNextElement(true);
+ default:
+ break;
}
Assert.isTrue(false);
return false;
@@ -3909,15 +3928,14 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
Object current = getCompareConfiguration()
.getProperty(ChangeCompareFilterPropertyAction.COMPARE_FILTER_ACTIONS);
boolean currentFiltersMatch = false;
- if (current != null && current instanceof List
- && ((List<?>) current).size() == compareFilterDescriptors.length) {
+ if (current instanceof List && ((List<?>) current).size() == compareFilterDescriptors.length) {
currentFiltersMatch = true;
@SuppressWarnings("unchecked")
List<ChangeCompareFilterPropertyAction> currentFilterActions = (List<ChangeCompareFilterPropertyAction>) current;
for (CompareFilterDescriptor compareFilterDescriptor : compareFilterDescriptors) {
boolean match = false;
- for (int j = 0; j < currentFilterActions.size(); j++) {
- if (compareFilterDescriptor.getFilterId().equals(currentFilterActions.get(j).getFilterId())) {
+ for (ChangeCompareFilterPropertyAction currentFilterAction : currentFilterActions) {
+ if (compareFilterDescriptor.getFilterId().equals(currentFilterAction.getFilterId())) {
match = true;
break;
}
@@ -3961,8 +3979,8 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fCompareFilterActions);
getCompareConfiguration().setProperty(ChangeCompareFilterPropertyAction.COMPARE_FILTERS_INITIALIZING, null);
} else {
- for (int i = 0; i < fCompareFilterActions.size(); i++) {
- fCompareFilterActions.get(i).setInput(input, ancestor, left, right);
+ for (ChangeCompareFilterPropertyAction action : fCompareFilterActions) {
+ action.setInput(input, ancestor, left, right);
}
}
}
@@ -4238,6 +4256,11 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
}
private void paintCenter(Canvas canvas, GC g) {
+ if (fLeft == null || fRight == null) {
+ // The paint event for the center control can occur before the left / right controls are created.
+ // simply ignore it in this case.
+ return;
+ }
Display display= canvas.getDisplay();
@@ -4566,7 +4589,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
if (rgb == null)
return null;
if (fColors == null)
- fColors= new HashMap<RGB, Color>(20);
+ fColors= new HashMap<>(20);
Color c= fColors.get(rgb);
if (c == null) {
c= new Color(display, rgb);
@@ -5136,17 +5159,17 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fInScrolling= false;
if (isThreeWay() && fAncestorCanvas != null)
- fAncestorCanvas.repaint();
+ fAncestorCanvas.redraw();
if (fLeftCanvas != null)
- fLeftCanvas.repaint();
+ fLeftCanvas.redraw();
Control center= getCenterControl();
- if (center instanceof BufferedCanvas)
- ((BufferedCanvas) center).repaint();
+ if (center instanceof Canvas)
+ ((Canvas) center).redraw();
if (fRightCanvas != null)
- fRightCanvas.repaint();
+ fRightCanvas.redraw();
}
/*
@@ -5394,7 +5417,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
*/
private int getHunkStart() {
Object input = getInput();
- if (input != null && input instanceof DiffNode){
+ if (input instanceof DiffNode){
ITypedElement right = ((DiffNode) input).getRight();
if (right != null) {
Object element = Adapters.adapt(right, IHunk.class);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
index 758bffe13..15fa7680b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
@@ -15,7 +15,10 @@ package org.eclipse.compare.internal;
import java.io.BufferedInputStream;
import java.io.InputStream;
+import java.text.DateFormat;
+import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.ResourceBundle;
@@ -53,11 +56,6 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.MessageFormat;
-import com.ibm.icu.util.Calendar;
-
-
public class AddFromHistoryDialog extends ResizableDialog {
static class HistoryInput implements ITypedElement, IEncodedStreamContentAccessor, IModificationDate {
@@ -188,8 +186,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
// sort input files
final int count= inputFiles.length;
final IFile[] files= new IFile[count];
- for (int i= 0; i < count; i++)
- files[i]= inputFiles[i];
+ System.arraycopy(inputFiles, 0, files, 0, count);
if (count > 1)
internalSort(files, 0, count-1);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java
index ede59b1ba..8c933a2b7 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java
@@ -15,6 +15,7 @@ package org.eclipse.compare.internal;
import java.io.IOException;
import java.io.InputStream;
+import java.text.MessageFormat;
import java.util.ResourceBundle;
import org.eclipse.compare.CompareConfiguration;
@@ -31,8 +32,6 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.PlatformUI;
-import com.ibm.icu.text.MessageFormat;
-
/**
* A simple compare viewer for binary files.
* Shows the position of the first non-matching byte.
@@ -51,7 +50,9 @@ public class BinaryCompareViewer extends AbstractViewer {
public BinaryCompareViewer(Composite parent, final CompareConfiguration cc) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.BINARY_COMPARE_VIEW);
+ if(PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.BINARY_COMPARE_VIEW);
+ }
fBundle= ResourceBundle.getBundle(BUNDLE_NAME);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java
deleted file mode 100644
index 7e4275781..000000000
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2017 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.compare.internal;
-
-import org.eclipse.jface.util.Util;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * A Canvas which reduces flicker by drawing in an off screen buffer.
- */
-public abstract class BufferedCanvas extends Canvas {
-
- //private static final boolean USE_DOUBLE_BUFFER= !"carbon".equals(SWT.getPlatform()); //$NON-NLS-1$
- private static final boolean USE_DOUBLE_BUFFER= true;
-
- /** The drawable for double buffering */
- Image fBuffer;
-
- public BufferedCanvas(Composite parent, int flags) {
- super(parent, flags | SWT.NO_BACKGROUND);
-
- addPaintListener(
- event -> doubleBufferPaint(event.gc)
- );
-
- addDisposeListener(
- e -> {
- if (fBuffer != null) {
- fBuffer.dispose();
- fBuffer= null;
- }
- }
- );
- }
-
- public void repaint() {
- if (!isDisposed()) {
- GC gc= new GC(this);
- doubleBufferPaint(gc);
- gc.dispose();
- if (Util.isGtk()) {
- redraw();
- }
- }
- }
-
- /*
- * Double buffer drawing.
- */
- void doubleBufferPaint(GC dest) {
-
- if (!USE_DOUBLE_BUFFER) {
- doPaint(dest);
- return;
- }
-
- Point size= getSize();
-
- if (size.x <= 1 || size.y <= 1) // we test for <= 1 because on X11 controls have initial size 1,1
- return;
-
- if (fBuffer != null) {
- Rectangle r= fBuffer.getBounds();
- if (r.width != size.x || r.height != size.y) {
- fBuffer.dispose();
- fBuffer= null;
- }
- }
- if (fBuffer == null)
- fBuffer= new Image(getDisplay(), size.x, size.y);
-
- GC gc= new GC(fBuffer);
- try {
- gc.setBackground(getBackground());
- gc.fillRectangle(0, 0, size.x, size.y);
- doPaint(gc);
- } finally {
- gc.dispose();
- }
-
- dest.drawImage(fBuffer, 0, 0);
- }
-
- abstract public void doPaint(GC gc);
-}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java
index 31d5f28d4..5b03a63e2 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java
@@ -24,7 +24,6 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.services.IServiceLocator;
public class CompareContainer implements ICompareContainer {
@@ -68,7 +67,7 @@ public class CompareContainer implements ICompareContainer {
public void run(boolean fork, boolean cancelable,
IRunnableWithProgress runnable)
throws InvocationTargetException, InterruptedException {
- PlatformUI.getWorkbench().getProgressService().run(fork, cancelable, runnable);
+ Utilities.executeRunnable(runnable, fork, cancelable);
}
@Override
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java
index 3026cc907..0d0e85eea 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 IBM Corporation and others.
+ * Copyright (c) 2009, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stefan Dirix (sdirix@eclipsesource.com) - Bug 473847: Minimum E4 Compatibility of Compare
*******************************************************************************/
package org.eclipse.compare.internal;
@@ -21,8 +22,9 @@ import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.CompareEditorInput;
import org.eclipse.compare.CompareViewerSwitchingPane;
import org.eclipse.compare.Splitter;
-import org.eclipse.compare.internal.core.ComparePlugin;
+import org.eclipse.compare.internal.core.CompareSettings;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.jface.layout.RowDataFactory;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.osgi.util.NLS;
@@ -39,6 +41,7 @@ import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -47,7 +50,6 @@ import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.ui.PlatformUI;
public class CompareContentViewerSwitchingPane extends CompareViewerSwitchingPane {
private static final String OPTIMIZED_INFO_IMAGE_NAME = "obj16/message_info.png"; //$NON-NLS-1$
@@ -120,10 +122,8 @@ public class CompareContentViewerSwitchingPane extends CompareViewerSwitchingPan
cl.setText(null);
toolBar = new ToolBar(composite, SWT.FLAT);
- toolBar.setVisible(false); // hide by default
final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH, 0);
- toolItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(
- /* IWorkbenchGraphicConstants */"IMG_LCL_VIEW_MENU")); //$NON-NLS-1$
+ Utilities.setMenuImage(toolItem);
toolItem.setToolTipText(CompareMessages.CompareContentViewerSwitchingPane_switchButtonTooltip);
toolItem.addSelectionListener(new SelectionAdapter() {
@Override
@@ -137,18 +137,21 @@ public class CompareContentViewerSwitchingPane extends CompareViewerSwitchingPan
showMenu();
}
});
+ toolBar.setVisible(false); // hide by default
+ RowDataFactory.swtDefaults().exclude(true).applyTo(toolBar);
labelOptimized = new CLabel(composite, SWT.NONE);
labelOptimized.setToolTipText(CompareMessages.CompareContentViewerSwitchingPane_optimizedTooltip);
labelOptimized.setImage(CompareUIPlugin.getImageDescriptor(
OPTIMIZED_INFO_IMAGE_NAME).createImage());
- labelOptimized.setVisible(false); // hide by default
labelOptimized.addDisposeListener(e -> {
Image img = labelOptimized.getImage();
if ((img != null) && (!img.isDisposed())) {
img.dispose();
}
});
+ labelOptimized.setVisible(false); // hide by default
+ RowDataFactory.swtDefaults().exclude(true).applyTo(labelOptimized);
recomputeLink = new Link(composite, SWT.NONE);
recomputeLink.setText(CompareMessages.CompareContentViewerSwitchingPane_optimizedLinkLabel);
@@ -162,19 +165,28 @@ public class CompareContentViewerSwitchingPane extends CompareViewerSwitchingPan
*/
IPreferenceStore preferenceStore = CompareUIPlugin.getDefault().getPreferenceStore();
boolean wasDisabled = preferenceStore.getBoolean(ComparePreferencePage.CAPPING_DISABLED);
- ComparePlugin.getDefault().setCappingDisabled(true);
+ CompareSettings.getDefault().setCappingDisabled(true);
preferenceStore.setValue(ComparePreferencePage.CAPPING_DISABLED, true);
try {
+ // Setting this property makes the TextMergeViewer re-compute the diff and
+ // refresh itself.
getCompareConfiguration().setProperty(DISABLE_CAPPING_TEMPORARILY, Boolean.TRUE);
+ // Hide the link now.
+ labelOptimized.setVisible(false);
+ recomputeLink.setVisible(false);
+ ((RowData) labelOptimized.getLayoutData()).exclude = true;
+ ((RowData) recomputeLink.getLayoutData()).exclude = true;
+ composite.requestLayout();
} finally {
if (!wasDisabled) {
- ComparePlugin.getDefault().setCappingDisabled(false);
+ CompareSettings.getDefault().setCappingDisabled(false);
preferenceStore.setValue(ComparePreferencePage.CAPPING_DISABLED, false);
}
}
}
});
recomputeLink.setVisible(false);
+ RowDataFactory.swtDefaults().exclude(true).applyTo(recomputeLink);
return composite;
}
@@ -192,12 +204,16 @@ public class CompareContentViewerSwitchingPane extends CompareViewerSwitchingPan
return;
ViewerDescriptor[] vd = CompareUIPlugin.getDefault()
.findContentViewerDescriptor(getViewer(), getInput(), getCompareConfiguration());
- toolBar.setVisible(vd != null && vd.length > 1);
+ boolean toolbarVisible = vd != null && vd.length > 1;
+ toolBar.setVisible(toolbarVisible);
+ ((RowData) toolBar.getLayoutData()).exclude = !toolbarVisible;
CompareConfiguration cc = getCompareConfiguration();
Boolean isOptimized = (Boolean) cc.getProperty(OPTIMIZED_ALGORITHM_USED);
boolean optimizedVisible = isOptimized != null && isOptimized.booleanValue();
labelOptimized.setVisible(optimizedVisible);
recomputeLink.setVisible(optimizedVisible);
+ ((RowData) labelOptimized.getLayoutData()).exclude = !optimizedVisible;
+ ((RowData) recomputeLink.getLayoutData()).exclude = !optimizedVisible;
}
private void showMenu() {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java
index ed303baf1..1611e62b1 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stefan Dirix (sdirix@eclipsesource.com) - Bug 473847: Minimum E4 Compatibility of Compare
*******************************************************************************/
package org.eclipse.compare.internal;
@@ -34,6 +35,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.FrameworkUtil;
/**
* This is a dialog that can host a {@link CompareEditorInput}.
@@ -198,7 +200,8 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
@Override
protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings compareSettings = CompareUIPlugin.getDefault().getDialogSettings();
+ IDialogSettings compareSettings = PlatformUI
+ .getDialogSettingsProvider(FrameworkUtil.getBundle(CompareDialog.class)).getDialogSettings();
String sectionName = this.getClass().getName();
IDialogSettings dialogSettings = compareSettings.getSection(sectionName);
if (dialogSettings == null) {
@@ -211,7 +214,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- if (getHelpContextId() != null)
+ if (PlatformUI.isWorkbenchRunning() && getHelpContextId() != null)
PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, getHelpContextId());
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
index 735ce130a..c02f3a56b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
@@ -454,7 +454,11 @@ public class CompareEditor extends EditorPart
}
}
fPageBook.showPage(fControl);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fControl, ICompareContextIds.COMPARE_EDITOR);
+
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(fControl, ICompareContextIds.COMPARE_EDITOR);
+ }
+
if (isActive()) {
setFocus();
}
@@ -521,9 +525,7 @@ public class CompareEditor extends EditorPart
try {
operation.run(progressMonitor);
firePropertyChange(PROP_DIRTY);
- } catch (InterruptedException x) {
- // NeedWork
- } catch (OperationCanceledException x) {
+ } catch (InterruptedException | OperationCanceledException x) {
// NeedWork
} catch (InvocationTargetException x) {
String title= Utilities.getString("CompareEditor.saveError.title"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
index 1d54e91c2..870e8385c 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
@@ -53,22 +53,20 @@ public class CompareEditorContributor extends EditorActionBarContributor {
public CompareEditorContributor() {
ResourceBundle bundle= CompareUI.getResourceBundle();
- IWorkbenchHelpSystem helpSystem= PlatformUI.getWorkbench().getHelpSystem();
-
fIgnoreWhitespace= ChangePropertyAction.createIgnoreWhiteSpaceAction(bundle, null);
- helpSystem.setHelp(fIgnoreWhitespace, ICompareContextIds.IGNORE_WHITESPACE_ACTION);
-
fNext= new NavigationAction(bundle, true);
- helpSystem.setHelp(fNext, ICompareContextIds.GLOBAL_NEXT_DIFF_ACTION);
-
fPrevious= new NavigationAction(bundle, false);
- helpSystem.setHelp(fPrevious, ICompareContextIds.GLOBAL_PREVIOUS_DIFF_ACTION);
-
fToolbarNext= new NavigationAction(bundle, true);
- helpSystem.setHelp(fToolbarNext, ICompareContextIds.NEXT_DIFF_ACTION);
-
fToolbarPrevious= new NavigationAction(bundle, false);
- helpSystem.setHelp(fToolbarPrevious, ICompareContextIds.PREVIOUS_DIFF_ACTION);
+
+ if (PlatformUI.isWorkbenchRunning()) {
+ IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
+ helpSystem.setHelp(fIgnoreWhitespace, ICompareContextIds.IGNORE_WHITESPACE_ACTION);
+ helpSystem.setHelp(fNext, ICompareContextIds.GLOBAL_NEXT_DIFF_ACTION);
+ helpSystem.setHelp(fPrevious, ICompareContextIds.GLOBAL_PREVIOUS_DIFF_ACTION);
+ helpSystem.setHelp(fToolbarNext, ICompareContextIds.NEXT_DIFF_ACTION);
+ helpSystem.setHelp(fToolbarPrevious, ICompareContextIds.PREVIOUS_DIFF_ACTION);
+ }
}
@Override
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java
index b5d2d88e8..9bb3d5dd7 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java
@@ -40,7 +40,7 @@ public class CompareFilterDescriptor {
private ResourceBundle fResourceBundle;
private ImageDescriptor fImageDescriptor;
- private class ConfigurationKeysEnumeration implements Enumeration<String> {
+ private static class ConfigurationKeysEnumeration implements Enumeration<String> {
private String[] keySet;
private int cursor = 0;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareHandlerService.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareHandlerService.java
index 564726cdb..a25353e7f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareHandlerService.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareHandlerService.java
@@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stefan Dirix (sdirix@eclipsesource.com) - Bug 473847: Minimum E4 Compatibility of Compare
*******************************************************************************/
package org.eclipse.compare.internal;
@@ -44,6 +45,10 @@ public class CompareHandlerService {
if (service != null)
return new CompareHandlerService(container, null);
}
+ if (!PlatformUI.isWorkbenchRunning() && shell != null) {
+ Expression e = new ActiveShellExpression(shell);
+ return new CompareHandlerService(container, e);
+ }
if (container.getWorkbenchPart() == null && shell != null) {
// We're in a dialog so we can use an active shell expression
IHandlerService service = PlatformUI.getWorkbench().getService(IHandlerService.class);
@@ -92,7 +97,7 @@ public class CompareHandlerService {
if (service != null)
fHandlerService = service;
}
- if (fHandlerService == null && fContainer.getWorkbenchPart() == null && fExpression != null) {
+ if (PlatformUI.isWorkbenchRunning() && fHandlerService == null && fContainer.getWorkbenchPart() == null && fExpression != null) {
// We're in a dialog so we can use an active shell expression
IHandlerService service = PlatformUI.getWorkbench().getService(IHandlerService.class);
if (service != null) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties
index d40c24459..8cdcff78b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2015 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
@@ -49,7 +49,7 @@ TextMergeViewer_direction_incoming= incoming
TextMergeViewer_direction_conflicting= conflicting
TextMergeViewer_diffType_format= {0} {1}
-TextMergeViewer_accessible_left=Left: {0}
+TextMergeViewer_accessible_left={0} Left: {1}
TextMergeViewer_diffDescription_noDiff_format= no diff
TextMergeViewer_diffDescription_diff_format= {0} #{1} (Left: {2}, Right: {3})
@@ -77,7 +77,7 @@ TextMergeViewer_17=Do &nothing
TextMergeViewer_atEnd_message= End of document reached. Continue from beginning?
TextMergeViewer_atBeginning_title= Go to Previous Difference
-TextMergeViewer_accessible_right=Right: {0}
+TextMergeViewer_accessible_right={0} Right: {1}
TextMergeViewer_atBeginning_message= Beginning of document reached. Continue from end?
TextMergeViewer_accessible_ancestor=Ancestor: {0}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
index 133adb208..a0e0e9452 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
@@ -27,7 +27,7 @@ import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.IEncodedStreamContentAccessor;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
-import org.eclipse.compare.internal.core.ComparePlugin;
+import org.eclipse.compare.internal.core.CompareSettings;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.compare.structuremergeviewer.Differencer;
import org.eclipse.jface.dialogs.Dialog;
@@ -207,7 +207,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
editors.forEach(FieldEditor::store);
fOverlayStore.propagate();
- ComparePlugin.getDefault().setCappingDisabled(
+ CompareSettings.getDefault().setCappingDisabled(
getPreferenceStore().getBoolean(
ComparePreferencePage.CAPPING_DISABLED));
return true;
@@ -249,8 +249,9 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
@Override
protected Control createContents(Composite parent) {
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.COMPARE_PREFERENCE_PAGE);
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.COMPARE_PREFERENCE_PAGE);
+ }
fOverlayStore.load();
fOverlayStore.start();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareResourceFilter.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareResourceFilter.java
index 94613e2f1..34d8c221b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareResourceFilter.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareResourceFilter.java
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.compare.internal;
+import java.text.MessageFormat;
import java.util.StringTokenizer;
import org.eclipse.core.resources.IResource;
@@ -20,9 +21,6 @@ import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
-import com.ibm.icu.text.MessageFormat;
-
-
public class CompareResourceFilter {
private static final char[][] NO_CHAR_CHAR= new char[0][];
@@ -40,13 +38,13 @@ public class CompareResourceFilter {
public boolean filter(String path0, boolean folder, boolean isArchive) {
if (!folder && fExtraResourceFileFilters != null) {
char[] name= path0.toCharArray();
- for (int i= 0, l= fExtraResourceFileFilters.length; i < l; i++)
- if (match(fExtraResourceFileFilters[i], name, true))
+ for (char[] filter : fExtraResourceFileFilters)
+ if (match(filter, name, true))
return true;
}
if (folder && fExtraResourceFolderFilters != null) {
- for (int i= 0, l= fExtraResourceFolderFilters.length; i < l; i++)
- if (fExtraResourceFolderFilters[i].equals(path0))
+ for (String filter : fExtraResourceFolderFilters)
+ if (filter.equals(path0))
return true;
}
return false;
@@ -81,25 +79,23 @@ public class CompareResourceFilter {
fExtraResourceFolderFilters= null;
} else {
int fileCount= 0, folderCount= 0;
- for (int i= 0, l= filters.length; i < l; i++) {
- char[] f= filters[i];
- if (f.length == 0)
+ for (char[] filter : filters) {
+ if (filter.length == 0)
continue;
- if (f[f.length - 1] == '/')
+ if (filter[filter.length - 1] == '/')
folderCount++;
else
fileCount++;
}
fExtraResourceFileFilters= new char[fileCount][];
fExtraResourceFolderFilters= new String[folderCount];
- for (int i= 0, l= filters.length; i < l; i++) {
- char[] f= filters[i];
- if (f.length == 0)
+ for (char[] filter : filters) {
+ if (filter.length == 0)
continue;
- if (f[f.length - 1] == '/')
- fExtraResourceFolderFilters[--folderCount]= new String(subarray(f, 0, f.length - 1));
+ if (filter[filter.length - 1] == '/')
+ fExtraResourceFolderFilters[--folderCount]= new String(subarray(filter, 0, filter.length - 1));
else
- fExtraResourceFileFilters[--fileCount]= f;
+ fExtraResourceFileFilters[--fileCount]= filter;
}
}
}
@@ -127,7 +123,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * pattern = { '?', 'b', '*' } name = { 'a', 'b', 'c' , 'd' } isCaseSensitive = true result => true
+ * pattern = { '?', 'b', '*' } name = { 'a', 'b', 'c' , 'd' } isCaseSensitive = true result =&gt; true
* </pre>
*
*
@@ -135,7 +131,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * pattern = { '?', 'b', '?' } name = { 'a', 'b', 'c' , 'd' } isCaseSensitive = true result => false
+ * pattern = { '?', 'b', '?' } name = { 'a', 'b', 'c' , 'd' } isCaseSensitive = true result =&gt; false
* </pre>
*
*
@@ -143,7 +139,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * pattern = { 'b', '*' } name = { 'a', 'b', 'c' , 'd' } isCaseSensitive = true result => false
+ * pattern = { 'b', '*' } name = { 'a', 'b', 'c' , 'd' } isCaseSensitive = true result =&gt; false
* </pre>
*
*
@@ -179,7 +175,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * pattern = { '?', 'b', '*' } patternStart = 1 patternEnd = 3 name = { 'a', 'b', 'c' , 'd' } nameStart = 1 nameEnd = 4 isCaseSensitive = true result => true
+ * pattern = { '?', 'b', '*' } patternStart = 1 patternEnd = 3 name = { 'a', 'b', 'c' , 'd' } nameStart = 1 nameEnd = 4 isCaseSensitive = true result =&gt; true
* </pre>
*
*
@@ -187,7 +183,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * pattern = { '?', 'b', '*' } patternStart = 1 patternEnd = 2 name = { 'a', 'b', 'c' , 'd' } nameStart = 1 nameEnd = 2 isCaseSensitive = true result => false
+ * pattern = { '?', 'b', '*' } patternStart = 1 patternEnd = 2 name = { 'a', 'b', 'c' , 'd' } nameStart = 1 nameEnd = 2 isCaseSensitive = true result =&gt; false
* </pre>
*
*
@@ -278,7 +274,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * divider = 'b' array = { 'a' , 'b', 'b', 'a', 'b', 'a' } result => { { 'a' }, { }, { 'a' }, { 'a' } }
+ * divider = 'b' array = { 'a' , 'b', 'b', 'a', 'b', 'a' } result =&gt; { { 'a' }, { }, { 'a' }, { 'a' } }
* </pre>
*
*
@@ -286,7 +282,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * divider = 'c' array = { 'a' , 'b', 'b', 'a', 'b', 'a' } result => { { 'a', 'b', 'b', 'a', 'b', 'a' } }
+ * divider = 'c' array = { 'a' , 'b', 'b', 'a', 'b', 'a' } result =&gt; { { 'a', 'b', 'b', 'a', 'b', 'a' } }
* </pre>
*
*
@@ -294,7 +290,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * divider = 'b' array = { 'a' , ' ', 'b', 'b', 'a', 'b', 'a' } result => { { 'a' }, { }, { 'a' }, { 'a' } }
+ * divider = 'b' array = { 'a' , ' ', 'b', 'b', 'a', 'b', 'a' } result =&gt; { { 'a' }, { }, { 'a' }, { 'a' } }
* </pre>
*
*
@@ -302,7 +298,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * divider = 'c' array = { ' ', ' ', 'a' , 'b', 'b', 'a', 'b', 'a', ' ' } result => { { 'a', 'b', 'b', 'a', 'b', 'a' } }
+ * divider = 'c' array = { ' ', ' ', 'a' , 'b', 'b', 'a', 'b', 'a', ' ' } result =&gt; { { 'a', 'b', 'b', 'a', 'b', 'a' } }
* </pre>
*
*
@@ -360,7 +356,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * array = { 'a' , 'b' } start = 0 end = 1 result => { 'a' }
+ * array = { 'a' , 'b' } start = 0 end = 1 result =&gt; { 'a' }
* </pre>
*
*
@@ -368,7 +364,7 @@ public class CompareResourceFilter {
* <li>
*
* <pre>
- * array = { 'a', 'b' } start = 0 end = -1 result => { 'a' , 'b' }
+ * array = { 'a', 'b' } start = 0 end = -1 result =&gt; { 'a' , 'b' }
* </pre>
*
*
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java
index 1593d8577..7624b7eea 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java
@@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stefan Dirix (sdirix@eclipsesource.com) - Bug 473847: Minimum E4 Compatibility of Compare
*******************************************************************************/
package org.eclipse.compare.internal;
@@ -43,7 +44,6 @@ import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.ui.PlatformUI;
public class CompareStructureViewerSwitchingPane extends
CompareViewerSwitchingPane {
@@ -111,8 +111,7 @@ public class CompareStructureViewerSwitchingPane extends
toolBar = new ToolBar(composite, SWT.FLAT);
toolBar.setVisible(false); // hide by default
final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH, 0);
- toolItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(
- /* IWorkbenchGraphicConstants */"IMG_LCL_VIEW_MENU")); //$NON-NLS-1$
+ Utilities.setMenuImage(toolItem);
toolItem
.setToolTipText(CompareMessages.CompareStructureViewerSwitchingPane_switchButtonTooltip);
toolItem.addSelectionListener(new SelectionAdapter() {
@@ -173,7 +172,7 @@ public class CompareStructureViewerSwitchingPane extends
// add others
for (ViewerDescriptor vdi : vd) {
label = vdi.getLabel();
- if (label == null || label.equals("")) { //$NON-NLS-1$
+ if (label == null || label.isEmpty()) {
String l = CompareUIPlugin.getDefault().findStructureTypeNameOrType((ICompareInput) getInput(), vdi, getCompareConfiguration());
if (l == null)
// couldn't figure out the label, skip the viewer
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
index a26bfe772..276d0ca70 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
@@ -12,6 +12,7 @@
* IBM Corporation - initial API and implementation
* Carsten Pfeiffer <carsten.pfeiffer@gebit.de> - CompareUIPlugin.getCommonType() returns null if left or right side is not available - https://bugs.eclipse.org/311843
* Stefan Xenos <sxenos@gmail.com> (Google) - bug 448968 - Add diagnostic logging
+ * Stefan Dirix <sdirix@eclipsesource.com> - bug 473847: Minimum E4 Compatibility of Compare
*******************************************************************************/
package org.eclipse.compare.internal;
@@ -23,6 +24,7 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
@@ -41,7 +43,7 @@ import org.eclipse.compare.IResourceProvider;
import org.eclipse.compare.IStreamContentAccessor;
import org.eclipse.compare.IStreamMerger;
import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.internal.core.ComparePlugin;
+import org.eclipse.compare.internal.core.CompareSettings;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.compare.structuremergeviewer.IStructureCreator;
import org.eclipse.compare.structuremergeviewer.StructureDiffViewer;
@@ -237,13 +239,13 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
private static CompareUIPlugin fgComparePlugin;
/** Maps type to icons */
- private static Map<String, Image> fgImages= new Hashtable<String, Image>(10);
+ private static Map<String, Image> fgImages= new Hashtable<>(10);
/** Maps type to ImageDescriptors */
- private static Map<String, ImageDescriptor> fgImageDescriptors= new Hashtable<String, ImageDescriptor>(10);
+ private static Map<String, ImageDescriptor> fgImageDescriptors= new Hashtable<>(10);
/** Maps ImageDescriptors to Images */
- private static Map<ImageDescriptor, Image> fgImages2= new Hashtable<ImageDescriptor, Image>(10);
+ private static Map<ImageDescriptor, Image> fgImages2= new Hashtable<>(10);
- private static List<Image> fgDisposeOnShutdownImages= new ArrayList<Image>();
+ private static List<Image> fgDisposeOnShutdownImages= new ArrayList<>();
private ResourceBundle fResourceBundle;
@@ -284,7 +286,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
debugRegistration = context.registerService(DebugOptionsListener.class, Policy.DEBUG_OPTIONS_LISTENER,
properties);
- ComparePlugin.getDefault().setCappingDisabled(
+ CompareSettings.getDefault().setCappingDisabled(
getPreferenceStore().getBoolean(
ComparePreferencePage.CAPPING_DISABLED));
}
@@ -450,10 +452,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
}
public static IWorkbench getActiveWorkbench() {
- CompareUIPlugin plugin= getDefault();
- if (plugin == null)
- return null;
- return plugin.getWorkbench();
+ return PlatformUI.getWorkbench();
}
public static IWorkbenchWindow getActiveWorkbenchWindow() {
@@ -478,17 +477,23 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
}
/**
- * Returns the SWT Shell of the active workbench window or <code>null</code> if
+ * If the workbench is running returns the SWT Shell of the active workbench window or <code>null</code> if
* no workbench window is active.
*
- * @return the SWT Shell of the active workbench window, or <code>null</code> if
- * no workbench window is active
+ * If the workbench is not running, returns the shell of the default display.
+ *
+ * @return If the workbench is running, returns the SWT Shell of the active workbench window, or <code>null</code> if
+ * no workbench window is active. Otherwise returns the shell of the default display.
*/
public static Shell getShell() {
- IWorkbenchWindow window = getActiveWorkbenchWindow();
- if (window == null)
- return null;
- return window.getShell();
+ if(PlatformUI.isWorkbenchRunning()){
+ IWorkbenchWindow window = getActiveWorkbenchWindow();
+ if (window == null)
+ return null;
+ return window.getShell();
+ }
+
+ return Display.getDefault().getActiveShell();
}
/**
@@ -609,10 +614,12 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
public boolean compareResultOK(CompareEditorInput input, IRunnableContext context) {
final Shell shell= getShell();
try {
- // run operation in separate thread and make it cancelable
- if (context == null)
- context = PlatformUI.getWorkbench().getProgressService();
- context.run(true, true, input);
+ // run operation in context if possible
+ if (context != null) {
+ context.run(true, true, input);
+ } else {
+ Utilities.executeRunnable(input);
+ }
String message= input.getMessage();
if (message != null) {
@@ -694,7 +701,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
if (image == null) {
if (fgComparePlugin != null) {
if (ITypedElement.FOLDER_TYPE.equals(type)) {
- image= getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
+ image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
//image= SharedImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
} else {
image= createWorkbenchImage(type);
@@ -729,6 +736,9 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
public static Image getImage(IAdaptable adaptable) {
if (adaptable != null) {
IWorkbenchAdapter o= Adapters.adapt(adaptable, IWorkbenchAdapter.class);
+ if (o == null) {
+ return null;
+ }
ImageDescriptor id= o.getImageDescriptor(adaptable);
if (id != null) {
Image image= fgImages2.get(id);
@@ -749,7 +759,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
}
private static Image createWorkbenchImage(String type) {
- IEditorRegistry er= getDefault().getWorkbench().getEditorRegistry();
+ IEditorRegistry er= PlatformUI.getWorkbench().getEditorRegistry();
ImageDescriptor id= er.getImageDescriptor("foo." + type); //$NON-NLS-1$
return id.createImage();
}
@@ -900,7 +910,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
}
ArrayList<CompareFilterDescriptor> list = new ArrayList<>(result);
- Collections.sort(list, (left, right) -> left.getFilterId().compareTo(right.getFilterId()));
+ Collections.sort(list, Comparator.comparing(CompareFilterDescriptor::getFilterId));
return result.toArray(new CompareFilterDescriptor[result.size()]);
}
@@ -967,10 +977,8 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
String rightType = guessType(input.getRight());
if (leftType != null || rightType != null) {
- boolean right_text = rightType != null
- && ITypedElement.TEXT_TYPE.equals(rightType);
- boolean left_text = leftType != null
- && ITypedElement.TEXT_TYPE.equals(leftType);
+ boolean right_text = ITypedElement.TEXT_TYPE.equals(rightType);
+ boolean left_text = ITypedElement.TEXT_TYPE.equals(leftType);
if ((rightType != null && !right_text)
|| (leftType != null && !left_text)) {
result.add(BINARY_TYPE);
@@ -1057,10 +1065,8 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
String rightType= guessType(input.getRight());
if (leftType != null || rightType != null) {
- boolean right_text = rightType != null
- && ITypedElement.TEXT_TYPE.equals(rightType);
- boolean left_text = leftType != null
- && ITypedElement.TEXT_TYPE.equals(leftType);
+ boolean right_text = ITypedElement.TEXT_TYPE.equals(rightType);
+ boolean left_text = ITypedElement.TEXT_TYPE.equals(leftType);
initializeRegistries();
if ((rightType != null && !right_text)
|| (leftType != null && !left_text)) {
@@ -1278,9 +1284,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
return ITypedElement.UNKNOWN_TYPE;
}
return ITypedElement.TEXT_TYPE;
- } catch (CoreException ex) {
- // be silent and return UNKNOWN_TYPE
- } catch (IOException ex) {
+ } catch (CoreException | IOException ex) {
// be silent and return UNKNOWN_TYPE
} finally {
if (is != null) {
@@ -1382,13 +1386,16 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
}
private void internalOpenDialog(final CompareEditorInput input) {
- Runnable runnable = () -> {
- CompareDialog dialog = new CompareDialog(PlatformUI
- .getWorkbench().getModalDialogShellProvider()
- .getShell(), input);
+ syncExec(() -> {
+ Shell shell;
+ if (PlatformUI.isWorkbenchRunning()) {
+ shell = PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
+ } else {
+ shell = Display.getDefault().getActiveShell();
+ }
+ CompareDialog dialog = new CompareDialog(shell, input);
dialog.open();
- };
- syncExec(runnable);
+ });
}
private void syncExec(Runnable runnable) {
@@ -1413,9 +1420,9 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
* @return an array of all dirty editor parts.
*/
public static IEditorPart[] getDirtyEditors() {
- Set<IEditorInput> inputs= new HashSet<IEditorInput>();
- List<IEditorPart> result= new ArrayList<IEditorPart>(0);
- IWorkbench workbench= getDefault().getWorkbench();
+ Set<IEditorInput> inputs= new HashSet<>();
+ List<IEditorPart> result= new ArrayList<>(0);
+ IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow[] windows= workbench.getWorkbenchWindows();
for (IWorkbenchWindow window : windows) {
IWorkbenchPage[] pages = window.getPages();
@@ -1492,10 +1499,8 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
String rightType= guessType(input.getRight());
if (leftType != null || rightType != null) {
- boolean right_text = rightType != null
- && ITypedElement.TEXT_TYPE.equals(rightType);
- boolean left_text = leftType != null
- && ITypedElement.TEXT_TYPE.equals(leftType);
+ boolean right_text = ITypedElement.TEXT_TYPE.equals(rightType);
+ boolean left_text = ITypedElement.TEXT_TYPE.equals(leftType);
initializeRegistries();
if ((rightType != null && !right_text)
|| (leftType != null && !left_text)) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java
index 805c090f5..8f1d0d55d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2017 Aleksandra Wozniak and others.
+ * Copyright (c) 2008, 2021 Aleksandra Wozniak and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -46,6 +46,7 @@ import org.eclipse.swt.dnd.DropTarget;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.DropTargetListener;
import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.TransferData;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -59,10 +60,12 @@ import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.part.ResourceTransfer;
+import org.osgi.framework.FrameworkUtil;
/**
* This is a dialog that can invoke the compare editor on chosen files.
@@ -73,7 +76,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
private int MIN_HEIGHT_WITH_ANCESTOR = 320;
private int MIN_HEIGHT_WITHOUT_ANCESTOR = 238;
- private class FileTextDragListener implements DragSourceListener {
+ private static class FileTextDragListener implements DragSourceListener {
private ContentTypeElement element;
@@ -98,7 +101,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
}
}
- private class FileTextDropListener implements DropTargetListener {
+ private static class FileTextDropListener implements DropTargetListener {
private ContentTypeElement element;
private ResourceTransfer resourceTransfer;
@@ -120,10 +123,10 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
event.detail = DND.DROP_NONE;
}
- for (int i = 0; i < event.dataTypes.length; i++) {
- if (resourceTransfer.isSupportedType(event.dataTypes[i])
- || textTransfer.isSupportedType(event.dataTypes[i])) {
- event.currentDataType = event.dataTypes[i];
+ for (TransferData dataType : event.dataTypes) {
+ if (resourceTransfer.isSupportedType(dataType)
+ || textTransfer.isSupportedType(dataType)) {
+ event.currentDataType = dataType;
if (event.detail != DND.DROP_COPY)
event.detail = DND.DROP_NONE;
break;
@@ -178,7 +181,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
}
- private abstract class ContentTypeElement {
+ private abstract static class ContentTypeElement {
private Button radioButton;
protected Button mainButton;
@@ -569,12 +572,10 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
} catch (CoreException e) { // in case .project file or folder has been deleted
IPath projectPath = stateLocation.append(TMP_PROJECT_NAME);
projectPath.toFile().mkdirs();
- FileOutputStream output = new FileOutputStream(
- projectPath.append(".project").toOSString()); //$NON-NLS-1$
- try {
+ try (FileOutputStream output = new FileOutputStream(
+ projectPath.append(".project").toOSString()) //$NON-NLS-1$
+ ) {
output.write(TMP_PROJECT_FILE.getBytes());
- } finally {
- output.close();
}
project.open(null);
}
@@ -813,7 +814,9 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
@Override
protected IDialogSettings getDialogBoundsSettings() {
String sectionName = getClass().getName() + "_dialogBounds"; //$NON-NLS-1$
- IDialogSettings settings = CompareUIPlugin.getDefault().getDialogSettings();
+ IDialogSettings settings = PlatformUI
+ .getDialogSettingsProvider(FrameworkUtil.getBundle(CompareWithOtherResourceDialog.class))
+ .getDialogSettings();
IDialogSettings section = settings.getSection(sectionName);
if (section == null)
section = settings.addNewSection(sectionName);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java
index bfcf86823..224638212 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java
@@ -26,7 +26,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
/**
* This is a temporary replacement for CompareWithOtherResourceAction which was
- * available from "Compare With > Other Resource...". See bug 264498.
+ * available from "Compare With &gt; Other Resource...". See bug 264498.
*/
public class CompareWithOtherResourceHandler extends AbstractHandler {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java
index f4d70a4e9..e90fdab53 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java
@@ -59,10 +59,8 @@ public class DiffImageDescriptor extends CompositeImageDescriptor {
}
private int calculateHash(ImageData baseImageData) {
- byte[] data = baseImageData.data;
int hash = baseImageData.width + baseImageData.height;
- for (int i = 0; i < data.length; i++) {
- byte b = data[i];
+ for (byte b : baseImageData.data) {
hash >>>= 1;
hash ^= b;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
index d1ce02c0b..b375e7bcd 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.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
@@ -43,7 +43,7 @@ public class DocLineComparator implements ITokenComparator {
/**
* Creates a <code>DocLineComparator</code> for the given document range.
* ignoreWhiteSpace controls whether comparing lines (in method
- * <code>rangesEqual<code>) should ignore whitespace.
+ * <code>rangesEqual</code>) should ignore whitespace.
*
* @param document the document from which the lines are taken
* @param region if non-<code>null</code> only lines within this range are taken
@@ -57,7 +57,7 @@ public class DocLineComparator implements ITokenComparator {
/**
* Creates a <code>DocLineComparator</code> for the given document range.
* ignoreWhiteSpace controls whether comparing lines (in method
- * <code>rangesEqual<code>) should ignore whitespace. Compare filters may be used
+ * <code>rangesEqual</code>) should ignore whitespace. Compare filters may be used
* to affect the detection of line differences.
*
* @param document
@@ -175,12 +175,12 @@ public class DocLineComparator implements ITokenComparator {
int tlen= getTokenLength(thisIndex);
int olen= other.getTokenLength(otherIndex);
- if (fCompareFilters != null && fCompareFilters.length > 0) {
- String[] linesToCompare = extract(thisIndex, otherIndex, other, true);
- return linesToCompare[0].equals(linesToCompare[1]);
- } else if (tlen == olen) {
+ if (tlen == olen) {
String[] linesToCompare = extract(thisIndex, otherIndex, other, false);
return linesToCompare[0].equals(linesToCompare[1]);
+ } else if (fCompareFilters != null && fCompareFilters.length > 0) {
+ String[] linesToCompare = extract(thisIndex, otherIndex, other, true);
+ return linesToCompare[0].equals(linesToCompare[1]);
}
}
return false;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java
index 0bbfb7251..b68ce8fa9 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java
@@ -24,6 +24,10 @@ import org.eclipse.compare.IEncodedStreamContentAccessor;
import org.eclipse.compare.IStreamContentAccessor;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.ResourceNode;
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.filebuffers.ITextFileBufferManager;
+import org.eclipse.core.filebuffers.LocationKind;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFileState;
import org.eclipse.core.runtime.CoreException;
@@ -52,7 +56,7 @@ public class EditionAction extends BaseCompareAction {
* Implements the IStreamContentAccessor and ITypedElement protocols
* for a Document.
*/
- class DocumentBufferNode implements ITypedElement, IEncodedStreamContentAccessor {
+ static class DocumentBufferNode implements ITypedElement, IEncodedStreamContentAccessor {
private static final String UTF_16= "UTF-16"; //$NON-NLS-1$
private IDocument fDocument;
private IFile fFile;
@@ -212,14 +216,30 @@ public class EditionAction extends BaseCompareAction {
try {
String text= Utilities.readString(sa);
document.replace(0, document.getLength(), text);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- } catch (BadLocationException e) {
+ } catch (CoreException | BadLocationException e) {
throw new InvocationTargetException(e);
}
}
private IDocument getDocument(IFile file) {
+ if (file == null) {
+ return null;
+ }
+
+ // first try FileBuffer API
+ ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
+ ITextFileBuffer buffer = bufferManager.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE);
+ if (buffer != null) {
+ IDocument document = buffer.getDocument();
+ if (document != null) {
+ return document;
+ }
+ }
+
+ // if unsuccessful, try open editors
+ if (!PlatformUI.isWorkbenchRunning()) {
+ return null;
+ }
IWorkbench wb= PlatformUI.getWorkbench();
if (wb == null)
return null;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java
index c143352ff..15affc0b7 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java
@@ -24,7 +24,7 @@ import org.eclipse.swt.widgets.ScrollBar;
/**
* A <code>Canvas</code> showing a single centered SWT <code>Image</code>.
- * If the <code>Image</code> is larger than the <code>Canvas<code>,
+ * If the <code>Image</code> is larger than the <code>Canvas</code>,
* <code>Scrollbars</code> will appear.
*/
class ImageCanvas extends Canvas {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
index 50d8da27a..ced347d45 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
@@ -44,7 +44,9 @@ public class ImageMergeViewer extends ContentMergeViewer {
public ImageMergeViewer(Composite parent, int styles, CompareConfiguration mp) {
super(styles, ResourceBundle.getBundle(BUNDLE_NAME), mp);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.IMAGE_COMPARE_VIEW);
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.IMAGE_COMPARE_VIEW);
+ }
buildControl(parent);
String title= Utilities.getString(getResourceBundle(), "title"); //$NON-NLS-1$
@@ -102,8 +104,10 @@ public class ImageMergeViewer extends ContentMergeViewer {
}
}
- canvas.setImage(image);
if (image != null) {
+ Image nonNullImage = image;
+ canvas.setImage(nonNullImage);
+ canvas.addDisposeListener(e -> nonNullImage.dispose());
canvas.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
} else {
canvas.setBackground(null);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java
index 98d1faefb..a16eb064f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java
@@ -12,6 +12,7 @@
* IBM Corporation - initial API and implementation
* Max Weninger (max.weninger@windriver.com) - Bug 131895 [Edit] Undo in compare
* Max Weninger (max.weninger@windriver.com) - Bug 72936 [Viewers] Show line numbers in comparision
+ * Stefan Dirix (sdirix@eclipsesource.com) - Bug 473847: Minimum E4 Compatibility of Compare
*******************************************************************************/
package org.eclipse.compare.internal;
@@ -64,7 +65,6 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
@@ -495,7 +495,7 @@ public class MergeSourceViewer implements ISelectionChangedListener,
fContainer.registerContextMenu(menu, getSourceViewer());
// for listening to editor show/hide line number preference value
- fPreferenceChangeListener= event -> MergeSourceViewer.this.handlePropertyChangeEvent(event);
+ fPreferenceChangeListener= MergeSourceViewer.this::handlePropertyChangeEvent;
EditorsUI.getPreferenceStore().addPropertyChangeListener(fPreferenceChangeListener);
fShowLineNumber= EditorsUI.getPreferenceStore().getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER);
if(fShowLineNumber){
@@ -555,10 +555,6 @@ public class MergeSourceViewer implements ISelectionChangedListener,
StyledText c= getSourceViewer().getTextWidget();
if (c != null) {
c.setEnabled(enabled);
- Display d= c.getDisplay();
- if (enabled) {
- c.setBackground(d.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- }
}
}
}
@@ -853,8 +849,7 @@ public class MergeSourceViewer implements ISelectionChangedListener,
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator("text")); //$NON-NLS-1$
- for (Iterator<IAction> iterator = textActions.iterator(); iterator.hasNext();) {
- IAction action = iterator.next();
+ for (IAction action : textActions) {
menu.add(action);
}
@@ -1041,7 +1036,7 @@ public class MergeSourceViewer implements ISelectionChangedListener,
}
private IOperationHistory getHistory() {
- if (PlatformUI.getWorkbench() == null) {
+ if (!PlatformUI.isWorkbenchRunning()) {
return null;
}
return PlatformUI.getWorkbench().getOperationSupport()
@@ -1054,7 +1049,7 @@ public class MergeSourceViewer implements ISelectionChangedListener,
// when the undo history changes. It could be localized to UNDO and REDO.
IUndoContext context = getUndoContext();
if (context != null && event.getOperation().hasContext(context)) {
- Display.getDefault().asyncExec(() -> updateContentDependantActions());
+ Display.getDefault().asyncExec(this::updateContentDependantActions);
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
index d1e65e45a..be6ff9a38 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -25,6 +25,7 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.FrameworkUtil;
/**
@@ -51,7 +52,8 @@ public abstract class ResizableDialog extends Dialog {
fBundle= bundle;
- fSettings= CompareUIPlugin.getDefault().getDialogSettings();
+ fSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(ResizableDialog.class))
+ .getDialogSettings();
}
public void setHelpContextId(String contextId) {
@@ -61,7 +63,7 @@ public abstract class ResizableDialog extends Dialog {
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- if (fContextId != null)
+ if (fContextId != null && PlatformUI.isWorkbenchRunning())
PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, fContextId);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java
index 94450efdf..b718f97df 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java
@@ -16,6 +16,7 @@
package org.eclipse.compare.internal;
import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
import java.util.HashSet;
import java.util.Set;
@@ -56,9 +57,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
-import com.ibm.icu.text.MessageFormat;
-
-
/**
* A two-way or three-way compare for arbitrary IResources.
*/
@@ -177,7 +175,7 @@ class ResourceCompareInput extends CompareEditorInput {
return fDiffViewer;
}
- class SelectAncestorDialog extends MessageDialog {
+ static class SelectAncestorDialog extends MessageDialog {
private IResource[] theResources;
IResource ancestorResource;
IResource leftResource;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java
index 2f38f2a4f..c76f8d3b0 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java
@@ -38,11 +38,7 @@ class StreamMergerDescriptor {
public IStreamMerger createStreamMerger() {
try {
return (IStreamMerger) fElement.createExecutableExtension(CLASS_ATTRIBUTE);
- } catch (CoreException ex) {
- //ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createSorter.title"), SearchMessages.getString("Search.Error.createSorter.message")); //$NON-NLS-2$ //$NON-NLS-1$
- return null;
- } catch (ClassCastException ex) {
- //ExceptionHandler.displayMessageDialog(ex, SearchMessages.getString("Search.Error.createSorter.title"), SearchMessages.getString("Search.Error.createSorter.message")); //$NON-NLS-2$ //$NON-NLS-1$
+ } catch (CoreException | ClassCastException ex) {
return null;
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
index 113ae4bdb..b071c0221 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
@@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stefan Dirix (sdirix@eclipsesource.com) - Bug 473847: Minimum E4 Compatibility of Compare
*******************************************************************************/
package org.eclipse.compare.internal;
@@ -23,6 +24,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLConnection;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -60,6 +62,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SafeRunner;
@@ -69,6 +72,7 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
@@ -77,9 +81,11 @@ import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.IActionBars;
@@ -88,11 +94,10 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
import org.eclipse.ui.texteditor.IDocumentProvider;
-import com.ibm.icu.text.MessageFormat;
-
/**
* Convenience and utility methods.
*/
@@ -580,7 +585,7 @@ public class Utilities {
}
private static Map<IFile, Long> createModificationStampMap(List<IResource> files) {
- Map<IFile, Long> map= new HashMap<IFile, Long>();
+ Map<IFile, Long> map= new HashMap<>();
for (IResource file : files) {
map.put((IFile) file, file.getModificationStamp());
}
@@ -758,7 +763,7 @@ public class Utilities {
* @return whether the left or right side of the input represents a hunk
*/
public static boolean isHunk(Object input) {
- if (input != null && input instanceof DiffNode){
+ if (input instanceof DiffNode){
ITypedElement right = ((DiffNode) input).getRight();
if (Adapters.adapt(right, IHunk.class) != null)
return true;
@@ -770,7 +775,7 @@ public class Utilities {
}
public static boolean isHunkOk(Object input) {
- if (input != null && input instanceof DiffNode){
+ if (input instanceof DiffNode){
ITypedElement right = ((DiffNode) input).getRight();
HunkResult element = Adapters.adapt(right, HunkResult.class);
if (element != null) {
@@ -813,7 +818,7 @@ public class Utilities {
for (Method method : methods) {
if (method.getName().equals("setReadTimeout")) { //$NON-NLS-1$
try {
- method.invoke(connection, new Object[] {Integer.valueOf(timeout)});
+ method.invoke(connection, Integer.valueOf(timeout));
return true;
} catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
// ignore
@@ -911,4 +916,62 @@ public class Utilities {
}
return buffer.toString();
}
+
+ /**
+ * Executes the given runnable. Uses the {@link org.eclipse.ui.progress.IProgressService IProgressService}
+ * if available.
+ *
+ * @param runnable
+ * The {@link IRunnableWithProgress} to execute.
+ * @throws InvocationTargetException
+ * @throws InterruptedException
+ */
+ public static void executeRunnable(IRunnableWithProgress runnable) throws InvocationTargetException,
+ InterruptedException {
+ executeRunnable(runnable, true, true);
+ }
+
+ /**
+ * Executes the given runnable. Uses the {@link org.eclipse.ui.progress.IProgressService IProgressService}
+ * if available.
+ *
+ * @param runnable
+ * The {@link IRunnableWithProgress} to execute.
+ * @param fork indicates whether to run within a separate thread.
+ * @param cancelable indicates whether the operation shall be cancelable
+ * @throws InvocationTargetException
+ * @throws InterruptedException
+ */
+ public static void executeRunnable(IRunnableWithProgress runnable, boolean fork, boolean cancelable) throws InvocationTargetException,
+ InterruptedException {
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getProgressService().run(fork, cancelable, runnable);
+ } else {
+ runnable.run(new NullProgressMonitor());
+ }
+ }
+
+ /**
+ * Sets the menu image for the given {@link Item}. Uses the workbench shared image if available, otherwise
+ * creates a new image and adds a dispose listener.
+ *
+ * @param item
+ * The {@link Item} for which the menu image is to be set.
+ */
+ public static void setMenuImage(final Item item) {
+ final Image image;
+ if (PlatformUI.isWorkbenchRunning()) {
+ image = PlatformUI.getWorkbench().getSharedImages().getImage(
+ /* IWorkbenchGraphicConstants */"IMG_LCL_VIEW_MENU"); //$NON-NLS-1$
+ } else {
+ image = CompareUIPlugin.getImageDescriptor("elcl16/view_menu.png").createImage(); //$NON-NLS-1$
+ item.addDisposeListener(e -> {
+ Image img = item.getImage();
+ if ((img != null) && (!img.isDisposed())) {
+ img.dispose();
+ }
+ });
+ }
+ item.setImage(image);
+ }
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Worker.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Worker.java
index 23b03854a..a702c1ec2 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Worker.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Worker.java
@@ -72,10 +72,7 @@ public class Worker implements IRunnableWithProgress {
try {
performNextTask(progress);
progress.checkCanceled();
- } catch (OperationCanceledException e) {
- // Only cancel all the work if the outer monitor is canceled.
- progress.checkCanceled();
- } catch (InterruptedException e) {
+ } catch (OperationCanceledException | InterruptedException e) {
// Only cancel all the work if the outer monitor is canceled.
progress.checkCanceled();
} catch (InvocationTargetException e) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java
index 8828ab25f..1398708a9 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java
@@ -48,8 +48,6 @@ import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextUtilities;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressService;
/**
* A document merger manages the differences between two documents
@@ -574,11 +572,10 @@ public class DocumentMerger {
}
monitor.done();
};
- IProgressService progressService= PlatformUI.getWorkbench().getProgressService();
RangeDifference[] e= null;
try {
- progressService.run(true, true, runnable);
+ Utilities.executeRunnable(runnable);
e= (RangeDifference[]) result[0];
} catch (InvocationTargetException ex) {
throw new CoreException(new Status(IStatus.ERROR, CompareUIPlugin.PLUGIN_ID, 0, CompareMessages.DocumentMerger_3, ex.getTargetException()));
@@ -1293,8 +1290,7 @@ public class DocumentMerger {
private Diff findNext(char contributor, List<Diff> v, int start, int end, boolean deep) {
if (v == null)
return null;
- for (int i= 0; i < v.size(); i++) {
- Diff diff= v.get(i);
+ for (Diff diff : v) {
Position p= diff.getPosition(contributor);
if (p != null) {
int startOffset= p.getOffset();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
index 0453443ff..4cc096c14 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
@@ -25,6 +25,7 @@ import java.io.StringReader;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -72,8 +73,6 @@ import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.views.navigator.ResourceComparator;
-import com.ibm.icu.text.MessageFormat;
-
public class InputPatchPage extends WizardPage {
// constants
@@ -181,7 +180,10 @@ public class InputPatchPage extends WizardPage {
shell.addShellListener(fActivationListener);
Dialog.applyDialogFont(composite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE);
+
+ if(PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE);
+ }
}
/**
@@ -284,11 +286,7 @@ public class InputPatchPage extends WizardPage {
patchFileURL), getContainer());
if (contents != null)
reader = new StringReader(contents);
- } catch (MalformedURLException e) {
- // ignore as we tested it with modify listener on combo
- } catch (InvocationTargetException e) { // ignore
- } catch (OperationCanceledException e) { // ignore
- } catch (InterruptedException e) { // ignore
+ } catch (MalformedURLException | InvocationTargetException | OperationCanceledException | InterruptedException e) { // ignore
}
}
fPatchSource= PatchMessages.InputPatchPage_URL_title;
@@ -297,13 +295,15 @@ public class InputPatchPage extends WizardPage {
IResource[] resources= Utilities.getResources(fTreeViewer.getSelection());
IResource patchFile= resources[0];
if (patchFile != null) {
- try {
- reader= new FileReader(patchFile.getLocation().toFile());
- } catch (FileNotFoundException ex) {
- MessageDialog.openError(null, PatchMessages.InputPatchPage_PatchErrorDialog_title, PatchMessages.InputPatchPage_PatchFileNotFound_message);
- } catch (NullPointerException nex) {
- //in case the path doesn't exist (eg. getLocation() returned null)
+ if (patchFile.getLocation() == null) {
MessageDialog.openError(null, PatchMessages.InputPatchPage_PatchErrorDialog_title, PatchMessages.InputPatchPage_PatchFileNotFound_message);
+ } else {
+ try {
+ reader = new FileReader(patchFile.getLocation().toFile());
+ } catch (FileNotFoundException ex) {
+ MessageDialog.openError(null, PatchMessages.InputPatchPage_PatchErrorDialog_title,
+ PatchMessages.InputPatchPage_PatchFileNotFound_message);
+ }
}
}
fPatchSource= PatchMessages.InputPatchPage_WorkspacePatch_title;
@@ -842,7 +842,7 @@ public class InputPatchPage extends WizardPage {
// readjust selection if there is a patch selected in the workspace or on the clipboard
// check workspace first
IResource patchTarget= fPatchWizard.getTarget();
- if (patchTarget instanceof IFile) {
+ if (patchTarget instanceof IFile && patchTarget.getLocation() != null) {
Reader reader= null;
try {
try {
@@ -858,10 +858,7 @@ public class InputPatchPage extends WizardPage {
}
} catch (FileNotFoundException ex) {
// silently ignored
- } catch (NullPointerException nex) {
- // silently ignored
}
-
} finally {
if (reader != null) {
try {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java
index 2c0e878b1..b5d7c73b7 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java
@@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.compare.internal.patch;
+import java.text.MessageFormat;
+
import org.eclipse.compare.internal.ICompareContextIds;
import org.eclipse.compare.internal.Utilities;
import org.eclipse.core.resources.IFile;
@@ -39,8 +41,6 @@ import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.views.navigator.ResourceComparator;
-import com.ibm.icu.text.MessageFormat;
-
/***
* This page only shows up if the user is trying to apply
* a non-workspace rooted patch.
@@ -88,7 +88,9 @@ public class PatchTargetPage extends WizardPage {
updateWidgetEnablements();
Dialog.applyDialogFont(composite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE);
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE);
+ }
useWorkspaceAsTarget.addListener(SWT.Selection, event -> {
fShowError = true;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java
index cf95f10eb..f03a532dd 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -20,7 +20,6 @@ import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.ExceptionHandler;
import org.eclipse.compare.internal.Utilities;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -34,7 +33,9 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.osgi.framework.FrameworkUtil;
public class PatchWizard extends Wizard {
@@ -79,7 +80,9 @@ public class PatchWizard extends Wizard {
}
private void initializeDialogSettings() {
- IDialogSettings workbenchSettings= CompareUIPlugin.getDefault().getDialogSettings();
+ IDialogSettings workbenchSettings = PlatformUI
+ .getDialogSettingsProvider(FrameworkUtil.getBundle(PatchWizard.class)).getDialogSettings();
+
IDialogSettings section= workbenchSettings.getSection(DIALOG_SETTINGS_KEY);
if (section == null) {
fHasNewDialogSettings= true;
@@ -166,12 +169,7 @@ public class PatchWizard extends Wizard {
@Override
protected void execute(IProgressMonitor monitor) throws InvocationTargetException {
try {
- fPatcher.applyAll(monitor, new Patcher.IFileValidator() {
- @Override
- public boolean validateResources(IFile[] resoures) {
- return Utilities.validateResources(resoures, getShell(), PatchMessages.PatchWizard_title);
- }
- });
+ fPatcher.applyAll(monitor, resoures -> Utilities.validateResources(resoures, getShell(), PatchMessages.PatchWizard_title));
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
@@ -188,7 +186,8 @@ public class PatchWizard extends Wizard {
// Save the dialog settings
if (fHasNewDialogSettings) {
- IDialogSettings workbenchSettings = CompareUIPlugin.getDefault().getDialogSettings();
+ IDialogSettings workbenchSettings = PlatformUI
+ .getDialogSettingsProvider(FrameworkUtil.getBundle(PatchWizardDialog.class)).getDialogSettings();
IDialogSettings section = workbenchSettings.getSection(DIALOG_SETTINGS_KEY);
section = workbenchSettings.addNewSection(DIALOG_SETTINGS_KEY);
setDialogSettings(section);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java
index a2a42d850..f4bb2990c 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,12 +13,13 @@
*******************************************************************************/
package org.eclipse.compare.internal.patch;
-import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.FrameworkUtil;
public class PatchWizardDialog extends WizardDialog {
private static final String PATCH_WIZARD_SETTINGS_SECTION = "PatchWizard"; //$NON-NLS-1$
@@ -32,7 +33,8 @@ public class PatchWizardDialog extends WizardDialog {
@Override
protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings settings = CompareUIPlugin.getDefault().getDialogSettings();
+ IDialogSettings settings = PlatformUI
+ .getDialogSettingsProvider(FrameworkUtil.getBundle(PatchWizardDialog.class)).getDialogSettings();
IDialogSettings section = settings.getSection(PATCH_WIZARD_SETTINGS_SECTION);
if (section == null) {
section = settings.addNewSection(PATCH_WIZARD_SETTINGS_SECTION);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index 88204b43a..0170fadb2 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -785,8 +785,7 @@ public class Patcher implements IHunkFilter {
}
public boolean hasRejects() {
- for (Iterator<FileDiffResult> iterator = diffResults.values().iterator(); iterator.hasNext();) {
- FileDiffResult result = iterator.next();
+ for (FileDiffResult result : diffResults.values()) {
if (result.hasRejects())
return true;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
index 4f72a8034..5c9efba78 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2018 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -19,7 +19,6 @@ import java.util.Iterator;
import java.util.regex.Pattern;
import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.CompareUI;
import org.eclipse.compare.internal.ComparePreferencePage;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.ICompareUIConstants;
@@ -64,6 +63,7 @@ import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.osgi.framework.FrameworkUtil;
public class PreviewPatchPage2 extends WizardPage {
@@ -136,8 +136,7 @@ public class PreviewPatchPage2 extends WizardPage {
// Initialize the input
try {
fInput.run(null);
- } catch (InterruptedException e) {//ignore
- } catch (InvocationTargetException e) {//ignore
+ } catch (InterruptedException | InvocationTargetException e) {//ignore
}
Label label = new Label(composite, SWT.NONE);
@@ -300,8 +299,7 @@ public class PreviewPatchPage2 extends WizardPage {
}
monitor.done();
});
- } catch (InvocationTargetException e) { //ignore
- } catch (InterruptedException e) { //ignore
+ } catch (InvocationTargetException | InterruptedException e) { //ignore
}
}
};
@@ -326,8 +324,7 @@ public class PreviewPatchPage2 extends WizardPage {
}
monitor.done();
});
- } catch (InvocationTargetException e) { //ignore
- } catch (InterruptedException e) { //ignore
+ } catch (InvocationTargetException | InterruptedException e) { //ignore
}
}
@@ -654,12 +651,9 @@ public class PreviewPatchPage2 extends WizardPage {
private int guessFuzzFactor(final WorkspacePatcher patcher) {
final int[] result= new int[] { -1 };
try {
- PlatformUI.getWorkbench().getProgressService().run(true, true,
- monitor -> result[0]= patcher.guessFuzzFactor(monitor)
- );
- } catch (InvocationTargetException ex) {
- // NeedWork
- } catch (InterruptedException ex) {
+ org.eclipse.compare.internal.Utilities
+ .executeRunnable(monitor -> result[0] = patcher.guessFuzzFactor(monitor));
+ } catch (InvocationTargetException | InterruptedException ex) {
// NeedWork
}
return result[0];
@@ -682,7 +676,8 @@ public class PreviewPatchPage2 extends WizardPage {
}
private void restoreWidgetValues() {
- IDialogSettings dialogSettings = CompareUI.getPlugin().getDialogSettings();
+ IDialogSettings dialogSettings = PlatformUI
+ .getDialogSettingsProvider(FrameworkUtil.getBundle(PreviewPatchPage2.class)).getDialogSettings();
settings = dialogSettings.getSection(PREVIEWPATCHPAGE_NAME);
if (settings == null) {
settings = dialogSettings.addNewSection(PREVIEWPATCHPAGE_NAME);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
index 1c91d01e2..6bfe69dd6 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
@@ -13,14 +13,14 @@
*******************************************************************************/
package org.eclipse.compare.structuremergeviewer;
+import java.text.MessageFormat;
+
import org.eclipse.compare.IEditableContent;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.internal.Utilities;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.swt.graphics.Image;
-import com.ibm.icu.text.MessageFormat;
-
/**
* Diff node are used as the compare result of the differencing engine.
* Since it implements the {@link ITypedElement} and {@link ICompareInput}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
index aed63ed10..e866c2116 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
@@ -237,7 +237,7 @@ public class DiffTreeViewer extends TreeViewer {
// Register for notification with the CompareConfiguration.
fCompareConfiguration= configuration;
if (fCompareConfiguration != null) {
- fPropertyChangeListener = event -> propertyChange(event);
+ fPropertyChangeListener = this::propertyChange;
fCompareConfiguration.addPropertyChangeListener(fPropertyChangeListener);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java
index 02898cf5b..04fb6b5da 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java
@@ -15,6 +15,7 @@ package org.eclipse.compare.structuremergeviewer;
import java.io.IOException;
import java.io.InputStream;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -31,8 +32,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import com.ibm.icu.text.MessageFormat;
-
/**
* A generic two-way or three-way differencing engine.
* <p>
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java
index 28fad0147..aa694c5ca 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java
@@ -118,9 +118,7 @@ public class DocumentRangeNode
fRange= new Position(start, length);
try {
fBaseDocument.addPosition(RANGE_CATEGORY, fRange);
- } catch (BadPositionCategoryException ex) {
- CompareUIPlugin.log(ex);
- } catch (BadLocationException ex) {
+ } catch (BadPositionCategoryException | BadLocationException ex) {
CompareUIPlugin.log(ex);
}
}
@@ -222,9 +220,7 @@ public class DocumentRangeNode
fBaseDocument.addPosition(RANGE_CATEGORY, p);
fAppendPosition= p;
}
- } catch (BadPositionCategoryException ex) {
- // silently ignored
- } catch (BadLocationException ex) {
+ } catch (BadPositionCategoryException | BadLocationException ex) {
// silently ignored
}
}
@@ -244,9 +240,7 @@ public class DocumentRangeNode
fBaseDocument.addPosition(RANGE_CATEGORY, p);
fAppendPosition= p;
return fAppendPosition;
- } catch (BadPositionCategoryException ex) {
- // silently ignored
- } catch (BadLocationException ex) {
+ } catch (BadPositionCategoryException | BadLocationException ex) {
// silently ignored
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IStructureCreator2.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IStructureCreator2.java
index fd79f15ec..d3714b1bc 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IStructureCreator2.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IStructureCreator2.java
@@ -55,7 +55,7 @@ public interface IStructureCreator2 extends IStructureCreator {
* @param monitor a progress monitor or <code>null</code> if progress and cancelation is not required
* @return the root node of the structure or <code>null</code> in case of
* error
- * @throws CoreException
+ * @throws CoreException if structure creation failed; depends on actual implementation
* @see IStructureCreator#getStructure(Object)
* @see #destroy(Object)
*/
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureCreator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureCreator.java
index 824323d3d..7e0a209a6 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureCreator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureCreator.java
@@ -152,7 +152,7 @@ public abstract class StructureCreator implements IStructureCreator2 {
* @param monitor a progress monitor or <code>null</code> if progress is not required
*
* @return a structure comparator
- * @throws CoreException
+ * @throws CoreException if creating the comparator failed; depends on actual implementation
*/
protected abstract IStructureComparator createStructureComparator(
final Object element, IDocument document,
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
index af1093d5f..30558588f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
@@ -96,7 +96,7 @@ public class StructureDiffViewer extends DiffTreeViewer {
private class StructureInfo {
private ITypedElement fInput;
private IStructureComparator fStructureComparator;
- private IRunnableWithProgress refreshTask = monitor -> refresh(monitor);
+ private IRunnableWithProgress refreshTask = this::refresh;
public boolean setInput(ITypedElement newInput, boolean force, IProgressMonitor monitor) {
boolean changed = false;
@@ -211,7 +211,7 @@ public class StructureDiffViewer extends DiffTreeViewer {
setAutoExpandLevel(3);
- fContentChangedListener= changed -> StructureDiffViewer.this.contentChanged(changed);
+ fContentChangedListener= StructureDiffViewer.this::contentChanged;
fCompareInputChangeListener = input -> StructureDiffViewer.this.compareInputChanged(input, true);
}
diff --git a/bundles/org.eclipse.compare/forceQualifierUpdate.txt b/bundles/org.eclipse.compare/forceQualifierUpdate.txt
new file mode 100644
index 000000000..7544272d6
--- /dev/null
+++ b/bundles/org.eclipse.compare/forceQualifierUpdate.txt
@@ -0,0 +1,3 @@
+# To force a version qualifier update add the bug here
+Bug 571840 - 4.20 I-Build: I20210310-0250 - Comparator Errors Found
+Bug 572789 - Comparator errors in I20210412-1800 after moving to compiler from 4.20 M1
diff --git a/bundles/org.eclipse.compare/icons/full/elcl16/view_menu.png b/bundles/org.eclipse.compare/icons/full/elcl16/view_menu.png
new file mode 100644
index 000000000..d8dc2f8fb
--- /dev/null
+++ b/bundles/org.eclipse.compare/icons/full/elcl16/view_menu.png
Binary files differ
diff --git a/bundles/org.eclipse.compare/icons/full/elcl16/view_menu@2x.png b/bundles/org.eclipse.compare/icons/full/elcl16/view_menu@2x.png
new file mode 100644
index 000000000..0774bdfdf
--- /dev/null
+++ b/bundles/org.eclipse.compare/icons/full/elcl16/view_menu@2x.png
Binary files differ
diff --git a/bundles/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugin.properties
index 8bb9f8039..6ad9582f6 100644
--- a/bundles/org.eclipse.compare/plugin.properties
+++ b/bundles/org.eclipse.compare/plugin.properties
@@ -69,6 +69,9 @@ Command.copyAllRightToLeft.description= Copy All Changes from Right to Left
Command.copyAllLeftToRight.name= Copy All from Left to Right
Command.copyAllLeftToRight.description= Copy All Changes from Left to Right
+Command.switchLeftAndRight.name= Swap Left and Right View
+Command.switchLeftAndRight.description= Switch the left and right sides in the compare editor
+
Command.selectNextChange.name= Select Next Change
Command.selectNextChange.description= Select Next Change
diff --git a/bundles/org.eclipse.compare/plugin.xml b/bundles/org.eclipse.compare/plugin.xml
index 754cb681c..d5f1bc180 100644
--- a/bundles/org.eclipse.compare/plugin.xml
+++ b/bundles/org.eclipse.compare/plugin.xml
@@ -199,6 +199,12 @@
id="org.eclipse.compare.copyAllLeftToRight">
</command>
<command
+ name="%Command.switchLeftAndRight.name"
+ description="%Command.switchLeftAndRight.description"
+ categoryId="org.eclipse.compare.ui.category.compare"
+ id="org.eclipse.compare.switchLeftAndRight">
+ </command>
+ <command
name="%Command.selectNextChange.name"
description="%Command.selectNextChange.description"
categoryId="org.eclipse.compare.ui.category.compare"
diff --git a/bundles/org.eclipse.compare/pom.xml b/bundles/org.eclipse.compare/pom.xml
index 8e660a65d..dab312874 100644
--- a/bundles/org.eclipse.compare/pom.xml
+++ b/bundles/org.eclipse.compare/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.compare</groupId>
<artifactId>org.eclipse.compare</artifactId>
- <version>3.7.700-SNAPSHOT</version>
+ <version>3.8.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/BUILD_INFO.txt b/bundles/org.eclipse.core.net.linux.x86_64/BUILD_INFO.txt
deleted file mode 100644
index a312cc736..000000000
--- a/bundles/org.eclipse.core.net.linux.x86_64/BUILD_INFO.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Native Build Info:
-------------------
-
-platform: linux.gtk.x86_64
-built by: Eric Williams, ericwill@redhat.com
-build date: 24-May-2018
-OS Name: RHEL Workstation 7.5
-OS Version: Linux 3.10.0
-Compiler version: gcc (GCC) 4.8.5
-Java version: Java(TM) 8 Runtime Environment, Standard Edition (1.8.0.171) \ No newline at end of file
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/forceQualifierUpdate.txt b/bundles/org.eclipse.core.net.linux.x86_64/forceQualifierUpdate.txt
deleted file mode 100644
index c6fa509ca..000000000
--- a/bundles/org.eclipse.core.net.linux.x86_64/forceQualifierUpdate.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# To force a version qualifier update add the bug here
-Bug 541541 - Build I20181125-1800 failed due to Platform Team changes
-Bug 541724 - Unable to build o.e.core.net.linux.x86_64 native fragment
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/libgnomeproxy-1.0.0.so b/bundles/org.eclipse.core.net.linux.x86_64/libgnomeproxy-1.0.0.so
deleted file mode 100644
index ab71687a2..000000000
--- a/bundles/org.eclipse.core.net.linux.x86_64/libgnomeproxy-1.0.0.so
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/pom.xml b/bundles/org.eclipse.core.net.linux.x86_64/pom.xml
deleted file mode 100644
index 373efc291..000000000
--- a/bundles/org.eclipse.core.net.linux.x86_64/pom.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2012, 2015 Eclipse Foundation and others.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Distribution License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/org/documents/edl-v10.php
-
- Contributors:
- Igor Fedorenko - initial implementation
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>eclipse.platform.team</artifactId>
- <groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
- <relativePath>../../</relativePath>
- </parent>
- <groupId>org.eclipse.core</groupId>
- <artifactId>org.eclipse.core.net.linux.x86_64</artifactId>
- <version>1.2.300-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-
- <properties>
- <skipAPIAnalysis>true</skipAPIAnalysis>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <configuration>
- <environments>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86_64</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>build-natives</id>
- <activation>
- <property>
- <!-- This has to be hardcoded. Profiles are not allowed to use pom defined properties :-( -->
- <name>native</name>
- <value>gtk.linux.x86_64</value>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>natives</id>
- <phase>process-resources</phase>
- <configuration>
- <target>
- <exec executable="make" newenvironment="false" dir="../org.eclipse.core.net/natives/unix/linux/"/>
- <copy todir=".">
- <fileset dir="../org.eclipse.core.net/natives/unix/linux/">
- <include name="libgnomeproxy-*.so"/>
- </fileset>
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/src/org/eclipse/core/net/ProxyProvider.java b/bundles/org.eclipse.core.net.linux.x86_64/src/org/eclipse/core/net/ProxyProvider.java
deleted file mode 100644
index f2f9a4bcc..000000000
--- a/bundles/org.eclipse.core.net.linux.x86_64/src/org/eclipse/core/net/ProxyProvider.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oakland Software Incorporated 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:
- * Oakland Software Incorporated - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.net;
-
-import org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider;
-
-public class ProxyProvider extends UnixProxyProvider {
-}
diff --git a/bundles/org.eclipse.core.net.linux/.classpath b/bundles/org.eclipse.core.net.linux/.classpath
new file mode 100644
index 000000000..e801ebfb4
--- /dev/null
+++ b/bundles/org.eclipse.core.net.linux/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/.project b/bundles/org.eclipse.core.net.linux/.project
index a22a02fce..4cf8c2fd8 100644
--- a/bundles/org.eclipse.core.net.linux.x86_64/.project
+++ b/bundles/org.eclipse.core.net.linux/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.core.net.linux.x86_64</name>
+ <name>org.eclipse.core.net.linux</name>
<comment></comment>
<projects>
</projects>
diff --git a/bundles/org.eclipse.core.net.linux/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.core.net.linux/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..c9545f06a
--- /dev/null
+++ b/bundles/org.eclipse.core.net.linux/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,9 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
+org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
diff --git a/bundles/org.eclipse.core.net.linux/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.net.linux/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..1daa675a7
--- /dev/null
+++ b/bundles/org.eclipse.core.net.linux/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %fragmentName
+Bundle-Vendor: %providerName
+Bundle-Localization: fragment
+Bundle-SymbolicName: org.eclipse.core.net.linux;singleton:=true
+Bundle-Version: 1.0.100.qualifier
+Fragment-Host: org.eclipse.core.net;bundle-version="1.1.0"
+Eclipse-PlatformFilter: (osgi.os=linux)
+Bundle-RequiredExecutionEnvironment: JavaSE-11
+Automatic-Module-Name: org.eclipse.core.net.linux
+Require-Bundle: com.sun.jna
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/about.html b/bundles/org.eclipse.core.net.linux/about.html
index 164f781a8..164f781a8 100644
--- a/bundles/org.eclipse.core.net.linux.x86_64/about.html
+++ b/bundles/org.eclipse.core.net.linux/about.html
diff --git a/bundles/org.eclipse.core.net.linux/build.properties b/bundles/org.eclipse.core.net.linux/build.properties
new file mode 100644
index 000000000..aeb64d809
--- /dev/null
+++ b/bundles/org.eclipse.core.net.linux/build.properties
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2021 Red Hat Inc. 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:
+# Red Hat Inc. - initial API and implementation
+###############################################################################
+bin.includes = fragment.properties,\
+ .,\
+ META-INF/,\
+ about.html
+src.includes = about.html
+source.. = src/
diff --git a/bundles/org.eclipse.core.net.linux/fragment.properties b/bundles/org.eclipse.core.net.linux/fragment.properties
new file mode 100644
index 000000000..cbcfcd739
--- /dev/null
+++ b/bundles/org.eclipse.core.net.linux/fragment.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2021 Red Hat Inc. 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:
+# Red Hat Inc. - initial API and implementation
+###############################################################################
+fragmentName = Proxy for Linux
+providerName = Eclipse.org
diff --git a/bundles/org.eclipse.core.net.linux/pom.xml b/bundles/org.eclipse.core.net.linux/pom.xml
new file mode 100644
index 000000000..f56d3c07b
--- /dev/null
+++ b/bundles/org.eclipse.core.net.linux/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2012, 2021 Eclipse Foundation and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Distribution License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/org/documents/edl-v10.php
+
+ Contributors:
+ Igor Fedorenko - initial implementation
+ Red Hat Inc. - modified for use in org.eclipse.core.net.linux
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>eclipse.platform.team</artifactId>
+ <groupId>eclipse.platform.team</groupId>
+ <version>4.24.0-SNAPSHOT</version>
+ <relativePath>../../</relativePath>
+ </parent>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>org.eclipse.core.net.linux</artifactId>
+ <version>1.0.100-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <properties>
+ <skipAPIAnalysis>true</skipAPIAnalysis>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <configuration>
+ <environments>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java b/bundles/org.eclipse.core.net.linux/src/org/eclipse/core/net/ProxyProvider.java
index 3f07bbe14..c2993586c 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java
+++ b/bundles/org.eclipse.core.net.linux/src/org/eclipse/core/net/ProxyProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2018 Oakland Software Incorporated and others
+ * Copyright (c) 2021 Red Hat Inc. and others
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -9,14 +9,11 @@
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
- * Oakland Software Incorporated - initial API and implementation
- * IBM Corporation - implementation
- * Red Hat - GSettings implementation and code clean up (bug 394087)
+ * Red Hat Inc. - initial API and implementation
*******************************************************************************/
-package org.eclipse.core.internal.net.proxy.unix;
+package org.eclipse.core.net;
import java.io.IOException;
-import java.lang.reflect.Method;
import java.net.URI;
import java.util.ArrayList;
import java.util.Locale;
@@ -30,24 +27,43 @@ import org.eclipse.core.internal.net.ProxyData;
import org.eclipse.core.internal.net.StringUtil;
import org.eclipse.core.net.proxy.IProxyData;
-public class UnixProxyProvider extends AbstractProxyProvider {
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.Pointer;
+import com.sun.jna.ptr.PointerByReference;
- private static final String LIBRARY_NAME = "gnomeproxy-1.0.0"; //$NON-NLS-1$
+/**
+ * JNA version of org.eclipse.core.internal.net.UnixProxyProvider
+ *
+ * @author jjohnstn
+ *
+ */
+public class ProxyProvider extends AbstractProxyProvider {
+
+ private static LibGio fLibGio;
+
+ private static Pointer proxySettings = Pointer.NULL;
+ private static Pointer httpProxySettings = Pointer.NULL;
+ private static Pointer httpsProxySettings = Pointer.NULL;
+ private static Pointer socksProxySettings = Pointer.NULL;
+ private static Pointer ftpProxySettings = Pointer.NULL;
private static final String ENABLE_GNOME = Activator.ID + ".enableGnome"; //$NON-NLS-1$
+ private static final String LIBRARY_NAME = "gio-2.0"; //$NON-NLS-1$
+
private static boolean isGnomeLibLoaded = false;
static {
// Load the GSettings JNI library if org.eclipse.core.net.enableGnome is specified
String value = System.getProperty(ENABLE_GNOME);
if ("".equals(value) || "true".equals(value)) { //$NON-NLS-1$ //$NON-NLS-2$
- loadGnomeLib();
+ initializeSettings();
}
}
- public UnixProxyProvider() {
- // Nothing to initialize
+ public ProxyProvider() {
+ // no initialization required
}
@Override
@@ -69,7 +85,7 @@ public class UnixProxyProvider extends AbstractProxyProvider {
proxies = getProxyData();
}
if (Policy.DEBUG) {
- Policy.debug("UnixProxyProvider#select result for [" + uri + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+ Policy.debug("LinuxProxyProvider#select result for [" + uri + "]"); //$NON-NLS-1$ //$NON-NLS-2$
for (IProxyData proxy : proxies) {
System.out.println(" " + proxy); //$NON-NLS-1$
}
@@ -212,9 +228,7 @@ public class UnixProxyProvider extends AbstractProxyProvider {
private static String getEnv(String env) {
try {
- Method m = System.class.getMethod(
- "getenv", new Class[] { String.class }); //$NON-NLS-1$
- return (String) m.invoke(null, new Object[] { env });
+ return System.getenv(env);
} catch (Throwable t) {
// Fall-back to running 'env' directly. Warning this is very slow...
// up to 200ms
@@ -241,29 +255,133 @@ public class UnixProxyProvider extends AbstractProxyProvider {
}
}
- private static void loadGnomeLib() {
+ private void debugPrint(String[] strs) {
+ for (int i = 0; i < strs.length; i++)
+ System.out.println(i + ": " + strs[i]); //$NON-NLS-1$
+ }
+
+ private interface LibGio extends Library {
+ Pointer g_settings_new(String schema);
+ boolean g_settings_get_boolean(Pointer settings, String key);
+ Pointer g_settings_get_string(Pointer settings, String key);
+ int g_settings_get_int(Pointer settings, String key);
+ PointerByReference g_settings_get_strv(Pointer Settings, String key);
+ void g_strfreev(PointerByReference p);
+ void g_free(Pointer p);
+ }
+
+ private static void initializeSettings() {
try {
- System.loadLibrary(LIBRARY_NAME);
- isGnomeLibLoaded = true;
+ fLibGio = Native.load(LIBRARY_NAME, LibGio.class);
+ proxySettings = fLibGio.g_settings_new ("org.gnome.system.proxy"); //$NON-NLS-1$
+ httpProxySettings = fLibGio.g_settings_new ("org.gnome.system.proxy.http"); //$NON-NLS-1$
+ httpsProxySettings = fLibGio.g_settings_new ("org.gnome.system.proxy.https"); //$NON-NLS-1$
+ socksProxySettings = fLibGio.g_settings_new ("org.gnome.system.proxy.socks"); //$NON-NLS-1$
+ ftpProxySettings = fLibGio.g_settings_new ("org.gnome.system.proxy.ftp"); //$NON-NLS-1$
+ isGnomeLibLoaded= true;
if (Policy.DEBUG_SYSTEM_PROVIDERS)
Policy.debug("Loaded " + //$NON-NLS-1$
System.mapLibraryName(LIBRARY_NAME) + " library"); //$NON-NLS-1$
- } catch (final UnsatisfiedLinkError e) {
- // Expected on systems that are missing Gnome library
+ } catch (UnsatisfiedLinkError e) {
+ isGnomeLibLoaded= false;
if (Policy.DEBUG_SYSTEM_PROVIDERS)
Policy.debug("Could not load library: " //$NON-NLS-1$
+ System.mapLibraryName(LIBRARY_NAME));
}
}
- private void debugPrint(String[] strs) {
- for (int i = 0; i < strs.length; i++)
- System.out.println(i + ": " + strs[i]); //$NON-NLS-1$
+ protected static ProxyData getGSettingsProxyInfo(String protocol) {
+
+ if (protocol == null) {
+ return null;
+ }
+
+ if (proxySettings == Pointer.NULL) {
+ initializeSettings();
+ }
+
+ // Everything else applies only if the system proxy mode is manual
+ // Auto-configuration is not supported
+ Pointer mode = fLibGio.g_settings_get_string(proxySettings, "mode"); //$NON-NLS-1$
+ if (!mode.getString(0).equalsIgnoreCase("manual")) { //$NON-NLS-1$
+ fLibGio.g_free(mode);
+ return null;
+ }
+ fLibGio.g_free(mode);
+
+ Pointer host;
+ int port;
+
+ switch (protocol.toLowerCase()) {
+ case "http": //$NON-NLS-1$
+ host = fLibGio.g_settings_get_string(httpProxySettings, "host"); //$NON-NLS-1$
+ port = fLibGio.g_settings_get_int(httpProxySettings, "port"); //$NON-NLS-1$
+ break;
+ case "https": //$NON-NLS-1$
+ host = fLibGio.g_settings_get_string(httpsProxySettings, "host"); //$NON-NLS-1$
+ port = fLibGio.g_settings_get_int(httpsProxySettings, "port"); //$NON-NLS-1$
+ break;
+ case "ftp": //$NON-NLS-1$
+ host = fLibGio.g_settings_get_string(ftpProxySettings, "host"); //$NON-NLS-1$
+ port = fLibGio.g_settings_get_int(ftpProxySettings, "port"); //$NON-NLS-1$
+ break;
+ case "socks": //$NON-NLS-1$
+ host = fLibGio.g_settings_get_string(socksProxySettings, "host"); //$NON-NLS-1$
+ port = fLibGio.g_settings_get_int(socksProxySettings, "port"); //$NON-NLS-1$
+ break;
+ default:
+ // Unknown/invalid proxy type
+ return null;
+ }
+
+ ProxyData proxyData = new ProxyData(protocol);
+ proxyData.setHost(host.getString(0));
+ fLibGio.g_free(host);
+ proxyData.setPort(port);
+
+ // Each proxy type is enabled only if the "host" key is non-empty and its "port" key is non-0
+ if (proxyData.getHost() == null || proxyData.getPort() == 0) {
+ return null;
+ }
+
+ if (protocol.equalsIgnoreCase("http")) { //$NON-NLS-1$
+ // Authentication applies only to http proxies
+ boolean reqAuth = fLibGio.g_settings_get_boolean(httpProxySettings, "use-authentication"); //$NON-NLS-1$
+ if (reqAuth) {
+ Pointer user = fLibGio.g_settings_get_string(httpProxySettings, "authentication-user"); //$NON-NLS-1$
+ proxyData.setUserid(user.getString(0));
+ fLibGio.g_free(user);
+
+ Pointer password = fLibGio.g_settings_get_string(httpProxySettings, "authentication-password"); //$NON-NLS-1$
+ proxyData.setPassword(password.getString(0));
+ fLibGio.g_free(password);
+ }
+ }
+
+ return proxyData;
}
- protected static native void gsettingsInit();
+ protected static String[] getGSettingsNonProxyHosts() {
+ if (proxySettings == Pointer.NULL) {
+ initializeSettings();
+ }
+
+ // Everything else applies only if the system proxy mode is manual
+ // Auto-configuration is not supported
+ Pointer mode = fLibGio.g_settings_get_string(proxySettings, "mode"); //$NON-NLS-1$
+ if (!mode.getString(0).equalsIgnoreCase("manual")) { //$NON-NLS-1$
+ fLibGio.g_free(mode);
+ return null;
+ }
+ fLibGio.g_free(mode);
- protected static native ProxyData getGSettingsProxyInfo(String protocol);
+ PointerByReference npHostsArray = fLibGio.g_settings_get_strv(proxySettings, "ignore-hosts"); //$NON-NLS-1$
+ String[] npHosts = npHostsArray.getPointer().getStringArray(0);
+
+ fLibGio.g_strfreev(npHostsArray);
+
+ return npHosts;
+ }
- protected static native String[] getGSettingsNonProxyHosts();
}
+
diff --git a/bundles/org.eclipse.core.net.win32.x86_64/.classpath b/bundles/org.eclipse.core.net.win32.x86_64/.classpath
index eca7bdba8..075009d77 100644
--- a/bundles/org.eclipse.core.net.win32.x86_64/.classpath
+++ b/bundles/org.eclipse.core.net.win32.x86_64/.classpath
@@ -2,6 +2,5 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.core.net.win32.x86_64/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.net.win32.x86_64/META-INF/MANIFEST.MF
index 4d67d7e3e..6c475ecbe 100644
--- a/bundles/org.eclipse.core.net.win32.x86_64/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.core.net.win32.x86_64/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %fragmentName
Bundle-Vendor: %providerName
Bundle-Localization: fragment
Bundle-SymbolicName: org.eclipse.core.net.win32.x86_64;singleton:=true
-Bundle-Version: 1.1.400.qualifier
+Bundle-Version: 1.1.600.qualifier
Fragment-Host: org.eclipse.core.net;bundle-version="1.1.0"
Eclipse-PlatformFilter: (& (osgi.os=win32) (osgi.arch=x86_64))
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/bundles/org.eclipse.core.net.win32.x86_64/META-INF/p2.inf b/bundles/org.eclipse.core.net.win32.x86_64/META-INF/p2.inf
new file mode 100644
index 000000000..bb8ec12d6
--- /dev/null
+++ b/bundles/org.eclipse.core.net.win32.x86_64/META-INF/p2.inf
@@ -0,0 +1,2 @@
+requires.0.namespace=org.eclipse.equinox.p2.iu
+requires.0.name=org.eclipse.core.net.win32 \ No newline at end of file
diff --git a/bundles/org.eclipse.core.net.win32.x86_64/build.properties b/bundles/org.eclipse.core.net.win32.x86_64/build.properties
index 1dd6d3af6..a8599f07f 100644
--- a/bundles/org.eclipse.core.net.win32.x86_64/build.properties
+++ b/bundles/org.eclipse.core.net.win32.x86_64/build.properties
@@ -14,8 +14,5 @@
bin.includes = fragment.properties,\
.,\
about.html,\
- META-INF/,\
- bin/,\
- jWinHttp-1.0.0.dll
+ META-INF/
src.includes = about.html
-source.. = src/
diff --git a/bundles/org.eclipse.core.net.win32.x86_64/jWinHttp-1.0.0.dll b/bundles/org.eclipse.core.net.win32.x86_64/jWinHttp-1.0.0.dll
deleted file mode 100644
index 7279d5ab6..000000000
--- a/bundles/org.eclipse.core.net.win32.x86_64/jWinHttp-1.0.0.dll
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.net.win32.x86_64/pom.xml b/bundles/org.eclipse.core.net.win32.x86_64/pom.xml
index 64e0a12ed..e4b1de1f6 100644
--- a/bundles/org.eclipse.core.net.win32.x86_64/pom.xml
+++ b/bundles/org.eclipse.core.net.win32.x86_64/pom.xml
@@ -14,12 +14,12 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.net.win32.x86_64</artifactId>
- <version>1.1.400-SNAPSHOT</version>
+ <version>1.1.600-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
diff --git a/bundles/org.eclipse.core.net.win32.x86_64/src/org/eclipse/core/net/ProxyProvider.java b/bundles/org.eclipse.core.net.win32.x86_64/src/org/eclipse/core/net/ProxyProvider.java
deleted file mode 100644
index e32aae27d..000000000
--- a/bundles/org.eclipse.core.net.win32.x86_64/src/org/eclipse/core/net/ProxyProvider.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.core.net;
-
-import org.eclipse.core.internal.net.WindowsProxyProvider;
-
-public class ProxyProvider extends WindowsProxyProvider {
-}
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/.classpath b/bundles/org.eclipse.core.net.win32/.classpath
index 01836c484..eca7bdba8 100644
--- a/bundles/org.eclipse.core.net.linux.x86_64/.classpath
+++ b/bundles/org.eclipse.core.net.win32/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.core.net.win32/.project b/bundles/org.eclipse.core.net.win32/.project
new file mode 100644
index 000000000..d57569ddc
--- /dev/null
+++ b/bundles/org.eclipse.core.net.win32/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.core.net.win32</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
+
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.core.net.win32/.settings/org.eclipse.core.runtime.prefs
index 5a0ad22d2..5a0ad22d2 100644
--- a/bundles/org.eclipse.core.net.linux.x86_64/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.core.net.win32/.settings/org.eclipse.core.runtime.prefs
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.core.net.win32/.settings/org.eclipse.jdt.core.prefs
index a698e5967..a698e5967 100644
--- a/bundles/org.eclipse.core.net.linux.x86_64/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.core.net.win32/.settings/org.eclipse.jdt.core.prefs
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.net.win32/META-INF/MANIFEST.MF
index bce4a7b96..fe35f4bc2 100644
--- a/bundles/org.eclipse.core.net.linux.x86_64/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.core.net.win32/META-INF/MANIFEST.MF
@@ -3,9 +3,11 @@ Bundle-ManifestVersion: 2
Bundle-Name: %fragmentName
Bundle-Vendor: %providerName
Bundle-Localization: fragment
-Bundle-SymbolicName: org.eclipse.core.net.linux.x86_64;singleton:=true
-Bundle-Version: 1.2.300.qualifier
+Bundle-SymbolicName: org.eclipse.core.net.win32;singleton:=true
+Bundle-Version: 1.0.0.qualifier
Fragment-Host: org.eclipse.core.net;bundle-version="1.1.0"
-Eclipse-PlatformFilter: (& (osgi.os=linux) (osgi.arch=x86_64))
+Eclipse-PlatformFilter: (osgi.os=win32)
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Automatic-Module-Name: org.eclipse.core.net.linux.x86_64
+Automatic-Module-Name: org.eclipse.core.net.win32
+Require-Bundle: com.sun.jna,
+ com.sun.jna.platform
diff --git a/bundles/org.eclipse.core.net.win32/about.html b/bundles/org.eclipse.core.net.win32/about.html
new file mode 100644
index 000000000..164f781a8
--- /dev/null
+++ b/bundles/org.eclipse.core.net.win32/about.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>About</title>
+</head>
+<body lang="EN-US">
+ <h2>About This Content</h2>
+
+ <p>November 30, 2017</p>
+ <h3>License</h3>
+
+ <p>
+ The Eclipse Foundation makes available all content in this plug-in
+ (&quot;Content&quot;). Unless otherwise indicated below, the Content
+ is provided to you under the terms and conditions of the Eclipse
+ Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
+ available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.
+ </p>
+
+ <p>
+ If you did not receive this Content directly from the Eclipse
+ Foundation, the Content is being redistributed by another party
+ (&quot;Redistributor&quot;) and different terms and conditions may
+ apply to your use of any object code in the Content. Check the
+ Redistributor's license that was provided with the Content. If no such
+ license exists, contact the Redistributor. Unless otherwise indicated
+ below, the terms and conditions of the EPL still apply to any source
+ code in the Content and such source code may be obtained at <a
+ href="http://www.eclipse.org/">http://www.eclipse.org</a>.
+ </p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/build.properties b/bundles/org.eclipse.core.net.win32/build.properties
index da27a77c9..b05379ff6 100644
--- a/bundles/org.eclipse.core.net.linux.x86_64/build.properties
+++ b/bundles/org.eclipse.core.net.win32/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2009 IBM Corporation and others.
+# Copyright (c) 2009, 2022 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
@@ -13,9 +13,7 @@
###############################################################################
bin.includes = fragment.properties,\
.,\
- META-INF/,\
about.html,\
- bin/,\
- libgnomeproxy-1.0.0.so
+ META-INF/
src.includes = about.html
source.. = src/
diff --git a/bundles/org.eclipse.core.net.linux.x86_64/fragment.properties b/bundles/org.eclipse.core.net.win32/fragment.properties
index 225a330c1..ff4e4defc 100644
--- a/bundles/org.eclipse.core.net.linux.x86_64/fragment.properties
+++ b/bundles/org.eclipse.core.net.win32/fragment.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2009 IBM Corporation and others.
+# Copyright (c) 2009 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
@@ -11,5 +11,5 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
-fragmentName = Proxy for Linux x86_64
+fragmentName = Proxy for Windows
providerName = Eclipse.org
diff --git a/bundles/org.eclipse.core.net.win32/pom.xml b/bundles/org.eclipse.core.net.win32/pom.xml
new file mode 100644
index 000000000..496f9858a
--- /dev/null
+++ b/bundles/org.eclipse.core.net.win32/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2012, 2022 Eclipse Foundation and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Distribution License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/org/documents/edl-v10.php
+
+ Contributors:
+ Igor Fedorenko - initial implementation
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>eclipse.platform.team</artifactId>
+ <groupId>eclipse.platform.team</groupId>
+ <version>4.24.0-SNAPSHOT</version>
+ <relativePath>../../</relativePath>
+ </parent>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>org.eclipse.core.net.win32</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <properties>
+ <skipAPIAnalysis>true</skipAPIAnalysis>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <configuration>
+ <environments>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java b/bundles/org.eclipse.core.net.win32/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java
index 30fa914a2..30fa914a2 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java
+++ b/bundles/org.eclipse.core.net.win32/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java b/bundles/org.eclipse.core.net.win32/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java
index b53ac4eaa..1e5479fa0 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java
+++ b/bundles/org.eclipse.core.net.win32/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java
@@ -48,9 +48,9 @@ public final class ProxyProviderUtil {
* or map. <br>
* The proxy list contains one or more of the following strings separated by
* semicolons:<br>
- * <code><pre>
+ * <pre><code>
* ([&lt;scheme&gt;=][&lt;scheme&gt; &quot;://&quot; ]&lt;server&gt;[ &quot;:&quot; &lt;port&gt;])
- * </pre></code>
+ * </code></pre>
*
* @param proxyList
* the proxy list as a string
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java b/bundles/org.eclipse.core.net.win32/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java
index 9632a371e..9632a371e 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java
+++ b/bundles/org.eclipse.core.net.win32/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java
diff --git a/bundles/org.eclipse.core.net.win32/src/org/eclipse/core/net/ProxyProvider.java b/bundles/org.eclipse.core.net.win32/src/org/eclipse/core/net/ProxyProvider.java
new file mode 100644
index 000000000..6529ae386
--- /dev/null
+++ b/bundles/org.eclipse.core.net.win32/src/org/eclipse/core/net/ProxyProvider.java
@@ -0,0 +1,456 @@
+/*******************************************************************************
+ * Copyright (c) 2022 Rolf Theunissen 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:
+ * Rolf Theunissen <rolf.theunissen@gmail.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.core.net;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.internal.net.AbstractProxyProvider;
+import org.eclipse.core.internal.net.Activator;
+import org.eclipse.core.internal.net.Policy;
+import org.eclipse.core.internal.net.ProxyData;
+import org.eclipse.core.internal.net.StringUtil;
+import org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass;
+import org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyProviderUtil;
+import org.eclipse.core.internal.net.proxy.win32.winhttp.StaticProxyConfig;
+import org.eclipse.core.net.proxy.IProxyData;
+
+import com.sun.jna.LastErrorException;
+import com.sun.jna.Native;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.Structure.FieldOrder;
+import com.sun.jna.platform.win32.Kernel32;
+import com.sun.jna.platform.win32.Kernel32Util;
+import com.sun.jna.platform.win32.WTypes.LPWSTR;
+import com.sun.jna.platform.win32.WinBase;
+import com.sun.jna.platform.win32.WinDef.HMODULE;
+import com.sun.jna.platform.win32.WinNT;
+import com.sun.jna.ptr.PointerByReference;
+import com.sun.jna.win32.StdCallLibrary;
+import com.sun.jna.win32.W32APIOptions;
+
+/**
+ * The <code>ProxyProvivider</code> gets its settings from the "internet options
+ * &gt;&gt; connection settings". For this it uses the Windows WinHttp API.
+ *
+ * @see "http://msdn2.microsoft.com/en-us/library/aa382925(VS.85).aspx"
+ */
+public class ProxyProvider extends AbstractProxyProvider {
+
+ private static final String LIBRARY_NAME = "winhttp";
+ private static final String USER_AGENT = "WinHttpProxyProvider";
+ private static final ProxyData[] EMPTY_PROXIES = new ProxyData[0];
+
+ private static WinHttp fWinHttp;
+ private static boolean isWinHttpLoaded = false;
+
+ private Pointer hHttpSession;
+ private boolean isWinHttpInitialized = false;
+
+ /* Cache static configuration */
+ private StaticProxyConfig fStaticProxyConfig;
+ private String fProxiesString;
+ private String fProxyBypassString;
+
+ static {
+ try {
+ fWinHttp = Native.load(LIBRARY_NAME, WinHttp.class, W32APIOptions.UNICODE_OPTIONS);
+ fWinHttp = (WinHttp) Native.synchronizedLibrary(fWinHttp);
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Loaded library " + System.mapLibraryName(LIBRARY_NAME));
+ }
+ isWinHttpLoaded = true;
+ } catch (UnsatisfiedLinkError e) {
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Could not load library " + System.mapLibraryName(LIBRARY_NAME));
+ }
+ Activator.logError("Problem during initializing system proxy configuration.", e);
+ }
+ }
+
+ public ProxyProvider() {
+ if (isWinHttpLoaded) {
+ initialize();
+ }
+ }
+
+ @Override
+ public IProxyData[] select(URI uri) {
+ IProxyData[] proxies = getSystemProxyInfo(uri);
+ if (Policy.DEBUG) {
+ Policy.debug("WindowsProxyProvider#select result for [" + uri + "]");
+ for (IProxyData proxy : proxies) {
+ System.out.println(" " + proxy);
+ }
+ }
+ return proxies;
+ }
+
+ protected IProxyData[] getSystemProxyInfo(URI uri) {
+ WinHttp.WinHttpCurrentUserIEProxyConfig proxyConfig = getProxyConfig();
+ if (proxyConfig == null) {
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Error getting proxy configuration");
+ }
+ return EMPTY_PROXIES;
+ }
+
+ try {
+ // Dynamic configuration - WPAD and/or PAC
+ // WinHTTP PAC only supports 'http[s]:', see ERROR_WINHTTP_UNRECOGNIZED_SCHEME
+ if (isWinHttpInitialized && (proxyConfig.fAutoDetect || proxyConfig.lpszAutoConfigUrl != null)
+ && (IProxyData.HTTP_PROXY_TYPE.equalsIgnoreCase(uri.getScheme())
+ || IProxyData.HTTPS_PROXY_TYPE.equalsIgnoreCase(uri.getScheme()))) {
+ WinHttp.WinHttpAutoProxyOptions autoProxyOptions = new WinHttp.WinHttpAutoProxyOptions();
+ WinHttp.WinHttpProxyInfo proxyInfo = new WinHttp.WinHttpProxyInfo();
+
+ // WPAD: Web Proxy Auto-Discovery configuration
+ if (proxyConfig.fAutoDetect) {
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Dynamic proxy configuration using WPAD");
+ }
+ autoProxyOptions.dwFlags = WinHttp.AUTOPROXY_AUTO_DETECT;
+ autoProxyOptions.dwAutoDetectFlags = WinHttp.AUTO_DETECT_TYPE_DHCP | WinHttp.AUTO_DETECT_TYPE_DNS_A;
+ }
+ // PAC: Proxy-Auto Configuration
+ // When both WPAD and PAC are set, WinHTTP tries PAC only after WPAD failed
+ if (proxyConfig.lpszAutoConfigUrl != null) {
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Dynamic proxy configuration using PAC url");
+ }
+ autoProxyOptions.dwFlags |= WinHttp.AUTOPROXY_CONFIG_URL;
+ autoProxyOptions.lpszAutoConfigUrl = proxyConfig.getAutoConfigUrl();
+ }
+ autoProxyOptions.fAutoLogonIfChallenged = true;
+
+ try {
+ getProxyForUrl(hHttpSession, uri.toString(), autoProxyOptions, proxyInfo);
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Dynamic proxy configuration returned: Proxy '" + proxyInfo.getProxy()
+ + "'; ProxyByPass '" + proxyInfo.getProxyBypass() + "';");
+ }
+
+ ProxyBypass proxyBypass = new ProxyBypass(proxyInfo.getProxyBypass());
+ if (proxyBypass.bypassProxyFor(uri)) {
+ return EMPTY_PROXIES;
+ }
+ return toArray(ProxyProviderUtil.getProxies(proxyInfo.getProxy()));
+ } catch (LastErrorException e) {
+ // WPAD/PAC errors are intermittent, they can disappear when network
+ // configuration changes. Ignore errors, continue to static configuration.
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Dynamic proxy configuration returned error: " + formatMessage(e.getErrorCode()));
+ }
+ } finally {
+ proxyInfo.free();
+ }
+
+ }
+ // Static configuration
+ if (proxyConfig.lpszProxy != null) {
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Static proxy configuration: Proxy '" + proxyConfig.getProxy() + "'; ProxyByPass '"
+ + proxyConfig.getProxyBypass() + "';");
+ }
+ StaticProxyConfig staticProxyConfig = getStaticConfig(proxyConfig.getProxy(),
+ proxyConfig.getProxyBypass());
+
+ List<IProxyData> proxies = new ArrayList<>();
+ staticProxyConfig.select(uri, proxies);
+ return toArray(proxies);
+ }
+
+ // Default configuration direct connection
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("No proxy configuration");
+ }
+ return EMPTY_PROXIES;
+
+ } finally {
+ proxyConfig.free();
+ }
+ }
+
+ @Override
+ protected IProxyData[] getProxyData() {
+ WinHttp.WinHttpCurrentUserIEProxyConfig proxyConfig = getProxyConfig();
+ if (proxyConfig == null) {
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Error getting proxy configuration");
+ }
+ return EMPTY_PROXIES;
+ }
+
+ try {
+ if (isWinHttpInitialized && (proxyConfig.fAutoDetect || proxyConfig.lpszAutoConfigUrl != null)) {
+ // Dynamic configuration
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Dynamic proxy configuration");
+ }
+ ProxyData data = new ProxyData(IProxyData.HTTP_PROXY_TYPE, "", -1, false, "WINDOWS_IE");
+ data.setDynamic(true);
+ return new IProxyData[] { data };
+ } else {
+ // Static Configuration
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Static proxy configuration");
+ }
+ if (proxyConfig.lpszProxy != null) {
+ StaticProxyConfig staticProxyConfig = getStaticConfig(proxyConfig.getProxy(),
+ proxyConfig.getProxyBypass());
+ return staticProxyConfig.getProxyData();
+ }
+ }
+ } finally {
+ proxyConfig.free();
+ }
+ // Default configuration direct connection
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("No proxy configuration");
+ }
+ return EMPTY_PROXIES;
+ }
+
+ @Override
+ protected String[] getNonProxiedHosts() {
+ WinHttp.WinHttpCurrentUserIEProxyConfig proxyConfig = getProxyConfig();
+ if (proxyConfig == null) {
+ // No configuration
+ return null;
+ }
+
+ try {
+ if (isWinHttpInitialized && (proxyConfig.fAutoDetect || proxyConfig.lpszAutoConfigUrl != null)) {
+ // Dynamic configuration
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Dynamic proxy configuration");
+ }
+ return null;
+ } else if (proxyConfig.lpszProxy != null) {
+ // Static configuration
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("Static proxy configuration");
+ }
+ StaticProxyConfig staticProxyConfig = getStaticConfig(proxyConfig.getProxy(),
+ proxyConfig.getProxyBypass());
+ return staticProxyConfig.getNonProxiedHosts();
+ }
+ } finally {
+ proxyConfig.free();
+ }
+ if (Policy.DEBUG_SYSTEM_PROVIDERS) {
+ Policy.debug("No proxy configuration");
+ }
+ return null;
+ }
+
+ private void initialize() {
+ try {
+ hHttpSession = fWinHttp.WinHttpOpen(USER_AGENT, WinHttp.ACCESS_TYPE_NO_PROXY, WinHttp.NO_PROXY_NAME,
+ WinHttp.NO_PROXY_BYPASS, 0);
+ isWinHttpInitialized = true;
+ } catch (LastErrorException e) {
+ isWinHttpInitialized = false;
+ Activator.logError("Problem during initializing WinHTTP session:" + formatMessage(e.getErrorCode()), null);
+ }
+
+ }
+
+ private WinHttp.WinHttpCurrentUserIEProxyConfig getProxyConfig() {
+ if (isWinHttpLoaded) {
+ WinHttp.WinHttpCurrentUserIEProxyConfig proxyConfig = new WinHttp.WinHttpCurrentUserIEProxyConfig();
+ try {
+ fWinHttp.WinHttpGetIEProxyConfigForCurrentUser(proxyConfig);
+ return proxyConfig;
+ } catch (LastErrorException e) {
+ proxyConfig.free();
+ Activator.logError("Problem during loading proxy configuration: " + formatMessage(e.getErrorCode()),
+ null);
+ }
+ }
+ return null;
+ }
+
+ private StaticProxyConfig getStaticConfig(String proxyString, String proxyBypassString) {
+ if (fStaticProxyConfig == null || !StringUtil.equals(fProxiesString, proxyString)
+ || !StringUtil.equals(fProxyBypassString, proxyBypassString)) {
+ fStaticProxyConfig = new StaticProxyConfig(proxyString, proxyBypassString);
+ fProxiesString = proxyString;
+ fProxyBypassString = proxyBypassString;
+ }
+ return fStaticProxyConfig;
+ }
+
+ /**
+ * https://docs.microsoft.com/en-us/windows/win32/winhttp/autoproxy-cache To
+ * improve performance when WinHTTP uses the out-of-process resolver, it is
+ * necessary to first try resolving with fAutoLogonIfChallenged set to false.
+ */
+ private static boolean getProxyForUrl(Pointer hSession, String lpcwszUrl,
+ WinHttp.WinHttpAutoProxyOptions pAutoProxyOptions, WinHttp.WinHttpProxyInfo pProxyInfo)
+ throws LastErrorException {
+ try {
+ return fWinHttp.WinHttpGetProxyForUrl(hSession, lpcwszUrl, pAutoProxyOptions, pProxyInfo);
+ } catch (LastErrorException e) {
+ if (e.getErrorCode() == WinHttp.ERROR_LOGIN_FAILURE) {
+ pAutoProxyOptions.fAutoLogonIfChallenged = true;
+ return fWinHttp.WinHttpGetProxyForUrl(hSession, lpcwszUrl, pAutoProxyOptions, pProxyInfo);
+ }
+ throw e;
+ }
+ }
+
+ private static IProxyData[] toArray(List<IProxyData> proxies) {
+ return proxies.toArray(new IProxyData[proxies.size()]);
+ }
+
+ private interface WinHttp extends StdCallLibrary {
+ // WinHttp error codes
+ int ERROR_BASE = 12000;
+ int ERROR_LOGIN_FAILURE = ERROR_BASE + 15;
+ int ERROR_LAST = ERROR_BASE + 186;
+
+ // Values for WinHttpOpen dwAccessType
+ int ACCESS_TYPE_NO_PROXY = 1;
+
+ // Prettifiers for optional parameters WinHttpOpen pszProxy and pszProxyBypass
+ String NO_PROXY_NAME = null;
+ String NO_PROXY_BYPASS = null;
+
+ // Flags for WINHTTP_AUTOPROXY_OPTIONS::dwFlags
+ int AUTOPROXY_AUTO_DETECT = 0x00000001;;
+ int AUTOPROXY_CONFIG_URL = 0x00000002;
+
+ // Flags for WINHTTP_AUTOPROXY_OPTIONS::dwAutoDetectFlags
+ int AUTO_DETECT_TYPE_DHCP = 0x00000001;
+ int AUTO_DETECT_TYPE_DNS_A = 0x00000002;
+
+ boolean WinHttpCloseHandle(Pointer hInternet) throws LastErrorException;
+
+ Pointer WinHttpOpen(String pszAgent, int dwAccessType, String pszProxy, String pszProxyByPass, int dwFlags)
+ throws LastErrorException;
+
+ boolean WinHttpGetIEProxyConfigForCurrentUser(WinHttpCurrentUserIEProxyConfig pProxyConfig)
+ throws LastErrorException;
+
+ boolean WinHttpGetProxyForUrl(Pointer hSession, String lpcwszUrl, WinHttpAutoProxyOptions pAutoProxyOptions,
+ WinHttpProxyInfo pProxyInfo) throws LastErrorException;
+
+ @FieldOrder({ "dwFlags", "dwAutoDetectFlags", "lpszAutoConfigUrl", "lpvReserved", "dwReserved",
+ "fAutoLogonIfChallenged" })
+ @SuppressWarnings("unused")
+ static class WinHttpAutoProxyOptions extends Structure {
+ public int dwFlags;
+ public int dwAutoDetectFlags;
+ public String lpszAutoConfigUrl;
+ public Pointer lpvReserved;
+ public int dwReserved;
+ public boolean fAutoLogonIfChallenged;
+ }
+
+ @FieldOrder({ "dwAccessType", "lpszProxy", "lpszProxyBypass" })
+ @SuppressWarnings("unused")
+ static class WinHttpProxyInfo extends Structure {
+ public int dwAccessType;
+ public LPWSTR lpszProxy;
+ public LPWSTR lpszProxyBypass;
+
+ public String getProxy() {
+ return lpszProxy == null ? null : lpszProxy.getValue();
+ }
+
+ public String getProxyBypass() {
+ return lpszProxyBypass == null ? null : lpszProxyBypass.getValue();
+ }
+
+ public void free() {
+ if (lpszProxy != null) {
+ Kernel32Util.freeGlobalMemory(lpszProxy.getPointer());
+ }
+ if (lpszProxyBypass != null) {
+ Kernel32Util.freeGlobalMemory(lpszProxyBypass.getPointer());
+ }
+ }
+ }
+
+ @FieldOrder({ "fAutoDetect", "lpszAutoConfigUrl", "lpszProxy", "lpszProxyBypass" })
+ static class WinHttpCurrentUserIEProxyConfig extends Structure {
+ public boolean fAutoDetect;
+ public LPWSTR lpszAutoConfigUrl;
+ public LPWSTR lpszProxy;
+ public LPWSTR lpszProxyBypass;
+
+ public String getAutoConfigUrl() {
+ return lpszAutoConfigUrl == null ? null : lpszAutoConfigUrl.getValue();
+ }
+
+ public String getProxy() {
+ return lpszProxy == null ? null : lpszProxy.getValue();
+ }
+
+ public String getProxyBypass() {
+ return lpszProxyBypass == null ? null : lpszProxyBypass.getValue();
+ }
+
+ public void free() {
+ if (lpszAutoConfigUrl != null) {
+ Kernel32Util.freeGlobalMemory(lpszAutoConfigUrl.getPointer());
+ }
+ if (lpszProxy != null) {
+ Kernel32Util.freeGlobalMemory(lpszProxy.getPointer());
+ }
+ if (lpszProxyBypass != null) {
+ Kernel32Util.freeGlobalMemory(lpszProxyBypass.getPointer());
+ }
+ }
+ }
+ }
+
+ private static String formatMessage(int code) {
+ if (code >= WinHttp.ERROR_BASE && code <= WinHttp.ERROR_LAST) {
+ HMODULE hmodule = Kernel32.INSTANCE.GetModuleHandle(System.mapLibraryName(LIBRARY_NAME));
+
+ if (hmodule == null) {
+ return "Error code " + code + "; No error message due to failure of ´GetModuleHandle("
+ + System.mapLibraryName(LIBRARY_NAME) + ")´.";
+ } else {
+ PointerByReference msgBuf = new PointerByReference();
+ int size = Kernel32.INSTANCE.FormatMessage(
+ WinBase.FORMAT_MESSAGE_ALLOCATE_BUFFER | WinBase.FORMAT_MESSAGE_FROM_HMODULE
+ | WinBase.FORMAT_MESSAGE_IGNORE_INSERTS,
+ hmodule.getPointer(), code, WinNT.LANG_USER_DEFAULT, msgBuf, 0, null);
+ if (size == 0) {
+ return "Error code " + code + "; No error message due to error " + Native.getLastError();
+ }
+
+ Pointer ptr = msgBuf.getValue();
+ try {
+ String str = ptr.getWideString(0);
+ return str.trim();
+ } finally {
+ Kernel32Util.freeLocalMemory(ptr);
+ }
+ }
+ }
+
+ try {
+ return Kernel32Util.formatMessage(code);
+ } catch (LastErrorException e) {
+ return "Error code " + code + "; No error message due to error " + e.getErrorCode();
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.core.net/.cvsignore b/bundles/org.eclipse.core.net/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/bundles/org.eclipse.core.net/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.core.net/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.core.net/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.core.net/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.core.net/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.core.net/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.core.net/.settings/org.eclipse.pde.prefs
index e45ce0c90..a09ac0201 100644
--- a/bundles/org.eclipse.core.net/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.core.net/.settings/org.eclipse.pde.prefs
@@ -1,3 +1,3 @@
-eclipse.preferences.version=1
-compilers.p.missing-packages=1
-compilers.p.unresolved-ex-points=1
+eclipse.preferences.version=1
+compilers.p.missing-packages=1
+compilers.p.unresolved-ex-points=1
diff --git a/bundles/org.eclipse.core.net/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.net/META-INF/MANIFEST.MF
index b9fd8e003..df95f6fda 100644
--- a/bundles/org.eclipse.core.net/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.core.net/META-INF/MANIFEST.MF
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.core.net;singleton:=true
-Bundle-Version: 1.3.600.qualifier
+Bundle-Version: 1.3.1200.qualifier
Bundle-Activator: org.eclipse.core.internal.net.Activator
Bundle-Vendor: %PLUGIN_PROVIDER
Bundle-Localization: plugin
Require-Bundle: org.eclipse.equinox.security;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.equinox.common;bundle-version="3.4.0",
+ org.eclipse.equinox.common;bundle-version="3.12.0",
org.eclipse.equinox.preferences;bundle-version="3.2.200",
org.eclipse.osgi;bundle-version="3.4.0",
org.eclipse.equinox.registry;bundle-version="3.4.0"
diff --git a/bundles/org.eclipse.core.net/natives/unix/gnomeproxy.c b/bundles/org.eclipse.core.net/natives/unix/gnomeproxy.c
deleted file mode 100644
index 9ffd828a8..000000000
--- a/bundles/org.eclipse.core.net/natives/unix/gnomeproxy.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright 2008, 2018 Oakland Software Incorporated 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:
- * Oakland Software Incorporated - initial API and implementation
- * IBM Corporation - enabling JNI calls for gconfInit method (bug 232495)
- * IBM Corporation - gnomeproxy cannot be built with latest versions of glib (bug 385047)
- * Red Hat - GSettings implementation and code clean up (bug 394087)
- */
-
-#include <jni.h>
-
-#include <glib.h>
-#include <gio/gio.h>
-
-#ifdef __linux__
-#include <string.h>
-#else
-#include <strings.h>
-#endif
-
-static GSettings *proxySettings = NULL;
-static GSettings *httpProxySettings = NULL;
-static GSettings *httpsProxySettings = NULL;
-static GSettings *socksProxySettings = NULL;
-static GSettings *ftpProxySettings = NULL;
-
-static jclass proxyInfoClass;
-static jclass stringClass;
-static jmethodID proxyInfoConstructor;
-static jmethodID toString;
-
-static jmethodID hostMethod;
-static jmethodID portMethod;
-static jmethodID userMethod;
-static jmethodID passwordMethod;
-
-#define CHECK_NULL(X) { if ((X) == NULL) fprintf (stderr,"JNI error at line %d\n", __LINE__); }
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider
- * Method: gsettingsInit
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_gsettingsInit(
- JNIEnv *env, jclass clazz) {
-
- proxySettings = g_settings_new ("org.gnome.system.proxy");
- httpProxySettings = g_settings_new ("org.gnome.system.proxy.http");
- httpsProxySettings = g_settings_new ("org.gnome.system.proxy.https");
- socksProxySettings = g_settings_new ("org.gnome.system.proxy.socks");
- ftpProxySettings = g_settings_new ("org.gnome.system.proxy.ftp");
- jclass cls= NULL;
- CHECK_NULL(cls = (*env)->FindClass(env, "org/eclipse/core/internal/net/ProxyData"));
- proxyInfoClass = (*env)->NewGlobalRef(env, cls);
-
- CHECK_NULL(cls = (*env)->FindClass(env, "java/lang/String"));
- stringClass = (*env)->NewGlobalRef(env, cls);
-
- CHECK_NULL(proxyInfoConstructor = (*env)->GetMethodID(env, proxyInfoClass, "<init>", "(Ljava/lang/String;)V"));
-
- CHECK_NULL(toString = (*env)->GetMethodID(env, proxyInfoClass, "toString", "()Ljava/lang/String;"));
-
- CHECK_NULL(hostMethod = (*env)->GetMethodID(env, proxyInfoClass, "setHost",
- "(Ljava/lang/String;)V"));
- CHECK_NULL(portMethod = (*env)->GetMethodID(env, proxyInfoClass, "setPort",
- "(I)V"));
- CHECK_NULL(userMethod = (*env)->GetMethodID(env, proxyInfoClass, "setUserid",
- "(Ljava/lang/String;)V"));
- CHECK_NULL(passwordMethod = (*env)->GetMethodID(env, proxyInfoClass, "setPassword",
- "(Ljava/lang/String;)V"));
-}
-
-/*
- * Class: org_eclipse_core_internal_net_UnixProxyProvider
- * Method: getGSettingsProxyInfo
- * Signature: ([Ljava/lang/String);
- */
-JNIEXPORT jobject JNICALL Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_getGSettingsProxyInfo(
- JNIEnv *env, jclass clazz, jstring protocol) {
-
- jboolean isCopy;
- const char *cprotocol;
-
- jobject proxyInfo= NULL;
-
- if (proxySettings == NULL) {
- Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_gsettingsInit(env, clazz);
- }
-
- CHECK_NULL(proxyInfo = (*env)->NewObject(env, proxyInfoClass, proxyInfoConstructor, protocol));
-
- cprotocol = (*env)->GetStringUTFChars(env, protocol, &isCopy);
- if (cprotocol == NULL)
- return NULL;
-
- gboolean useSame = g_settings_get_boolean(proxySettings,
- "use-same-proxy");
-
- if (strcasecmp(cprotocol, "http") == 0 || useSame) {
- gboolean useProxy = g_settings_get_boolean(httpProxySettings,
- "enabled");
- if (!useProxy) {
- proxyInfo = NULL;
- goto exit;
- }
-
- gchar *host = g_settings_get_string(httpProxySettings,
- "host");
- jobject jhost = (*env)->NewStringUTF(env, host);
- (*env)->CallVoidMethod(env, proxyInfo, hostMethod, jhost);
- g_free(host);
-
- gint port = g_settings_get_int(httpProxySettings, "port");
- (*env)->CallVoidMethod(env, proxyInfo, portMethod, port);
-
- gboolean reqAuth = g_settings_get_boolean(httpProxySettings,
- "use-authentication");
- if (reqAuth) {
- gchar *user = g_settings_get_string(httpProxySettings,
- "authentication-user");
- jobject juser = (*env)->NewStringUTF(env, user);
- (*env)->CallVoidMethod(env, proxyInfo, userMethod, juser);
-
- gchar *password = g_settings_get_string(httpProxySettings,
- "authentication-password");
- jobject jpassword = (*env)->NewStringUTF(env, password);
- (*env)->CallVoidMethod(env, proxyInfo, passwordMethod,
- jpassword);
- g_free(user);
- g_free(password);
- }
- goto exit;
- }
-
- // Everything else applies only if the system proxy mode is manual
- gchar *mode = g_settings_get_string(proxySettings, "mode");
- if (strcasecmp(mode, "manual") != 0) {
- proxyInfo = NULL;
- goto exit;
- }
- g_free(mode);
-
- gchar *host;
- gint port;
- if (strcasecmp(cprotocol, "https") == 0) {
- host = g_settings_get_string(httpsProxySettings, "host");
- port = g_settings_get_int(httpsProxySettings, "port");
- } else if (strcasecmp(cprotocol, "socks") == 0) {
- host = g_settings_get_string(socksProxySettings, "host");
- port = g_settings_get_int(socksProxySettings, "port");
- } else if (strcasecmp(cprotocol, "ftp") == 0) {
- host = g_settings_get_string(ftpProxySettings, "host");
- port = g_settings_get_int(ftpProxySettings, "port");
- } else {
- proxyInfo = NULL;
- goto exit;
- }
-
- jobject jhost = (*env)->NewStringUTF(env, host);
- (*env)->CallVoidMethod(env, proxyInfo, hostMethod, jhost);
- (*env)->CallVoidMethod(env, proxyInfo, portMethod, port);
- g_free(host);
-
- exit: if (isCopy == JNI_TRUE)
- (*env)->ReleaseStringUTFChars(env, protocol, cprotocol);
- return proxyInfo;
-}
-
-typedef struct {
- jobjectArray npHostArray;
- JNIEnv *env;
- int index;
-} ListProcContext;
-
-// user_data is the ListProcContext
-void listProc(gpointer data, gpointer user_data) {
- ListProcContext *lpc = user_data;
- jobject jnpHost = (*lpc->env)->NewStringUTF(lpc->env, (char *)data);
- (*lpc->env)->SetObjectArrayElement(lpc->env, lpc->npHostArray,
- lpc->index++, jnpHost);
-}
-
-/*
- * Class: org_eclipse_core_internal_net_UnixProxyProvider
- * Method: getGSettingsNonProxyHosts
- * Signature: ()[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_getGSettingsNonProxyHosts(
- JNIEnv *env, jclass clazz) {
-
- if (proxySettings == NULL) {
- Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_gsettingsInit(env, clazz);
- }
-
- gchar **npfHostsArray;
- GSList *npHosts = NULL;
- gint size, i;
-
- npfHostsArray = g_settings_get_strv(proxySettings, "ignore-hosts");
-
- for (i = 0; npfHostsArray[i] != NULL; i++) {
- npHosts = g_slist_prepend(npHosts, npfHostsArray[i]);
- }
-
- npHosts = g_slist_reverse(npHosts);
- size = g_slist_length(npHosts);
- jobjectArray ret = (*env)->NewObjectArray(env, size, stringClass, NULL);
-
- ListProcContext lpc;
- lpc.env = env;
- lpc.npHostArray = ret;
- lpc.index = 0;
-
- g_slist_foreach(npHosts, listProc, &lpc);
- g_strfreev(npfHostsArray);
- g_slist_free(npHosts);
- return ret;
-}
-
diff --git a/bundles/org.eclipse.core.net/natives/unix/gnomeproxy.h b/bundles/org.eclipse.core.net/natives/unix/gnomeproxy.h
deleted file mode 100644
index 8dab51c91..000000000
--- a/bundles/org.eclipse.core.net/natives/unix/gnomeproxy.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider */
-
-#ifndef _Included_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider
-#define _Included_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* Inaccessible static: isGnomeLibLoaded */
-/*
- * Class: org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider
- * Method: gsettingsInit
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_gsettingsInit
- (JNIEnv *, jclass);
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider
- * Method: getGSettingsProxyInfo
- * Signature: (Ljava/lang/String;)Lorg/eclipse/core/internal/net/ProxyData;
- */
-JNIEXPORT jobject JNICALL Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_getGSettingsProxyInfo
- (JNIEnv *, jclass, jstring);
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider
- * Method: getGSettingsNonProxyHosts
- * Signature: ()[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_getGSettingsNonProxyHosts
- (JNIEnv *, jclass);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/bundles/org.eclipse.core.net/natives/unix/linux/makefile b/bundles/org.eclipse.core.net/natives/unix/linux/makefile
deleted file mode 100644
index 040a594a4..000000000
--- a/bundles/org.eclipse.core.net/natives/unix/linux/makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-#**********************************************************************
-# Copyright (c) 2008, 2018 Oakland Software Incorporated 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:
-# Oakland Software Incorporated - initial submission
-# IBM Corporation - refactoring, bug 245849
-# Red Hat - GSettings implementation and code clean up (bug 394087)
-#
-#**********************************************************************
-#
-# makefile for libgnomeproxy-1.0.0.so
-
-GNOMEPROXY.C = ../gnomeproxy.c
-GNOMEPROXY.O = gnomeproxy.o
-LIB_NAME = gnomeproxy.so
-LIB_NAME_FULL = libgnomeproxy-1.0.0.so
-
-OS_TYPE = linux
-JDK_INCLUDE = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/${OS_TYPE}
-INCLUDE = `pkg-config --cflags gio-2.0`
-COMPILER_FLAGS = -O0 -fPIC -g3 -Wall -c -fmessage-length=0 ${TARGET_ENVIRONMENT}
-
-LIBS := `pkg-config --libs gio-2.0`
-LINKER_FLAGS= ${TARGET_ENVIRONMENT}
-
-all: link
-
-compile:
- @echo "Building file: $(GNOMEPROXY.O)"
- @echo "Invoking: GCC C Compiler"
- gcc $(INCLUDE) $(JDK_INCLUDE) $(COMPILER_FLAGS) -o $(GNOMEPROXY.O) $(GNOMEPROXY.C)
- @echo "Finished building: $(GNOMEPROXY.O)"
- @echo " "
-
-link: compile
- @echo "Building target: $(LIB_NAME_FULL)"
- @echo "Invoking: GCC C Linker"
- gcc $(LINKER_FLAGS) -shared -Wl,-soname,$(LIB_NAME) -o $(LIB_NAME_FULL) $(LIBS) $(GNOMEPROXY.O) -lc
- @echo "Finished building target: $(LIB_NAME_FULL)"
- @echo " "
-
-clean:
- -$(RM) $(GNOMEPROXY.O) $(LIB_NAME_FULL)
- -@echo " "
diff --git a/bundles/org.eclipse.core.net/natives/win32/jWinHttp.cpp b/bundles/org.eclipse.core.net/natives/win32/jWinHttp.cpp
deleted file mode 100644
index 01f0420ba..000000000
--- a/bundles/org.eclipse.core.net/natives/win32/jWinHttp.cpp
+++ /dev/null
@@ -1,482 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 compeople AG 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:
- * compeople AG (Stefan Liebig) - initial API and implementation
- *******************************************************************************/
-
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-
-#define WIN32_LEAN_AND_MEAN
-
-#include <stdio.h>
-#include <iostream>
-#include <windows.h>
-#include <winhttp.h>
-#include <objbase.h>
-
-#include "jWinHttp.h"
-
-using namespace std;
-
-// Remember the GetLastError() after a failed WinHttp... call.
-static int lastError;
-
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- ) {
- switch (ul_reason_for_call) {
- case DLL_PROCESS_ATTACH:
- #ifdef _DEBUG
- cout << "DLL_PROCESS_ATTACH - jWinHttp" << endl;
- #endif
- break;
- case DLL_THREAD_ATTACH:
- #ifdef _DEBUG
- cout << "DLL_THREAD_ATTACH - jWinHttp" << endl;
- #endif
- break;
- case DLL_THREAD_DETACH:
- #ifdef _DEBUG
- cout << "DLL_THREAD_DETACH - jWinHttp" << endl;
- #endif
- break;
- case DLL_PROCESS_DETACH:
- #ifdef _DEBUG
- cout << "DLL_PROCESS_DETACH - jWinHttp" << endl;
- #endif
- break;
- }
- return TRUE;
-}
-
-
-/*
- * Helper for some ugly things!
- * ............................
- */
-
-const jchar * getStringChars( JNIEnv * env, jstring jString ) {
- if ( jString != NULL ) {
- return env->GetStringChars( jString, NULL );
- } else {
- return NULL;
- }
-}
-
-void releaseStringChars( JNIEnv * env, jstring jString, const jchar * jCharString ) {
- if ( jString != NULL ) {
- env->ReleaseStringChars( jString, jCharString );
- }
-}
-
-jobject newString( JNIEnv * env, LPWSTR string ) {
- return env->NewString( (const jchar *)string, lstrlenW( string ) );
-}
-
-void setStringField( JNIEnv * env, jclass jClass, jobject jObject, const char * field, LPWSTR value ) {
- if ( value != NULL ) {
- jfieldID jFieldId = env->GetFieldID( jClass, field, "Ljava/lang/String;" );
- env->SetObjectField( jObject, jFieldId, newString( env, value ) );
- GlobalFree( value );
- }
-}
-
-jstring getStringField( JNIEnv * env, jclass jClass, jobject jObject, const char * field ) {
- jfieldID jFieldId = env->GetFieldID( jClass, field, "Ljava/lang/String;" );
- return (jstring)env->GetObjectField( jObject, jFieldId );
-}
-
-void setBooleanField( JNIEnv * env, jclass jClass, jobject jObject, const char * field, BOOL value ) {
- jfieldID jFieldId = env->GetFieldID( jClass, field, "Z" );
- env->SetBooleanField( jObject, jFieldId, value );
-}
-
-jboolean getBooleanField( JNIEnv * env, jclass jClass, jobject jObject, const char * field ) {
- jfieldID jFieldId = env->GetFieldID( jClass, field, "Z" );
- return env->GetBooleanField( jObject, jFieldId );
-}
-
-void setIntField( JNIEnv * env, jclass jClass, jobject jObject, const char * field, jint value ) {
- jfieldID jFieldId = env->GetFieldID( jClass, field, "I" );
- env->SetIntField( jObject, jFieldId, value );
-}
-
-jint getIntField( JNIEnv * env, jclass jClass, jobject jObject, const char * field ) {
- jfieldID jFieldId = env->GetFieldID( jClass, field, "I" );
- return env->GetIntField( jObject, jFieldId );
-}
-
-#ifdef _DEBUG
- LPCWSTR null( const LPCWSTR string ) {
- if ( string == NULL ) {
- return (LPCWSTR) L"null";
- } else {
- return string;
- }
- }
-
- LPWSTR null( const LPWSTR string ) {
- if ( string == NULL ) {
- return (LPWSTR) L"null";
- } else {
- return string;
- }
- }
-#endif
-
-/*
- * The real ugly work goes on here!
- * ................................
- */
-
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: open
- * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;I)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_open
- (JNIEnv * env, jclass jClass, jstring jUserAgent, jint jAccessType, jstring jProxyName, jstring jProxyBypass, jint jFlags ) {
-
- #ifdef _DEBUG
- cout << "WinHttp_open - entered" << endl;
- #endif
-
- const jchar * userAgent = (const jchar *) L"jWinHttp Java Wrapper";
- const jchar * proxyName = NULL;
- const jchar * proxyBypass = NULL;
-
- userAgent = getStringChars( env, jUserAgent );
- proxyName = getStringChars( env, jProxyName );
- proxyBypass = getStringChars( env, jProxyBypass );
-
- CoInitialize( NULL ); // --> http://support.microsoft.com/?kbid=834742
-
- int hInternet = (int) WinHttpOpen( (LPCWSTR)userAgent, jAccessType, (LPCWSTR)proxyName, (LPCWSTR)proxyBypass, jFlags );
-
- if ( hInternet == NULL ) {
- lastError = GetLastError();
- #ifdef _DEBUG
- cout << "WinHttpOpen() failed with " << lastError << endl;
- #endif
- } else {
- lastError = 0;
- }
-
-
- #ifdef _DEBUG
- cout << "WinHttpOpen() returned: " << hInternet << endl;
- #endif
-
-
- releaseStringChars( env, jUserAgent, userAgent );
- releaseStringChars( env, jProxyName, proxyName );
- releaseStringChars( env, jProxyBypass, proxyBypass );
-
- #ifdef _DEBUG
- cout << "WinHttp_open - exit" << endl;
- #endif
-
- return hInternet;
-}
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: closeHandle
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_closeHandle
- (JNIEnv * env, jclass jClass, jint jInternet) {
-
- #ifdef _DEBUG
- cout << "WinHttp_closeHandle - entered" << endl;
- #endif
-
- BOOL ok = WinHttpCloseHandle( (void *) jInternet );
-
- if ( ! ok ) {
- lastError = GetLastError();
- #ifdef _DEBUG
- cout << "WinHttpClose() failed with " << lastError << endl;
- #endif
- } else {
- lastError = 0;
- }
-
- CoUninitialize();
-
- #ifdef _DEBUG
- cout << "WinHttp_closeHandle - exit" << endl;
- #endif
-
- return ok;
-}
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: getIEProxyConfigForCurrentUser
- * Signature: (Lorg/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpCurrentUserIEProxyConfig;)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_getIEProxyConfigForCurrentUser
- (JNIEnv * env, jclass jClass, jobject jWinHttpCurrentUserIEProxyConfig) {
-
- #ifdef _DEBUG
- cout << "WinHttp_getIEProxyConfigForCurrentUser - entered" << endl;
- #endif
-
- WINHTTP_CURRENT_USER_IE_PROXY_CONFIG proxyConfig;
- ZeroMemory( &proxyConfig, sizeof( proxyConfig ) );
-
- BOOL ok = WinHttpGetIEProxyConfigForCurrentUser( &proxyConfig );
-
- if ( ! ok ) {
- lastError = GetLastError();
- #ifdef _DEBUG
- cout << "HttpGetIEProxyConfigForCurrentUser() failed with " << lastError << endl;
- #endif
- }
-
- if ( ok ) {
-
- #ifdef _DEBUG
- cout << "proxyConfig.fAutoDetect: " << proxyConfig.fAutoDetect << endl;
- wcout << L"proxyConfig.lpszProxy: " << null( proxyConfig.lpszProxy ) << endl;
- wcout << L"proxyConfig.lpszProxyBypass: " << null( proxyConfig.lpszProxyBypass ) << endl;
- #endif
-
- lastError = 0;
- jclass jWinHttpCurrentUserIEProxyConfigClass = env->GetObjectClass( jWinHttpCurrentUserIEProxyConfig );
- setBooleanField( env,jWinHttpCurrentUserIEProxyConfigClass, jWinHttpCurrentUserIEProxyConfig, "isAutoDetect", proxyConfig.fAutoDetect );
- setStringField( env, jWinHttpCurrentUserIEProxyConfigClass, jWinHttpCurrentUserIEProxyConfig, "autoConfigUrl", proxyConfig.lpszAutoConfigUrl );
- setStringField( env, jWinHttpCurrentUserIEProxyConfigClass, jWinHttpCurrentUserIEProxyConfig, "proxy", proxyConfig.lpszProxy );
- setStringField( env, jWinHttpCurrentUserIEProxyConfigClass, jWinHttpCurrentUserIEProxyConfig, "proxyBypass", proxyConfig.lpszProxyBypass );
- }
-
-
- #ifdef _DEBUG
- cout << "WinHttp_getIEProxyConfigForCurrentUser - exit" << endl;
- #endif
-
- return ok;
-}
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: getProxyForUrl
- * Signature: (ILjava/lang/String;Lorg/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpAutoProxyOptions;Lorg/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyInfo;)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_getProxyForUrl
- (JNIEnv * env, jclass jClass, jint jInternet, jstring jUrl, jobject jWinHttpAutoProxyOptions, jobject jWinHttpProxyInfo ) {
-
- #ifdef _DEBUG
- cout << "WinHttp_getProxyForUrl - entered" << endl;
- #endif
-
- WINHTTP_AUTOPROXY_OPTIONS autoProxyOptions;
- ZeroMemory( &autoProxyOptions, sizeof( autoProxyOptions ) );
-
- jclass jWinHttpAutoProxyOptionsClass = env->GetObjectClass( jWinHttpAutoProxyOptions );
-
- autoProxyOptions.dwFlags = getIntField( env, jWinHttpAutoProxyOptionsClass, jWinHttpAutoProxyOptions, "flags" );
- autoProxyOptions.dwAutoDetectFlags = getIntField( env, jWinHttpAutoProxyOptionsClass, jWinHttpAutoProxyOptions, "autoDetectFlags" );
- jstring jAutoConfigUrl = getStringField( env, jWinHttpAutoProxyOptionsClass, jWinHttpAutoProxyOptions, "autoConfigUrl" );
- autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)getStringChars( env, jAutoConfigUrl );
-
- // The ´reserved´ fields will not be transfered!
- // - String reservedPointer
- // - int reservedInt
-
- autoProxyOptions.fAutoLogonIfChallenged = getBooleanField( env, jWinHttpAutoProxyOptionsClass, jWinHttpAutoProxyOptions, "autoLogonIfChallenged" );
-
- #ifdef _DEBUG
- cout << "autoProxyOptions.dwFlags: " << autoProxyOptions.dwFlags << endl;
- cout << "autoProxyOptions.dwAutoDetectFlags: " << autoProxyOptions.dwAutoDetectFlags << endl;
- wcout << L"autoProxyOptions.lpszAutoConfigUrl: " << null( autoProxyOptions.lpszAutoConfigUrl ) << endl;
- cout << "autoProxyOptions.fAutoLogonIfChallenged: " << autoProxyOptions.fAutoLogonIfChallenged << endl;
- #endif
-
- WINHTTP_PROXY_INFO proxyInfo;
- ZeroMemory( &proxyInfo, sizeof( proxyInfo ) );
-
- const jchar * url = getStringChars( env, jUrl );
-
- BOOL ok = WinHttpGetProxyForUrl( (void *)jInternet, (LPCWSTR)url, &autoProxyOptions, &proxyInfo );
-
- if ( ! ok ) {
- lastError = GetLastError();
- #ifdef _DEBUG
- cout << "WinHttpGetProxyForUrl() failed with " << lastError << endl;
- #endif
- }
-
- releaseStringChars( env, jUrl, url );
- releaseStringChars( env, jAutoConfigUrl, (const jchar *)autoProxyOptions.lpszAutoConfigUrl );
-
- if ( ok ) {
- lastError = 0;
- jclass jWinHttpProxyInfoClass = env->GetObjectClass( jWinHttpProxyInfo );
-
- #ifdef _DEBUG
- cout << "proxyInfo.dwAccessType: " << proxyInfo.dwAccessType << endl;
- wcout << L"proxyInfo.lpszProxy: " << null( proxyInfo.lpszProxy ) << endl;
- wcout << L"proxyInfo.lpszProxyBypass: " << null( proxyInfo.lpszProxyBypass ) << endl;
- #endif
-
- setIntField( env, jWinHttpProxyInfoClass, jWinHttpProxyInfo, "accessType", proxyInfo.dwAccessType );
- setStringField( env, jWinHttpProxyInfoClass, jWinHttpProxyInfo, "proxy", proxyInfo.lpszProxy );
- setStringField( env, jWinHttpProxyInfoClass, jWinHttpProxyInfo, "proxyBypass", proxyInfo.lpszProxyBypass );
- }
-
- #ifdef _DEBUG
- cout << "WinHttp_getProxyForUrl - exit" << endl;
- #endif
-
- return ok;
-}
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: detectAutoProxyConfigUrl
- * Signature: (Lorg/eclipse/core/internal/net/proxy/win32/winhttp/AutoProxyHolder;)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_detectAutoProxyConfigUrl
- (JNIEnv * env, jclass jClass, jobject jAutoProxyHolder) {
-
- #ifdef _DEBUG
- cout << "WinHttp_detectAutoProxyConfigUrl - entered" << endl;
- #endif
-
- jclass jAutoProxyHolderClass = env->GetObjectClass( jAutoProxyHolder );
- DWORD dwAutoDetectFlags = getIntField( env, jAutoProxyHolderClass, jAutoProxyHolder, "autoDetectFlags" );
-
- #ifdef _DEBUG
- cout << "autoProxyHolder.autoDetectFlags: " << dwAutoDetectFlags << endl;
- #endif
-
- LPWSTR pwszAutoConfigUrl;
-
- BOOL ok = WinHttpDetectAutoProxyConfigUrl( dwAutoDetectFlags, &pwszAutoConfigUrl );
-
- if ( ! ok ) {
- lastError = GetLastError();
- #ifdef _DEBUG
- cout << "WinHttpDetectAutoProxyConfigUrl() failed with " << lastError << endl;
- #endif
- }
-
- if ( ok ) {
- lastError = 0;
-
- #ifdef _DEBUG
- wcout << L"autoConfigUrl: " << null( pwszAutoConfigUrl ) << endl;
- #endif
-
- setStringField( env, jAutoProxyHolderClass, jAutoProxyHolder, "autoConfigUrl", pwszAutoConfigUrl );
- }
-
- #ifdef _DEBUG
- cout << "WinHttp_detectAutoProxyConfigUrl - exit" << endl;
- #endif
-
- return ok;
-}
-
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: getLastError
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_getLastError
- (JNIEnv * env, jclass jClass) {
-
- #ifdef _DEBUG
- cout << "WinHttp_getLastError - entered" << endl;
- #endif
-
- #ifdef _DEBUG
- cout << "WinHttp_getLastError - exit" << endl;
- #endif
-
- return lastError;
-}
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: getLastErrorMessage
- * Signature: ()Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_getLastErrorMessage
- (JNIEnv * env, jclass jClass) {
-
- #ifdef _DEBUG
- cout << "WinHttp_getLastErrorMessage - entered" << endl;
- #endif
-
- LPVOID lpMsgBuf = NULL;
- DWORD result = 0;
-
- if ( lastError >= WINHTTP_ERROR_BASE && lastError <= WINHTTP_ERROR_LAST ) {
- HMODULE hModule = GetModuleHandle( "winhttp.dll" );
-
- if ( hModule == NULL ) {
- lpMsgBuf = "Could not retrieve error message, because ´GetModuleHandle( \"winhttp.dll\" )´ failed.";
- } else {
- result = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_HMODULE |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- hModule,
- lastError,
- MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // Default language
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL );
- }
-
- } else {
- result = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- lastError,
- MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // Default language
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL );
- }
-
- if ( lpMsgBuf == NULL ) {
- #ifdef _DEBUG
- cout << "WinHttp_getLastErrorMessage() failed with " << GetLastError() << " for error code " << lastError << endl;
- #endif
-
- lpMsgBuf = "Could not retrieve error message.";
- }
-
- jstring string = env->NewStringUTF( (char *) lpMsgBuf );
-
- if ( result > 0 ) {
- // Free dynamically allocated buffer
- LocalFree( lpMsgBuf );
- }
-
- #ifdef _DEBUG
- cout << "WinHttp_getLastErrorMessage - exit" << endl;
- #endif
-
- return string;
-}
-
diff --git a/bundles/org.eclipse.core.net/natives/win32/jWinHttp.h b/bundles/org.eclipse.core.net/natives/win32/jWinHttp.h
deleted file mode 100644
index 5acba8435..000000000
--- a/bundles/org.eclipse.core.net/natives/win32/jWinHttp.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp */
-
-#ifndef _Included_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
-#define _Included_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: open
- * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;I)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_open
- (JNIEnv *, jclass, jstring, jint, jstring, jstring, jint);
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: closeHandle
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_closeHandle
- (JNIEnv *, jclass, jint);
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: getIEProxyConfigForCurrentUser
- * Signature: (Lorg/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpCurrentUserIEProxyConfig;)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_getIEProxyConfigForCurrentUser
- (JNIEnv *, jclass, jobject);
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: getProxyForUrl
- * Signature: (ILjava/lang/String;Lorg/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpAutoProxyOptions;Lorg/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyInfo;)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_getProxyForUrl
- (JNIEnv *, jclass, jint, jstring, jobject, jobject);
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: detectAutoProxyConfigUrl
- * Signature: (Lorg/eclipse/core/internal/net/proxy/win32/winhttp/AutoProxyHolder;)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_detectAutoProxyConfigUrl
- (JNIEnv *, jclass, jobject);
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: getLastError
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_getLastError
- (JNIEnv *, jclass);
-
-/*
- * Class: org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp
- * Method: getLastErrorMessage
- * Signature: ()Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_org_eclipse_core_internal_net_proxy_win32_winhttp_WinHttp_getLastErrorMessage
- (JNIEnv *, jclass);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/bundles/org.eclipse.core.net/natives/win32/x86/jWinHttp.vcproj b/bundles/org.eclipse.core.net/natives/win32/x86/jWinHttp.vcproj
deleted file mode 100644
index 3ed7f71f1..000000000
--- a/bundles/org.eclipse.core.net/natives/win32/x86/jWinHttp.vcproj
+++ /dev/null
@@ -1,234 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="jWinHttp"
- ProjectGUID="{463DB2C1-6B11-4DC9-A29D-E3AD15E5FAD1}"
- TargetFrameworkVersion="0"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=".\Debug/jWinHttp.tlb"
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;C:\Program Files\Java\jdk1.6.0_10\include\win32&quot;;&quot;C:\Program Files\Java\jdk1.6.0_10\include\&quot;;include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WINHTTP_EXPORTS"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- BrowseInformation="1"
- WarningLevel="3"
- SuppressStartupBanner="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1031"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="odbc32.lib odbccp32.lib winhttp.lib"
- OutputFile=".\Debug/jWinHttp-1.0.0.dll"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/jWinHttp.pdb"
- ImportLibrary=".\Debug/jWinHttp.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\Debug/jWinHttp.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=".\Release/jWinHttp.tlb"
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="&quot;C:\Program Files\Java\jdk1.6.0_10\include\win32&quot;;&quot;C:\Program Files\Java\jdk1.6.0_10\include\&quot;;include"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WINHTTP_EXPORTS"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1031"
- AdditionalIncludeDirectories="include"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winhttp.lib"
- OutputFile=".\Release/jWinHttp-1.0.0.dll"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/jWinHttp.pdb"
- ImportLibrary=".\Release/jWinHttp.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\Release/jWinHttp.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Quellcodedateien"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
- >
- <File
- RelativePath="..\jWinHttp.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header-Dateien"
- Filter="h;hpp;hxx;hm;inl"
- >
- <File
- RelativePath="..\jWinHttp.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Ressourcendateien"
- Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/bundles/org.eclipse.core.net/natives/win32/x86_64/jWinHttp.vcproj b/bundles/org.eclipse.core.net/natives/win32/x86_64/jWinHttp.vcproj
deleted file mode 100644
index 8525b089b..000000000
--- a/bundles/org.eclipse.core.net/natives/win32/x86_64/jWinHttp.vcproj
+++ /dev/null
@@ -1,424 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="jWinHttp"
- ProjectGUID="{463DB2C1-6B11-4DC9-A29D-E3AD15E5FAD1}"
- TargetFrameworkVersion="0"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=".\Debug/jWinHttp.tlb"
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;C:\Program Files\Java\jdk1.6.0_10\include\win32&quot;;&quot;C:\Program Files\Java\jdk1.6.0_10\include\&quot;;include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WINHTTP_EXPORTS"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- BrowseInformation="1"
- WarningLevel="3"
- SuppressStartupBanner="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1031"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="odbc32.lib odbccp32.lib winhttp.lib"
- OutputFile=".\Debug/jWinHttp-1.0.0.dll"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/jWinHttp.pdb"
- ImportLibrary=".\Debug/jWinHttp.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\Debug/jWinHttp.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=".\Release/jWinHttp.tlb"
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="&quot;C:\Program Files\Java\jdk1.6.0_10\include\win32&quot;;&quot;C:\Program Files\Java\jdk1.6.0_10\include\&quot;;include"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WINHTTP_EXPORTS"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1031"
- AdditionalIncludeDirectories="include"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winhttp.lib"
- OutputFile=".\Release/jWinHttp-1.0.0.dll"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/jWinHttp.pdb"
- ImportLibrary=".\Release/jWinHttp.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\Release/jWinHttp.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="3"
- TypeLibraryName=".\Debug/jWinHttp.tlb"
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;C:\Program Files\Java\jdk1.6.0_10\include\win32&quot;;&quot;C:\Program Files\Java\jdk1.6.0_10\include\&quot;;include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WINHTTP_EXPORTS"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- BrowseInformation="1"
- WarningLevel="3"
- SuppressStartupBanner="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1031"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="odbc32.lib odbccp32.lib winhttp.lib"
- OutputFile=".\Debug/jWinHttp-1.0.0.dll"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/jWinHttp.pdb"
- ImportLibrary=".\Debug/jWinHttp.lib"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\Debug/jWinHttp.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="3"
- TypeLibraryName=".\Release/jWinHttp.tlb"
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="&quot;C:\Program Files\Java\jdk1.6.0_10\include\win32&quot;;&quot;C:\Program Files\Java\jdk1.6.0_10\include\&quot;;include"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WINHTTP_EXPORTS"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1031"
- AdditionalIncludeDirectories="include"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winhttp.lib"
- OutputFile=".\Release/jWinHttp-1.0.0.dll"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/jWinHttp.pdb"
- ImportLibrary=".\Release/jWinHttp.lib"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\Release/jWinHttp.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Quellcodedateien"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
- >
- <File
- RelativePath="..\jWinHttp.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header-Dateien"
- Filter="h;hpp;hxx;hm;inl"
- >
- <File
- RelativePath="..\jWinHttp.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Ressourcendateien"
- Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/bundles/org.eclipse.core.net/pom.xml b/bundles/org.eclipse.core.net/pom.xml
index 03a26cd86..1e296c2c0 100644
--- a/bundles/org.eclipse.core.net/pom.xml
+++ b/bundles/org.eclipse.core.net/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.net</artifactId>
- <version>1.3.600-SNAPSHOT</version>
+ <version>1.3.1200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/Activator.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/Activator.java
index a115b9cf9..031680a5d 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/Activator.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/Activator.java
@@ -171,8 +171,7 @@ public class Activator implements BundleActivator {
properties.put(DebugOptions.LISTENER_SYMBOLICNAME, ID);
debugRegistration = context.registerService(DebugOptionsListener.class, Policy.DEBUG_OPTIONS_LISTENER, properties);
- if (Boolean
- .valueOf(System.getProperty(PROP_REGISTER_SERVICE, "true")).booleanValue()) { //$NON-NLS-1$
+ if (Boolean.parseBoolean(System.getProperty(PROP_REGISTER_SERVICE, "true"))) { //$NON-NLS-1$
ProxyManager proxyManager = (ProxyManager) ProxyManager
.getProxyManager();
proxyManager.initialize();
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java
index d7453ea7f..5e240e046 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java
@@ -318,10 +318,13 @@ public class ProxyManager implements IProxyService, IPreferenceChangeListener {
}
private boolean isHostFiltered(URI uri) {
- String[] filters = getNonProxiedHosts();
- for (String filter : filters) {
- if (StringUtil.hostMatchesFilter(uri.getHost(), filter))
- return true;
+ String host = uri.getHost();
+ if (host != null) {
+ String[] filters = getNonProxiedHosts();
+ for (String filter : filters) {
+ if (StringUtil.hostMatchesFilter(host, filter))
+ return true;
+ }
}
return false;
}
@@ -422,9 +425,12 @@ public class ProxyManager implements IProxyService, IPreferenceChangeListener {
@Override
public IProxyData[] select(URI uri) {
- IProxyData data = getProxyDataForHost(uri.getHost(), uri.getScheme());
- if (data != null) {
- return resolveType(new IProxyData[] { data });
+ String host = uri.getHost();
+ if (host != null) {
+ IProxyData data = getProxyDataForHost(host, uri.getScheme());
+ if (data != null) {
+ return resolveType(new IProxyData[] { data });
+ }
}
return new IProxyData[0];
}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java
index 10b60c74c..0f6b7ad51 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java
@@ -46,12 +46,17 @@ public class ProxySelector {
}
public static String localizeProvider(String name) {
- if (DIRECT_PROVIDER.equals(name)) {
- return Messages.ProxySelector_0;
- } else if (ECLIPSE_PROVIDER.equals(name)) {
- return Messages.ProxySelector_1;
- } else if (NATIVE_PROVIDER.equals(name)) {
- return Messages.ProxySelector_2;
+ if (name != null) {
+ switch (name) {
+ case DIRECT_PROVIDER:
+ return Messages.ProxySelector_0;
+ case ECLIPSE_PROVIDER:
+ return Messages.ProxySelector_1;
+ case NATIVE_PROVIDER:
+ return Messages.ProxySelector_2;
+ default:
+ break;
+ }
}
Assert.isTrue(false);
return null;
@@ -70,30 +75,36 @@ public class ProxySelector {
public static void setActiveProvider(String provider) {
IProxyService service = ProxyManager.getProxyManager();
- if (provider.equals(DIRECT_PROVIDER)) {
+ switch (provider) {
+ case DIRECT_PROVIDER:
service.setProxiesEnabled(false);
service.setSystemProxiesEnabled(false);
- } else if (provider.equals(ECLIPSE_PROVIDER)) {
+ break;
+ case ECLIPSE_PROVIDER:
service.setProxiesEnabled(true);
service.setSystemProxiesEnabled(false);
- } else if (provider.equals(NATIVE_PROVIDER)) {
+ break;
+ case NATIVE_PROVIDER:
service.setProxiesEnabled(true);
service.setSystemProxiesEnabled(true);
- } else {
+ break;
+ default:
throw new IllegalArgumentException("Provider not supported"); //$NON-NLS-1$
}
}
public static ProxyData[] getProxyData(String provider) {
ProxyManager manager = (ProxyManager) ProxyManager.getProxyManager();
- if (provider.equals(DIRECT_PROVIDER)) {
+ switch (provider) {
+ case DIRECT_PROVIDER:
return new ProxyData[0];
- } else if (provider.equals(ECLIPSE_PROVIDER)) {
+ case ECLIPSE_PROVIDER:
return castArray(manager.getProxyData());
- } else if (provider.equals(NATIVE_PROVIDER)) {
+ case NATIVE_PROVIDER:
return castArray(manager.getNativeProxyData());
+ default:
+ throw new IllegalArgumentException("Provider not supported"); //$NON-NLS-1$
}
- throw new IllegalArgumentException("Provider not supported"); //$NON-NLS-1$
}
private static ProxyData[] castArray(IProxyData data[]) {
@@ -127,14 +138,16 @@ public class ProxySelector {
public static String[] getBypassHosts(String provider) {
ProxyManager manager = (ProxyManager) ProxyManager.getProxyManager();
- if (provider.equals(DIRECT_PROVIDER)) {
+ switch (provider) {
+ case DIRECT_PROVIDER:
return new String[0];
- } else if (provider.equals(ECLIPSE_PROVIDER)) {
+ case ECLIPSE_PROVIDER:
return manager.getNonProxiedHosts();
- } else if (provider.equals(NATIVE_PROVIDER)) {
+ case NATIVE_PROVIDER:
return manager.getNativeNonProxiedHosts();
+ default:
+ throw new IllegalArgumentException("Provider not supported"); //$NON-NLS-1$
}
- throw new IllegalArgumentException("Provider not supported"); //$NON-NLS-1$
}
public static void setBypassHosts(String provider, String hosts[]) {
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java
index 613733402..955bfb1e7 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java
@@ -70,12 +70,16 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener
String value = System.getProperty(PROP_SOCKS_SYSTEM_PROPERTY_HANDLING);
if (value == null) {
socksSystemPropertySetting = ONLY_SET_FOR_1_5_OR_LATER;
- } else if (value.equals("always")) { //$NON-NLS-1$
+ } else switch (value) {
+ case "always": //$NON-NLS-1$
socksSystemPropertySetting = ALWAYS_SET;
- } else if (value.equals("never")) { //$NON-NLS-1$
+ break;
+ case "never": //$NON-NLS-1$
socksSystemPropertySetting = NEVER_SET;
- } else {
+ break;
+ default:
socksSystemPropertySetting = ONLY_SET_FOR_1_5_OR_LATER;
+ break;
}
}
@@ -218,12 +222,18 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener
/* package */void updateSystemProperties(IProxyData proxyData) {
try {
- if (proxyData.getType().equals(IProxyData.HTTP_PROXY_TYPE)) {
+ switch (proxyData.getType()) {
+ case IProxyData.HTTP_PROXY_TYPE:
updateHttpSystemProperties();
- } else if (proxyData.getType().equals(IProxyData.HTTPS_PROXY_TYPE)) {
+ break;
+ case IProxyData.HTTPS_PROXY_TYPE:
updateHttpsSystemProperties();
- } else if (proxyData.getType().equals(IProxyData.SOCKS_PROXY_TYPE)) {
+ break;
+ case IProxyData.SOCKS_PROXY_TYPE:
updateSocksSystemProperties();
+ break;
+ default:
+ break;
}
} catch (SecurityException e) {
Activator.logError("A security exception occurred while trying to put the proxy data into the system properties", e); //$NON-NLS-1$
@@ -233,12 +243,15 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener
private boolean verifyDataMatchesSystemProperties(ProxyData proxyData) {
try {
boolean proxiesEnabled = ProxyManager.getProxyManager().isProxiesEnabled();
- if (proxyData.getType().equals(IProxyData.HTTP_PROXY_TYPE)) {
+ switch (proxyData.getType()) {
+ case IProxyData.HTTP_PROXY_TYPE:
return verifyDataMatchesHttpSystemProperties(proxyData, proxiesEnabled);
- } else if (proxyData.getType().equals(IProxyData.HTTPS_PROXY_TYPE)) {
+ case IProxyData.HTTPS_PROXY_TYPE:
return verifyDataMatchesHttpsSystemProperties(proxyData, proxiesEnabled);
- } else if (proxyData.getType().equals(IProxyData.SOCKS_PROXY_TYPE)) {
+ case IProxyData.SOCKS_PROXY_TYPE:
return verifyDataMatchesSocksSystemProperties(proxyData, proxiesEnabled);
+ default:
+ break;
}
} catch (SecurityException e) {
@@ -333,12 +346,15 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener
private boolean verifySystemPropertiesEmpty(String proxyType) {
try {
- if (proxyType.equals(IProxyData.HTTP_PROXY_TYPE)) {
+ switch (proxyType) {
+ case IProxyData.HTTP_PROXY_TYPE:
return verifyHttpSystemPropertiesEmpty();
- } else if (proxyType.equals(IProxyData.HTTPS_PROXY_TYPE)) {
+ case IProxyData.HTTPS_PROXY_TYPE:
return verifyHttpsSystemPropertiesEmpty();
- } else if (proxyType.equals(IProxyData.SOCKS_PROXY_TYPE)) {
+ case IProxyData.SOCKS_PROXY_TYPE:
return verifySocksSystemPropertiesEmpty();
+ default:
+ break;
}
} catch (SecurityException e) {
// Just ignore this here since it will be surfaced elsewhere
@@ -394,7 +410,7 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener
boolean proxiesEnabled = isProxyEnabled();
Assert.isTrue(data.getType().equals(IProxyData.HTTP_PROXY_TYPE));
Properties sysProps = System.getProperties();
- if (!proxiesEnabled || data.getHost() == null || data.getHost().equals("")) { //$NON-NLS-1$
+ if (!proxiesEnabled || data.getHost() == null || data.getHost().isEmpty()) {
sysProps.remove("http.proxySet"); //$NON-NLS-1$
sysProps.remove("http.proxyHost"); //$NON-NLS-1$
sysProps.remove("http.proxyPort"); //$NON-NLS-1$
@@ -453,7 +469,7 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener
boolean proxiesEnabled = isProxyEnabled();
Assert.isTrue(data.getType().equals(IProxyData.HTTPS_PROXY_TYPE));
Properties sysProps = System.getProperties();
- if (!proxiesEnabled || data.getHost() == null || data.getHost().equals("")) { //$NON-NLS-1$
+ if (!proxiesEnabled || data.getHost() == null || data.getHost().isEmpty()) {
sysProps.remove("https.proxySet"); //$NON-NLS-1$
sysProps.remove("https.proxyHost"); //$NON-NLS-1$
sysProps.remove("https.proxyPort"); //$NON-NLS-1$
@@ -493,7 +509,7 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener
boolean proxiesEnabled = isProxyEnabled();
Assert.isTrue(data.getType().equals(IProxyData.SOCKS_PROXY_TYPE));
Properties sysProps = System.getProperties();
- if (!proxiesEnabled || data.getHost() == null || data.getHost().equals("")) { //$NON-NLS-1$
+ if (!proxiesEnabled || data.getHost() == null || data.getHost().isEmpty()) {
sysProps.remove("socksProxyHost"); //$NON-NLS-1$
sysProps.remove("socksProxyPort"); //$NON-NLS-1$
} else {
@@ -517,7 +533,10 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener
}
public void initialize() {
- updateSystemProperties(getProxyData(VERIFY_EMPTY));
+ // On mac, the system proxy configuration is set by the JVM automatically
+ boolean isMac = "macosx".equals(System.getProperty("osgi.os")); //$NON-NLS-1$//$NON-NLS-2$
+ int verify = isMac ? DO_NOT_VERIFY : VERIFY_EMPTY;
+ updateSystemProperties(getProxyData(verify));
preferenceManager.addNodeChangeListener(PREF_PROXY_DATA_NODE, this);
preferenceManager.addPreferenceChangeListener(getPreferenceNode(), this);
}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringMatcher.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringMatcher.java
deleted file mode 100644
index 7b33a9e78..000000000
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringMatcher.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2017 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.core.internal.net;
-
-import java.util.Vector;
-
-/**
- * A string pattern matcher, suppporting * and ? wildcards.
- * Note: code copied from org.eclipse.jdt.internal.core.util.StringMatcher on April 3, 2001
- * (version 0.1 - 010901H18 [rename jbl]).
- */
-public class StringMatcher {
- protected String fPattern;
- protected int fLength; // pattern length
- protected boolean fIgnoreWildCards;
- protected boolean fIgnoreCase;
- protected boolean fHasLeadingStar;
- protected boolean fHasTrailingStar;
- protected String fSegments[]; //the given pattern is split into * separated segments
-
- /* boundary value beyond which we don't need to search in the text */
- protected int fBound = 0;
-
-
- protected static final char fSingleWildCard = '\u0000';
-
- public static class Position {
- int start; //inclusive
- int end; //exclusive
- public Position(int start, int end) {
- this.start = start;
- this.end = end;
- }
- public int getStart() {
- return start;
- }
- public int getEnd() {
- return end;
- }
- }
- /**
- * Find the first occurrence of the pattern between <code>start</code)(inclusive)
- * and <code>end</code>(exclusive).
- * @param text the String object to search in
- * @param start the starting index of the search range, inclusive
- * @param end the ending index of the search range, exclusive
- * @return an <code>StringMatcher.Position</code> object that keeps the starting
- * (inclusive) and ending positions (exclusive) of the first occurrence of the
- * pattern in the specified range of the text; return null if not found or subtext
- * is empty (start==end). A pair of zeros is returned if pattern is empty string
- * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
- * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
- */
-
- public StringMatcher.Position find(String text, int start, int end) {
- if (fPattern == null|| text == null)
- throw new IllegalArgumentException();
-
- int tlen = text.length();
- if (start < 0)
- start = 0;
- if (end > tlen)
- end = tlen;
- if (end < 0 ||start >= end )
- return null;
- if (fLength == 0)
- return new Position(start, start);
- if (fIgnoreWildCards) {
- int x = posIn(text, start, end);
- if (x < 0)
- return null;
- return new Position(x, x+fLength);
- }
-
- int segCount = fSegments.length;
- if (segCount == 0)//pattern contains only '*'(s)
- return new Position (start, end);
-
- int curPos = start;
- int matchStart = -1;
- int i;
- for (i = 0; i < segCount && curPos < end; ++i) {
- String current = fSegments[i];
- int nextMatch = regExpPosIn(text, curPos, end, current);
- if (nextMatch < 0 )
- return null;
- if(i == 0)
- matchStart = nextMatch;
- curPos = nextMatch + current.length();
- }
- if (i < segCount)
- return null;
- return new Position(matchStart, curPos);
- }
- /**
- * StringMatcher constructor takes in a String object that is a simple
- * pattern which may contain '*' for 0 and many characters and
- * '?' for exactly one character.
- *
- * Literal '*' and '?' characters must be escaped in the pattern
- * e.g., "\*" means literal "*", etc.
- *
- * Escaping any other character (including the escape character itself),
- * just results in that character in the pattern.
- * e.g., "\a" means "a" and "\\" means "\"
- *
- * If invoking the StringMatcher with string literals in Java, don't forget
- * escape characters are represented by "\\".
- *
- * @param aPattern the pattern to match text with
- * @param ignoreCase if true, case is ignored
- * @param ignoreWildCards if true, wild cards and their escape sequences are ignored
- * (everything is taken literally).
- */
- public StringMatcher(String aPattern, boolean ignoreCase, boolean ignoreWildCards) {
- fIgnoreCase = ignoreCase;
- fIgnoreWildCards = ignoreWildCards;
- fLength = aPattern.length();
-
- /* convert case */
- if (fIgnoreCase) {
- fPattern = aPattern.toUpperCase();
- } else {
- fPattern = aPattern;
- }
-
- if (fIgnoreWildCards) {
- parseNoWildCards();
- } else {
- parseWildCards();
- }
- }
- /**
- * Given the starting (inclusive) and the ending (exclusive) poisitions in the
- * <code>text</code>, determine if the given substring matches with aPattern
- * @return true if the specified portion of the text matches the pattern
- * @param text a String object that contains the substring to match
- * @param start marks the starting position (inclusive) of the substring
- * @param end marks the ending index (exclusive) of the substring
- */
- public boolean match(String text, int start, int end) {
- if (null == text)
- throw new IllegalArgumentException();
-
- if (start > end)
- return false;
-
- if (fIgnoreWildCards)
- return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength);
- int segCount= fSegments.length;
- if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) // pattern contains only '*'(s)
- return true;
- if (start == end)
- return fLength == 0;
- if (fLength == 0)
- return start == end;
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
-
- int tCurPos= start;
- int bound= end - fBound;
- if ( bound < 0)
- return false;
- int i=0;
- String current= fSegments[i];
- int segLength= current.length();
-
- /* process first segment */
- if (!fHasLeadingStar){
- if(!regExpRegionMatches(text, start, current, 0, segLength)) {
- return false;
- }
- ++i;
- tCurPos= tCurPos + segLength;
- }
- if ((fSegments.length == 1) && (!fHasLeadingStar) && (!fHasTrailingStar)) {
- // only one segment to match, no wildcards specified
- return tCurPos == end;
- }
- /* process middle segments */
- while (i < segCount) {
- current= fSegments[i];
- int currentMatch;
- int k= current.indexOf(fSingleWildCard);
- if (k < 0) {
- currentMatch= textPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- } else {
- currentMatch= regExpPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- }
- tCurPos= currentMatch + current.length();
- i++;
- }
-
- /* process final segment */
- if (!fHasTrailingStar && tCurPos != end) {
- int clen= current.length();
- return regExpRegionMatches(text, end - clen, current, 0, clen);
- }
- return i == segCount ;
- }
- /**
- * match the given <code>text</code> with the pattern
- * @return true if matched eitherwise false
- * @param text a String object
- */
- public boolean match(String text) {
- return match(text, 0, text.length());
- }
- /**
- * This method parses the given pattern into segments seperated by wildcard '*' characters.
- * Since wildcards are not being used in this case, the pattern consists of a single segment.
- */
- private void parseNoWildCards() {
- fSegments = new String[1];
- fSegments[0] = fPattern;
- fBound = fLength;
- }
- /**
- * This method parses the given pattern into segments seperated by wildcard '*' characters.
- * @param p a String object that is a simple regular expression with '*' and/or '?'
- */
- private void parseWildCards() {
- if(fPattern.startsWith("*"))//$NON-NLS-1$
- fHasLeadingStar = true;
- if(fPattern.endsWith("*")) {//$NON-NLS-1$
- /* make sure it's not an escaped wildcard */
- if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
- fHasTrailingStar = true;
- }
- }
-
- Vector<String> temp = new Vector<>();
-
- int pos = 0;
- StringBuilder buf = new StringBuilder();
- while (pos < fLength) {
- char c = fPattern.charAt(pos++);
- switch (c) {
- case '\\':
- if (pos >= fLength) {
- buf.append(c);
- } else {
- char next = fPattern.charAt(pos++);
- /* if it's an escape sequence */
- if (next == '*' || next == '?' || next == '\\') {
- buf.append(next);
- } else {
- /* not an escape sequence, just insert literally */
- buf.append(c);
- buf.append(next);
- }
- }
- break;
- case '*':
- if (buf.length() > 0) {
- /* new segment */
- temp.addElement(buf.toString());
- fBound += buf.length();
- buf.setLength(0);
- }
- break;
- case '?':
- /* append special character representing single match wildcard */
- buf.append(fSingleWildCard);
- break;
- default:
- buf.append(c);
- }
- }
-
- /* add last buffer to segment list */
- if (buf.length() > 0) {
- temp.addElement(buf.toString());
- fBound += buf.length();
- }
-
- fSegments = new String[temp.size()];
- temp.copyInto(fSegments);
- }
- /**
- * @param text a string which contains no wildcard
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int posIn(String text, int start, int end) {//no wild card in pattern
- int max = end - fLength;
-
- if (!fIgnoreCase) {
- int i = text.indexOf(fPattern, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i = start; i <= max; ++i) {
- if (text.regionMatches(true, i, fPattern, 0, fLength))
- return i;
- }
-
- return -1;
- }
- /**
- * @param text a simple regular expression that may only contain '?'(s)
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a simple regular expression that may contains '?'
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int regExpPosIn(String text, int start, int end, String p) {
- int plen = p.length();
-
- int max = end - plen;
- for (int i = start; i <= max; ++i) {
- if (regExpRegionMatches(text, i, p, 0, plen))
- return i;
- }
- return -1;
- }
-
- /**
- *
- * @param text the text
- * @param tStart the start
- * @param p the pattern
- * @param pStart the pattern start
- * @param plen the pattern length
- * @return whether the region matches
- */
- protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) {
- while (plen-- > 0) {
- char tchar = text.charAt(tStart++);
- char pchar = p.charAt(pStart++);
-
- /* process wild cards */
- if (!fIgnoreWildCards) {
- /* skip single wild cards */
- if (pchar == fSingleWildCard) {
- continue;
- }
- }
- if (pchar == tchar)
- continue;
- if (fIgnoreCase) {
- char tc = Character.toUpperCase(tchar);
- if (tc == pchar)
- continue;
- }
- return false;
- }
- return true;
- }
- /**
- * @param text the string to match
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a string that has no wildcard
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int textPosIn(String text, int start, int end, String p) {
-
- int plen = p.length();
- int max = end - plen;
-
- if (!fIgnoreCase) {
- int i = text.indexOf(p, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i = start; i <= max; ++i) {
- if (text.regionMatches(true, i, p, 0, plen))
- return i;
- }
-
- return -1;
- }
-}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java
index f0f2fa41a..c5a77ca74 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java
@@ -15,6 +15,8 @@ package org.eclipse.core.internal.net;
import java.util.ArrayList;
+import org.eclipse.core.text.StringMatcher;
+
public class StringUtil {
/**
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/WindowsProxyProvider.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/WindowsProxyProvider.java
deleted file mode 100644
index 06ffc0dee..000000000
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/WindowsProxyProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2017 compeople AG 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:
- * compeople AG (Stefan Liebig) - initial API and implementation
- * IBM Corporation - implementation
- *******************************************************************************/
-package org.eclipse.core.internal.net;
-
-import java.net.URI;
-
-import org.eclipse.core.internal.net.proxy.win32.winhttp.WinHttpProxyProvider;
-import org.eclipse.core.net.proxy.IProxyData;
-
-public class WindowsProxyProvider extends AbstractProxyProvider {
-
- private static final String LIBRARY_NAME = "jWinHttp-1.0.0"; //$NON-NLS-1$
-
- private static boolean jWinHttpLoaded = false;
-
- static {
- try {
- System.loadLibrary(LIBRARY_NAME);
- if (Policy.DEBUG_SYSTEM_PROVIDERS)
- Policy.debug("Loaded " + LIBRARY_NAME + " library"); //$NON-NLS-1$ //$NON-NLS-2$
- jWinHttpLoaded = true;
- } catch (final UnsatisfiedLinkError e) {
- Activator.logError(
- "Could not load library: " + System.mapLibraryName(LIBRARY_NAME), e); //$NON-NLS-1$
- }
- }
-
- private WinHttpProxyProvider winHttpProxyProvider;
-
- public WindowsProxyProvider() {
- if (jWinHttpLoaded) {
- winHttpProxyProvider = new WinHttpProxyProvider();
- } else {
- winHttpProxyProvider = null;
- }
- }
-
- @Override
- public IProxyData[] select(URI uri) {
- IProxyData[] proxies = new IProxyData[0];
- if (jWinHttpLoaded) {
- proxies = winHttpProxyProvider.getProxyData(uri);
- }
- if (Policy.DEBUG) {
- Policy.debug("WindowsProxyProvider#select result for [" + uri + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- for (IProxyData proxy : proxies) {
- System.out.println(" " + proxy); //$NON-NLS-1$
- }
- }
- return proxies;
- }
-
- @Override
- protected IProxyData[] getProxyData() {
- if (jWinHttpLoaded) {
- return winHttpProxyProvider.getProxyData();
- }
- return new IProxyData[0];
- }
-
- @Override
- protected String[] getNonProxiedHosts() {
- if (jWinHttpLoaded) {
- return winHttpProxyProvider.getNonProxiedHosts();
- }
- return new String[0];
- }
-
-}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/AutoProxyHolder.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/AutoProxyHolder.java
deleted file mode 100644
index 143706b48..000000000
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/AutoProxyHolder.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 compeople AG 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:
- * compeople AG (Stefan Liebig) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.net.proxy.win32.winhttp;
-
-/**
- * This holder class just helps passing parameters into a native function and retrieve information
- * from it.
- * <p>
- * The fields will be written/read by the jni glue code.
- * </p>
- */
-public class AutoProxyHolder {
-
- public int autoDetectFlags;
-
- public String autoConfigUrl;
-
- /**
- * Set the auto detect flags.
- *
- * @param autoDetectFlags
- */
- public void setAutoDetectFlags(int autoDetectFlags) {
- this.autoDetectFlags= autoDetectFlags;
- }
-
- /**
- * Get the auto config url.
- *
- * @return the auto config url (pac file)
- */
- public String getAutoConfigUrl() {
- return autoConfigUrl;
- }
-
-}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttp.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttp.java
deleted file mode 100644
index 8973fa370..000000000
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttp.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 compeople AG 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:
- * compeople AG (Stefan Liebig) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.net.proxy.win32.winhttp;
-
-/**
- * This is the Win32 WinHttp wrapper.
- * <p>
- * Not complete, but offers what we currently need
- * </p>
- */
-public final class WinHttp {
-
- /**
- * The constant indicates the null proxy name parameter
- */
- static final String NO_PROXY_NAME= null;
-
- /**
- * The constant indicates the null proxy bypass parameter
- */
- static final String NO_PROXY_BYPASS= null;
-
- /**
- * WinHttpOpen - see Microsoft SDK Documentation
- *
- * @param userAgent
- * @param accessType
- * @param proxyName
- * @param proxyBypass
- * @param flags
- * @return the handle
- */
- public static native int open(String userAgent, int accessType, String proxyName, String proxyBypass, int flags);
-
- /**
- * WinHttpCloseHandle - see Microsoft SDK Documentation
- *
- * @param hInternet
- * @return true on success
- */
- public static native boolean closeHandle(int hInternet);
-
- /**
- * WinHttpGetIEProxyConfigForCurrentUser - see Microsoft SDK Documentation
- *
- * @param proxyConfig
- * @return true on success
- */
- public static native boolean getIEProxyConfigForCurrentUser(WinHttpCurrentUserIEProxyConfig proxyConfig);
-
- /**
- * WinHttpGetProxyForUrl - see Microsoft SDK Documentation
- *
- * @param hSession
- * @param url
- * @param autoProxyOptions
- * @param proxyInfo
- * @return true on success
- */
- public static native boolean getProxyForUrl(int hSession, String url, WinHttpAutoProxyOptions autoProxyOptions, WinHttpProxyInfo proxyInfo);
-
- /**
- * WinHttpDetectAutoProxyConfigUrl - see Microsoft SDK Documentation
- *
- * @param autoProxyHolder
- * @return true on success
- */
- public static native boolean detectAutoProxyConfigUrl(AutoProxyHolder autoProxyHolder);
-
- /**
- * GetLastError - see Microsoft SDK Documentation
- *
- * @return the last error code (win32)
- */
- public static native int getLastError();
-
- /**
- * GetLastErrorMessage - formats the last error
- *
- * @return the readable last error code
- */
- public static native String getLastErrorMessage();
-
-}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpAutoProxyOptions.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpAutoProxyOptions.java
deleted file mode 100644
index b8d647376..000000000
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpAutoProxyOptions.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 compeople AG 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:
- * compeople AG (Stefan Liebig) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.net.proxy.win32.winhttp;
-
-/**
- * Wrapper for Win32 WINHTTP_AUTOPROXY_OPTIONS Structure.
- * <p>
- * The fields will be read by the jni glue code.
- * </p>
- */
-public class WinHttpAutoProxyOptions {
-
- // Flags for WINHTTP_AUTOPROXY_OPTIONS::dwFlags
- public static final int WINHTTP_AUTOPROXY_AUTO_DETECT= 0x00000001;
-
- public static final int WINHTTP_AUTOPROXY_CONFIG_URL= 0x00000002;
-
- public static final int WINHTTP_AUTOPROXY_RUN_INPROCESS= 0x00010000;
-
- public static final int WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY= 0x00020000;
-
- // Flags for WINHTTP_AUTOPROXY_OPTIONS::dwAutoDetectFlags
- public static final int WINHTTP_AUTO_DETECT_TYPE_DHCP= 0x00000001;
-
- public static final int WINHTTP_AUTO_DETECT_TYPE_DNS_A= 0x00000002;
-
- public int flags;
-
- public int autoDetectFlags;
-
- public String autoConfigUrl;
-
- public String reservedPointer;
-
- public int reservedInt;
-
- public boolean autoLogonIfChallenged;
-
- /**
- * @param autoConfigUrl the autoConfigUrl to set
- */
- public void setAutoConfigUrl(String autoConfigUrl) {
- this.autoConfigUrl= autoConfigUrl;
- }
-
- /**
- * @param autoDetectFlags the autoDetectFlags to set
- */
- public void setAutoDetectFlags(int autoDetectFlags) {
- this.autoDetectFlags= autoDetectFlags;
- }
-
- /**
- * @param autoLogonIfChallenged the autoLogonIfChallenged to set
- */
- public void setAutoLogonIfChallenged(boolean autoLogonIfChallenged) {
- this.autoLogonIfChallenged= autoLogonIfChallenged;
- }
-
- /**
- * @param flags the flags to set
- */
- public void setFlags(int flags) {
- this.flags= flags;
- }
-
-}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpCurrentUserIEProxyConfig.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpCurrentUserIEProxyConfig.java
deleted file mode 100644
index ca63b2d7b..000000000
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpCurrentUserIEProxyConfig.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 compeople AG 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:
- * compeople AG (Stefan Liebig) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.net.proxy.win32.winhttp;
-
-import org.eclipse.core.internal.net.StringUtil;
-
-/**
- * Wrapper for Win32 WINHTTP_CURRENT_USER_IE_PROXY_CONFIG structure.<br>
- * Plus a few helper methods that enrich the plain C structure.
- * <p>
- * The fields will be written by the jni glue code.
- * </p>
- */
-public class WinHttpCurrentUserIEProxyConfig {
-
- public boolean isAutoDetect;
- public String autoConfigUrl;
- public String proxy;
- public String proxyBypass;
-
- /**
- * @return the autoConfigUrl
- */
- public String getAutoConfigUrl() {
- return autoConfigUrl;
- }
-
- /**
- * @return the proxy
- */
- public String getProxy() {
- return proxy;
- }
-
- /**
- * @return the proxyBypass
- */
- public String getProxyBypass() {
- return proxyBypass;
- }
-
- /**
- * I auto detection requested?
- *
- * @return the isAutoDetect
- */
- public boolean isAutoDetect() {
- return isAutoDetect;
- }
-
- /**
- * Is a auto config url reqested?
- *
- * @return true if there is a auto config url
- */
- public boolean isAutoConfigUrl() {
- return autoConfigUrl != null && autoConfigUrl.length() != 0;
- }
-
- /**
- * Are static proxies defined?
- *
- * @return the isStaticProxy
- */
- public boolean isStaticProxy() {
- return proxy != null && proxy.length() != 0;
- }
-
- /**
- * Did the auto-detect change?
- *
- * @param proxyConfig
- * the proxy config; maybe null
- * @return true if changed
- */
- public boolean autoDetectChanged(WinHttpCurrentUserIEProxyConfig proxyConfig) {
- if (proxyConfig == null)
- return true;
- return isAutoDetect != proxyConfig.isAutoDetect;
- }
-
- /**
- * Did the auto-config url change?
- *
- * @param proxyConfig
- * the proxy config; maybe null
- * @return true if changed
- */
- public boolean autoConfigUrlChanged(
- WinHttpCurrentUserIEProxyConfig proxyConfig) {
- if (proxyConfig == null)
- return true;
- return !StringUtil.equals(autoConfigUrl,
- proxyConfig.autoConfigUrl);
- }
-
- /**
- * Did the static proxy information change?
- *
- * @param proxyConfig
- * the proxy config; maybe null
- * @return true if changed
- */
- public boolean staticProxyChanged(
- WinHttpCurrentUserIEProxyConfig proxyConfig) {
- if (proxyConfig == null)
- return true;
- return !(StringUtil.equals(proxy, proxyConfig.proxy) && StringUtil
- .equals(proxyBypass, proxyConfig.proxyBypass));
- }
-
-}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyInfo.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyInfo.java
deleted file mode 100644
index cbd632f4d..000000000
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyInfo.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 compeople AG 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:
- * compeople AG (Stefan Liebig) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.net.proxy.win32.winhttp;
-
-/**
- * Wrapper for Win32 WINHTTP_PROXY_INFO Structure.
- * <p>
- * The fields will be written by the jni glue code.
- * </p>
- */
-public class WinHttpProxyInfo {
-
- // WinHttpOpen dwAccessType values (also for
- // WINHTTP_PROXY_INFO::dwAccessType)
- public static final int WINHTTP_ACCESS_TYPE_DEFAULT_PROXY= 0;
-
- public static final int WINHTTP_ACCESS_TYPE_NO_PROXY= 1;
-
- public static final int WINHTTP_ACCESS_TYPE_NAMED_PROXY= 3;
-
- public int accessType;
-
- public String proxy;
-
- public String proxyBypass;
-
- /**
- * @return the accessType
- */
- public int getAccessType() {
- return accessType;
- }
-
- /**
- * @return the proxy
- */
- public String getProxy() {
- return proxy;
- }
-
- /**
- * @return the proxyBypass
- */
- public String getProxyBypass() {
- return proxyBypass;
- }
-
-}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyProvider.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyProvider.java
deleted file mode 100644
index 05f853737..000000000
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyProvider.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2017 compeople AG 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:
- * compeople AG (Stefan Liebig) - initial API and implementation
- * IBM Corporation - Add proxy providers layer on the top of ProxyManager (bug 255616)
- *******************************************************************************/
-package org.eclipse.core.internal.net.proxy.win32.winhttp;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.internal.net.Activator;
-import org.eclipse.core.internal.net.ProxyData;
-import org.eclipse.core.net.proxy.IProxyData;
-
-/**
- * The <code>WinHttpProxyProvivider</code> gets its settings from the
- * "internet options >> connection settings". For this it uses the Windows
- * WinHttp API.
- *
- * @see "http://msdn2.microsoft.com/en-us/library/aa382925(VS.85).aspx"
- */
-public class WinHttpProxyProvider {
-
- private WinHttpCurrentUserIEProxyConfig proxyConfig;
- private StaticProxyConfig staticProxyConfig;
- private String wpadAutoConfigUrl;
- private boolean tryWpadGetUrl;
- private boolean tryPac;
-
- // Buffered delayed logging to avoid deadlocks. Logging itself might trigger
- // through listeners/appenders other threads to do some communication which in
- // turn uses this proxy provider.
- private String logMessage;
- private Throwable logThrowable;
-
- private static final ProxyData[] EMPTY_PROXIES = new ProxyData[0];
- private static final String MY_NAME = WinHttpProxyProvider.class.getName();
-
- /**
- * Retrieve the proxies that are suitable for the given uri. An empty array
- * of proxies indicates that no proxy should be used (direct connection).
- * This method considers already the �no proxy for� definition of the
- * internet options dialog.
- *
- * @param uri
- * @return an array of proxies
- */
- public IProxyData[] getProxyData(URI uri) {
- logMessage = null;
- IProxyData[] proxies;
- synchronized (this) {
- proxies = getProxyDataUnsynchronized(uri);
- }
- if (logMessage != null)
- Activator.logError(logMessage, logThrowable);
- return proxies;
- }
-
- public IProxyData[] getProxyData() {
- logMessage = null;
- IProxyData[] proxies;
- synchronized (this) {
- proxies = getProxyDataUnsynchronized();
- }
- if (logMessage != null)
- Activator.logError(logMessage, logThrowable);
- return proxies;
- }
-
- private IProxyData[] getProxyDataUnsynchronized() {
- WinHttpCurrentUserIEProxyConfig newProxyConfig = new WinHttpCurrentUserIEProxyConfig();
- if (!WinHttp.getIEProxyConfigForCurrentUser(newProxyConfig)) {
- logError(
- "WinHttp.GetIEProxyConfigForCurrentUser failed with error '" + WinHttp.getLastErrorMessage() + "' #" + WinHttp.getLastError() + ".", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return EMPTY_PROXIES;
- }
-
- // Explicit proxies defined?
- if (newProxyConfig.isStaticProxy()) {
- // Yes, let�s see if we are still up-to-date
- if (newProxyConfig.staticProxyChanged(proxyConfig))
- staticProxyConfig = new StaticProxyConfig(newProxyConfig
- .getProxy(), newProxyConfig.getProxyBypass());
-
- return staticProxyConfig.getProxyData();
- }
-
- // Let�s find out if auto detect has changed.
- if (newProxyConfig.autoDetectChanged(proxyConfig)) {
- tryWpadGetUrl = newProxyConfig.isAutoDetect();
- if (!tryWpadGetUrl)
- wpadAutoConfigUrl = null;
- }
-
- // Let�s find out if pac file url has changed.
- if (newProxyConfig.autoConfigUrlChanged(proxyConfig))
- tryPac = newProxyConfig.isAutoConfigUrl();
-
- if (!tryPac && wpadAutoConfigUrl == null)
- return new IProxyData[0];
-
- ProxyData data = new ProxyData(IProxyData.HTTP_PROXY_TYPE, "", -1, //$NON-NLS-1$
- false, "WINDOWS_IE"); //$NON-NLS-1$
- data.setDynamic(true);
- return new IProxyData[] { data };
- }
-
- public String[] getNonProxiedHosts() {
- logMessage = null;
- String[] hosts;
- synchronized (this) {
- hosts = getNonProxiedHostsUnsynchronized();
- }
- if (logMessage != null)
- Activator.logError(logMessage, logThrowable);
- return hosts;
- }
-
- private String[] getNonProxiedHostsUnsynchronized() {
- WinHttpCurrentUserIEProxyConfig newProxyConfig = new WinHttpCurrentUserIEProxyConfig();
- if (!WinHttp.getIEProxyConfigForCurrentUser(newProxyConfig)) {
- logError(
- "WinHttp.GetIEProxyConfigForCurrentUser failed with error '" + WinHttp.getLastErrorMessage() + "' #" + WinHttp.getLastError() + ".", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return new String[0];
- }
- if (newProxyConfig.isStaticProxy()) {
- // Yes, let�s see if we are still up-to-date
- if (newProxyConfig.staticProxyChanged(proxyConfig))
- staticProxyConfig = new StaticProxyConfig(newProxyConfig
- .getProxy(), newProxyConfig.getProxyBypass());
- return staticProxyConfig.getNonProxiedHosts();
- }
- return null;
- }
-
- /**
- * This method is the not synchronized counterpart of
- * <code>getProxyData</code>.
- *
- * @param uri
- * @return an array of proxies
- */
- private IProxyData[] getProxyDataUnsynchronized(URI uri) {
- WinHttpCurrentUserIEProxyConfig newProxyConfig = new WinHttpCurrentUserIEProxyConfig();
- if (!WinHttp.getIEProxyConfigForCurrentUser(newProxyConfig)) {
- logError(
- "WinHttp.GetIEProxyConfigForCurrentUser failed with error '" + WinHttp.getLastErrorMessage() + "' #" + WinHttp.getLastError() + ".", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return EMPTY_PROXIES;
- }
-
- List<IProxyData> proxies = new ArrayList<>();
-
- // Let�s find out if auto detect has changed.
- if (newProxyConfig.autoDetectChanged(proxyConfig)) {
- tryWpadGetUrl = newProxyConfig.isAutoDetect();
- if (!tryWpadGetUrl)
- wpadAutoConfigUrl = null;
- }
-
- // Let�s find out if pac file url has changed.
- if (newProxyConfig.autoConfigUrlChanged(proxyConfig))
- tryPac = newProxyConfig.isAutoConfigUrl();
-
- // Explicit proxies defined?
- if (newProxyConfig.isStaticProxy()) {
- // Yes, let�s see if we are still up-to-date
- if (newProxyConfig.staticProxyChanged(proxyConfig))
- staticProxyConfig = new StaticProxyConfig(newProxyConfig
- .getProxy(), newProxyConfig.getProxyBypass());
-
- staticProxyConfig.select(uri, proxies);
- }
- proxyConfig = newProxyConfig;
-
- if (!tryPac && wpadAutoConfigUrl == null)
- return toArray(proxies);
-
- // Create the WinHTTP session.
- int hHttpSession = WinHttp.open(MY_NAME,
- WinHttpProxyInfo.WINHTTP_ACCESS_TYPE_NO_PROXY,
- WinHttp.NO_PROXY_NAME, WinHttp.NO_PROXY_BYPASS, 0);
- if (hHttpSession == 0) {
- logError(
- "WinHttp.Open failed with error'" + WinHttp.getLastErrorMessage() + "' #" + WinHttp.getLastError() + ".", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return toArray(proxies);
- }
-
- try {
- pacSelect(hHttpSession, uri, proxies);
- wpadSelect(hHttpSession, uri, proxies);
- } finally {
- WinHttp.closeHandle(hHttpSession);
- }
-
- return toArray(proxies);
- }
-
- protected void pacSelect(int hHttpSession, URI uri, List<IProxyData> proxies) {
- if (!tryPac)
- return;
- List<IProxyData> pacProxies = pacSelect(hHttpSession, proxyConfig
- .getAutoConfigUrl(), uri);
- if (pacProxies == null)
- tryPac = false;
- else
- proxies.addAll(pacProxies);
-
- }
-
- protected void wpadSelect(int hHttpSession, URI uri, List<IProxyData> proxies) {
- if (tryWpadGetUrl) {
- tryWpadGetUrl = false;
- AutoProxyHolder autoProxyHolder = new AutoProxyHolder();
- autoProxyHolder
- .setAutoDetectFlags(WinHttpAutoProxyOptions.WINHTTP_AUTO_DETECT_TYPE_DHCP
- | WinHttpAutoProxyOptions.WINHTTP_AUTO_DETECT_TYPE_DNS_A);
- boolean ok = WinHttp.detectAutoProxyConfigUrl(autoProxyHolder);
- if (!ok) {
- logError(
- "WinHttp.DetectAutoProxyConfigUrl for wpad failed with error '" + WinHttp.getLastErrorMessage() + "' #" + WinHttp.getLastError() + ".", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return;
- }
- wpadAutoConfigUrl = autoProxyHolder.getAutoConfigUrl();
- }
- if (wpadAutoConfigUrl == null)
- return;
- List<IProxyData> wpadProxies = pacSelect(hHttpSession, wpadAutoConfigUrl, uri);
- if (wpadProxies == null)
- wpadAutoConfigUrl = null;
- else
- proxies.addAll(wpadProxies);
- }
-
- /**
- * Retrieve the proxies from the specified pac file url.
- *
- * @param hHttpSession
- * @param configUrl
- * @param uri
- * @return a list of proxies (IProxyData) or null in case of an error.
- */
- protected List<IProxyData> pacSelect(int hHttpSession, String configUrl, URI uri) {
- // Don�t ask for anything else than http or https since that is not
- // supported by WinHttp pac file support:
- // ERROR_WINHTTP_UNRECOGNIZED_SCHEME
- if (!IProxyData.HTTP_PROXY_TYPE.equalsIgnoreCase(uri.getScheme())
- && !IProxyData.HTTPS_PROXY_TYPE.equalsIgnoreCase(uri
- .getScheme()))
- return Collections.emptyList();
- // Set up the autoproxy call.
- WinHttpAutoProxyOptions autoProxyOptions = new WinHttpAutoProxyOptions();
- autoProxyOptions
- .setFlags(WinHttpAutoProxyOptions.WINHTTP_AUTOPROXY_CONFIG_URL);
- autoProxyOptions.setAutoConfigUrl(configUrl);
- autoProxyOptions.setAutoLogonIfChallenged(true);
- WinHttpProxyInfo proxyInfo = new WinHttpProxyInfo();
-
- boolean ok = WinHttp.getProxyForUrl(hHttpSession, uri.toString(),
- autoProxyOptions, proxyInfo);
- if (!ok) {
- logError(
- "WinHttp.GetProxyForUrl for pac failed with error '" + WinHttp.getLastErrorMessage() + "' #" + WinHttp.getLastError() + ".", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return null;
- }
- ProxyBypass proxyBypass = new ProxyBypass(proxyInfo.getProxyBypass());
- if (proxyBypass.bypassProxyFor(uri))
- return Collections.emptyList();
- return ProxyProviderUtil.getProxies(proxyInfo.getProxy());
- }
-
- private void logError(String message, Throwable throwable) {
- this.logMessage = message;
- this.logThrowable = throwable;
- }
-
- private static IProxyData[] toArray(List<IProxyData> proxies) {
- return proxies.toArray(new IProxyData[proxies.size()]);
- }
-
-}
diff --git a/bundles/org.eclipse.cvs/META-INF/MANIFEST.MF b/bundles/org.eclipse.cvs/META-INF/MANIFEST.MF
index e2bcb1c77..51263fd78 100644
--- a/bundles/org.eclipse.cvs/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.cvs/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cvs; singleton:=true
-Bundle-Version: 1.4.1100.qualifier
+Bundle-Version: 1.4.2100.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.cvs/about.properties b/bundles/org.eclipse.cvs/about.properties
index ee16b2c8b..c575797c1 100644
--- a/bundles/org.eclipse.cvs/about.properties
+++ b/bundles/org.eclipse.cvs/about.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2018 IBM Corporation and others.
+# Copyright (c) 2000, 2021 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
@@ -22,6 +22,6 @@ blurb=Eclipse CVS Client\n\
Version: {featureVersion}\n\
Build id: {0}\n\
\n\
-(c) Copyright Eclipse contributors and others 2000, 2019. All rights reserved.\n\
+(c) Copyright Eclipse contributors and others 2000, 2021. All rights reserved.\n\
Visit http://www.eclipse.org/eclipse/platform-cvs
diff --git a/bundles/org.eclipse.cvs/pom.xml b/bundles/org.eclipse.cvs/pom.xml
index 1cf650941..0f40be4d3 100644
--- a/bundles/org.eclipse.cvs/pom.xml
+++ b/bundles/org.eclipse.cvs/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2017 Eclipse Foundation and others.
+ Copyright (c) 2012, 2019 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -14,12 +14,12 @@
<parent>
<groupId>eclipse.platform.team</groupId>
<artifactId>eclipse.platform.team</artifactId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.cvs</groupId>
<artifactId>org.eclipse.cvs</artifactId>
- <version>1.4.1100-SNAPSHOT</version>
+ <version>1.4.2100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
diff --git a/bundles/org.eclipse.jsch.core/.cvsignore b/bundles/org.eclipse.jsch.core/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/bundles/org.eclipse.jsch.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.jsch.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.jsch.core/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.jsch.core/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.jsch.core/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
index 067a863b8..3b79680d1 100644
--- a/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jsch.core;singleton:=true
-Bundle-Version: 1.3.600.qualifier
+Bundle-Version: 1.3.900.qualifier
Bundle-Activator: org.eclipse.jsch.internal.core.JSchCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jsch.core/pom.xml b/bundles/org.eclipse.jsch.core/pom.xml
index 3cb502496..6d4bc82c7 100644
--- a/bundles/org.eclipse.jsch.core/pom.xml
+++ b/bundles/org.eclipse.jsch.core/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.jsch</groupId>
<artifactId>org.eclipse.jsch.core</artifactId>
- <version>1.3.600-SNAPSHOT</version>
+ <version>1.3.900-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/core/IJSchService.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/core/IJSchService.java
index 8bbcc8e51..da6f833b9 100644
--- a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/core/IJSchService.java
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/core/IJSchService.java
@@ -110,7 +110,7 @@ public interface IJSchService{
* @param monitor
* a progress monitor or <code>null</code> if progress and
* cancelation is not desired
- * @throws JSchException
+ * @throws JSchException if errors occur
*/
public abstract void connect(Proxy proxy, String host, int port, int timeout,
IProgressMonitor monitor) throws JSchException;
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Messages.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Messages.java
index c694d7b26..9144da895 100644
--- a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Messages.java
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Messages.java
@@ -1,15 +1,16 @@
-/**********************************************************************
+/*******************************************************************************
* Copyright (c) 2007 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
-t https://www.eclipse.org/legal/epl-2.0/
-t
-t SPDX-License-Identifier: EPL-2.0
+ * 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 - Initial API and implementation
- **********************************************************************/
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
package org.eclipse.jsch.internal.core;
import org.eclipse.osgi.util.NLS;
diff --git a/bundles/org.eclipse.jsch.ui/.classpath b/bundles/org.eclipse.jsch.ui/.classpath
index 22f30643c..e801ebfb4 100644
--- a/bundles/org.eclipse.jsch.ui/.classpath
+++ b/bundles/org.eclipse.jsch.ui/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.jsch.ui/.cvsignore b/bundles/org.eclipse.jsch.ui/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/bundles/org.eclipse.jsch.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.jsch.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.jsch.ui/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.jsch.ui/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.jsch.ui/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.jsch.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jsch.ui/.settings/org.eclipse.jdt.core.prefs
index b603ebc40..19980e8a2 100644
--- a/bundles/org.eclipse.jsch.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.jsch.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,9 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -16,6 +16,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
@@ -51,6 +52,7 @@ org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
@@ -72,12 +74,14 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,NORMAL
org.eclipse.jdt.core.compiler.taskTags=TODO,XXX
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -85,20 +89,23 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@@ -169,7 +176,6 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
@@ -193,11 +199,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -228,6 +235,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -252,13 +261,17 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -306,6 +319,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -342,9 +357,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -380,9 +398,13 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
index 946ceb511..be8bd6f9d 100644
--- a/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jsch.ui;singleton:=true
-Bundle-Version: 1.3.600.qualifier
+Bundle-Version: 1.4.100.qualifier
Bundle-Activator: org.eclipse.jsch.internal.ui.JSchUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -10,8 +10,8 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
org.eclipse.jsch.core;bundle-version="[1.2.0,2.0.0)",
com.jcraft.jsch;bundle-version="[0.1.50,1.0.0)"
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.eclipse.jsch.internal.ui;x-internal:=true,
org.eclipse.jsch.internal.ui.authenticator;x-internal:=true,
org.eclipse.jsch.internal.ui.preference;x-internal:=true,
diff --git a/bundles/org.eclipse.jsch.ui/pom.xml b/bundles/org.eclipse.jsch.ui/pom.xml
index 2a7bec28e..a59392614 100644
--- a/bundles/org.eclipse.jsch.ui/pom.xml
+++ b/bundles/org.eclipse.jsch.ui/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.jsch</groupId>
<artifactId>org.eclipse.jsch.ui</artifactId>
- <version>1.3.600-SNAPSHOT</version>
+ <version>1.4.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java
index b8eef4087..43d6d4908 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java
@@ -103,7 +103,7 @@ public void start(BundleContext context) throws Exception {
store.setValue(IUIConstants.PREF_FIRST_STARTUP, false);
}
- tracker = new ServiceTracker(getBundle().getBundleContext(),IJSchService.class.getName(), null);
+ tracker = new ServiceTracker<>(getBundle().getBundleContext(), IJSchService.class.getName(), null);
tracker.open();
}
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/KeyboardInteractiveDialog.java b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/KeyboardInteractiveDialog.java
index 6b1328251..20a1bb4f1 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/KeyboardInteractiveDialog.java
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/KeyboardInteractiveDialog.java
@@ -193,7 +193,7 @@ protected Control createDialogArea(Composite parent) {
createPasswordFields(main);
- if (isPasswordAuth & domain != null) {
+ if (isPasswordAuth && domain != null) {
allowCachingButton = new Button(main, SWT.CHECK);
allowCachingButton.setText(Messages.KeyboardInteractiveDialog_4);
data = new GridData(GridData.FILL_HORIZONTAL
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties
index dc6bda5e2..aa6a976f4 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties
@@ -87,7 +87,7 @@ CVSSSH2PreferencePage_142=You must select at least one key exchange method.
CVSSSH2PreferencePage_143=You must select at least one MAC method.
CVSSSH2PreferencePage_144=Key Exchange &Methods
CVSSSH2PreferencePage_145=MA&C Methods
-CVSSSH2PreferencePage_146=SSH Agent
+CVSSSH2PreferencePage_146=&SSH Agent
CVSSSH2PreferencePage_147=Select preferred SSH Agent
UserInfoPrompter_0=SSH2 Message
UserInfoPrompter_1=SSH2 Message
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/ExportDialog.java b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/ExportDialog.java
index df4c889aa..f60d12771 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/ExportDialog.java
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/ExportDialog.java
@@ -39,16 +39,19 @@ class ExportDialog extends Dialog{
this.message=message;
}
+ @Override
protected void configureShell(Shell newShell){
super.configureShell(newShell);
newShell.setText(title);
}
+ @Override
public void create(){
super.create();
field.setFocus();
}
+ @Override
protected Control createDialogArea(Composite parent){
initializeDialogUnits(parent);
Composite main=new Composite(parent, SWT.NONE);
@@ -87,6 +90,7 @@ class ExportDialog extends Dialog{
return target;
}
+ @Override
protected void okPressed(){
String _target=field.getText();
if(_target==null||_target.length()==0){
@@ -96,6 +100,7 @@ class ExportDialog extends Dialog{
super.okPressed();
}
+ @Override
protected void cancelPressed(){
target=null;
super.cancelPressed();
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PassphraseDialog.java b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PassphraseDialog.java
index e30f18d4c..26589bde7 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PassphraseDialog.java
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PassphraseDialog.java
@@ -37,16 +37,19 @@ class PassphraseDialog extends Dialog{
this.message=message;
}
+ @Override
protected void configureShell(Shell newShell){
super.configureShell(newShell);
newShell.setText(message);
}
+ @Override
public void create(){
super.create();
passphraseField.setFocus();
}
+ @Override
protected Control createDialogArea(Composite parent){
initializeDialogUnits(parent);
Composite main=new Composite(parent, SWT.NONE);
@@ -88,6 +91,7 @@ class PassphraseDialog extends Dialog{
return passphrase;
}
+ @Override
protected void okPressed(){
String _passphrase=passphraseField.getText();
if(_passphrase==null||_passphrase.length()==0){
@@ -97,6 +101,7 @@ class PassphraseDialog extends Dialog{
super.okPressed();
}
+ @Override
protected void cancelPressed(){
passphrase=null;
super.cancelPressed();
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
index f213b710b..7efee3892 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
@@ -1440,9 +1440,9 @@ protected Control createContents(Composite parent){
}
try{
- ByteArrayInputStream bis=new ByteArrayInputStream(pkey);
- c.put(bis, "authorized_keys", null, ChannelSftp.APPEND); //$NON-NLS-1$
- bis.close();
+ try (ByteArrayInputStream bis = new ByteArrayInputStream(pkey)) {
+ c.put(bis, "authorized_keys", null, ChannelSftp.APPEND); //$NON-NLS-1$
+ }
checkPermission(c, "authorized_keys"); //$NON-NLS-1$
checkPermission(c, "."); // .ssh //$NON-NLS-1$
c.cd(".."); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.core/.classpath b/bundles/org.eclipse.team.core/.classpath
index 22f30643c..e801ebfb4 100644
--- a/bundles/org.eclipse.team.core/.classpath
+++ b/bundles/org.eclipse.team.core/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.team.core/.cvsignore b/bundles/org.eclipse.team.core/.cvsignore
deleted file mode 100644
index c5e82d745..000000000
--- a/bundles/org.eclipse.team.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/bundles/org.eclipse.team.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.team.core/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.team.core/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.team.core/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.team.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.team.core/.settings/org.eclipse.jdt.core.prefs
index 9f6ef3661..88ac3528d 100644
--- a/bundles/org.eclipse.team.core/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.team.core/.settings/org.eclipse.jdt.core.prefs
@@ -18,9 +18,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -36,6 +36,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
@@ -92,6 +93,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
@@ -127,7 +129,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
diff --git a/bundles/org.eclipse.team.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.team.core/.settings/org.eclipse.pde.prefs
index 85b2478a9..d3ef2b590 100644
--- a/bundles/org.eclipse.team.core/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.team.core/.settings/org.eclipse.pde.prefs
@@ -1,32 +1,32 @@
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=0
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=0
-compilers.p.missing-version-export-package=2
-compilers.p.missing-version-import-package=2
-compilers.p.missing-version-require-bundle=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=1
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=0
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=0
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=1
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF
index 99bfc4861..fe95a904c 100644
--- a/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.core; singleton:=true
-Bundle-Version: 3.8.700.qualifier
+Bundle-Version: 3.9.300.qualifier
Bundle-Activator: org.eclipse.team.internal.core.TeamPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -24,9 +24,9 @@ Export-Package: org.eclipse.team.core,
org.eclipse.team.internal.core.streams;x-friends:="org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui",
org.eclipse.team.internal.core.subscribers;x-friends:="org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui"
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.1.0,2.0.0)",
org.eclipse.compare.core;bundle-version="[3.5.200,4.0.0)"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.team.core
diff --git a/bundles/org.eclipse.team.core/forceQualifierUpdate.txt b/bundles/org.eclipse.team.core/forceQualifierUpdate.txt
new file mode 100644
index 000000000..e47440f21
--- /dev/null
+++ b/bundles/org.eclipse.team.core/forceQualifierUpdate.txt
@@ -0,0 +1,5 @@
+# To force a version qualifier update, add the bug here
+Bug 564006 - Comparator Errors in I20200605-1230
+Comparator errors in I20210308-0720
+Bug 574012 - Comparator errors in I20210604-0350
+Bug 578351 - Lambda generation order is unstable in ecj \ No newline at end of file
diff --git a/bundles/org.eclipse.team.core/pom.xml b/bundles/org.eclipse.team.core/pom.xml
index f0d1b8a00..b400a3cea 100644
--- a/bundles/org.eclipse.team.core/pom.xml
+++ b/bundles/org.eclipse.team.core/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.core</artifactId>
- <version>3.8.700-SNAPSHOT</version>
+ <version>3.9.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.core/schema/defaultFileModificationValidator.exsd b/bundles/org.eclipse.team.core/schema/defaultFileModificationValidator.exsd
index d117df44f..23642d528 100644
--- a/bundles/org.eclipse.team.core/schema/defaultFileModificationValidator.exsd
+++ b/bundles/org.eclipse.team.core/schema/defaultFileModificationValidator.exsd
@@ -1,99 +1,99 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.team.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.team.core" id="defaultFileModificationValidator" name="Default File Modification Validator"/>
- </appInfo>
- <documentation>
- This extension point is for internal use only. Its purpose is to provide prompting for the overwriting of read-only resources using validateEdit on unshared projects.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="validator"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="validator">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.core.resources.FileModificationValidator"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.1
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- Internal use only
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Internal use only
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2004, 2011 IBM Corporation and others.
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.team.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.team.core" id="defaultFileModificationValidator" name="Default File Modification Validator"/>
+ </appInfo>
+ <documentation>
+ This extension point is for internal use only. Its purpose is to provide prompting for the overwriting of read-only resources using validateEdit on unshared projects.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="validator"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="validator">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.core.resources.FileModificationValidator"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 3.1
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ Internal use only
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ Internal use only
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2004, 2011 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 &lt;a href=&quot;https://www.eclipse.org/legal/epl-2.0&quot;&gt;https://www.eclipse.org/legal/epl-v20.html&lt;/a&gt;/
-SPDX-License-Identifier: EPL-2.0
- </documentation>
- </annotation>
-
-</schema>
+SPDX-License-Identifier: EPL-2.0
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IProjectSetSerializer.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IProjectSetSerializer.java
index e9f1f0a3f..f1c3aeb84 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IProjectSetSerializer.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IProjectSetSerializer.java
@@ -47,7 +47,7 @@ public interface IProjectSetSerializer {
* com.ibm.swt.widgets.Shell or it will be null.
* @param monitor a progress monitor
* @return String[] an array of serialized reference strings uniquely identifying the projects
- * @throws TeamException
+ * @throws TeamException on failures; depends on concrete implementation
*/
public String[] asReference(IProject[] providerProjects, Object context, IProgressMonitor monitor) throws TeamException;
@@ -67,7 +67,7 @@ public interface IProjectSetSerializer {
* com.ibm.swt.widgets.Shell or it will be null.
* @param monitor a progress monitor
* @return IProject[] an array of projects that were created
- * @throws TeamException
+ * @throws TeamException on failures; depends on concrete implementation
*/
public IProject[] addToWorkspace(String[] referenceStrings, String filename, Object context, IProgressMonitor monitor) throws TeamException;
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetCapability.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetCapability.java
index 1c3bbcc46..011c4199c 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetCapability.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetCapability.java
@@ -230,7 +230,7 @@ public abstract class ProjectSetCapability {
* @return
* an array of confirmed projects to be loaded
* or <code>null</code> if the operation is to be canceled.
- * @throws TeamException
+ * @throws TeamException on failure
*/
protected IProject[] confirmOverwrite(
ProjectSetSerializationContext context,
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetSerializationContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetSerializationContext.java
index 752f54368..a4e19a392 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetSerializationContext.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetSerializationContext.java
@@ -62,7 +62,7 @@ public class ProjectSetSerializationContext {
* @return
* an array of zero or more projects that should be overwritten
* or <code>null</code> if the operation is to be canceled
- * @throws TeamException
+ * @throws TeamException on failure
*/
public IProject[] confirmOverwrite(IProject[] projects) throws TeamException {
return new IProject[0];
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java
index 9ce34692a..1ee36de2d 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java
@@ -83,7 +83,7 @@ import org.eclipse.team.internal.core.TeamPlugin;
* repository provider with a project by invoking
* <code>RepositoryProvider.map()</code>.
* </p>
- *
+ *
* @see RepositoryProvider#map(IProject, String)
*
* @since 2.0
@@ -271,7 +271,7 @@ public abstract class RepositoryProvider implements IProjectNature, IAdaptable {
}
/**
* Disassociates project with the repository provider its currently mapped to.
- * @param project
+ * @param project project to unmap
* @throws TeamException The project isn't associated with any repository provider.
*/
public static void unmap(IProject project) throws TeamException {
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
index d25103c29..d2ff8463e 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
@@ -52,7 +52,7 @@ import org.eclipse.team.internal.core.FileContentManager;
import org.eclipse.team.internal.core.Messages;
import org.eclipse.team.internal.core.Policy;
import org.eclipse.team.internal.core.StorageMergerRegistry;
-import org.eclipse.team.internal.core.StringMatcher;
+import org.eclipse.team.internal.core.WildcardStringMatcher;
import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.team.internal.core.TeamResourceChangeListener;
import org.eclipse.team.internal.core.importing.BundleImporterExtension;
@@ -97,7 +97,7 @@ public final class Team {
// The ignore list that is read at startup from the persisted file
protected static SortedMap<String, Boolean> globalIgnore, pluginIgnore;
- private static StringMatcher[] ignoreMatchers;
+ private static WildcardStringMatcher[] ignoreMatchers;
private final static FileContentManager fFileContentManager;
@@ -155,8 +155,8 @@ public final class Team {
}
private static boolean matchesEnabledIgnore(IResource resource) {
- StringMatcher[] matchers = getStringMatchers();
- for (StringMatcher matcher : matchers) {
+ WildcardStringMatcher[] matchers = getStringMatchers();
+ for (WildcardStringMatcher matcher : matchers) {
String resourceName = resource.getName();
if (matcher.isPathPattern()) {
resourceName = resource.getFullPath().toString();
@@ -247,16 +247,16 @@ public final class Team {
return result;
}
- private synchronized static StringMatcher[] getStringMatchers() {
+ private synchronized static WildcardStringMatcher[] getStringMatchers() {
if (ignoreMatchers==null) {
IIgnoreInfo[] ignorePatterns = getAllIgnores();
- ArrayList<StringMatcher> matchers = new ArrayList<>(ignorePatterns.length);
+ ArrayList<WildcardStringMatcher> matchers = new ArrayList<>(ignorePatterns.length);
for (IIgnoreInfo ignorePattern : ignorePatterns) {
if (ignorePattern.getEnabled()) {
- matchers.add(new StringMatcher(ignorePattern.getPattern(), true, false));
+ matchers.add(new WildcardStringMatcher(ignorePattern.getPattern()));
}
}
- ignoreMatchers = new StringMatcher[matchers.size()];
+ ignoreMatchers = new WildcardStringMatcher[matchers.size()];
ignoreMatchers = matchers.toArray(ignoreMatchers);
}
return ignoreMatchers;
@@ -435,8 +435,7 @@ public final class Team {
File f = pluginStateLocation.toFile();
if (!f.exists()) return false;
try {
- DataInputStream dis = new DataInputStream(new FileInputStream(f));
- try {
+ try (DataInputStream dis = new DataInputStream(new FileInputStream(f))) {
int ignoreCount = 0;
try {
ignoreCount = dis.readInt();
@@ -450,8 +449,6 @@ public final class Team {
boolean enabled = dis.readBoolean();
globalIgnore.put(pattern, Boolean.valueOf(enabled));
}
- } finally {
- dis.close();
}
f.delete();
} catch (FileNotFoundException e) {
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/FastDiffFilter.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/FastDiffFilter.java
index c527898ff..eb971879e 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/FastDiffFilter.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/FastDiffFilter.java
@@ -33,8 +33,7 @@ public abstract class FastDiffFilter extends DiffFilter {
@Override
public boolean select(IDiff node) {
int status = ((Diff)node).getStatus();
- for (int i = 0; i < states.length; i++) {
- int state = states[i];
+ for (int state : states) {
if ((status & mask) == state) {
return true;
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffTree.java
index 919762520..8890f5ae6 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffTree.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffTree.java
@@ -117,11 +117,11 @@ public interface IDiffTree {
* <p>
* For example, this will return the number of outgoing changes in the set:
* </p>
- *
+ *
* <pre>
* long outgoing = countFor(IThreeWayDiff.OUTGOING, IThreeWayDiff.DIRECTION_MASK);
* </pre>
- *
+ *
* @param state the sync state
* @param mask the sync state mask
* @return the number of matching resources in the set.
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffVisitor.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffVisitor.java
index d365953d7..1aefb1238 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffVisitor.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/IDiffVisitor.java
@@ -18,7 +18,7 @@ package org.eclipse.team.core.diff;
* <p>
* Usage:
* </p>
- *
+ *
* <pre>
* class Visitor implements IDiffVisitor {
* public boolean visit(IDiffNode diff) {
@@ -42,7 +42,7 @@ package org.eclipse.team.core.diff;
* <p>
* Clients may implement this interface.
* </p>
- *
+ *
* @see IDiffTree#accept(org.eclipse.core.runtime.IPath, IDiffVisitor, int)
*
* @since 3.2
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/DiffTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/DiffTree.java
index 3405624cd..c6c52fa01 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/DiffTree.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/DiffTree.java
@@ -197,7 +197,7 @@ public class DiffTree implements IDiffTree {
* <code>endInput</code> should be done in a finally block as illustrated in the
* following code snippet.
* </p>
- *
+ *
* <pre>
* try {
* set.beginInput();
@@ -337,7 +337,7 @@ public class DiffTree implements IDiffTree {
* @return all the diffs contained in this diff tree
*/
public IDiff[] getDiffs() {
- return (IDiff[]) pathTree.values().toArray(new IDiff[pathTree.size()]);
+ return pathTree.values().toArray(new IDiff[pathTree.size()]);
}
@Override
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java
index ee5100a29..b9f1c22a3 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java
@@ -26,6 +26,7 @@ import org.eclipse.team.core.ScmUrlImportDescription;
* on bundle manifest entries.
* <p>
* Following is an example extension:
+ * </p>
*
* <pre>
* &lt;extension point=&quot;org.eclipse.team.core.bundleImporters&quot;&gt;
@@ -36,7 +37,6 @@ import org.eclipse.team.core.ScmUrlImportDescription;
* &lt;/extension&gt;
* </pre>
*
- * </p>
* <p>
* Clients contributing bundle importer extensions are intended to implement
* this interface. They can also subclass {@link BundleImporterDelegate}.
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ChangeTracker.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ChangeTracker.java
index dbf9c7b75..9827983cf 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ChangeTracker.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ChangeTracker.java
@@ -24,7 +24,6 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.team.core.RepositoryProvider;
@@ -135,14 +134,11 @@ public abstract class ChangeTracker {
private IResource[] getProjectChanges(IProject project, IResourceDelta projectDelta) {
final List<IResource> result = new ArrayList<>();
try {
- projectDelta.accept(new IResourceDeltaVisitor() {
- @Override
- public boolean visit(IResourceDelta delta) throws CoreException {
- if (isResourceOfInterest(delta.getResource()) & isChangeOfInterest(delta)) {
- result.add(delta.getResource());
- }
- return true;
+ projectDelta.accept(delta -> {
+ if (isResourceOfInterest(delta.getResource()) & isChangeOfInterest(delta)) {
+ result.add(delta.getResource());
}
+ return true;
});
} catch (CoreException e) {
TeamPlugin.log(e);
@@ -269,7 +265,7 @@ public abstract class ChangeTracker {
* @param project the project
* @param name the unique name used to identify the change set
* @param files the change files to be grouped
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
protected void ensureGrouped(IProject project, String name, IFile[] files) throws CoreException {
IChangeGroupingRequestor collector = getCollector(project);
@@ -287,7 +283,8 @@ public abstract class ChangeTracker {
* repository provider associated with the file's project.
* @param file the file
* @return whether the given file is modified
- * @throws CoreException
+ * @throws CoreException if an error occurs while trying to determine the modification state
+ * of the file
*/
protected boolean isModified(IFile file) throws CoreException {
IChangeGroupingRequestor collector = getCollector(file.getProject());
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java
index 6256fecd3..d42d8f331 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java
@@ -104,7 +104,7 @@ public class DelegatingStorageMerger implements IStorageMerger {
* to create the merger to which the merge should be delegated.
* @param target the storage that contains the target contents of the merge.
* @return a merger for the given storage or <code>null</code>
- * @throws CoreException
+ * @throws CoreException no merger found
*/
protected IStorageMerger createDelegateMerger(IStorage target) throws CoreException {
IStorageMerger merger = null;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/IMergeContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/IMergeContext.java
index f3040790b..20df86e70 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/IMergeContext.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/IMergeContext.java
@@ -306,7 +306,7 @@ public interface IMergeContext extends ISynchronizationContext {
* match the local state.
* @param diff the diff
* @param monitor a progress monitor
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
public void reject(IDiff diff, IProgressMonitor monitor) throws CoreException;
@@ -316,7 +316,7 @@ public interface IMergeContext extends ISynchronizationContext {
* each diff.
* @param diffs the diffs
* @param monitor a progress monitor
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
public void reject(IDiff[] diffs, IProgressMonitor monitor) throws CoreException;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ISynchronizationScopeManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ISynchronizationScopeManager.java
index b345b5091..ee91d50ae 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ISynchronizationScopeManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ISynchronizationScopeManager.java
@@ -58,7 +58,7 @@ public interface ISynchronizationScopeManager {
* @param monitor a progress monitor
* when building the scope
*
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
void initialize(IProgressMonitor monitor) throws CoreException;
@@ -72,7 +72,7 @@ public interface ISynchronizationScopeManager {
* @param mappings the mappings to be refreshed
* @param monitor a progress monitor
* @return a set of traversals that cover the given mappings
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
ResourceTraversal[] refresh(ResourceMapping[] mappings, IProgressMonitor monitor) throws CoreException;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java
index 41ff492e5..37e15e353 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java
@@ -316,7 +316,7 @@ public abstract class MergeContext extends SynchronizationContext implements IMe
* the diff whose local is to be replaced
* @param monitor
* a progress monitor
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
protected void performReplace(final IDiff diff, IProgressMonitor monitor) throws CoreException {
IResourceDiff d;
@@ -356,7 +356,7 @@ public abstract class MergeContext extends SynchronizationContext implements IMe
* the diff whose local is now in-sync
* @param monitor
* a progress monitor
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
protected abstract void makeInSync(IDiff diff, IProgressMonitor monitor) throws CoreException;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/ResourceDiff.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/ResourceDiff.java
index 7fbbf5735..12b81ff3e 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/ResourceDiff.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/ResourceDiff.java
@@ -51,7 +51,7 @@ public class ResourceDiff extends TwoWayDiff implements IResourceDiff {
* Convenience constructor for creating a simple folder diff that consists of a
* resource and a kind only. It is equivalent to
* <code>ResourceDiff(resource, kind, 0, null, null)</code>
- *
+ *
* @param resource a resource
* @param kind the kind of change (ADDED, REMOVED or CHANGED)
*/
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/SynchronizationScopeManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/SynchronizationScopeManager.java
index 74773943a..4125c8e32 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/SynchronizationScopeManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/SynchronizationScopeManager.java
@@ -92,7 +92,7 @@ public class SynchronizationScopeManager extends PlatformObject implements ISync
* @param context the resource mapping context
* @param monitor a progress monitor
* @return the resource mappings
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
public static ResourceMapping[] getMappingsFromProviders(ResourceTraversal[] traversals,
ResourceMappingContext context,
@@ -175,7 +175,7 @@ public class SynchronizationScopeManager extends PlatformObject implements ISync
@Override
public void initialize(
IProgressMonitor monitor) throws CoreException {
- ResourcesPlugin.getWorkspace().run((IWorkspaceRunnable) monitor1 -> internalPrepareContext(monitor1),
+ ResourcesPlugin.getWorkspace().run((IWorkspaceRunnable) this::internalPrepareContext,
getSchedulingRule(), IResource.NONE, monitor);
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ISubscriberChangeEvent.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ISubscriberChangeEvent.java
index 37db51a58..6b083c07f 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ISubscriberChangeEvent.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ISubscriberChangeEvent.java
@@ -53,13 +53,13 @@ public interface ISubscriberChangeEvent {
* Return the flags that describe the type of change. The returned value should
* be ANDed with the change type flags to determine whether the change event is
* of a particular type. For example,
- *
+ *
* <pre>
* if (event.getFlags() &amp; ISubscriberChangeEvent.SYNC_CHANGED) {
* // the sync info for the resource has changed
* }
* </pre>
- *
+ *
* @return the flags that describe the type of change
*/
public abstract int getFlags();
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java
index 3a3271f22..e22539efa 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java
@@ -99,7 +99,7 @@ abstract public class Subscriber {
* @param resource the resource being tested
* @return <code>true</code> if this resource is supervised, and <code>false</code>
* otherwise
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
abstract public boolean isSupervised(IResource resource) throws TeamException;
@@ -114,7 +114,7 @@ abstract public class Subscriber {
* </p>
* @param resource the resource
* @return a list of member resources
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
abstract public IResource[] members(IResource resource) throws TeamException;
@@ -150,7 +150,7 @@ abstract public class Subscriber {
*
* @param resource the resource of interest
* @return sync info
- * @throws TeamException
+ * @throws TeamException if an error occurs
* @see #getDiff(IResource)
*/
abstract public SyncInfo getSyncInfo(IResource resource) throws TeamException;
@@ -372,7 +372,7 @@ abstract public class Subscriber {
*
* @param resource the resource of interest
* @return the diff for the resource or <code>null</code>
- * @throws CoreException
+ * @throws CoreException if an error occurs
* @throws TeamException if errors occur
* @since 3.2
*/
@@ -395,7 +395,7 @@ abstract public class Subscriber {
* </ul>
* @param traversals the traversals to be visited
* @param visitor the visitor
- * @throws CoreException
+ * @throws CoreException if an error occurs
* @throws TeamException if errors occur
* @since 3.2
*/
@@ -495,7 +495,7 @@ abstract public class Subscriber {
* @param stateMask the mask that identifies the state flags of interested
* @param monitor a progress monitor
* @return the synchronization state of the given resource mapping
- * @throws CoreException
+ * @throws CoreException if an error occurs
* @since 3.2
* @see IDiff
* @see IThreeWayDiff
@@ -504,23 +504,20 @@ abstract public class Subscriber {
ResourceTraversal[] traversals = mapping.getTraversals(new SubscriberResourceMappingContext(this, true), monitor);
final int[] direction = new int[] { 0 };
final int[] kind = new int[] { 0 };
- accept(traversals, new IDiffVisitor() {
- @Override
- public boolean visit(IDiff diff) {
- if (diff instanceof IThreeWayDiff) {
- IThreeWayDiff twd = (IThreeWayDiff) diff;
- direction[0] |= twd.getDirection();
- }
- // If the traversals contain a combination of kinds, return a CHANGE
- int diffKind = diff.getKind();
- if (kind[0] == 0)
- kind[0] = diffKind;
- if (kind[0] != diffKind) {
- kind[0] = IDiff.CHANGE;
- }
- // Only need to visit the children of a change
- return diffKind == IDiff.CHANGE;
+ accept(traversals, diff -> {
+ if (diff instanceof IThreeWayDiff) {
+ IThreeWayDiff twd = (IThreeWayDiff) diff;
+ direction[0] |= twd.getDirection();
+ }
+ // If the traversals contain a combination of kinds, return a CHANGE
+ int diffKind = diff.getKind();
+ if (kind[0] == 0)
+ kind[0] = diffKind;
+ if (kind[0] != diffKind) {
+ kind[0] = IDiff.CHANGE;
}
+ // Only need to visit the children of a change
+ return diffKind == IDiff.CHANGE;
});
return (direction[0] | kind[0]) & stateMask;
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberMergeContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberMergeContext.java
index 6f1399709..e133455e1 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberMergeContext.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberMergeContext.java
@@ -109,7 +109,7 @@ public abstract class SubscriberMergeContext extends MergeContext {
* Return the sync info for the given resource.
* @param resource the resource
* @return the sync info for the resource obtained from the subscriber
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
protected SyncInfo getSyncInfo(IResource resource) throws CoreException {
return handler.getSubscriber().getSyncInfo(resource);
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberResourceMappingContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberResourceMappingContext.java
index 695368f5a..baf7b5f0c 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberResourceMappingContext.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberResourceMappingContext.java
@@ -162,7 +162,10 @@ public class SubscriberResourceMappingContext extends RemoteResourceMappingConte
* @param depth the depth of the refresh
* @param flags the flags that indicate extra state that should be fetched
* @param monitor a progress monitor
- * @throws TeamException
+ * @throws TeamException if this method fails. Reasons include:
+ * <ul>
+ * <li>The server could not be contacted.</li>
+ * </ul>
*/
protected void refresh(IResource[] resources, int depth, int flags, IProgressMonitor monitor) throws TeamException {
subscriber.refresh(resources, depth, monitor);
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java
index e04482f88..c51497698 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java
@@ -16,7 +16,6 @@ package org.eclipse.team.core.subscribers;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -83,9 +82,8 @@ public class SubscriberScopeManager extends SynchronizationScopeManager implemen
@Override
public void dispose() {
- for (Iterator iter = participants.values().iterator(); iter.hasNext();) {
- ISynchronizationScopeParticipant p = (ISynchronizationScopeParticipant) iter.next();
- p.dispose();
+ for (ISynchronizationScopeParticipant participant : participants.values()) {
+ participant.dispose();
}
super.dispose();
}
@@ -118,9 +116,7 @@ public class SubscriberScopeManager extends SynchronizationScopeManager implemen
* appropriately
*/
/* private */ void hookupParticipants() {
- ModelProvider[] providers = getScope().getModelProviders();
- for (int i = 0; i < providers.length; i++) {
- ModelProvider provider = providers[i];
+ for (ModelProvider provider : getScope().getModelProviders()) {
if (!participants.containsKey(provider)) {
ISynchronizationScopeParticipant p = createParticipant(provider);
if (p != null) {
@@ -146,8 +142,7 @@ public class SubscriberScopeManager extends SynchronizationScopeManager implemen
public void subscriberResourceChanged(ISubscriberChangeEvent[] deltas) {
List<IResource> changedResources = new ArrayList<>();
List<IProject> changedProjects = new ArrayList<>();
- for (int i = 0; i < deltas.length; i++) {
- ISubscriberChangeEvent event = deltas[i];
+ for (ISubscriberChangeEvent event : deltas) {
if ((event.getFlags() & (ISubscriberChangeEvent.ROOT_ADDED | ISubscriberChangeEvent.ROOT_REMOVED)) != 0) {
changedProjects.add(event.getResource().getProject());
}
@@ -160,15 +155,12 @@ public class SubscriberScopeManager extends SynchronizationScopeManager implemen
private void fireChange(final IResource[] resources, final IProject[] projects) {
final Set<ResourceMapping> result = new HashSet<>();
- ISynchronizationScopeParticipant[] handlers = participants.values().toArray(new ISynchronizationScopeParticipant[participants.size()]);
- for (int i = 0; i < handlers.length; i++) {
- final ISynchronizationScopeParticipant participant = handlers[i];
+ for (final ISynchronizationScopeParticipant participant : participants.values()) {
SafeRunner.run(new ISafeRunnable() {
@Override
public void run() throws Exception {
- ResourceMapping[] mappings = participant.handleContextChange(SubscriberScopeManager.this.getScope(), resources, projects);
- for (int j = 0; j < mappings.length; j++) {
- ResourceMapping mapping = mappings[j];
+ for (ResourceMapping mapping : participant
+ .handleContextChange(SubscriberScopeManager.this.getScope(), resources, projects)) {
result.add(mapping);
}
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/FastSyncInfoFilter.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/FastSyncInfoFilter.java
index aed94334d..59ee87acf 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/FastSyncInfoFilter.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/FastSyncInfoFilter.java
@@ -150,8 +150,7 @@ public class FastSyncInfoFilter extends SyncInfoFilter {
@Override
public boolean select(SyncInfo info) {
int syncKind = info.getKind();
- for (int i = 0; i < changeFilters.length; i++) {
- int filter = changeFilters[i];
+ for (int filter : changeFilters) {
if ((syncKind & SyncInfo.CHANGE_MASK) == filter)
return true;
}
@@ -185,8 +184,7 @@ public class FastSyncInfoFilter extends SyncInfoFilter {
@Override
public boolean select(SyncInfo info) {
int syncKind = info.getKind();
- for (int i = 0; i < directionFilters.length; i++) {
- int filter = directionFilters[i];
+ for (int filter : directionFilters) {
if ((syncKind & SyncInfo.DIRECTION_MASK) == filter)
return true;
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java
index 1d73e387e..4e7161004 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java
@@ -17,7 +17,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -268,7 +267,7 @@ public class SyncInfoTree extends SyncInfoSet {
* <li><code>IResource.DEPTH_INFINITE</code>: the resource and all of it's
* descendants.
* </ul>
- *
+ *
* @param resource the root of the resource subtree
* @param depth the depth of the subtree
*/
@@ -311,8 +310,7 @@ public class SyncInfoTree extends SyncInfoSet {
private synchronized IResource[] internalMembers(IWorkspaceRoot root) {
Set possibleChildren = parents.keySet();
Set<IResource> children = new HashSet<>();
- for (Iterator it = possibleChildren.iterator(); it.hasNext();) {
- Object next = it.next();
+ for (Object next : possibleChildren) {
IResource element = root.findMember((IPath)next);
if (element != null) {
children.add(element.getProject());
@@ -339,8 +337,7 @@ public class SyncInfoTree extends SyncInfoSet {
IPath path = parent.getFullPath();
Set possibleChildren = parents.get(path);
if(possibleChildren != null) {
- for (Iterator it = possibleChildren.iterator(); it.hasNext();) {
- Object next = it.next();
+ for (Object next : possibleChildren) {
IResource element = (IResource)next;
IPath childPath = element.getFullPath();
IResource modelObject = null;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java
index a74000d3c..e1cd255e0 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java
@@ -18,7 +18,6 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -60,7 +59,7 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre
* <code>IResource.DEPTH_ONE</code>, or <code>IResource.DEPTH_INFINITE</code>)
* @param monitor a progress monitor
* @return the array of resources whose corresponding variants have changed
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
@Override
public IResource[] refresh(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException {
@@ -88,7 +87,7 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre
* <code>IResource.DEPTH_ONE</code>, or <code>IResource.DEPTH_INFINITE</code>)
* @param monitor a progress monitor
* @return the resource's whose variants have changed
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
protected IResource[] refresh(IResource resource, int depth, IProgressMonitor monitor) throws TeamException {
IResource[] changedResources = null;
@@ -122,7 +121,7 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre
* <code>IResource.DEPTH_ONE</code>, or <code>IResource.DEPTH_INFINITE</code>)
* @param monitor a progress monitor
* @return the resource's whose variants have changed
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
protected IResource[] collectChanges(IResource local, IResourceVariant remote, int depth, IProgressMonitor monitor) throws TeamException {
List<IResource> changedResources = new ArrayList<>();
@@ -176,7 +175,7 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre
* @param local the local resource
* @param remote the newly fetched resource variant
* @return <code>true</code> if the resource variant changed
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
protected abstract boolean setVariant(IResource local, IResourceVariant remote) throws TeamException;
@@ -187,15 +186,14 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre
}
if (depth == IResource.DEPTH_ZERO) return;
Map<IResource, IResourceVariant> children = mergedMembers(local, remote, monitor);
- for (Iterator<IResource> it = children.keySet().iterator(); it.hasNext();) {
- IResource localChild = it.next();
+ for (IResource localChild : children.keySet()) {
IResourceVariant remoteChild = children.get(localChild);
collectChanges(localChild, remoteChild, changedResources,
depth == IResource.DEPTH_INFINITE ? IResource.DEPTH_INFINITE : IResource.DEPTH_ZERO,
monitor);
}
- IResource[] cleared = collectedMembers(local, children.keySet().toArray(new IResource[children.keySet().size()]));
+ IResource[] cleared = collectedMembers(local, children.keySet().toArray(new IResource[children.size()]));
changedResources.addAll(Arrays.asList(cleared));
monitor.worked(1);
}
@@ -243,10 +241,10 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre
IResource localChild =
localSet != null ? (IResource) localSet.get(keyChildName) : null;
-
+
IResourceVariant remoteChild =
remoteSet != null ? (IResourceVariant) remoteSet.get(keyChildName) : null;
-
+
if (localChild == null) {
// there has to be a remote resource available if we got this far
Assert.isTrue(remoteChild != null);
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/CachedResourceVariant.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/CachedResourceVariant.java
index fb17d43e3..b270711ac 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/CachedResourceVariant.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/CachedResourceVariant.java
@@ -148,7 +148,7 @@ public abstract class CachedResourceVariant extends PlatformObject implements IR
* This method is not intended to be overridden by clients.
* @param stream the stream containing the contents of the resource variant
* @param monitor a progress monitor
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
protected void setContents(InputStream stream, IProgressMonitor monitor) throws TeamException {
// Ensure that there is a cache entry to receive the contents
@@ -186,7 +186,7 @@ public abstract class CachedResourceVariant extends PlatformObject implements IR
* <p>
* This method is not intended to be overridden by clients.
* @return the cached contents or <code>null</code>
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
protected InputStream getCachedContents() throws TeamException {
if (isContainer() || !isContentsCached()) return null;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariant.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariant.java
index bc6705393..46e900f63 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariant.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariant.java
@@ -58,7 +58,7 @@ public interface IResourceVariant {
*
* @return an <code>IStorage</code> that provides access to the contents of
* the remote resource or <code>null</code> if the remote resource is a container.
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public IStorage getStorage(IProgressMonitor monitor) throws TeamException;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariantTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariantTree.java
index dc6c5fbcc..f687e784b 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariantTree.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/IResourceVariantTree.java
@@ -43,7 +43,7 @@ public interface IResourceVariantTree {
* members can be retrieved using <code>getResourceVariant(IResource)</code>.
* @param resource the local resource
* @return the members of the local resource for which this tree contains resource variants
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public abstract IResource[] members(IResource resource) throws TeamException;
@@ -52,7 +52,7 @@ public interface IResourceVariantTree {
* <code>null</code> if there is no variant for the resource.
* @param resource the local resource
* @return the resource's variant in this tree
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public abstract IResourceVariant getResourceVariant(IResource resource) throws TeamException;
@@ -60,7 +60,7 @@ public interface IResourceVariantTree {
* Return whether the local resource has a variant in this tree.
* @param resource the local resource
* @return <code>true</code> if the tree contains a variant for the resource
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public boolean hasResourceVariant(IResource resource) throws TeamException;
@@ -73,7 +73,7 @@ public interface IResourceVariantTree {
* @param monitor a progress monitor
* @return the array of resources whose corresponding variants have changed
* as a result of the refresh
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public IResource[] refresh(
IResource[] resources,
@@ -86,7 +86,7 @@ public interface IResourceVariantTree {
* @param resource the resource
* @param depth the flush depth (one of <code>IResource.DEPTH_ZERO</code>,
* <code>IResource.DEPTH_ONE</code>, or <code>IResource.DEPTH_INFINITE</code>)
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public void flushVariants(IResource resource, int depth) throws TeamException;
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/PersistantResourceVariantByteStore.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/PersistantResourceVariantByteStore.java
index 3080d9609..b250efb3b 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/PersistantResourceVariantByteStore.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/PersistantResourceVariantByteStore.java
@@ -105,13 +105,19 @@ public class PersistantResourceVariantByteStore extends ResourceVariantByteStore
}
/**
- * Return whether the resource variant state for this resource is known.
- * This is used to differentiate the case where a resource variant has never been fetched
- * from the case where the resource variant is known to not exist. In the later
- * case, this method returns <code>true</code> while <code>getBytes</code> returns <code>null</code>
+ * Return whether the resource variant state for this resource is known. This is
+ * used to differentiate the case where a resource variant has never been
+ * fetched from the case where the resource variant is known to not exist. In
+ * the later case, this method returns <code>true</code> while
+ * <code>getBytes</code> returns <code>null</code>
+ *
* @param resource the local resource
* @return whether the resource variant state for this resource is known
- * @throws TeamException
+ * @throws TeamException if this operation fails. Reasons include:
+ * <ul>
+ * <li><code>IResourceStatus.PARTNER_NOT_REGISTERED</code>
+ * The sync partner is not registered.</li>
+ * </ul>
*/
public boolean isVariantKnown(IResource resource) throws TeamException {
return internalGetSyncBytes(resource) != null;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantByteStore.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantByteStore.java
index 275603ab0..27c299432 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantByteStore.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantByteStore.java
@@ -51,7 +51,7 @@ public abstract class ResourceVariantByteStore {
* fetched or otherwise determined yet.
* @param resource the local resource
* @return the bytes that represent the resource's variant
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public abstract byte[] getBytes(IResource resource) throws TeamException;
@@ -64,7 +64,7 @@ public abstract class ResourceVariantByteStore {
* @param resource the local resource
* @param bytes the bytes that represent the resource's variant
* @return <code>true</code> if the bytes changed
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public abstract boolean setBytes(IResource resource, byte[] bytes) throws TeamException;
@@ -77,24 +77,29 @@ public abstract class ResourceVariantByteStore {
* @param depth the depth of the operation (one of <code>IResource.DEPTH_ZERO</code>,
* <code>IResource.DEPTH_ONE</code>, or <code>IResource.DEPTH_INFINITE</code>)
* @return <code>true</code> if there were bytes present which were removed
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public abstract boolean flushBytes(IResource resource, int depth) throws TeamException;
/**
- * Method called to indicate that it is known that there is no variant associated
- * with the local resource. Subclasses may handle this information in different ways.
- * The <code>flush(IResource, int)</code> method should be used in the cases
- * where a client wishes to remove bytes for other reason.
+ * Method called to indicate that it is known that there is no variant
+ * associated with the local resource. Subclasses may handle this information in
+ * different ways. The <code>flush(IResource, int)</code> method should be used
+ * in the cases where a client wishes to remove bytes for other reason.
+ *
* @param resource the local resource
* @return <code>true</code> if this changes the bytes for the variant
+ * @throws TeamException if an error occurs
*/
public abstract boolean deleteBytes(IResource resource) throws TeamException;
/**
- * Return the children of the given resource that have resource variants in this tree.
+ * Return the children of the given resource that have resource variants in this
+ * tree.
+ *
* @param resource the parent resource
* @return the members who have resource variants in this tree.
+ * @throws TeamException if an error occurs
*/
public abstract IResource[] members(IResource resource) throws TeamException;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWayResourceComparator.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWayResourceComparator.java
index 0cb9013cb..0366ed2cd 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWayResourceComparator.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWayResourceComparator.java
@@ -34,7 +34,7 @@ public class ThreeWayResourceComparator implements IResourceVariantComparator {
* Create a three-way resource comparator that uses the
* <code>ThreeWaySynchronizer</code> to compare a local resource to a resource
* variant.
- *
+ *
* @param synchronizer The synchronizer to use.
*/
public ThreeWayResourceComparator(ThreeWaySynchronizer synchronizer) {
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySubscriber.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySubscriber.java
index 297a045d4..89d4f015b 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySubscriber.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySubscriber.java
@@ -111,7 +111,7 @@ public abstract class ThreeWaySubscriber extends ResourceVariantTreeSubscriber i
* @param resource the local resource
* @param bytes the bytes that identify a variant of the resource
* @return the resource variant handle recreated from the bytes
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public abstract IResourceVariant getResourceVariant(IResource resource, byte[] bytes) throws TeamException;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySynchronizer.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySynchronizer.java
index 94b4572ae..4b06b5bb1 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySynchronizer.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWaySynchronizer.java
@@ -36,7 +36,6 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.core.Policy;
import org.eclipse.team.internal.core.subscribers.BatchingLock;
import org.eclipse.team.internal.core.subscribers.BatchingLock.IFlushOperation;
-import org.eclipse.team.internal.core.subscribers.BatchingLock.ThreadInfo;
import org.eclipse.team.internal.core.subscribers.SyncByteConverter;
/**
@@ -52,20 +51,15 @@ import org.eclipse.team.internal.core.subscribers.SyncByteConverter;
* @since 3.0
*/
public class ThreeWaySynchronizer {
-
- private IFlushOperation flushOperation = new IFlushOperation() {
- /**
- * Callback which is invoked when the batching resource lock is released
- * or when a flush is requested (see beginBatching(IResource)).
- *
- * @see BatchingLock#flush(IProgressMonitor)
- */
- @Override
- public void flush(ThreadInfo info, IProgressMonitor monitor)
- throws TeamException {
- if (info != null && !info.isEmpty()) {
- broadcastSyncChanges(info.getChangedResources());
- }
+ /**
+ * Callback which is invoked when the batching resource lock is released or when
+ * a flush is requested (see beginBatching(IResource)).
+ *
+ * @see BatchingLock#flush(IProgressMonitor)
+ */
+ private IFlushOperation flushOperation = (info, monitor) -> {
+ if (info != null && !info.isEmpty()) {
+ broadcastSyncChanges(info.getChangedResources());
}
};
@@ -134,7 +128,7 @@ public class ThreeWaySynchronizer {
*
* @param resource the resource
* @return the base bytes cached with the resource or <code>null</code>
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public byte[] getBaseBytes(IResource resource) throws TeamException {
try {
@@ -160,7 +154,7 @@ public class ThreeWaySynchronizer {
*
* @param resource the resource
* @param baseBytes the base bytes that identify the base resource variant
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public void setBaseBytes(IResource resource, byte[] baseBytes) throws TeamException {
Assert.isNotNull(baseBytes);
@@ -194,7 +188,7 @@ public class ThreeWaySynchronizer {
* @param resource the resource
* @return <code>true</code> if the resource has been modified since the
* last time the base bytes were set.
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public boolean isLocallyModified(IResource resource) throws TeamException {
return ((internalGetSyncBytes(resource) == null && ! isIgnored(resource)) ||
@@ -210,7 +204,7 @@ public class ThreeWaySynchronizer {
*
* @param resource the resource
* @return the remote bytes cached with the resource or <code>null</code>
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public byte[] getRemoteBytes(IResource resource) throws TeamException {
try {
@@ -236,7 +230,7 @@ public class ThreeWaySynchronizer {
* @param resource the resource
* @param remoteBytes the base bytes that identify the remote resource variant
* @return <code>true</code> if the remote bytes changed as a result of the set
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public boolean setRemoteBytes(IResource resource, byte[] remoteBytes) throws TeamException {
Assert.isNotNull(remoteBytes);
@@ -274,7 +268,7 @@ public class ThreeWaySynchronizer {
* done when the corresponding remote resource variant no longer exists.
* @param resource the resource
* @return <code>true</code> if the remote bytes changed as a result of the removal
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public boolean removeRemoteBytes(IResource resource) throws TeamException {
ISchedulingRule rule = null;
@@ -304,7 +298,7 @@ public class ThreeWaySynchronizer {
* Return whether the given resource has sync bytes in the synchronizer.
* @param resource the local resource
* @return whether there are sync bytes cached for the local resources.
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public boolean hasSyncBytes(IResource resource) throws TeamException {
return internalGetSyncBytes(resource) != null;
@@ -315,7 +309,7 @@ public class ThreeWaySynchronizer {
* using <code>setIgnored(IResource)</code>.
* @param resource the resource
* @return <code>true</code> if the resource is ignored.
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public boolean isIgnored(IResource resource) throws TeamException {
byte[] bytes = cache.getBytes(resource);
@@ -328,7 +322,7 @@ public class ThreeWaySynchronizer {
* are never dirty (see <code>isLocallyModified</code>) and
* do not have base or remote bytes cached for them.
* @param resource the resource to be ignored
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public void setIgnored(IResource resource) throws TeamException {
internalSetSyncBytes(resource, IGNORED_BYTES);
@@ -340,7 +334,7 @@ public class ThreeWaySynchronizer {
* @param resource the local resource
* @return the children of the local resource that have cached sync bytes
* or are not ignored
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public IResource[] members(IResource resource) throws TeamException {
if (resource.getType() == IResource.FILE) {
@@ -370,7 +364,7 @@ public class ThreeWaySynchronizer {
* @param resource the resource
* @param depth the depth of the flush (one of <code>IResource.DEPTH_ZERO</code>,
* <code>IResource.DEPTH_ONE</code>, or <code>IResource.DEPTH_INFINITE</code>)
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public void flush(IResource resource, int depth) throws TeamException {
ISchedulingRule rule = null;
@@ -395,7 +389,7 @@ public class ThreeWaySynchronizer {
* @param resourceRule the scheduling rule that encompasses all modifications
* @param runnable the runnable that performs the sync state modifications
* @param monitor a progress monitor
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public void run(IResource resourceRule, IWorkspaceRunnable runnable, IProgressMonitor monitor) throws TeamException {
monitor = Policy.monitorFor(monitor);
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java
index 0b6b9a1c8..f5af7e20b 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java
@@ -38,9 +38,9 @@ import org.eclipse.team.core.TeamException;
* which cannot be performed in the delta handler because the workspace is locked.</li>
* <li>a data structure is not thread safe and requires serialized operations.<li>
* </ul>
- * </p>
* <p>
* The event handler has the following characteristics:
+ * </p>
* <ol>
* <li>Incoming events are placed in an incoming queue.</li>
* <li>Each event is processed by calling the <code>processEvent</code> method
@@ -53,8 +53,7 @@ import org.eclipse.team.core.TeamException;
* operations.<li>
* <li>Errors that occur during event processing or dispatch can be accumulated by calling the <code>handle</code>
* method. Accumulated errors are used to form the status that is returned when the job completes.<li>
- * </ul>
- * </p>
+ * </ol>
*
* @since 3.0
*/
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java
index 4c7dd374f..3faff38e0 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java
@@ -21,7 +21,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
@@ -97,18 +96,15 @@ public class FileContentManager implements IFileContentManager {
if (!f.exists())
return false;
- try {
- DataInputStream input = new DataInputStream(new FileInputStream(f));
- try {
+ try (DataInputStream input = new DataInputStream(new FileInputStream(f))) {
map.putAll(readOldFormatExtensionMappings(input));
- } finally {
- input.close();
- f.delete();
- }
} catch (IOException ex) {
TeamPlugin.log(IStatus.ERROR, ex.getMessage(), ex);
return false;
+ } finally {
+ f.delete();
}
+
return true;
}
@@ -258,8 +254,8 @@ public class FileContentManager implements IFileContentManager {
private static IStringMapping [] getStringMappings(Map map) {
final IStringMapping [] result= new IStringMapping [map.size()];
int index= 0;
- for (final Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
- final Map.Entry entry= (Map.Entry)iter.next();
+ for (Object element : map.entrySet()) {
+ final Map.Entry entry= (Map.Entry)element;
result[index++]= new StringMapping((String)entry.getKey(), ((Integer)entry.getValue()).intValue());
}
return result;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java
index 1fdb4ab47..e76f6fa4a 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java
@@ -90,7 +90,7 @@ public class InfiniteSubProgressMonitor extends SubProgressMonitor {
*/
@Override
public void subTask(String name) {
- if(name != null && ! name.equals("")) { //$NON-NLS-1$
+ if(name != null && ! name.isEmpty()) {
super.subTask(name);
}
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/StringMatcher.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/StringMatcher.java
deleted file mode 100644
index 6e04483e7..000000000
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/StringMatcher.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2017 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.team.internal.core;
-
-
-import java.util.Vector;
-
-/**
- * A string pattern matcher. Supports '*' and '?' wildcards.
- * Note: code copied from org.eclipse.jdt.internal.core.util.StringMatcher on April 3, 2001
- * (version 0.1 - 010901H18 [rename jbl]). Sync'ed on November 4, 2009 (revision 1.17).
- *
- */
-public class StringMatcher {
- protected String fPattern;
- protected int fLength; // pattern length
- protected boolean fIgnoreWildCards;
- protected boolean fIgnoreCase;
- protected boolean fHasLeadingStar;
- protected boolean fHasTrailingStar;
- protected String fSegments[]; //the given pattern is split into * separated segments
-
- /* boundary value beyond which we don't need to search in the text */
- protected int fBound = 0;
- private boolean fPathPattern;
-
-
- protected static final char fSingleWildCard = '\u0000';
-
- public static class Position {
- int start; //inclusive
- int end; //exclusive
- public Position(int start, int end) {
- this.start = start;
- this.end = end;
- }
- public int getStart() {
- return start;
- }
- public int getEnd() {
- return end;
- }
- }
-
- /**
- * StringMatcher constructor takes in a String object that is a simple
- * pattern. The pattern may contain '*' for 0 and many characters and
- * '?' for exactly one character.
- *
- * Literal '*' and '?' characters must be escaped in the pattern
- * e.g., "\*" means literal "*", etc.
- *
- * Escaping any other character (including the escape character itself),
- * just results in that character in the pattern.
- * e.g., "\a" means "a" and "\\" means "\"
- *
- * If invoking the StringMatcher with string literals in Java, don't forget
- * escape characters are represented by "\\".
- *
- * @param pattern the pattern to match text against
- * @param ignoreCase if true, case is ignored
- * @param ignoreWildCards if true, wild cards and their escape sequences are ignored
- * (everything is taken literally).
- */
- public StringMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards) {
- if (pattern == null)
- throw new IllegalArgumentException();
- fIgnoreCase = ignoreCase;
- fIgnoreWildCards = ignoreWildCards;
- fPattern= pattern;
- fLength = pattern.length();
- fPathPattern = pattern.indexOf('/') != -1;
-
- if (fIgnoreWildCards) {
- parseNoWildCards();
- } else {
- parseWildCards();
- }
- }
-
- /**
- * Find the first occurrence of the pattern between <code>start</code>(inclusive)
- * and <code>end</code>(exclusive).
- * @param text the String object to search in
- * @param start the starting index of the search range, inclusive
- * @param end the ending index of the search range, exclusive
- * @return an <code>StringMatcher.Position</code> object that keeps the starting
- * (inclusive) and ending positions (exclusive) of the first occurrence of the
- * pattern in the specified range of the text; return null if not found or subtext
- * is empty (start==end). A pair of zeros is returned if pattern is empty string
- * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
- * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
- */
-
- public StringMatcher.Position find(String text, int start, int end) {
- if (fPattern == null|| text == null)
- throw new IllegalArgumentException();
-
- int tlen = text.length();
- if (start < 0)
- start = 0;
- if (end > tlen)
- end = tlen;
- if (end < 0 ||start >= end )
- return null;
- if (fLength == 0)
- return new Position(start, start);
- if (fIgnoreWildCards) {
- int x = posIn(text, start, end);
- if (x < 0)
- return null;
- return new Position(x, x+fLength);
- }
-
- int segCount = fSegments.length;
- if (segCount == 0)//pattern contains only '*'(s)
- return new Position (start, end);
-
- int curPos = start;
- int matchStart = -1;
- int i;
- for (i = 0; i < segCount && curPos < end; ++i) {
- String current = fSegments[i];
- int nextMatch = regExpPosIn(text, curPos, end, current);
- if (nextMatch < 0 )
- return null;
- if(i == 0)
- matchStart = nextMatch;
- curPos = nextMatch + current.length();
- }
- if (i < segCount)
- return null;
- return new Position(matchStart, curPos);
- }
-
- /**
- * match the given <code>text</code> with the pattern
- * @return <code>true</code> if matched otherwise <code>false</code>
- * @param text a String object
- */
- public boolean match(String text) {
- return match(text, 0, text.length());
- }
- /**
- * Given the starting (inclusive) and the ending (exclusive) positions in the
- * <code>text</code>, determine if the given substring matches with aPattern
- * @return true if the specified portion of the text matches the pattern
- * @param text a String object that contains the substring to match
- * @param start marks the starting position (inclusive) of the substring
- * @param end marks the ending index (exclusive) of the substring
- */
- public boolean match(String text, int start, int end) {
- if (null == text)
- throw new IllegalArgumentException();
-
- if (start > end)
- return false;
-
- if (fIgnoreWildCards)
- return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength);
- int segCount= fSegments.length;
- if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) // pattern contains only '*'(s)
- return true;
- if (start == end)
- return fLength == 0;
- if (fLength == 0)
- return start == end;
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
-
- int tCurPos= start;
- int bound= end - fBound;
- if ( bound < 0)
- return false;
- int i=0;
- String current= fSegments[i];
- int segLength= current.length();
-
- /* process first segment */
- if (!fHasLeadingStar){
- if(!regExpRegionMatches(text, start, current, 0, segLength)) {
- return false;
- } else {
- ++i;
- tCurPos= tCurPos + segLength;
- }
- }
- if ((fSegments.length == 1) && (!fHasLeadingStar) && (!fHasTrailingStar)) {
- // only one segment to match, no wildcards specified
- return tCurPos == end;
- }
- /* process middle segments */
- while (i < segCount) {
- current= fSegments[i];
- int currentMatch;
- int k= current.indexOf(fSingleWildCard);
- if (k < 0) {
- currentMatch= textPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- } else {
- currentMatch= regExpPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- }
- tCurPos= currentMatch + current.length();
- i++;
- }
-
- /* process final segment */
- if (!fHasTrailingStar && tCurPos != end) {
- int clen= current.length();
- return regExpRegionMatches(text, end - clen, current, 0, clen);
- }
- return i == segCount ;
- }
-
- /**
- * check existence of '/' in the pattern.
- * @return <b>true</b> if pattern contains '/'
- */
- public boolean isPathPattern() {
- return fPathPattern;
- }
-
- /**
- * This method parses the given pattern into segments seperated by wildcard '*' characters.
- * Since wildcards are not being used in this case, the pattern consists of a single segment.
- */
- private void parseNoWildCards() {
- fSegments = new String[1];
- fSegments[0] = fPattern;
- fBound = fLength;
- }
- /**
- * Parses the given pattern into segments seperated by wildcard '*' characters.
- */
- private void parseWildCards() {
- if(fPattern.startsWith("*"))//$NON-NLS-1$
- fHasLeadingStar = true;
- if(fPattern.endsWith("*")) {//$NON-NLS-1$
- /* make sure it's not an escaped wildcard */
- if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
- fHasTrailingStar = true;
- }
- }
-
- Vector<String> temp = new Vector<>();
-
- int pos = 0;
- StringBuilder buf = new StringBuilder();
- while (pos < fLength) {
- char c = fPattern.charAt(pos++);
- switch (c) {
- case '\\':
- if (pos >= fLength) {
- buf.append(c);
- } else {
- char next = fPattern.charAt(pos++);
- /* if it's an escape sequence */
- if (next == '*' || next == '?' || next == '\\') {
- buf.append(next);
- } else {
- /* not an escape sequence, just insert literally */
- buf.append(c);
- buf.append(next);
- }
- }
- break;
- case '*':
- if (buf.length() > 0) {
- /* new segment */
- temp.addElement(buf.toString());
- fBound += buf.length();
- buf.setLength(0);
- }
- break;
- case '?':
- /* append special character representing single match wildcard */
- buf.append(fSingleWildCard);
- break;
- default:
- buf.append(c);
- }
- }
-
- /* add last buffer to segment list */
- if (buf.length() > 0) {
- temp.addElement(buf.toString());
- fBound += buf.length();
- }
-
- fSegments = new String[temp.size()];
- temp.copyInto(fSegments);
- }
- /**
- * @param text a string which contains no wildcard
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int posIn(String text, int start, int end) {//no wild card in pattern
- int max = end - fLength;
-
- if (!fIgnoreCase) {
- int i = text.indexOf(fPattern, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i = start; i <= max; ++i) {
- if (text.regionMatches(true, i, fPattern, 0, fLength))
- return i;
- }
-
- return -1;
- }
- /**
- * @param text a simple regular expression that may only contain '?'(s)
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a simple regular expression that may contains '?'
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int regExpPosIn(String text, int start, int end, String p) {
- int plen = p.length();
-
- int max = end - plen;
- for (int i = start; i <= max; ++i) {
- if (regExpRegionMatches(text, i, p, 0, plen))
- return i;
- }
- return -1;
- }
-
- /**
- *
- * @param text the text
- * @param tStart the start
- * @param p the pattern
- * @param pStart the pattern start
- * @param plen the pattern length
- * @return whether the region matches
- */
- protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) {
- while (plen-- > 0) {
- char tchar = text.charAt(tStart++);
- char pchar = p.charAt(pStart++);
-
- /* process wild cards */
- if (!fIgnoreWildCards) {
- /* skip single wild cards */
- if (pchar == fSingleWildCard) {
- continue;
- }
- }
- if (pchar == tchar)
- continue;
- if (fIgnoreCase) {
- if (Character.toUpperCase(tchar) == Character.toUpperCase(pchar))
- continue;
- // comparing after converting to upper case doesn't handle all cases;
- // also compare after converting to lower case
- if (Character.toLowerCase(tchar) == Character.toLowerCase(pchar))
- continue;
- }
- return false;
- }
- return true;
- }
- /**
- * @param text the string to match
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a string that has no wildcard
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int textPosIn(String text, int start, int end, String p) {
-
- int plen = p.length();
- int max = end - plen;
-
- if (!fIgnoreCase) {
- int i = text.indexOf(p, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i = start; i <= max; ++i) {
- if (text.regionMatches(true, i, p, 0, plen))
- return i;
- }
-
- return -1;
- }
-}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/WildcardStringMatcher.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/WildcardStringMatcher.java
new file mode 100644
index 000000000..823496044
--- /dev/null
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/WildcardStringMatcher.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2020 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.team.internal.core;
+
+import org.eclipse.core.text.StringMatcher;
+
+/**
+ * A string pattern matcher. Supports '*' and '?' wildcards.
+ */
+public class WildcardStringMatcher {
+
+ private final StringMatcher fMatcher;
+
+ private final boolean fPathPattern;
+
+ /**
+ * Constructs a wildcard matcher for a pattern that may contain '*' for 0 and
+ * many characters and '?' for exactly one character. Character matching is
+ * case-insensitive.
+ *
+ * Literal '*' and '?' characters must be escaped in the pattern e.g., "\*"
+ * means literal "*", etc.
+ *
+ * The escape character '\' is an escape only if followed by '*', '?', or '\'.
+ * All other occurrences are taken literally.
+ *
+ * If invoking the StringMatcher with string literals in Java, don't forget
+ * escape characters are represented by "\\".
+ *
+ * @param pattern the pattern to match text against
+ * @throws IllegalArgumentException if {@code pattern == null}
+ */
+ public WildcardStringMatcher(String pattern) {
+ fMatcher = new StringMatcher(pattern, true, false);
+ fPathPattern = pattern.indexOf('/') != -1;
+ }
+
+ /**
+ * Determines whether the patterns contains a forward slash.
+ *
+ * @return {@code true} if the pattern contains a '/', {@code false} otherwise
+ */
+ public boolean isPathPattern() {
+ return fPathPattern;
+ }
+
+ /**
+ * Determines whether the given {@code text} matches the pattern.
+ *
+ * @param text String to match; must not be {@code null}
+ * @return {@code true} if the whole {@code text} matches the pattern;
+ * {@code false} otherwise
+ * @throws IllegalArgumentException if {@code text == null}
+ */
+ public boolean match(String text) {
+ return fMatcher.match(text);
+ }
+
+}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/CompoundResourceTraversal.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/CompoundResourceTraversal.java
index d8e0ccf2f..5eaf39707 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/CompoundResourceTraversal.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/CompoundResourceTraversal.java
@@ -76,8 +76,7 @@ public class CompoundResourceTraversal {
public synchronized boolean isCovered(IResource resource, int depth) {
IPath fullPath = resource.getFullPath();
// Regardless of the depth, look for a deep folder that covers the resource
- for (Iterator iter = deepFolders.iterator(); iter.hasNext();) {
- IResource deepFolder = (IResource) iter.next();
+ for (IResource deepFolder : deepFolders) {
if (deepFolder.getFullPath().isPrefixOf(fullPath)) {
return true;
}
@@ -195,26 +194,22 @@ public class CompoundResourceTraversal {
*/
private IResource[] getUncoveredResources(CompoundResourceTraversal otherTraversal) {
Set<IResource> result = new HashSet<>();
- for (Iterator iter = otherTraversal.files.iterator(); iter.hasNext();) {
- IResource resource = (IResource) iter.next();
+ for (IResource resource : otherTraversal.files) {
if (!isCovered(resource, IResource.DEPTH_ZERO)) {
result.add(resource);
}
}
- for (Iterator iter = otherTraversal.zeroFolders.iterator(); iter.hasNext();) {
- IResource resource = (IResource) iter.next();
+ for (IResource resource : otherTraversal.zeroFolders) {
if (!isCovered(resource, IResource.DEPTH_ZERO)) {
result.add(resource);
}
}
- for (Iterator iter = otherTraversal.shallowFolders.iterator(); iter.hasNext();) {
- IResource resource = (IResource) iter.next();
+ for (IResource resource : otherTraversal.shallowFolders) {
if (!isCovered(resource, IResource.DEPTH_ONE)) {
result.add(resource);
}
}
- for (Iterator iter = otherTraversal.deepFolders.iterator(); iter.hasNext();) {
- IResource resource = (IResource) iter.next();
+ for (IResource resource : otherTraversal.deepFolders) {
if (!isCovered(resource, IResource.DEPTH_INFINITE)) {
result.add(resource);
}
@@ -257,26 +252,22 @@ public class CompoundResourceTraversal {
public ResourceTraversal[] getUncoveredTraversals(CompoundResourceTraversal otherTraversal) {
synchronized (otherTraversal) {
CompoundResourceTraversal uncovered = new CompoundResourceTraversal();
- for (Iterator iter = otherTraversal.files.iterator(); iter.hasNext();) {
- IResource resource = (IResource) iter.next();
+ for (IResource resource : otherTraversal.files) {
if (!isCovered(resource, IResource.DEPTH_ZERO)) {
uncovered.addResource(resource, IResource.DEPTH_ZERO);
}
}
- for (Iterator iter = otherTraversal.zeroFolders.iterator(); iter.hasNext();) {
- IResource resource = (IResource) iter.next();
+ for (IResource resource : otherTraversal.zeroFolders) {
if (!isCovered(resource, IResource.DEPTH_ZERO)) {
uncovered.addResource(resource, IResource.DEPTH_ZERO);
}
}
- for (Iterator iter = otherTraversal.shallowFolders.iterator(); iter.hasNext();) {
- IResource resource = (IResource) iter.next();
+ for (IResource resource : otherTraversal.shallowFolders) {
if (!isCovered(resource, IResource.DEPTH_ONE)) {
uncovered.addResource(resource, IResource.DEPTH_ONE);
}
}
- for (Iterator iter = otherTraversal.deepFolders.iterator(); iter.hasNext();) {
- IResource resource = (IResource) iter.next();
+ for (IResource resource : otherTraversal.deepFolders) {
if (!isCovered(resource, IResource.DEPTH_INFINITE)) {
uncovered.addResource(resource, IResource.DEPTH_INFINITE);
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java
index dc7e98007..e119fd3be 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java
@@ -17,7 +17,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -56,8 +55,7 @@ public class PathTree {
}
public boolean descendantHasFlag(int property) {
if (hasDescendants()) {
- for (Iterator<IPath> iter = descendantsWithPayload.iterator(); iter.hasNext();) {
- IPath path = iter.next();
+ for (IPath path : descendantsWithPayload) {
Node child = getNode(path);
if (child.hasFlag(property)) {
return true;
@@ -154,8 +152,7 @@ public class PathTree {
if (node != null) {
Set possibleChildren = node.descendantsWithPayload;
if(possibleChildren != null) {
- for (Iterator it = possibleChildren.iterator(); it.hasNext();) {
- Object next = it.next();
+ for (Object next : possibleChildren) {
IPath descendantPath = (IPath)next;
IPath childPath = null;
if(descendantPath.segmentCount() == (path.segmentCount() + 1)) {
@@ -250,8 +247,7 @@ public class PathTree {
*/
public synchronized IPath[] getPaths() {
List<IPath> result = new ArrayList<>();
- for (Iterator iter = objects.keySet().iterator(); iter.hasNext();) {
- IPath path = (IPath) iter.next();
+ for (IPath path : objects.keySet()) {
Node node = getNode(path);
if (node.getPayload() != null)
result.add(path);
@@ -263,10 +259,9 @@ public class PathTree {
* Return all the values contained in this path tree.
* @return all the values in the tree
*/
- public synchronized Collection values() {
+ public synchronized Collection<Object> values() {
List<Object> result = new ArrayList<>();
- for (Iterator iter = objects.keySet().iterator(); iter.hasNext();) {
- IPath path = (IPath) iter.next();
+ for (IPath path : objects.keySet()) {
Node node = getNode(path);
if (node.getPayload() != null)
result.add(node.getPayload());
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/ScopeManagerEventHandler.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/ScopeManagerEventHandler.java
index 95ac2ef9a..d658266f7 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/ScopeManagerEventHandler.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/ScopeManagerEventHandler.java
@@ -33,7 +33,7 @@ public class ScopeManagerEventHandler extends BackgroundEventHandler {
private Set<ResourceMapping> toRefresh = new HashSet<>();
private ISynchronizationScopeManager manager;
- class ResourceMappingEvent extends Event {
+ static class ResourceMappingEvent extends Event {
private final ResourceMapping[] mappings;
public ResourceMappingEvent(ResourceMapping[] mappings) {
super(REFRESH);
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutInputStream.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutInputStream.java
index df4dc0599..454e1ee6d 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutInputStream.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutInputStream.java
@@ -64,7 +64,7 @@ public class TimeoutInputStream extends FilterInputStream {
this.readTimeout = readTimeout;
this.closeTimeout = closeTimeout;
this.iobuffer = new byte[bufferSize];
- thread = new Thread((Runnable) () -> runThread(), "TimeoutInputStream");//$NON-NLS-1$
+ thread = new Thread((Runnable) this::runThread, "TimeoutInputStream");//$NON-NLS-1$
thread.setDaemon(true);
thread.start();
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutOutputStream.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutOutputStream.java
index 3af0922c0..406a4cb78 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutOutputStream.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutOutputStream.java
@@ -64,7 +64,7 @@ public class TimeoutOutputStream extends FilterOutputStream {
this.writeTimeout = writeTimeout;
this.closeTimeout = closeTimeout;
this.iobuffer = new byte[bufferSize];
- thread = new Thread((Runnable) () -> runThread(), "TimeoutOutputStream");//$NON-NLS-1$
+ thread = new Thread((Runnable) this::runThread, "TimeoutOutputStream");//$NON-NLS-1$
thread.setDaemon(true);
thread.start();
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/BatchingLock.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/BatchingLock.java
index 426710046..63a569c17 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/BatchingLock.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/BatchingLock.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.core.subscribers;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -60,7 +59,7 @@ public class BatchingLock {
}
};
- public class ThreadInfo {
+ public static class ThreadInfo {
private Set<IResource> changedResources = new HashSet<>();
private IFlushOperation operation;
private List<ISchedulingRule> rules = new ArrayList<>();
@@ -224,8 +223,7 @@ public class BatchingLock {
return rules.remove(rules.size() - 1);
}
public boolean ruleContains(IResource resource) {
- for (Iterator iter = rules.iterator(); iter.hasNext();) {
- ISchedulingRule rule = (ISchedulingRule) iter.next();
+ for (ISchedulingRule rule : rules) {
if (rule != NULL_SCHEDULING_RULE && rule.contains(resource)) {
return true;
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ChangeSetManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ChangeSetManager.java
index 1cf0e10ac..850b4153f 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ChangeSetManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ChangeSetManager.java
@@ -27,7 +27,7 @@ import org.eclipse.core.runtime.SafeRunner;
*/
public abstract class ChangeSetManager {
- private ListenerList<IChangeSetChangeListener> listeners = new ListenerList<IChangeSetChangeListener>(ListenerList.IDENTITY);
+ private ListenerList<IChangeSetChangeListener> listeners = new ListenerList<>(ListenerList.IDENTITY);
private Set<ChangeSet> sets;
private boolean initializing;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/DiffTreeStatistics.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/DiffTreeStatistics.java
index 7cd58fbd0..c64e55aad 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/DiffTreeStatistics.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/DiffTreeStatistics.java
@@ -25,7 +25,7 @@ import org.eclipse.team.core.synchronize.SyncInfo;
public class DiffTreeStatistics {
/**
- * {Integer sync kind -> Long number of infos with that sync kind in this sync set}
+ * {Integer sync kind -&gt; Long number of infos with that sync kind in this sync set}
*/
protected Map<Integer, Long> stats = Collections.synchronizedMap(new HashMap<>());
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncByteConverter.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncByteConverter.java
index d6c585941..a0086a42e 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncByteConverter.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncByteConverter.java
@@ -53,7 +53,7 @@ public class SyncByteConverter {
/**
* Method startOfSlot returns the index of the slash that occurs before the
- * given slot index. The provided index should be >= 1 which assumes that
+ * given slot index. The provided index should be &gt;= 1 which assumes that
* slot zero occurs before the first slash.
*
* @param syncBytes
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncInfoTreeChangeEvent.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncInfoTreeChangeEvent.java
index ea2c485dc..178816a57 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncInfoTreeChangeEvent.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncInfoTreeChangeEvent.java
@@ -77,8 +77,7 @@ public class SyncInfoTreeChangeEvent extends SyncInfoSetChangeEvent implements I
}
private boolean isDescendantOfAddedRoot(IResource resource) {
- for (Iterator iter = addedSubtrees.iterator(); iter.hasNext();) {
- IResource root = (IResource) iter.next();
+ for (IResource root : addedSubtrees) {
if (isParent(root, resource)) {
// There is a higher added root already in the list
return true;
diff --git a/bundles/org.eclipse.team.cvs.core/.classpath b/bundles/org.eclipse.team.cvs.core/.classpath
index 22f30643c..e801ebfb4 100644
--- a/bundles/org.eclipse.team.cvs.core/.classpath
+++ b/bundles/org.eclipse.team.cvs.core/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.team.cvs.core/.cvsignore b/bundles/org.eclipse.team.cvs.core/.cvsignore
deleted file mode 100644
index c5e82d745..000000000
--- a/bundles/org.eclipse.team.cvs.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.jdt.core.prefs
index 3e8224c8c..fbccaa918 100644
--- a/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.jdt.core.prefs
@@ -18,9 +18,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -120,8 +120,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
diff --git a/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.pde.prefs
index 85b2478a9..d3ef2b590 100644
--- a/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.team.cvs.core/.settings/org.eclipse.pde.prefs
@@ -1,32 +1,32 @@
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=0
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=0
-compilers.p.missing-version-export-package=2
-compilers.p.missing-version-import-package=2
-compilers.p.missing-version-require-bundle=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=1
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=0
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=0
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=1
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
index fcb2f0dac..1454ac2f0 100644
--- a/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.core; singleton:=true
-Bundle-Version: 3.4.700.qualifier
+Bundle-Version: 3.5.0.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.core.CVSProviderPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -25,7 +25,5 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.net;bundle-version="[1.0.0,2.0.0)",
org.eclipse.equinox.security;bundle-version="[1.0.0,2.0.0)"
Bundle-ActivationPolicy: lazy
-Import-Package: com.ibm.icu.text,
- com.ibm.icu.util
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.team.cvs.core
diff --git a/bundles/org.eclipse.team.cvs.core/forceQualifierUpdate.txt b/bundles/org.eclipse.team.cvs.core/forceQualifierUpdate.txt
index 5a2a85fdc..276ac8145 100644
--- a/bundles/org.eclipse.team.cvs.core/forceQualifierUpdate.txt
+++ b/bundles/org.eclipse.team.cvs.core/forceQualifierUpdate.txt
@@ -1,2 +1,3 @@
# To force a version qualifier update, add the bug here
Bug 509973 - Comparator errors in I20170105-0320
+Bug 573468 - 4.20 I-Build: I20210510-1800 - Comparator Errors Found
diff --git a/bundles/org.eclipse.team.cvs.core/pom.xml b/bundles/org.eclipse.team.cvs.core/pom.xml
index 4c71f1637..d29538357 100644
--- a/bundles/org.eclipse.team.cvs.core/pom.xml
+++ b/bundles/org.eclipse.team.cvs.core/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.cvs.core</artifactId>
- <version>3.4.700-SNAPSHOT</version>
+ <version>3.5.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java
index 00a84652b..5c3674b5e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java
@@ -60,12 +60,12 @@ public class CVSCompareSubscriber extends CVSSyncTreeSubscriber implements ISubs
*/
public void resetRoots(IResource[] resources, CVSTag[] tags) {
if (this.resources != null) {
- List removed = new ArrayList();
+ List<ISubscriberChangeEvent> removed = new ArrayList<>();
for (IResource resource : this.resources) {
removed.add(new SubscriberChangeEvent(this, ISubscriberChangeEvent.ROOT_REMOVED, resource));
}
this.resources = new IResource[0];
- fireTeamResourceChange((ISubscriberChangeEvent[]) removed.toArray(new ISubscriberChangeEvent[removed.size()]));
+ fireTeamResourceChange(removed.toArray(new ISubscriberChangeEvent[removed.size()]));
if (tree != null) {
tree.dispose();
tree = null;
@@ -116,7 +116,7 @@ public class CVSCompareSubscriber extends CVSSyncTreeSubscriber implements ISubs
@Override
public void subscriberResourceChanged(ISubscriberChangeEvent[] deltas) {
- List outgoingDeltas = new ArrayList(deltas.length);
+ List<ISubscriberChangeEvent> outgoingDeltas = new ArrayList<>(deltas.length);
for (ISubscriberChangeEvent delta : deltas) {
if ((delta.getFlags() & ISubscriberChangeEvent.ROOT_REMOVED) != 0) {
IResource resource = delta.getResource();
@@ -134,12 +134,12 @@ public class CVSCompareSubscriber extends CVSSyncTreeSubscriber implements ISubs
}
}
- fireTeamResourceChange((SubscriberChangeEvent[]) outgoingDeltas.toArray(new SubscriberChangeEvent[outgoingDeltas.size()]));
+ fireTeamResourceChange(outgoingDeltas.toArray(new SubscriberChangeEvent[outgoingDeltas.size()]));
}
private SubscriberChangeEvent[] handleRemovedRoot(IResource removedRoot) {
// Determine if any of the roots of the compare are affected
- List removals = new ArrayList(resources.length);
+ List<IResource> removals = new ArrayList<>(resources.length);
for (IResource root : resources) {
if (removedRoot.getFullPath().isPrefixOf(root.getFullPath())) {
// The root is no longer managed by CVS
@@ -156,15 +156,15 @@ public class CVSCompareSubscriber extends CVSSyncTreeSubscriber implements ISubs
}
// Adjust the roots of the subscriber
- List newRoots = new ArrayList(resources.length);
+ List<IResource> newRoots = new ArrayList<>(resources.length);
newRoots.addAll(Arrays.asList(resources));
newRoots.removeAll(removals);
- resources = (IResource[]) newRoots.toArray(new IResource[newRoots.size()]);
+ resources = newRoots.toArray(new IResource[newRoots.size()]);
// Create the deltas for the removals
SubscriberChangeEvent[] deltas = new SubscriberChangeEvent[removals.size()];
for (int i = 0; i < deltas.length; i++) {
- deltas[i] = new SubscriberChangeEvent(this, ISubscriberChangeEvent.ROOT_REMOVED, (IResource)removals.get(i));
+ deltas[i] = new SubscriberChangeEvent(this, ISubscriberChangeEvent.ROOT_REMOVED, removals.get(i));
}
return deltas;
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
index 70568ab3b..f20bc522f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
@@ -97,7 +97,7 @@ public class CVSProviderPlugin extends Plugin {
private static final String REPOSITORIES_STATE_FILE = ".cvsProviderState"; //$NON-NLS-1$
// version numbers for the state file (a positive number indicates version 1)
private static final int REPOSITORIES_STATE_FILE_VERSION_2 = -1;
- private static List decoratorEnablementListeners = new ArrayList();
+ private static List<ICVSDecoratorEnablementListener> decoratorEnablementListeners = new ArrayList<>();
private CVSWorkspaceSubscriber cvsWorkspaceSubscriber;
@@ -290,7 +290,7 @@ public class CVSProviderPlugin extends Plugin {
super.start(context);
// register debug options listener
- Hashtable properties = new Hashtable(2);
+ Hashtable<String,String> properties = new Hashtable<>(2);
properties.put(DebugOptions.LISTENER_SYMBOLICNAME, ID);
debugRegistration = context.registerService(DebugOptionsListener.class, Policy.DEBUG_OPTIONS_LISTENER, properties);
@@ -312,7 +312,7 @@ public class CVSProviderPlugin extends Plugin {
// Must load the change set manager on startup since it listens to deltas
getChangeSetManager();
- tracker = new ServiceTracker(getBundle().getBundleContext(), IJSchService.class.getName(), null);
+ tracker = new ServiceTracker<>(getBundle().getBundleContext(), IJSchService.class.getName(), null);
tracker.open();
}
@@ -427,7 +427,7 @@ public class CVSProviderPlugin extends Plugin {
public static void broadcastDecoratorEnablementChanged(final boolean enabled) {
ICVSDecoratorEnablementListener[] listeners;
synchronized(decoratorEnablementListeners) {
- listeners = (ICVSDecoratorEnablementListener[]) decoratorEnablementListeners.toArray(new ICVSDecoratorEnablementListener[decoratorEnablementListeners.size()]);
+ listeners = decoratorEnablementListeners.toArray(new ICVSDecoratorEnablementListener[decoratorEnablementListeners.size()]);
}
for (ICVSDecoratorEnablementListener listener : listeners) {
ISafeRunnable code = new ISafeRunnable() {
@@ -507,9 +507,9 @@ public class CVSProviderPlugin extends Plugin {
File file = pluginStateLocation.toFile();
if (file.exists()) {
try {
- DataInputStream dis = new DataInputStream(new FileInputStream(file));
- readOldState(dis);
- dis.close();
+ try (DataInputStream dis = new DataInputStream(new FileInputStream(file))) {
+ readOldState(dis);
+ }
// The file is no longer needed as the state is
// persisted in the user settings
file.delete();
@@ -704,16 +704,16 @@ public class CVSProviderPlugin extends Plugin {
return pass==null ? "" : (String) pass; //$NON-NLS-1$
}
- private Map getAuthInfo() {
+ private Map<String,String> getAuthInfo() {
// Retrieve username and password from keyring.
- Map authInfo = Platform.getAuthorizationInfo(FAKE_URL, "proxy", ""); //$NON-NLS-1$ //$NON-NLS-2$
- return authInfo!=null ? authInfo : Collections.EMPTY_MAP;
+ Map<String,String> authInfo = Platform.getAuthorizationInfo(FAKE_URL, "proxy", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ return authInfo!=null ? authInfo : Collections.emptyMap();
}
public void setProxyAuth(String proxyUser, String proxyPass) {
- Map authInfo = getAuthInfo();
+ Map<String,String> authInfo = getAuthInfo();
if (authInfo.isEmpty()) {
- authInfo = new java.util.HashMap(4);
+ authInfo = new java.util.HashMap<>(4);
}
if (proxyUser != null) {
authInfo.put(INFO_PROXY_USER, proxyUser);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java
index d46978bd0..3a5f41f86 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java
@@ -25,31 +25,25 @@ public class CVSRepositoryLocationMatcher {
private static final String PSERVER = "pserver"; //$NON-NLS-1$
private static final String EXT = "ext"; //$NON-NLS-1$
- private static Comparator COMPATIBLE_LOCATIONS_COMPARATOR = (o1, o2) -> {
- if (o1 instanceof ICVSRepositoryLocation
- && o2 instanceof ICVSRepositoryLocation) {
- ICVSRepositoryLocation rl1 = (ICVSRepositoryLocation) o1;
- ICVSRepositoryLocation rl2 = (ICVSRepositoryLocation) o2;
- String name1 = rl1.getMethod().getName();
- String name2 = rl2.getMethod().getName();
-
- if (!name1.equals(name2) && isCompatible(rl1, rl2, false)) {
- if (name1.equals(EXTSSH))
- return -1;
- if (name2.equals(EXTSSH))
- return 1;
- if (name1.equals(PSERVER))
- return -1;
- if (name2.equals(PSERVER))
- return 1;
- if (name1.equals(EXT))
- return -1;
- if (name2.equals(EXT))
- return 1;
- }
- return name1.compareTo(name2);
+ private static Comparator<ICVSRepositoryLocation> COMPATIBLE_LOCATIONS_COMPARATOR = (rl1, rl2) -> {
+ String name1 = rl1.getMethod().getName();
+ String name2 = rl2.getMethod().getName();
+
+ if (!name1.equals(name2) && isCompatible(rl1, rl2, false)) {
+ if (name1.equals(EXTSSH))
+ return -1;
+ if (name2.equals(EXTSSH))
+ return 1;
+ if (name1.equals(PSERVER))
+ return -1;
+ if (name2.equals(PSERVER))
+ return 1;
+ if (name1.equals(EXT))
+ return -1;
+ if (name2.equals(EXT))
+ return 1;
}
- return 0;
+ return name1.compareTo(name2);
};
public static Map<IProject, List<ICVSRepositoryLocation>> prepareSuggestedRepositoryLocations(
@@ -98,9 +92,9 @@ public class CVSRepositoryLocationMatcher {
ICVSRepositoryLocation projectSetRepositoryLocation = (ICVSRepositoryLocation) i
.next();
- List matching = new ArrayList();
- List compatible = new ArrayList();
- List list = new ArrayList();
+ List<ICVSRepositoryLocation> matching = new ArrayList<>();
+ List<ICVSRepositoryLocation> compatible = new ArrayList<>();
+ List<ICVSRepositoryLocation> list = new ArrayList<>();
for (Iterator j = knownRepositories.iterator(); j.hasNext();) {
ICVSRepositoryLocation knownRepositoryLocation = (ICVSRepositoryLocation) j
.next();
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java
index 7400f582e..95b9088e6 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java
@@ -135,7 +135,7 @@ public class CVSTag implements ITag {
public static IStatus validateTagName(String tagName) {
if (tagName == null)
return new CVSStatus(IStatus.ERROR, CVSMessages.CVSTag_nullName);
- if (tagName.equals("")) //$NON-NLS-1$
+ if (tagName.isEmpty())
return new CVSStatus(IStatus.ERROR, CVSMessages.CVSTag_emptyName);
if (!Character. isLetter(tagName.charAt(0)))
return new CVSStatus(IStatus.ERROR, CVSMessages.CVSTag_beginName);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
index 417b222d9..3cfce1ef2 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
@@ -195,7 +195,7 @@ public class CVSTeamProvider extends RepositoryProvider {
* Get the arguments to be passed to a commit or update
*/
private String[] getValidArguments(IResource[] resources, LocalOption[] options) throws CVSException {
- List arguments = new ArrayList(resources.length);
+ List<String> arguments = new ArrayList<>(resources.length);
for (IResource resource : resources) {
checkIsChild(resource);
IPath cvsPath = resource.getFullPath().removeFirstSegments(1);
@@ -205,7 +205,7 @@ public class CVSTeamProvider extends RepositoryProvider {
arguments.add(cvsPath.toString());
}
}
- return (String[])arguments.toArray(new String[arguments.size()]);
+ return arguments.toArray(new String[arguments.size()]);
}
private ICVSResource[] getCVSArguments(IResource[] resources) {
@@ -272,7 +272,8 @@ public class CVSTeamProvider extends RepositoryProvider {
/**
* Sets the keyword substitution mode for the specified resources.
* <p>
- * Applies the following rules in order:<br>
+ * Applies the following rules in order:
+ * </p>
* <ul>
* <li>If a file is not managed, skips it.</li>
* <li>If a file is not changing modes, skips it.</li>
@@ -285,7 +286,6 @@ public class CVSTeamProvider extends RepositoryProvider {
* casually trying to commit pending changes to the repository without first checking out
* a new copy. This is not a perfect solution, as they could just as easily do an UPDATE
* and not obtain the new keyword sync info.
- * </p>
*
* @param changeSet a map from IFile to KSubstOption
* @param monitor the progress monitor
@@ -299,7 +299,7 @@ public class CVSTeamProvider extends RepositoryProvider {
final IStatus[] result = new IStatus[] { ICommandOutputListener.OK };
workspaceRoot.getLocalRoot().run(monitor1 -> {
final Map /* from KSubstOption to List of String */ filesToAdmin = new HashMap();
- final Collection /* of ICVSFile */ filesToCommitAsText = new HashSet(); // need fast lookup
+ final Collection<ICVSFile> filesToCommitAsText = new HashSet<>(); // need fast lookup
final boolean useCRLF = IS_CRLF_PLATFORM && (CVSProviderPlugin.getPlugin().isUsePlatformLineend());
/*** determine the resources to be committed and/or admin'd ***/
@@ -369,7 +369,7 @@ public class CVSTeamProvider extends RepositoryProvider {
Command.NO_GLOBAL_OPTIONS,
new LocalOption[] { Command.DO_NOT_RECURSE, Commit.FORCE,
Command.makeArgumentOption(Command.MESSAGE_OPTION, keywordChangeComment) },
- (ICVSResource[]) filesToCommitAsText.toArray(new ICVSResource[filesToCommitAsText.size()]),
+ filesToCommitAsText.toArray(new ICVSResource[filesToCommitAsText.size()]),
filesToCommitAsText,
null,
Policy.subMonitorFor(monitor1, filesToCommitAsText.size()));
@@ -419,7 +419,7 @@ public class CVSTeamProvider extends RepositoryProvider {
/**
* This method translates the contents of a file from binary into text (ASCII).
* Fixes the line delimiters in the local file to reflect the platform's
- * native encoding. Performs CR/LF -> LF or LF -> CR/LF conversion
+ * native encoding. Performs CR/LF -&gt; LF or LF -&gt; CR/LF conversion
* depending on the platform but does not affect delimiters that are
* already correctly encoded.
*/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java
index dfbabc211..c0afe7c57 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java
@@ -83,7 +83,7 @@ public class CVSWorkspaceSubscriber extends CVSSyncTreeSubscriber implements IRe
* @see org.eclipse.team.core.sync.ISyncTreeSubscriber#roots()
*/
public IResource[] roots() {
- List result = new ArrayList();
+ List<IProject> result = new ArrayList<>();
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject project : projects) {
if(project.isOpen()) {
@@ -93,7 +93,7 @@ public class CVSWorkspaceSubscriber extends CVSSyncTreeSubscriber implements IRe
}
}
}
- return (IProject[]) result.toArray(new IProject[result.size()]);
+ return result.toArray(new IProject[result.size()]);
}
@Override
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java
index 17964ed15..4cb4afe15 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java
@@ -107,7 +107,7 @@ public interface ICVSFile extends ICVSResource, ICVSStorage {
/**
* Answers whether the file is executable or not.
*
- * @returns <code>false</code> if the platform doesn't support the executable flag.
+ * @return <code>false</code> if the platform doesn't support the executable flag.
*/
public boolean isExecutable() throws CVSException;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFileModificationValidator.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFileModificationValidator.java
index 460ae70e9..535d3b524 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFileModificationValidator.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFileModificationValidator.java
@@ -21,9 +21,9 @@ import org.eclipse.core.runtime.IStatus;
* @author Administrator
*
* To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
+ * Window&gt;Preferences&gt;Java&gt;Templates.
* To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
+ * Window&gt;Preferences&gt;Java&gt;Code Generation.
*/
public interface ICVSFileModificationValidator {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IUserAuthenticator.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IUserAuthenticator.java
index 10313ce9a..0f1eae70d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IUserAuthenticator.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IUserAuthenticator.java
@@ -88,7 +88,7 @@ public interface IUserAuthenticator {
/**
* Prompts the user for a number values using text fields. The labels are provided in
- * the <core>prompt</code> array. Implementors will return the entered values, or null if
+ * the <code>prompt</code> array. Implementors will return the entered values, or null if
* the user cancel the prompt.
*
* @param location The repository location to authenticate the user for or <code>null</code>
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java
index d2a8af7fa..ea892ca1e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java
@@ -23,14 +23,14 @@ import org.eclipse.team.internal.ccvs.core.util.Util;
* Handles a "Checked-in" response from the CVS server.
* <p>
* Suppose as a result of performing a command the CVS server responds
- * as follows:<br>
+ * as follows:
+ * </p>
* <pre>
* [...]
* Checked-in ??? \n
* [...]
* </pre>
- * Then
- * </p>
+ * Then
*/
class CheckedInHandler extends ResponseHandler {
public String getResponseID() {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
index 9571b6cd8..0f098d3bb 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
@@ -84,14 +84,14 @@ public class Checkout extends Command {
Assert.isTrue(session.getLocalRoot().isFolder());
// Send the information about the local workspace resources to the server
- List resourcesToSend = new ArrayList(resources.length);
+ List<ICVSResource> resourcesToSend = new ArrayList<>(resources.length);
for (ICVSResource resource : resources) {
if (resource.exists() && resource.isFolder() && ((ICVSFolder)resource).isCVSFolder()) {
resourcesToSend.add(resource);
}
}
if ( ! resourcesToSend.isEmpty()) {
- resources = (ICVSResource[]) resourcesToSend.toArray(new ICVSResource[resourcesToSend.size()]);
+ resources = resourcesToSend.toArray(new ICVSResource[resourcesToSend.size()]);
new FileStructureVisitor(session, localOptions, true, true).visit(session, resources, monitor);
} else {
monitor.beginTask(null, 100);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
index 36471692c..e800d790b 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
@@ -88,7 +88,7 @@ public abstract class Command extends Request {
/*** Local options: keyword substitution mode ***/
// valid for: add admin checkout export import update
- private static final Map ksubstOptionMap = new HashMap();
+ private static final Map<String, KSubstOption> ksubstOptionMap = new HashMap<>();
public static final KSubstOption KSUBST_BINARY = new KSubstOption("-kb"); //$NON-NLS-1$
public static final KSubstOption KSUBST_TEXT = new KSubstOption("-ko"); //$NON-NLS-1$
public static final KSubstOption KSUBST_TEXT_EXPAND = new KSubstOption("-kkv"); //$NON-NLS-1$
@@ -573,13 +573,13 @@ public abstract class Command extends Request {
if (!this.isElementOf(options)) {
return options;
}
- List result = new ArrayList();
+ List<LocalOption> result = new ArrayList<>();
for (LocalOption option : options) {
if (!option.equals(this)) {
result.add(option);
}
}
- return (LocalOption[]) result.toArray(new LocalOption[result.size()]);
+ return result.toArray(new LocalOption[result.size()]);
}
}
/**
@@ -603,7 +603,7 @@ public abstract class Command extends Request {
*/
public static KSubstOption fromMode(String mode) {
if (mode.length() == 0) mode = "-kkv"; // use default //$NON-NLS-1$
- KSubstOption option = (KSubstOption) ksubstOptionMap.get(mode);
+ KSubstOption option = ksubstOptionMap.get(mode);
if (option == null) option = new KSubstOption(mode, true);
return option;
}
@@ -622,7 +622,7 @@ public abstract class Command extends Request {
* Returns an array of all valid modes.
*/
public static KSubstOption[] getAllKSubstOptions() {
- return (KSubstOption[]) ksubstOptionMap.values().toArray(new KSubstOption[ksubstOptionMap.size()]);
+ return ksubstOptionMap.values().toArray(new KSubstOption[ksubstOptionMap.size()]);
}
/**
* Returns the entry line mode string for this instance. Note that it might return blank strings
@@ -745,13 +745,13 @@ public abstract class Command extends Request {
* @return an array of all arguments of belonging to matching options
*/
protected static String[] collectOptionArguments(Option[] array, String option) {
- List /* of String */ list = new ArrayList();
+ List<String> list = new ArrayList<>();
for (int i = 0; i < array.length; ++i) {
if (array[i].getOption().equals(option)) {
list.add(array[i].argument);
}
}
- return (String[]) list.toArray(new String[list.size()]);
+ return list.toArray(new String[list.size()]);
}
/**
@@ -785,7 +785,7 @@ public abstract class Command extends Request {
* Execute a CVS command on an array of ICVSResource. This method simply converts
* the ICVSResource to String paths relative to the local root of the session and
* invokes <code>execute(Session, GlobalOption[], LocalOption[], String[], ICommandOutputListener, IProgressMonitor)</code>.
- * </p>
+ *
* @param session the open CVS session
* @param globalOptions the array of global options, or NO_GLOBAL_OPTIONS
* @param localOptions the array of local options, or NO_LOCAL_OPTIONS
@@ -806,11 +806,11 @@ public abstract class Command extends Request {
protected String[] convertArgumentsForOpenSession(ICVSResource[] arguments, Session openSession) throws CVSException {
// Convert arguments
- List stringArguments = new ArrayList(arguments.length);
+ List<String> stringArguments = new ArrayList<>(arguments.length);
for (ICVSResource argument : arguments) {
stringArguments.add(argument.getRelativePath(openSession.getLocalRoot()));
}
- return (String[]) stringArguments.toArray(new String[stringArguments.size()]);
+ return stringArguments.toArray(new String[stringArguments.size()]);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java
index 793bc37a1..0923ced79 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java
@@ -22,7 +22,8 @@ import org.eclipse.team.internal.ccvs.core.*;
* Handles a "Copy-file" response from the CVS server.
* <p>
* Suppose as a result of performing a command the CVS server responds
- * as follows:<br>
+ * as follows:
+ * </p>
* <pre>
* [...]
* Copy-file myproject/ \n
@@ -33,7 +34,6 @@ import org.eclipse.team.internal.ccvs.core.*;
* Then we copy (or optionally rename) the local file "oldfile.txt" in
* folder "myproject" to "newfile.txt". This response is used to create
* a backup copy of an existing file before merging in new changes.
- * </p>
*/
class CopyHandler extends ResponseHandler {
public String getResponseID() {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java
index 307f18842..4d9957cb3 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java
@@ -26,7 +26,8 @@ import org.eclipse.team.internal.ccvs.core.util.CVSDateFormatter;
* Handles a "Mod-time" response from the CVS server.
* <p>
* Suppose as a result of performing a command the CVS server responds
- * as follows:<br>
+ * as follows:
+ * </p>
* <pre>
* [...]
* Mod-time 18 Oct 2001 20:21:13 -0330\n
@@ -34,7 +35,6 @@ import org.eclipse.team.internal.ccvs.core.util.CVSDateFormatter;
* </pre>
* Then we parse and remember the date for use in subsequent
* file transfer responses such as Updated.
- * </p>
*/
class ModTimeHandler extends ResponseHandler {
public String getResponseID() {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NotifiedHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NotifiedHandler.java
index 6df20e6e4..d87423d45 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NotifiedHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NotifiedHandler.java
@@ -23,9 +23,9 @@ import org.eclipse.team.internal.ccvs.core.ICVSFolder;
* @author Administrator
*
* To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
+ * Window&gt;Preferences&gt;Java&gt;Templates.
* To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
+ * Window&gt;Preferences&gt;Java&gt;Code Generation.
*/
public class NotifiedHandler extends ResponseHandler {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java
index b0857c4a0..e75d8dbfb 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java
@@ -30,13 +30,14 @@ public class RLog extends RemoteCommand {
/**
* Makes a -r option for rlog. Here are the currently supported options:
*
- * tag1 tag2 result
- * ==== ==== =================================
- * date date date<date (all revisions between date and later)
- * tag tag tag:tag (all revisions between tag and tag, must be on same branch)
- * branch date >date (all revisions of date or later)
- * branch tag tag: (all revisions from tag to the end of branchs tip)
- *
+ * <pre>{@code
+ * tag1 tag2 result
+ * ====== ==== =================================
+ * date date date<date (all revisions between date and later)
+ * tag tag tag:tag (all revisions between tag and tag, must be on same branch)
+ * branch date >date (all revisions of date or later)
+ * branch tag tag: (all revisions from tag to the end of branchs tip)
+ * }</pre>
* Valid for: rlog
*/
public static LocalOption makeTagOption(CVSTag tag1, CVSTag tag2) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java
index 8e68dff51..e756fc111 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java
@@ -69,7 +69,7 @@ public class RTag extends RemoteCommand {
}
// Add the source tag to the local options
- List modifiedLocalOptions = new ArrayList(localOptions.length + 1);
+ List<LocalOption> modifiedLocalOptions = new ArrayList<>(localOptions.length + 1);
if (sourceTag==null) sourceTag = CVSTag.DEFAULT;
modifiedLocalOptions.addAll(Arrays.asList(localOptions));
modifiedLocalOptions.add(makeTagOption(sourceTag));
@@ -87,7 +87,7 @@ public class RTag extends RemoteCommand {
System.arraycopy(arguments, 0, newArguments, 1, arguments.length);
return execute(session, globalOptions,
- (LocalOption[]) modifiedLocalOptions.toArray(new LocalOption[modifiedLocalOptions.size()]),
+ modifiedLocalOptions.toArray(new LocalOption[modifiedLocalOptions.size()]),
newArguments, null, monitor);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java
index 8ca5978dc..8bfe95c9e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java
@@ -52,7 +52,7 @@ public abstract class RemoteCommand extends Command {
throws CVSException {
// Convert arguments
- List stringArguments = new ArrayList(arguments.length);
+ List<String> stringArguments = new ArrayList<>(arguments.length);
for (ICVSResource resource : arguments) {
String remotePath;
if (isDefinedModule(resource)) {
@@ -63,7 +63,7 @@ public abstract class RemoteCommand extends Command {
}
stringArguments.add(remotePath);
}
- return (String[]) stringArguments.toArray(new String[stringArguments.size()]);
+ return stringArguments.toArray(new String[stringArguments.size()]);
}
private boolean isDefinedModule(ICVSResource resource) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java
index b2eddd6fa..b74e099e4 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java
@@ -30,7 +30,7 @@ public abstract class Request {
public static final ValidRequests VALID_REQUESTS = new ValidRequests();
/*** Response handler map ***/
- private static final Map responseHandlers = new HashMap();
+ private static final Map<String,ResponseHandler> responseHandlers = new HashMap<>();
private static void initializeHandlerCache() {
synchronized(responseHandlers) {
@@ -67,16 +67,15 @@ public abstract class Request {
*
* @return a map of response handlers
*/
- protected static Map getReponseHandlerMap() {
+ protected static Map<String,ResponseHandler> getReponseHandlerMap() {
synchronized(responseHandlers) {
if (responseHandlers.isEmpty()) {
initializeHandlerCache();
}
- Map copy = new HashMap();
+ Map<String,ResponseHandler> copy = new HashMap<>();
for (Iterator iter = responseHandlers.values().iterator(); iter.hasNext();) {
ResponseHandler handler = (ResponseHandler) iter.next();
copy.put(handler.getResponseID(), handler.getInstance());
-
}
return copy;
}
@@ -154,7 +153,7 @@ public abstract class Request {
// handle completion responses
if (response.equals("ok")) { //$NON-NLS-1$
break;
- } else if (response.equals("error") || (isCVSNT && response.equals(""))) { //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (response.equals("error") || (isCVSNT && response.isEmpty())) { //$NON-NLS-1$
argument = argument.trim();
boolean serious = false;
if (argument.length() == 0) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
index 6a1827aba..b6d940dfd 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
@@ -37,7 +37,8 @@ public abstract class ResponseHandler {
* Handles a server response.
* <p>
* Suppose as a result of performing a command the CVS server responds
- * as follows:<br>
+ * as follows:
+ * </p>
* <pre>
* [...]
* Clear-sticky myDirectory \n
@@ -48,8 +49,7 @@ public abstract class ResponseHandler {
* for <em>Clear-sticky</em> will be invoked with <code>argument</code>
* set to <em>"myDirectory"</em>. It must then read the remaining
* response data from the connection (<em>"/u/cvsroot/myDirectory"</em>
- * including the newline) and take any necessary action.
- * </p><p>
+ * including the newline) and take any necessary action.<p>
* Note: The type and quantity of additional data that must be read
* from the connection varies on a per-response basis.
* </p>
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
index 9840e92ce..aabc321dc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
@@ -83,7 +83,7 @@ public class Session {
private boolean noLocalChanges = false;
private boolean createBackups = true;
private int compressionLevel = 0;
- private List expansions;
+ private List<String> expansions;
private Collection /* of ICVSFile */ textTransferOverrideSet = null;
// state need to indicate whether
@@ -91,10 +91,10 @@ public class Session {
// The resource bundle key that provides the file sending message
private String sendFileTitleMessage;
- private Map responseHandlers;
+ private Map<String,ResponseHandler> responseHandlers;
// List of errors accumulated while the command is executing
- private List errors = new ArrayList();
+ private List<IStatus> errors = new ArrayList<>();
private Command currentCommand;
@@ -136,7 +136,7 @@ public class Session {
*/
protected void resetModuleExpansion() {
if (expansions == null)
- expansions = new ArrayList();
+ expansions = new ArrayList<>();
else
expansions.clear();
}
@@ -268,7 +268,7 @@ public class Session {
*/
public String[] getModuleExpansions() {
if (expansions == null) return new String[0];
- return (String[]) expansions.toArray(new String[expansions.size()]);
+ return expansions.toArray(new String[expansions.size()]);
}
/**
@@ -313,12 +313,12 @@ public class Session {
/**
* Sends an argument to the server.
- * <p>e.g. sendArgument("Hello\nWorld\n Hello World") sends:
+ * <p>e.g. sendArgument("Hello\nWorld\n Hello World") sends:</p>
* <pre>
* Argument Hello \n
* Argumentx World \n
* Argumentx Hello World \n
- * </pre></p>
+ * </pre>
*
* @param arg the argument to send
*/
@@ -357,10 +357,10 @@ public class Session {
/**
* Sends an Is-modified request to the server without the file contents.
- * <p>e.g. if a file called "local_file" was modified, sends:
+ * <p>e.g. if a file called "local_file" was modified, sends:</p>
* <pre>
* Is-modified local_file \n
- * </pre></p><p>
+ * </pre><p>
* This request is an optimized form of the Modified request and may not
* be supported by all servers. Hence, if it is not supported, a Modified
* request is sent instead along with the file's contents. According to
@@ -420,11 +420,11 @@ public class Session {
/**
* Sends a Directory request to the server.
- * <p>e.g. sendDirectory("local_dir", "remote_dir") sends:
+ * <p>e.g. sendDirectory("local_dir", "remote_dir") sends:</p>
* <pre>
* Directory local_dir
* repository_root/remote_dir
- * </pre></p>
+ * </pre>
*
* @param localDir the path of the local directory relative to localRoot
* @param remoteDir the path of the remote directory relative to repositoryRoot
@@ -492,10 +492,10 @@ public class Session {
/**
* Sends a global options to the server.
- * <p>e.g. sendGlobalOption("-n") sends:
+ * <p>e.g. sendGlobalOption("-n") sends:</p>
* <pre>
* Global_option -n \n
- * </pre></p>
+ * </pre>
*
* @param option the global option to send
*/
@@ -563,13 +563,13 @@ public class Session {
/**
* Sends a Modified request to the server along with the file contents.
- * <p>e.g. if a file called "local_file" was modified, sends:
+ * <p>e.g. if a file called "local_file" was modified, sends:</p>
* <pre>
* Modified local_file \n
* file_permissions \n
* file_size \n
* [... file_contents ...]
- * </pre></p><p>
+ * </pre><p>
* Under some circumstances, Is-modified may be used in place of this request.<br>
* Do not use with history, init, import, rdiff, release, rtag, or update.
* </p><p>
@@ -960,7 +960,7 @@ public class Session {
* Get the response handler map to be used for this session. The map is created by making a copy of the global
* reponse handler map.
*/
- protected Map getReponseHandlers() {
+ protected Map<String,ResponseHandler> getReponseHandlers() {
if (responseHandlers == null) {
responseHandlers = Request.getReponseHandlerMap();
}
@@ -990,7 +990,7 @@ public class Session {
}
public ResponseHandler getResponseHandler(String responseID) {
- return (ResponseHandler)getReponseHandlers().get(responseID);
+ return getReponseHandlers().get(responseID);
}
/**
@@ -1008,7 +1008,7 @@ public class Session {
}
public IStatus[] getErrors() {
- return (IStatus[]) errors.toArray(new IStatus[errors.size()]);
+ return errors.toArray(new IStatus[errors.size()]);
}
public void clearErrors() {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java
index 59c21d149..c831b408f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java
@@ -26,7 +26,8 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.MutableFolderSyncInfo;
* from the CVS server.
* <p>
* Suppose as a result of performing a command the CVS server responds
- * as follows:<br>
+ * as follows:
+ * </p>
* <pre>
* [...]
* Set-static-directory myproject/ \n
@@ -35,7 +36,6 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.MutableFolderSyncInfo;
* </pre>
* Then we set or clear the static flag of the folder "myproject",
* automatically creating it if it does not exist locally,
- * </p>
*/
class StaticHandler extends ResponseHandler {
private final boolean setStaticDirectory;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java
index 48fe582ff..b03786434 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java
@@ -25,7 +25,8 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.MutableFolderSyncInfo;
* Handles any "Set-sticky" and "Clear-stick" responses from the CVS server.
* <p>
* Suppose as a result of performing a command the CVS server responds
- * as follows:<br>
+ * as follows:
+ * </p>
* <pre>
* [...]
* Set-sticky myproject/ \n
@@ -35,7 +36,6 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.MutableFolderSyncInfo;
* </pre>
* Then we set or clear the sticky tag property of the folder "myproject",
* automatically creating it if it does not exist locally,
- * </p>
*/
class StickyHandler extends ResponseHandler {
private final boolean setSticky;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java
index dd7783fac..4b1d8d18c 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java
@@ -26,9 +26,9 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
* @author Administrator
*
* To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
+ * Window&gt;Preferences&gt;Java&gt;Templates.
* To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
+ * Window&gt;Preferences&gt;Java&gt;Code Generation.
*/
public class TemplateHandler extends ResponseHandler {
@@ -66,18 +66,13 @@ public class TemplateHandler extends ResponseHandler {
IProgressMonitor monitor)
throws CVSException {
- try {
- // Transfer the contents
- OutputStream out = new ByteArrayOutputStream();
- try {
- byte[] buffer = new byte[1024];
- int read;
- while ((read = stream.read(buffer)) >= 0) {
- Policy.checkCanceled(monitor);
- out.write(buffer, 0, read);
- }
- } finally {
- out.close();
+ try ( // Transfer the contents
+ OutputStream out = new ByteArrayOutputStream()) {
+ byte[] buffer = new byte[1024];
+ int read;
+ while ((read = stream.read(buffer)) >= 0) {
+ Policy.checkCanceled(monitor);
+ out.write(buffer, 0, read);
}
} catch (IOException e) {
throw CVSException.wrapException(e);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequestsHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequestsHandler.java
index 6e8ee42e8..be034d839 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequestsHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequestsHandler.java
@@ -16,13 +16,13 @@ package org.eclipse.team.internal.ccvs.core.client;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.client.Session;
/**
* Handles a "Valid-requests" response from the CVS server.
* <p>
* Suppose as a result of performing a command the CVS server responds
- * as follows:<br>
+ * as follows:
+ * </p>
* <pre>
* [...]
* Valid-requests ci co update Root Directory Valid-responses Argument ...\n
@@ -30,7 +30,6 @@ import org.eclipse.team.internal.ccvs.core.client.Session;
* </pre>
* Then we remember the set of valid requests for this session in
* preparation for isValidRequests queries.
- * </p>
*/
class ValidRequestsHandler extends ResponseHandler {
public String getResponseID() {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java
index b9408f4b7..5e6a1dc55 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java
@@ -28,7 +28,7 @@ public class AnnotateListener extends CommandOutputListener {
* Handle output from the CVS Annotate command.
*/
ByteArrayOutputStream aStream = new ByteArrayOutputStream();
- List blocks = new ArrayList();
+ List<CVSAnnotateBlock> blocks = new ArrayList<>();
int lineNumber;
public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
@@ -72,7 +72,7 @@ public class AnnotateListener extends CommandOutputListener {
if (size == 0) {
blocks.add(aBlock);
} else {
- CVSAnnotateBlock lastBlock = (CVSAnnotateBlock) blocks.get(size - 1);
+ CVSAnnotateBlock lastBlock = blocks.get(size - 1);
if (lastBlock.getRevision().equals(aBlock.getRevision())) {
lastBlock.setEndLine(aBlock.getStartLine());
} else {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/EditorsListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/EditorsListener.java
index 73a6ebaa0..f469198fc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/EditorsListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/EditorsListener.java
@@ -38,7 +38,7 @@ public class EditorsListener extends CommandOutputListener {
/**
* List to store the EditorsInfos
*/
- private List infos = new LinkedList();
+ private List<EditorsInfo> infos = new LinkedList<>();
/**
* Name of the current file
@@ -99,7 +99,7 @@ public class EditorsListener extends CommandOutputListener {
* @return IEditorsInfo[]
*/
public EditorsInfo[] getEditorsInfos() {
- return (EditorsInfo[]) infos.toArray(new EditorsInfo[infos.size()]);
+ return infos.toArray(new EditorsInfo[infos.size()]);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
index f1fe64e41..810d9cc01 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
@@ -22,6 +22,7 @@ import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.team.core.history.ITag;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.CommandOutputListener;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
@@ -67,8 +68,8 @@ public class LogListener extends CommandOutputListener {
private String revision;
private String author;
private Date creationDate;
- private List versions = new ArrayList();
- private Map internedStrings = new HashMap();
+ private List<VersionInfo> versions = new ArrayList<>();
+ private Map<String,String> internedStrings = new HashMap<>();
private final ILogEntryListener listener;
/**
@@ -195,10 +196,10 @@ public class LogListener extends CommandOutputListener {
}
if (state == DONE) {
// we are only interested in tag names for this revision, remove all others.
- List thisRevisionTags = versions.isEmpty() ? Collections.EMPTY_LIST : new ArrayList(3);
- List thisRevisionBranches = new ArrayList(1);
+ List<ITag> thisRevisionTags = versions.isEmpty() ? Collections.emptyList() : new ArrayList<>(3);
+ List<ITag> thisRevisionBranches = new ArrayList<>(1);
//a parallel lists for revision tags (used only for branches with no commits on them)
- List revisionVersions = versions.isEmpty() ? Collections.EMPTY_LIST : new ArrayList(3);
+ List<String> revisionVersions = versions.isEmpty() ? Collections.emptyList() : new ArrayList<>(3);
String branchRevision = this.getBranchRevision(revision);
for (Iterator i = versions.iterator(); i.hasNext();) {
VersionInfo version = (VersionInfo) i.next();
@@ -307,7 +308,7 @@ public class LogListener extends CommandOutputListener {
}
private String internAndCopyString(String string) {
- String internedString = (String) internedStrings.get(string);
+ String internedString = internedStrings.get(string);
if (internedString == null) {
internedString = new String(string);
internedStrings.put(internedString, internedString);
@@ -316,7 +317,7 @@ public class LogListener extends CommandOutputListener {
}
private String internString(String string) {
- String internedString = (String) internedStrings.get(string);
+ String internedString = internedStrings.get(string);
if (internedString == null) {
internedString = string;
internedStrings.put(internedString, internedString);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java
index 1d7440a2a..023e24213 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java
@@ -32,7 +32,7 @@ public class ModuleDefinitionsListener extends CommandOutputListener {
// the last line read from the context (used to accumulate multi-line definitions)
private String lastLine = ""; //$NON-NLS-1$
- private Map moduleMap;
+ private Map<String,String> moduleMap;
public ModuleDefinitionsListener() {
reset();
@@ -63,10 +63,10 @@ public class ModuleDefinitionsListener extends CommandOutputListener {
}
public String[] getModuleExpansions() {
- return (String[])moduleMap.values().toArray(new String[moduleMap.size()]);
+ return moduleMap.values().toArray(new String[moduleMap.size()]);
}
public void reset() {
- this.moduleMap = new HashMap();
+ this.moduleMap = new HashMap<>();
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java
index 305a2c8e8..c7b12f939 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java
@@ -41,7 +41,7 @@ public class ServerMessageLineMatcher {
public ServerMessageLineMatcher(String template, String[] expectedVariables) throws CVSException {
// Extract the variable names from the template
Matcher matcher = VARIABLE_MATCHING_PATTERN.matcher(template);
- List variables = new ArrayList();
+ List<String> variables = new ArrayList<>();
while (matcher.find()) {
if (matcher.groupCount() != 2) {
IStatus status = new CVSStatus(IStatus.ERROR,NLS.bind(CVSMessages.ServerMessageLineMatcher_5, new String[] { template }));
@@ -50,7 +50,7 @@ public class ServerMessageLineMatcher {
variables.add(matcher.group(2));
}
ensureMatches(template, variables, expectedVariables);
- this.variables = (String[]) variables.toArray(new String[variables.size()]);
+ this.variables = variables.toArray(new String[variables.size()]);
// Modify the template so it can be used to match message lines from the server
// (i.e. remove the variable markup)
@@ -91,7 +91,7 @@ public class ServerMessageLineMatcher {
Matcher matcher = pattern.matcher(line);
if (!matcher.find()) return null;
Assert.isTrue(matcher.groupCount() == variables.length);
- Map result = new HashMap();
+ Map<String,String> result = new HashMap<>();
for (int i = 1; i <= matcher.groupCount(); i++) {
result.put(variables[i - 1], matcher.group(i));
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java
index 4af630c88..83c5e2d7f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java
@@ -71,8 +71,8 @@ public class StatusListener extends CommandOutputListener {
* If the status returns that the file is in the Attic, then remove the
* Attic segment. This is because files added to a branch that are not in
* the main trunk (HEAD) are added to the Attic but cvs does magic on
- * updateto put them in the correct location.
- * (e.g. /project/Attic/file.txt -> /project/file.txt)
+ * update to put them in the correct location.
+ * (e.g. /project/Attic/file.txt -&gt; /project/file.txt)
*/
private String removeAtticSegment(String path) {
return Util.removeAtticSegment(path);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
index b9b1dd980..8a3e9d92f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
@@ -266,7 +266,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
* The status of the exception indicates success or failure. The status
* of the exception contains a specific message suitable for displaying
* to a user who has knowledge of the provided location string.
- * @see CVSRepositoryLocation.fromString(String)
+ * @see CVSRepositoryLocation#fromString(String)
*/
public static CVSRepositoryLocation fromString(String location, boolean validateOnly) throws CVSException {
String errorMessage = null;
@@ -421,7 +421,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
*/
public static IConnectionMethod[] getPluggedInConnectionMethods() {
if(pluggedInConnectionMethods==null) {
- List<Object> connectionMethods = new ArrayList<Object>();
+ List<Object> connectionMethods = new ArrayList<>();
if (STANDALONE_MODE) {
connectionMethods.add(new PServerConnectionMethod());
@@ -641,7 +641,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
ICVSRemoteResource[] resources = root.members(progress);
// There is the off chance that there is a file in the root of the repository.
// This is not supported by cvs so we need to make sure there are no files
- List<ICVSRemoteResource> folders = new ArrayList<ICVSRemoteResource>(resources.length);
+ List<ICVSRemoteResource> folders = new ArrayList<>(resources.length);
for (ICVSRemoteResource remoteResource : resources) {
if (remoteResource.isContainer()) {
folders.add(remoteResource);
@@ -1085,7 +1085,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
CVS_RSH_PARAMETERS = stringReplace(CVS_RSH_PARAMETERS, PORT_VARIABLE, Integer.valueOf(port).toString());
// Build the command list to be sent to the OS.
- List<String> commands = new ArrayList<String>();
+ List<String> commands = new ArrayList<>();
commands.add(CVS_RSH);
StringTokenizer tokenizer = new StringTokenizer(CVS_RSH_PARAMETERS);
while (tokenizer.hasMoreTokens()) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/ExtConnection.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/ExtConnection.java
index 5e33e784f..7b2992532 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/ExtConnection.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/ExtConnection.java
@@ -89,7 +89,7 @@ public class ExtConnection implements IServerConnection {
/**
* Opens the connection and invokes cvs in server mode.
*
- * @see Connection.open()
+ * @see Connection#open()
*/
public void open(IProgressMonitor monitor) throws IOException {
String[] command = ((CVSRepositoryLocation)location).getExtCommand(password);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java
index 2d1832567..827098b25 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java
@@ -46,9 +46,9 @@ public class CVSURI {
* note, that URIs with the pipe separator are currently not supported.
*
* <ul>
- * <li>cvs://[:]method:user[:password]@host:[port]/root/path#project/path[,tagName]</li>
- * <li>cvs://_method_user[_password]~host_[port]!root!path/project/path[?<version,branch,date,revision>=tagName]</li>
- * <li>scm:cvs<delimiter>method<delimiter>[user[<delimiter>password]@]host[<delimiter>port]<delimiter>/root/path<delimiter>project/path[;project="projectName"][;tag=tagName]</li>
+ * <li>{@literal cvs://[:]method:user[:password]@host:[port]/root/path#project/path[,tagName]}</li>
+ * <li>{@literal cvs://_method_user[_password]~host_[port]!root!path/project/path[?<version,branch,date,revision>=tagName]}</li>
+ * <li>{@literal scm:cvs<delimiter>method<delimiter>[user[<delimiter>password]@]host[<delimiter>port]<delimiter>/root/path<delimiter>project/path[;project="projectName"][;tag=tagName]}</li>
* </ul>
* @param uri the URI
* @return a CVS URI
@@ -181,7 +181,7 @@ public class CVSURI {
int i = f.lastIndexOf(',');
if (i != -1) {
String s = f.substring(i + 1);
- if (!s.equals("")) //$NON-NLS-1$
+ if (!s.isEmpty())
return s;
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/LogEntryCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/LogEntryCache.java
index e837d78d3..9dd8b3ef1 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/LogEntryCache.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/LogEntryCache.java
@@ -44,7 +44,7 @@ class LogEntryCache implements ILogEntryListener {
*/
public ILogEntry[] getLogEntries(String path) {
Map map = internalGetLogEntries(path);
- return (ILogEntry[]) map.values().toArray(new ILogEntry[map.values().size()]);
+ return (ILogEntry[]) map.values().toArray(new ILogEntry[map.size()]);
}
ILogEntry internalGetLogEntry(String path, String revision) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/CVSCheckedInChangeSet.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/CVSCheckedInChangeSet.java
index fc79e9783..06963d815 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/CVSCheckedInChangeSet.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/CVSCheckedInChangeSet.java
@@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.core.mapping;
-import com.ibm.icu.text.DateFormat;
+import java.text.DateFormat;
import java.util.Date;
import org.eclipse.team.internal.ccvs.core.ILogEntry;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/ChangeSetResourceMapping.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/ChangeSetResourceMapping.java
index aaf674188..748593022 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/ChangeSetResourceMapping.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/mapping/ChangeSetResourceMapping.java
@@ -40,12 +40,12 @@ public class ChangeSetResourceMapping extends ResourceMapping {
}
public IProject[] getProjects() {
- Set result = new HashSet();
+ Set<IProject> result = new HashSet<>();
IResource[] resources = changeSet.getResources();
for (IResource resource : resources) {
result.add(resource.getProject());
}
- return (IProject[]) result.toArray(new IProject[result.size()]);
+ return result.toArray(new IProject[result.size()]);
}
public ResourceTraversal[] getTraversals(ResourceMappingContext context,
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
index 7546634f8..21e20cb93 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
@@ -101,7 +101,8 @@ public class EclipseSynchronizer implements IFlushOperation {
*
* @param folder the folder
* @param info the folder sync info, must not be null
- * @see #getFolderSync, #deleteFolderSync
+ * @see #getFolderSync
+ * @see #deleteFolderSync
*/
public void setFolderSync(IContainer folder, FolderSyncInfo info) throws CVSException {
Assert.isNotNull(info); // enforce the use of deleteFolderSync
@@ -144,7 +145,8 @@ public class EclipseSynchronizer implements IFlushOperation {
*
* @param folder the folder
* @return the folder sync info associated with the folder, or null if none.
- * @see #setFolderSync, #deleteFolderSync
+ * @see #setFolderSync
+ * @see #deleteFolderSync
*/
public FolderSyncInfo getFolderSync(IContainer folder) throws CVSException {
if (folder.getType() == IResource.ROOT || !isValid(folder)) return null;
@@ -166,7 +168,8 @@ public class EclipseSynchronizer implements IFlushOperation {
* for all of its children. Does not recurse.
*
* @param folder the folder
- * @see #getFolderSync, #setFolderSync
+ * @see #getFolderSync
+ * @see #setFolderSync
*/
public void deleteFolderSync(IContainer folder) throws CVSException {
if (folder.getType() == IResource.ROOT || !isValid(folder)) return;
@@ -211,7 +214,8 @@ public class EclipseSynchronizer implements IFlushOperation {
*
* @param resource the resource
* @param info the resource sync info, must not be null
- * @see #getResourceSync, #deleteResourceSync
+ * @see #getResourceSync
+ * @see #deleteResourceSync
*/
public void setResourceSync(IResource resource, ResourceSyncInfo info) throws CVSException {
Assert.isNotNull(info); // enforce the use of deleteResourceSync
@@ -243,7 +247,8 @@ public class EclipseSynchronizer implements IFlushOperation {
*
* @param resource the resource
* @return the resource sync info associated with the resource, or null if none.
- * @see #setResourceSync, #deleteResourceSync
+ * @see #setResourceSync
+ * @see #deleteResourceSync
*/
public ResourceSyncInfo getResourceSync(IResource resource) throws CVSException {
byte[] info = getSyncBytes(resource);
@@ -256,7 +261,8 @@ public class EclipseSynchronizer implements IFlushOperation {
*
* @param resource the resource
* @return the resource sync info associated with the resource, or null if none.
- * @see #setResourceSync, #deleteResourceSync
+ * @see #setResourceSync
+ * @see #deleteResourceSync
*/
public byte[] getSyncBytes(IResource resource) throws CVSException {
IContainer parent = resource.getParent();
@@ -294,7 +300,8 @@ public class EclipseSynchronizer implements IFlushOperation {
*
* @param resource the resource
* @param info the resource sync info, must not be null
- * @see #getResourceSync, #deleteResourceSync
+ * @see #getResourceSync
+ * @see #deleteResourceSync
*/
public void setSyncBytes(IResource resource, byte[] syncBytes) throws CVSException {
Assert.isNotNull(syncBytes); // enforce the use of deleteResourceSync
@@ -325,7 +332,8 @@ public class EclipseSynchronizer implements IFlushOperation {
* Deletes the resource sync info for the specified resource, if it exists.
*
* @param resource the resource
- * @see #getResourceSync, #setResourceSync
+ * @see #getResourceSync
+ * @see #setResourceSync
*/
public void deleteResourceSync(IResource resource) throws CVSException {
IContainer parent = resource.getParent();
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
index 97b65a345..cdd92b1ad 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
@@ -44,7 +44,7 @@ public class RemoteFolderTreeBuilder {
private static final int MAX_REVISION_FETCHES_PER_CONNECTION = 1024;
- private Map<String, Map> fileDeltas;
+ private Map<String, Map<String, DeltaNode>> fileDeltas;
private List<String> changedFiles;
private Map<String, RemoteFolderTree> remoteFolderTable;
@@ -96,9 +96,9 @@ public class RemoteFolderTreeBuilder {
this.repository = repository;
this.root = root;
this.tag = tag;
- this.fileDeltas = new HashMap<String, Map>();
- this.changedFiles = new ArrayList<String>();
- this.remoteFolderTable = new HashMap<String, RemoteFolderTree>();
+ this.fileDeltas = new HashMap<>();
+ this.changedFiles = new ArrayList<>();
+ this.remoteFolderTable = new HashMap<>();
// Build the local options
List<LocalOption> localOptions = new ArrayList<>();
@@ -563,7 +563,7 @@ public class RemoteFolderTreeBuilder {
// Prune any empty child folders
if (isPruneEmptyDirectories() && !emptyChildren.isEmpty()) {
- List<ICVSRemoteResource> newChildren = new ArrayList<ICVSRemoteResource>();
+ List<ICVSRemoteResource> newChildren = new ArrayList<>();
newChildren.addAll(Arrays.asList(remote.getChildren()));
newChildren.removeAll(emptyChildren);
remote.setChildren(newChildren.toArray(new ICVSRemoteResource[newChildren.size()]));
@@ -709,7 +709,7 @@ public class RemoteFolderTreeBuilder {
private void fetchFileRevisions(Session session, String[] fileNames, final IProgressMonitor monitor) throws CVSException {
// Create a listener for receiving the revision info
- final List<CVSException> exceptions = new ArrayList<CVSException>();
+ final List<CVSException> exceptions = new ArrayList<>();
IStatusListener listener = new IStatusListener() {
public void fileStatus(ICVSFolder root, String path, String remoteRevision) {
try {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
index dc0dfc496..1cdfe6f28 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -65,9 +65,9 @@ public class RemoteModule extends RemoteFolder {
*/
public static RemoteModule[] createRemoteModules(String[] moduleDefinitionStrings, ICVSRepositoryLocation repository, CVSTag tag) {
- Map modules = new HashMap();
- Map referencedModulesTable = new HashMap();
- Map moduleAliases = new HashMap();
+ Map<String, RemoteModule> modules = new HashMap<>();
+ Map<String, String[]> referencedModulesTable = new HashMap<>();
+ Map<String,String[]> moduleAliases = new HashMap<>();
// First pass: Create the remote module instances based on remote mapping
for (String moduleDefinitionString : moduleDefinitionStrings) {
@@ -119,7 +119,7 @@ public class RemoteModule extends RemoteFolder {
}
// An alias expands to one or more modules or paths
- List expansions = new ArrayList(10);
+ List<String> expansions = new ArrayList<>(10);
expansions.add(next);
while (tokenizer.hasMoreTokens())
expansions.add(tokenizer.nextToken());
@@ -132,7 +132,7 @@ public class RemoteModule extends RemoteFolder {
// The module definition may have a leading directory which can be followed by some files
if (!(next.charAt(0) == '&')) {
String directory = next;
- List files = new ArrayList();
+ List<String> files = new ArrayList<>();
while (tokenizer.hasMoreTokens() && (next.charAt(0) != '&')) {
next = tokenizer.nextToken() ;
if ((next.charAt(0) != '&'))
@@ -143,7 +143,7 @@ public class RemoteModule extends RemoteFolder {
if ( ! files.isEmpty()) {
ICVSRemoteResource[] children = new ICVSRemoteResource[files.size()];
for (int j = 0; j < children.length; j++) {
- children[j] = new RemoteFile(remoteModule, Update.STATE_NONE, (String)files.get(j), null, null, tag);
+ children[j] = new RemoteFile(remoteModule, Update.STATE_NONE, files.get(j), null, null, tag);
remoteModule.setChildren(children);
}
}
@@ -167,9 +167,9 @@ public class RemoteModule extends RemoteFolder {
Iterator iter = moduleAliases.keySet().iterator();
while (iter.hasNext()) {
String moduleName = (String)iter.next();
- RemoteModule module = (RemoteModule)modules.get(moduleName);
- String[] expansion = (String[])moduleAliases.get(moduleName);
- List referencedFolders = new ArrayList();
+ RemoteModule module = modules.get(moduleName);
+ String[] expansion = moduleAliases.get(moduleName);
+ List<ICVSRemoteResource> referencedFolders = new ArrayList<>();
boolean expandable = true;
for (String e : expansion) {
if (e.charAt(0) == '!') {
@@ -181,7 +181,7 @@ public class RemoteModule extends RemoteFolder {
// XXX Unsupported for now
expandable = false;
} else {
- RemoteModule child = (RemoteModule) modules.get(e);
+ RemoteModule child = modules.get(e);
if (child == null) {
referencedFolders.add(new RemoteFolder(null, repository, path.toString(), tag));
} else {
@@ -198,7 +198,7 @@ public class RemoteModule extends RemoteFolder {
}
if (expandable) {
//TODO: Make module static??
- module.setChildren((ICVSRemoteResource[]) referencedFolders.toArray(new ICVSRemoteResource[referencedFolders.size()]));
+ module.setChildren(referencedFolders.toArray(new ICVSRemoteResource[referencedFolders.size()]));
} else {
module.setExpandable(false);
}
@@ -208,13 +208,13 @@ public class RemoteModule extends RemoteFolder {
iter = modules.keySet().iterator();
while (iter.hasNext()) {
String moduleName = (String)iter.next();
- String[] children = (String[])referencedModulesTable.get(moduleName);
+ String[] children = referencedModulesTable.get(moduleName);
if (children != null) {
- RemoteModule module = (RemoteModule)modules.get(moduleName);
+ RemoteModule module = modules.get(moduleName);
List<RemoteModule> referencedFolders = new ArrayList<>();
boolean expandable = true;
for (String c : children) {
- RemoteModule child = (RemoteModule) modules.get(c.substring(1));
+ RemoteModule child = modules.get(c.substring(1));
if (child == null) {
// invalid module definition
expandable = false;
@@ -239,7 +239,7 @@ public class RemoteModule extends RemoteFolder {
}
}
- return (RemoteModule[])modules.values().toArray(new RemoteModule[modules.size()]);
+ return modules.values().toArray(new RemoteModule[modules.size()]);
}
public RemoteModule(String label, RemoteFolder parent, ICVSRepositoryLocation repository, String repositoryRelativePath, LocalOption[] localOptions, CVSTag tag, boolean isStatic) {
@@ -277,12 +277,8 @@ public class RemoteModule extends RemoteFolder {
} else {
// Combine two sets of children
allChildren = new ICVSRemoteResource[physicalChildren.length + referencedModules.length];
- for (int i = 0; i < physicalChildren.length; i++) {
- allChildren[i] = physicalChildren[i];
- }
- for (int i = 0; i < referencedModules.length; i++) {
- allChildren[i + physicalChildren.length] = referencedModules[i];
- }
+ System.arraycopy(physicalChildren, 0, allChildren, 0, physicalChildren.length);
+ System.arraycopy(referencedModules, 0, allChildren, physicalChildren.length, referencedModules.length);
}
} else if (physicalChildren != null) {
allChildren = physicalChildren;
@@ -314,20 +310,20 @@ public class RemoteModule extends RemoteFolder {
if (folderInfo.getIsStatic()) {
ICVSRemoteResource[] children = getChildren();
if (children != null) {
- List taggedChildren = new ArrayList(children.length);
+ List<ICVSRemoteResource> taggedChildren = new ArrayList<>(children.length);
for (ICVSRemoteResource resource : children) {
taggedChildren.add(((RemoteResource)resource).forTag(r, tagName));
}
- r.setChildren((ICVSRemoteResource[]) taggedChildren.toArray(new ICVSRemoteResource[taggedChildren.size()]));
+ r.setChildren(taggedChildren.toArray(new ICVSRemoteResource[taggedChildren.size()]));
}
}
if (referencedModules != null) {
- List taggedModules = new ArrayList(referencedModules.length);
+ List<ICVSRemoteResource> taggedModules = new ArrayList<>(referencedModules.length);
for (ICVSRemoteResource referencedModule : referencedModules) {
RemoteModule module = (RemoteModule) referencedModule;
taggedModules.add(module.forTag(r, tagName));
}
- r.setReferencedModules((ICVSRemoteResource[]) taggedModules.toArray(new ICVSRemoteResource[taggedModules.size()]));
+ r.setReferencedModules(taggedModules.toArray(new ICVSRemoteResource[taggedModules.size()]));
}
return r;
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
index 5d78afc5b..e0df6c7d9 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
@@ -247,12 +247,16 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
byte [] diBytes = ResourcesPlugin.getWorkspace().getSynchronizer().getSyncInfo(FOLDER_DIRTY_STATE_KEY, container);
if(diBytes != null && !CVSProviderPlugin.getPlugin().crashOnLastRun()) {
di = new String(diBytes);
- if(di.equals(NOT_DIRTY_INDICATOR)) {
+ switch (di) {
+ case NOT_DIRTY_INDICATOR:
di = NOT_DIRTY_INDICATOR;
- } else if(di.equals(IS_DIRTY_INDICATOR)) {
+ break;
+ case IS_DIRTY_INDICATOR:
di = IS_DIRTY_INDICATOR;
- } else {
+ break;
+ default:
di = RECOMPUTE_INDICATOR;
+ break;
}
} else {
di = RECOMPUTE_INDICATOR;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java
index d58011df4..28d3ab039 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java
@@ -106,7 +106,7 @@ public class FolderSyncInfo {
return true;
}
/**
- * Gets the root, cannot be <code>null.
+ * Gets the root, cannot be <code>null</code>.
*
* @return Returns a String
*/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java
index 14f23c3ce..9817e5e7f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java
@@ -691,7 +691,7 @@ public class ResourceSyncInfo {
}
/**
* Method startOfSlot returns the index of the slash that occurs before the
- * given slot index. The provided index should be >= 1 which assumes that
+ * given slot index. The provided index should be &gt;= 1 which assumes that
* slot zero occurs before the first slash.
*
* @param syncBytes
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java
index 5bdbdcce3..a6f8c2814 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java
@@ -491,13 +491,10 @@ public class SyncFileWriter {
try {
InputStream in = getInputStream(file);
if (in != null) {
- BufferedReader reader = new BufferedReader(new InputStreamReader(in), 512);
- try {
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(in), 512)) {
String line = reader.readLine();
if (line == null) return ""; //$NON-NLS-1$
return line;
- } finally {
- reader.close();
}
}
return null;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java
index 71f680f27..58404355d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java
@@ -536,7 +536,7 @@ public class Util {
* Attic segment. This is because files added to a branch that are not in
* the main trunk (HEAD) are added to the Attic but cvs does magic on
* update to put them in the correct location.
- * (e.g. /project/Attic/file.txt -> /project/file.txt)
+ * (e.g. /project/Attic/file.txt -&gt; /project/file.txt)
*/
public static String removeAtticSegment(String path) {
int lastSeparator = path.lastIndexOf(Session.SERVER_SEPARATOR);
diff --git a/bundles/org.eclipse.team.cvs.ssh2/.classpath b/bundles/org.eclipse.team.cvs.ssh2/.classpath
index 22f30643c..e801ebfb4 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/.classpath
+++ b/bundles/org.eclipse.team.cvs.ssh2/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.team.cvs.ssh2/.cvsignore b/bundles/org.eclipse.team.cvs.ssh2/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/bundles/org.eclipse.team.cvs.ssh2/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.jdt.core.prefs
index ba53c86a1..931eeecd0 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.team.cvs.ssh2/.settings/org.eclipse.jdt.core.prefs
@@ -9,9 +9,9 @@ org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -24,6 +24,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -47,6 +48,7 @@ org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
@@ -68,7 +70,8 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=en
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
diff --git a/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF
index cdb638d9a..b0d3dcab2 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.ssh2; singleton:=true
-Bundle-Version: 3.3.500.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.ssh2.CVSSSH2Plugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -13,5 +13,5 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
com.jcraft.jsch;bundle-version="[0.1.50,1.0.0)",
org.eclipse.jsch.core;bundle-version="[1.1.0,2.0.0)"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.team.cvs.ssh2
diff --git a/bundles/org.eclipse.team.cvs.ssh2/pom.xml b/bundles/org.eclipse.team.cvs.ssh2/pom.xml
index 7ee73da23..9ddbf9b1e 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/pom.xml
+++ b/bundles/org.eclipse.team.cvs.ssh2/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.cvs.ssh2</artifactId>
- <version>3.3.500-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Messages.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Messages.java
index d0002fe90..2a12a6369 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Messages.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Messages.java
@@ -17,7 +17,7 @@ import org.eclipse.osgi.util.NLS;
public class CVSSSH2Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.team.internal.ccvs.ssh2.messages";//$NON-NLS-1$
-
+
public static String JSchSession_3;
public static String JSchSession_4;
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Method.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Method.java
index f615399b1..4125fd3c6 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Method.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Method.java
@@ -20,19 +20,22 @@ import org.eclipse.team.internal.ccvs.core.*;
* SSH2 will hijack the 'extssh' method and use the SSH2 protocol instead
* of SSH1. If the server doesn't support SSH2, the server connection method
* will try connecting with SSH1.
- *
+ *
* @since 3.0
*/
public class CVSSSH2Method implements IConnectionMethod {
-
+
+ @Override
public String getName() {
return "extssh"; //$NON-NLS-1$
}
-
+
+ @Override
public IServerConnection createConnection(ICVSRepositoryLocation root, String password) {
return new CVSSSH2ServerConnection(root, password);
}
-
+
+ @Override
public void disconnect(ICVSRepositoryLocation location) {
}
}
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java
index 7bdb66a7b..562ae61b6 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java
@@ -31,12 +31,13 @@ public class CVSSSH2Plugin extends Plugin {
private ServiceRegistration debugRegistration;
private ServiceTracker tracker;
-
+
public CVSSSH2Plugin() {
super();
plugin = this;
}
+ @Override
public void stop(BundleContext context) throws Exception {
try {
// unregister debug options listener
@@ -53,7 +54,8 @@ public class CVSSSH2Plugin extends Plugin {
public static CVSSSH2Plugin getDefault() {
return plugin;
}
-
+
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
@@ -65,7 +67,7 @@ public class CVSSSH2Plugin extends Plugin {
tracker = new ServiceTracker(getBundle().getBundleContext(), IJSchService.class.getName(), null);
tracker.open();
}
-
+
public IJSchService getJSchService() {
return (IJSchService)tracker.getService();
}
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java
index 6594396b5..860178aa0 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java
@@ -38,12 +38,12 @@ import com.jcraft.jsch.JSchException;
/**
* SSH2 connection method. Has the property of defaulting to SSH1 if the server
- * doesn't support SSH2.
+ * doesn't support SSH2.
*/
public class CVSSSH2ServerConnection implements IServerConnection {
-
+
private static final String SSH1_COMPATIBILITY_CLASS = "org.eclipse.team.internal.ccvs.ssh.SSHServerConnection"; //$NON-NLS-1$
-
+
private final class SSH2IOException extends IOException {
private static final long serialVersionUID = 1L;
@@ -54,6 +54,7 @@ public class CVSSSH2ServerConnection implements IServerConnection {
this.e = e;
}
+ @Override
public Throwable getCause() {
return e;
}
@@ -66,11 +67,12 @@ public class CVSSSH2ServerConnection implements IServerConnection {
private JSchSession session;
private Channel channel;
private IServerConnection ssh1;
-
+
protected CVSSSH2ServerConnection(ICVSRepositoryLocation location, String password) {
this.location = location;
this.password = password;
}
+ @Override
public void close() throws IOException {
if (ssh1 != null) {
ssh1.close();
@@ -98,26 +100,29 @@ public class CVSSSH2ServerConnection implements IServerConnection {
if (channel != null)
channel.disconnect();
}
- }
+ }
}
+ @Override
public InputStream getInputStream() {
if (ssh1 != null) {
return ssh1.getInputStream();
}
return inputStream;
}
+ @Override
public OutputStream getOutputStream() {
if (ssh1 != null) {
return ssh1.getOutputStream();
}
return outputStream;
}
+ @Override
public void open(IProgressMonitor monitor) throws IOException, CVSAuthenticationException {
if (ssh1 != null) {
ssh1.open(monitor);
return;
}
- monitor.subTask(NLS.bind(CVSSSH2Messages.CVSSSH2ServerConnection_open, new String[] { location.getHost() }));
+ monitor.subTask(NLS.bind(CVSSSH2Messages.CVSSSH2ServerConnection_open, new String[] { location.getHost() }));
monitor.worked(1);
internalOpen(monitor);
}
@@ -163,12 +168,14 @@ public class CVSSSH2ServerConnection implements IServerConnection {
}
int timeout = location.getTimeout();
inputStream = new PollingInputStream(new TimeoutInputStream(new FilterInputStream(channel_in) {
+ @Override
public void close() {
// Don't close the underlying stream as it belongs to the session
}
},
8192 /*bufferSize*/, (timeout>0 ? 1000 : 0) /*readTimeout*/, -1 /*closeTimeout*/, true /* growWhenFull */), timeout > 0 ? timeout : 1, monitor);
outputStream = new PollingOutputStream(new TimeoutOutputStream(new FilterOutputStream(channel_out) {
+ @Override
public void close() {
// Don't close the underlying stream as it belongs to the session
}
@@ -186,7 +193,7 @@ public class CVSSSH2ServerConnection implements IServerConnection {
String message = e.getMessage();
if (JSchSession.isAuthenticationFailure(e)) {
// Do not retry as the Jsh library has it's own retry logic
- throw new CVSAuthenticationException(CVSSSH2Messages.CVSSSH2ServerConnection_0, CVSAuthenticationException.NO_RETRY,location, e);
+ throw new CVSAuthenticationException(CVSSSH2Messages.CVSSSH2ServerConnection_0, CVSAuthenticationException.NO_RETRY,location, e);
} else if (message.startsWith("Session.connect: ")) { //$NON-NLS-1$
// Jsh has messages formatted like "Session.connect: java.net.NoRouteToHostException: ..."
// Strip of the exception and try to convert it to a more meaningfull string
@@ -196,7 +203,7 @@ public class CVSSSH2ServerConnection implements IServerConnection {
if (end != -1) {
String exception = message.substring(start, end).trim();
if (exception.contains("NoRouteToHostException")) { //$NON-NLS-1$
- message = NLS.bind(CVSSSH2Messages.CVSSSH2ServerConnection_1, new String[] { location.getHost() });
+ message = NLS.bind(CVSSSH2Messages.CVSSSH2ServerConnection_1, new String[] { location.getHost() });
throw new NoRouteToHostException(message);
} else if (exception.contains("java.net.UnknownHostException")) { //$NON-NLS-1$
throw new UnknownHostException(location.getHost());
@@ -210,10 +217,10 @@ public class CVSSSH2ServerConnection implements IServerConnection {
}
}
}
-
+
/**
* Returns SSH-1 connection.
- *
+ *
* @return a connection or <code>null</code>, if SSH-1 is not supported
*/
private IServerConnection createSSH1Connection() {
@@ -247,7 +254,7 @@ public class CVSSSH2ServerConnection implements IServerConnection {
}
return null;
}
-
+
private boolean isChannelNotOpenError(JSchException ee) {
return ee.getMessage().contains("channel is not opened"); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java
index 14c91c3ad..56eb62ffe 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java
@@ -30,7 +30,7 @@ import com.jcraft.jsch.*;
class JSchSession {
private static final int SSH_DEFAULT_PORT = 22;
private static Hashtable<String, JSchSession> pool = new Hashtable<>();
-
+
private final Session session;
private final ICVSRepositoryLocation location;
@@ -44,12 +44,12 @@ class JSchSession {
public static boolean isAuthenticationFailure(JSchException ee) {
return ee.getMessage().equals("Auth fail"); //$NON-NLS-1$
}
-
+
static JSchSession getSession(final ICVSRepositoryLocation location, String username, String password, String hostname, int port, IProgressMonitor monitor) throws JSchException {
int actualPort = port;
if (actualPort == ICVSRepositoryLocation.USE_DEFAULT_PORT)
actualPort = getPort(location);
-
+
String key = getPoolKey(username, hostname, actualPort);
try {
@@ -63,16 +63,19 @@ class JSchSession {
IJSchService service = getJSchService();
IJSchLocation jlocation=service.getLocation(username, hostname, actualPort);
- // As for the connection method "pserverssh2",
+ // As for the connection method "pserverssh2",
// there is not a place to save the given password for ssh2.
if (!location.getMethod().getName().equals("pserverssh2")) { //$NON-NLS-1$
IPasswordStore pstore = new IPasswordStore() {
+ @Override
public void clear(IJSchLocation l) {
location.flushUserInfo();
}
+ @Override
public boolean isCached(IJSchLocation l) {
return location.getUserInfoCached();
}
+ @Override
public void update(IJSchLocation l) {
location.setPassword(l.getPassword());
location.setAllowCaching(true);
@@ -81,7 +84,7 @@ class JSchSession {
jlocation.setPasswordStore(pstore);
}
jlocation.setComment(NLS.bind(CVSSSH2Messages.JSchSession_3, new String[] {location.toString()}));
-
+
Session session = null;
try {
session = createSession(service, jlocation, password, monitor);
@@ -153,7 +156,7 @@ class JSchSession {
static JSch getJSch() {
return getJSchService().getJSch();
}
-
+
private JSchSession(Session session, ICVSRepositoryLocation location) {
this.session = session;
this.location = location;
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2Method.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2Method.java
index 3b71f48a0..17932ab88 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2Method.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2Method.java
@@ -19,12 +19,15 @@ import org.eclipse.team.internal.ccvs.core.IConnectionMethod;
import org.eclipse.team.internal.ccvs.core.IServerConnection;
public class PServerSSH2Method implements IConnectionMethod {
+ @Override
public String getName() {
return "pserverssh2"; //$NON-NLS-1$
}
+ @Override
public IServerConnection createConnection(ICVSRepositoryLocation root, String password) {
return new PServerSSH2ServerConnection(root, password);
}
+ @Override
public void disconnect(ICVSRepositoryLocation location) {
}
}
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java
index 55e5c20c7..b2afdb820 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java
@@ -37,17 +37,21 @@ public class PServerSSH2ServerConnection implements IServerConnection {
this.password = password;
}
+ @Override
public void close() throws IOException {
psc.close();
}
+ @Override
public InputStream getInputStream() {
return psc.getInputStream();
}
+ @Override
public OutputStream getOutputStream() {
return psc.getOutputStream();
}
+ @Override
public void open(IProgressMonitor monitor) throws IOException, CVSAuthenticationException {
monitor.subTask("PServerSSH2ServerConnection.open"); //$NON-NLS-1$
monitor.worked(1);
@@ -114,7 +118,7 @@ public class PServerSSH2ServerConnection implements IServerConnection {
} catch (JSchException ee) {
retry--;
if(retry<0){
- throw new CVSAuthenticationException(CVSSSH2Messages.CVSSSH2ServerConnection_3, CVSAuthenticationException.NO_RETRY, location);
+ throw new CVSAuthenticationException(CVSSSH2Messages.CVSSSH2ServerConnection_3, CVSAuthenticationException.NO_RETRY, location);
}
if(session != null && session.isConnected()){
session.disconnect();
@@ -125,7 +129,7 @@ public class PServerSSH2ServerConnection implements IServerConnection {
}
// password for location will be over-written in JSchSession ;-<
((CVSRepositoryLocation)location).setPassword(password);
-
+
// CVSROOT=":pserver:localhost:"+lport+""cvs_root
try {
// If user does not give a password, it must be null.
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/Policy.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/Policy.java
index 95133cfbd..4e258cc73 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/Policy.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/Policy.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -21,6 +21,7 @@ public class Policy {
public static boolean DEBUG = false;
static final DebugOptionsListener DEBUG_OPTIONS_LISTENER = new DebugOptionsListener() {
+ @Override
public void optionsChanged(DebugOptions options) {
DEBUG = options.getBooleanOption(CVSSSH2Plugin.ID + "/debug", false); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.team.cvs.ui/.classpath b/bundles/org.eclipse.team.cvs.ui/.classpath
index 22f30643c..e801ebfb4 100644
--- a/bundles/org.eclipse.team.cvs.ui/.classpath
+++ b/bundles/org.eclipse.team.cvs.ui/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.team.cvs.ui/.cvsignore b/bundles/org.eclipse.team.cvs.ui/.cvsignore
deleted file mode 100644
index fe99505dc..000000000
--- a/bundles/org.eclipse.team.cvs.ui/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-
diff --git a/bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.jdt.core.prefs
index 56f040d5b..a3fb47012 100644
--- a/bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.team.cvs.ui/.settings/org.eclipse.jdt.core.prefs
@@ -18,9 +18,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -36,6 +36,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
@@ -81,6 +82,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
@@ -117,8 +119,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
diff --git a/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF
index 43162bf0e..83b002781 100644
--- a/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.ui; singleton:=true
-Bundle-Version: 3.4.600.qualifier
+Bundle-Version: 3.5.0.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.ui.CVSUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -33,5 +33,5 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.3.0,4.0.0)";resolution:=op
org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
com.ibm.icu;bundle-version="4.4.2"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.team.cvs.ui
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history.gif b/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history.gif
deleted file mode 100644
index f6142713a..000000000
--- a/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history.png b/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history.png
new file mode 100644
index 000000000..d48339527
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history.png
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history@2x.png b/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history@2x.png
index 9d482043c..6dbbb4c38 100644
--- a/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history@2x.png
+++ b/bundles/org.eclipse.team.cvs.ui/icons/full/dlcl16/filter_history@2x.png
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history.gif b/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history.gif
deleted file mode 100644
index 6fe6f0e10..000000000
--- a/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history.png b/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history.png
new file mode 100644
index 000000000..58faf49c8
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history.png
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history@2x.png b/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history@2x.png
index 779bc07b1..062359255 100644
--- a/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history@2x.png
+++ b/bundles/org.eclipse.team.cvs.ui/icons/full/elcl16/filter_history@2x.png
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/pom.xml b/bundles/org.eclipse.team.cvs.ui/pom.xml
index e3ce753fa..8b5ea3a5e 100644
--- a/bundles/org.eclipse.team.cvs.ui/pom.xml
+++ b/bundles/org.eclipse.team.cvs.ui/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.cvs.ui</artifactId>
- <version>3.4.600-SNAPSHOT</version>
+ <version>3.5.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java
index 1c14839e8..c147b8556 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;
+import java.text.DateFormat;
import java.util.Date;
import org.eclipse.core.resources.IFile;
@@ -31,8 +32,6 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
import org.eclipse.ui.PlatformUI;
-import com.ibm.icu.text.DateFormat;
-
public class CVSFilePropertiesPage extends CVSPropertiesPage {
IFile file;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilter.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilter.java
index 3f1c3f627..cdb38cda0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilter.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilter.java
@@ -102,15 +102,15 @@ public class CVSHistoryFilter extends ViewerFilter {
}
protected boolean hasBranchName() {
- return !branchName.equals(""); //$NON-NLS-1$
+ return !branchName.isEmpty();
}
protected boolean hasAuthor() {
- return !author.equals(""); //$NON-NLS-1$
+ return !author.isEmpty();
}
protected boolean hasComment() {
- return !comment.equals(""); //$NON-NLS-1$
+ return !comment.isEmpty();
}
protected boolean hasDate() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilterDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilterDialog.java
index 5c27d55a8..cd2a3a396 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilterDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilterDialog.java
@@ -13,18 +13,18 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;
+import java.util.Calendar;
import java.util.Date;
-import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.PlatformUI;
-import com.ibm.icu.util.Calendar;
-
public class CVSHistoryFilterDialog extends TrayDialog {
private CVSHistoryFilter historyFilter;
@@ -43,12 +43,14 @@ public class CVSHistoryFilterDialog extends TrayDialog {
setHelpAvailable(false); // Disable help controls - F1 will still work
}
+ @Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(CVSUIMessages.HistoryFilterDialog_title);
PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IHelpContextIds.HISTORY_FILTER_DIALOG);
}
+ @Override
protected Control createDialogArea(Composite parent) {
Composite topLevel = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -143,6 +145,7 @@ public class CVSHistoryFilterDialog extends TrayDialog {
/**
* A button has been pressed. Process the dialog contents.
*/
+ @Override
protected void buttonPressed(int buttonId) {
if (IDialogConstants.CANCEL_ID == buttonId) {
super.buttonPressed(buttonId);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
index 1911fc3d2..4c83d51f0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
@@ -18,6 +18,8 @@ package org.eclipse.team.internal.ccvs.ui;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.*;
import org.eclipse.compare.*;
@@ -77,10 +79,6 @@ import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.progress.IProgressConstants;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
-import com.ibm.icu.util.Calendar;
-
public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryCompareAdapter {
/* private */ ICVSFile file;
@@ -1414,7 +1412,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC
@Override
public void run() {
String searchString = searchField.getText();
- if (searchString.equals("") || //$NON-NLS-1$
+ if (searchString.isEmpty() ||
searchString.equals(CVSUIMessages.CVSHistoryPage_EnterSearchTerm)) {
if (searchFilter != null)
treeViewer.removeFilter(searchFilter);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java
index ecbaae729..ea2757538 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java
@@ -17,6 +17,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;
+import java.text.DateFormat;
import java.util.Date;
import org.eclipse.core.resources.IFile;
@@ -47,8 +48,6 @@ import org.eclipse.team.internal.ui.history.DateHistoryCategory;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.themes.ITheme;
-import com.ibm.icu.text.DateFormat;
-
public class CVSHistoryTableProvider {
public static final String CATEGORIES_COLOR = "org.eclipse.team.cvs.ui.fontsandcolors.cvshistorypagecategories"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
index 58ddc939b..84a071880 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
@@ -14,6 +14,7 @@
package org.eclipse.team.internal.ccvs.ui;
+import java.text.SimpleDateFormat;
import java.util.*;
import org.eclipse.core.resources.*;
@@ -42,8 +43,6 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.themes.ITheme;
import org.osgi.framework.Bundle;
-import com.ibm.icu.text.SimpleDateFormat;
-
public class CVSLightweightDecorator extends LabelProvider implements ILightweightLabelDecorator, IResourceStateChangeListener, IPropertyChangeListener {
// Decorator id as defined in the decorator extension point
@@ -468,7 +467,7 @@ public class CVSLightweightDecorator extends LabelProvider implements ILightweig
* Perform a blanket refresh of all CVS decorations
*/
public static void refresh() {
- CVSUIPlugin.getPlugin().getWorkbench().getDecoratorManager().update(CVSUIPlugin.DECORATOR_ID);
+ PlatformUI.getWorkbench().getDecoratorManager().update(CVSUIPlugin.DECORATOR_ID);
}
/*
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
index db1f92bb2..d29dc81af 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
@@ -17,16 +17,13 @@
package org.eclipse.team.internal.ccvs.ui;
-import com.ibm.icu.text.Collator;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
+import java.text.Collator;
+import java.util.*;
import java.util.List;
-import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -56,6 +53,7 @@ import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage {
public static class PerspectiveDescriptorComparator implements Comparator {
+ @Override
public int compare(Object o1, Object o2) {
if (o1 instanceof IPerspectiveDescriptor && o2 instanceof IPerspectiveDescriptor) {
String id1= ((IPerspectiveDescriptor)o1).getLabel();
@@ -89,10 +87,12 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
PlatformUI.getWorkbench().getHelpSystem().setHelp(fCheckbox, helpID);
}
+ @Override
public void initializeValue(IPreferenceStore store) {
fCheckbox.setSelection(store.getBoolean(fKey));
}
+ @Override
public void performOk(IPreferenceStore store) {
store.setValue(fKey, fCheckbox.getSelection());
}
@@ -124,6 +124,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
return fCombo;
}
+ @Override
public void initializeValue(IPreferenceStore store) {
final Object value= getValue(store, fKey);
final int index= fValues.indexOf(value);
@@ -133,6 +134,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
fCombo.select(0);
}
+ @Override
public void performOk(IPreferenceStore store) {
saveValue(store, fKey, fValues.get(fCombo.getSelectionIndex()));
}
@@ -146,10 +148,12 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
super(composite, key, label, helpID, labels, values);
}
+ @Override
protected void saveValue(IPreferenceStore store, String key, Object object) {
store.setValue(key, ((Integer)object).intValue());
}
+ @Override
protected Object getValue(IPreferenceStore store, String key) {
return Integer.valueOf(store.getInt(key));
}
@@ -161,10 +165,12 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
super(composite, key, label, helpID, labels, values);
}
+ @Override
protected Object getValue(IPreferenceStore store, String key) {
return store.getString(key);
}
+ @Override
protected void saveValue(IPreferenceStore store, String key, Object object) {
store.setValue(key, (String)object);
}
@@ -194,6 +200,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
PlatformUI.getWorkbench().getHelpSystem().setHelp(fGroup, helpID);
}
+ @Override
public void initializeValue(IPreferenceStore store) {
final Object value= loadValue(store, fKey);
final int index= fValues.indexOf(value);
@@ -203,6 +210,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
}
}
+ @Override
public void performOk(IPreferenceStore store) {
for (int i = 0; i < fButtons.length; ++i) {
if (fButtons[i].getSelection()) {
@@ -223,10 +231,12 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
super(composite, key, label, helpID, labels, values);
}
+ @Override
protected Object loadValue(IPreferenceStore store, String key) {
return Integer.valueOf(store.getInt(key));
}
+ @Override
protected void saveValue(IPreferenceStore store, String key, Object value) {
store.setValue(key, ((Integer)value).intValue());
}
@@ -238,10 +248,12 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
super(composite, key, label, helpID, labels, values);
}
+ @Override
protected Object loadValue(IPreferenceStore store, String key) {
return store.getString(key);
}
+ @Override
protected void saveValue(IPreferenceStore store, String key, Object value) {
store.setValue(key, (String)value);
}
@@ -264,15 +276,18 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
PlatformUI.getWorkbench().getHelpSystem().setHelp(fText, helpID);
}
+ @Override
public void initializeValue(IPreferenceStore store) {
final String value= store.getString(fKey);
fText.setText(value);
}
+ @Override
public void performOk(IPreferenceStore store) {
store.setValue(fKey, fText.getText());
}
+ @Override
public void modifyText(ModifyEvent e) {
modifyText(fText);
}
@@ -347,6 +362,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
YES_NO_PROMPT= new String [] { CVSUIMessages.CVSPreferencesPage_11, CVSUIMessages.CVSPreferencesPage_12, CVSUIMessages.CVSPreferencesPage_13 }; //
}
+ @Override
protected Control createContents(Composite parent) {
// create a tab folder for the page
@@ -384,6 +400,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
ICVSUIConstants.PREF_COMMIT_FILES_DISPLAY_THRESHOLD,
CVSUIMessages.CVSPreferencesPage_20,
null) {
+ @Override
protected void modifyText(Text text) {
// Parse the timeout value
try {
@@ -406,6 +423,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
ICVSUIConstants.PREF_COMMIT_COMMENTS_MAX_HISTORY,
CVSUIMessages.CVSPreferencesPage_47,
null) {
+ @Override
protected void modifyText(Text text) {
try {
final int x = Integer.parseInt(text.getText());
@@ -438,6 +456,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
ICVSUIConstants.PREF_TIMEOUT,
CVSUIMessages.CVSPreferencesPage_23,
IHelpContextIds.PREF_COMMS_TIMEOUT) {
+ @Override
protected void modifyText(Text text) {
// Parse the timeout value
try {
@@ -465,11 +484,13 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
new Integer [] { Integer.valueOf(0), Integer.valueOf(1), Integer.valueOf(2)});
quietnessCombo.getCombo().addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (getQuietnessOptionFor(quietnessCombo.getCombo().getSelectionIndex()).equals(Command.SILENT)) {
MessageDialog.openWarning(getShell(), CVSUIMessages.CVSPreferencesPage_30, CVSUIMessages.CVSPreferencesPage_31); //
}
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
@@ -574,9 +595,11 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
}
}
+ @Override
public void init(IWorkbench workbench) {
}
+ @Override
public boolean performOk() {
final IPreferenceStore store = getPreferenceStore();
@@ -608,6 +631,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
return true;
}
+ @Override
protected void performDefaults() {
super.performDefaults();
final IPreferenceStore store = getPreferenceStore();
@@ -623,6 +647,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
*
* @return the preference store for this plugin
*/
+ @Override
protected IPreferenceStore doGetPreferenceStore() {
return CVSUIPlugin.getPlugin().getPreferenceStore();
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index a88999cd0..b5f47920c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -519,7 +519,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
public static void openDialog(Shell providedShell, final IOpenableInShell openable, int flags) {
// If no shell was provided, try to get one from the active window
if (providedShell == null) {
- IWorkbenchWindow window = CVSUIPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
providedShell = window.getShell();
// sync-exec when we do this just in case
@@ -743,8 +743,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
}
public IEditorPart openEditor(ICVSRemoteFile file, IProgressMonitor monitor) throws InvocationTargetException {
- IWorkbench workbench = getWorkbench();
- IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
return Utils.openEditor(page, file.getAdapter(IFileRevision.class), monitor);
} catch (CoreException e) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/EditorsView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/EditorsView.java
index dbdb7443e..47471eb3b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/EditorsView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/EditorsView.java
@@ -15,7 +15,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;
-import java.text.ParseException;
+import java.text.*;
import java.util.Locale;
import org.eclipse.jface.viewers.*;
@@ -28,9 +28,6 @@ import org.eclipse.team.internal.ccvs.core.EditorsInfo;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
-
/**
*
* The <code>EditorsView</code> shows the result of cvs editors command
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryTableProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryTableProvider.java
index e0ae44760..8ae3bbae6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryTableProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryTableProvider.java
@@ -14,6 +14,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;
+import java.text.DateFormat;
import java.util.Date;
import org.eclipse.core.runtime.IAdaptable;
@@ -28,8 +29,6 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
-import com.ibm.icu.text.DateFormat;
-
/**
* This class provides the table and it's required components for a file's revision
* history
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
index 1d64b5945..d81673b4f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
@@ -75,7 +75,7 @@ public interface ICVSUIConstants {
public final String IMG_LINK_WITH_EDITOR_ENABLED = "elcl16/synced.gif"; //$NON-NLS-1$
//history page toolbar
- public final String IMG_FILTER_HISTORY = "elcl16/filter_history.gif"; //$NON-NLS-1$
+ public final String IMG_FILTER_HISTORY = "elcl16/filter_history.png"; //$NON-NLS-1$
// wizards
public final String IMG_NEWLOCATION = "etool16/newlocation_wiz.gif"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java
index a76f60759..323e7ebd4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java
@@ -32,9 +32,9 @@ import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
* @author Administrator
*
* To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
+ * Window&gt;Preferences&gt;Java&gt;Templates.
* To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
+ * Window&gt;Preferences&gt;Java&gt;Code Generation.
*/
public class WorkingSetSelectionArea extends DialogArea {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java
index 2d821f732..7e6a25264 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java
@@ -67,9 +67,7 @@ public class ConfigureTagsFromRepoViewOnFolder extends CVSAction {
final Shell shell = getShell();
shell.getDisplay().syncExec(() -> {
ICVSFolder[] cvsFolders = new ICVSFolder[roots.length];
- for (int i = 0; i < roots.length; i++) {
- cvsFolders[i] = roots[i];
- }
+ System.arraycopy(roots, 0, cvsFolders, 0, roots.length);
TagConfigurationDialog d = new TagConfigurationDialog(shell, TagSource.create(cvsFolders));
d.open();
});
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java
index e1e3e1f9b..fe8f07ad6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java
@@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.console;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.Date;
import org.eclipse.core.runtime.*;
@@ -33,9 +35,6 @@ import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.*;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
-
/**
* Console that shows the output of CVS commands. It is shown as a page in the generic
* console view. It supports coloring for message, command, and error lines in addition
@@ -344,37 +343,56 @@ public class CVSOutputConsole extends MessageConsole implements IConsoleListener
String property = event.getProperty();
// colors
if (visible) {
- if (property.equals(ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR)) {
- Color newColor = createColor(CVSUIPlugin.getStandardDisplay(), ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR);
+ switch (property) {
+ case ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR: {
+ Color newColor = createColor(CVSUIPlugin.getStandardDisplay(),
+ ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR);
commandStream.setColor(newColor);
commandColor.dispose();
commandColor = newColor;
- } else if (property.equals(ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR)) {
- Color newColor = createColor(CVSUIPlugin.getStandardDisplay(), ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR);
+ return;
+ }
+ case ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR: {
+ Color newColor = createColor(CVSUIPlugin.getStandardDisplay(),
+ ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR);
messageStream.setColor(newColor);
messageColor.dispose();
messageColor = newColor;
- } else if (property.equals(ICVSUIConstants.PREF_CONSOLE_ERROR_COLOR)) {
- Color newColor = createColor(CVSUIPlugin.getStandardDisplay(), ICVSUIConstants.PREF_CONSOLE_ERROR_COLOR);
+ return;
+ }
+ case ICVSUIConstants.PREF_CONSOLE_ERROR_COLOR: {
+ Color newColor = createColor(CVSUIPlugin.getStandardDisplay(),
+ ICVSUIConstants.PREF_CONSOLE_ERROR_COLOR);
errorStream.setColor(newColor);
errorColor.dispose();
errorColor = newColor;
// font
- } else if (property.equals(ICVSUIConstants.PREF_CONSOLE_FONT)) {
+ return;
+ }
+ case ICVSUIConstants.PREF_CONSOLE_FONT:
setFont(((FontRegistry) event.getSource()).get(ICVSUIConstants.PREF_CONSOLE_FONT));
+ return;
+ default:
+ break;
}
}
- if (property.equals(ICVSUIConstants.PREF_CONSOLE_SHOW_ON_MESSAGE)) {
+ switch (property) {
+ case ICVSUIConstants.PREF_CONSOLE_SHOW_ON_MESSAGE:
Object value = event.getNewValue();
if (value instanceof String) {
showOnMessage = Boolean.valueOf((String) value).booleanValue();
} else {
showOnMessage = ((Boolean) value).booleanValue();
}
- } else if(property.equals(ICVSUIConstants.PREF_CONSOLE_LIMIT_OUTPUT)) {
+ break;
+ case ICVSUIConstants.PREF_CONSOLE_LIMIT_OUTPUT:
initLimitOutput();
- } else if(property.equals(ICVSUIConstants.PREF_CONSOLE_WRAP)) {
+ break;
+ case ICVSUIConstants.PREF_CONSOLE_WRAP:
initWrapSetting();
+ break;
+ default:
+ break;
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelSynchronizeParticipant.java
index 1d29141cf..9632a5821 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelSynchronizeParticipant.java
@@ -29,9 +29,7 @@ public abstract class CVSModelSynchronizeParticipant extends ModelSynchronizePar
public static PreferencePage[] addCVSPreferencePages(PreferencePage[] inheritedPages) {
PreferencePage[] pages = new PreferencePage[inheritedPages.length + 1];
- for (int i = 0; i < inheritedPages.length; i++) {
- pages[i] = inheritedPages[i];
- }
+ System.arraycopy(inheritedPages, 0, pages, 0, inheritedPages.length);
pages[pages.length - 1] = new ComparePreferencePage();
pages[pages.length - 1].setTitle(CVSUIMessages.CVSParticipant_2);
return pages;
@@ -57,9 +55,7 @@ public abstract class CVSModelSynchronizeParticipant extends ModelSynchronizePar
return enabledProviders;
}
ModelProvider[] extended = new ModelProvider[enabledProviders.length + 1];
- for (int i = 0; i < enabledProviders.length; i++) {
- extended[i] = enabledProviders[i];
- }
+ System.arraycopy(enabledProviders, 0, extended, 0, enabledProviders.length);
ChangeSetModelProvider provider = ChangeSetModelProvider.getProvider();
if (provider == null)
return enabledProviders;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java
index 4f627b2b3..caf98ac74 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java
@@ -83,8 +83,8 @@ public class ChangeSetActionProvider extends ResourceModelActionProvider {
}
/**
- * Escape a string so it can be used as an action text without '&'
- * being interpreted as a mnemonic. Specifically, turn each '&' into '&&'.
+ * Escape a string so it can be used as an action text without '&amp;'
+ * being interpreted as a mnemonic. Specifically, turn each '&amp;' into '&amp;&amp;'.
*/
/* package */static String escapeActionText(String x) {
// Loosely based on org.eclipse.jface.action.LegacyActionTools#removeMnemonics
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CompareSubscriberContext.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CompareSubscriberContext.java
index f2844bf16..159a75ffe 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CompareSubscriberContext.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CompareSubscriberContext.java
@@ -101,7 +101,7 @@ public class CompareSubscriberContext extends CVSSubscriberMergeContext implemen
if (isConsiderContents()) {
String pattern = CVSUIPlugin.getPlugin().getPreferenceStore().getString(
ICVSUIConstants.PREF_SYNCVIEW_REGEX_FILTER_PATTERN);
- if (pattern != null && !pattern.equals("")) { //$NON-NLS-1$
+ if (pattern != null && !pattern.isEmpty()) {
return new RegexDiffFilter(pattern);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/OpenChangeSetAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/OpenChangeSetAction.java
index 54ae477c1..ff0bc80ab 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/OpenChangeSetAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/OpenChangeSetAction.java
@@ -14,6 +14,7 @@
package org.eclipse.team.internal.ccvs.ui.mappings;
import java.lang.reflect.InvocationTargetException;
+import java.text.DateFormat;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ResourceTraversal;
@@ -41,8 +42,6 @@ import org.eclipse.team.internal.ui.mapping.ResourceModelParticipantAction;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.ui.PlatformUI;
-import com.ibm.icu.text.DateFormat;
-
class OpenChangeSetAction extends ResourceModelParticipantAction {
protected OpenChangeSetAction(ISynchronizePageConfiguration configuration) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java
index 3da350d41..1b72375b2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -147,7 +147,7 @@ public class WorkspaceSubscriberContext extends CVSSubscriberMergeContext implem
if (isConsiderContents()) {
String pattern = CVSUIPlugin.getPlugin().getPreferenceStore().getString(
ICVSUIConstants.PREF_SYNCVIEW_REGEX_FILTER_PATTERN);
- if (pattern != null && !pattern.equals("")) { //$NON-NLS-1$
+ if (pattern != null && !pattern.isEmpty()) {
return new RegexDiffFilter(pattern);
}
}
@@ -287,7 +287,7 @@ public class WorkspaceSubscriberContext extends CVSSubscriberMergeContext implem
protected void ensureRemotesMatch(IResource resource, IDiff node, SyncInfo info) throws CVSException {
IResourceVariant variant = info.getRemote();
IFileRevision remote = getRemote(node);
- if (variant != null && remote != null && remote instanceof IFileRevision) {
+ if (variant != null && remote != null) {
String ci1 = variant.getContentIdentifier();
String ci2 = remote.getContentIdentifier();
if (!ci1.equals(ci2)) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
index 335262329..ee007897d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -63,7 +63,8 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
@Override
protected URL getOperationIcon() {
- return Platform.find(CVSUIPlugin.getPlugin().getBundle(), new Path(ICVSUIConstants.ICON_PATH + ICVSUIConstants.IMG_CVS_PERSPECTIVE));
+ return FileLocator.find(CVSUIPlugin.getPlugin().getBundle(),
+ new Path(ICVSUIConstants.ICON_PATH + ICVSUIConstants.IMG_CVS_PERSPECTIVE));
}
@Override
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
index 4c3988e08..9d004bca2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
@@ -511,7 +511,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
}
/* private */ void createWorkingSet(String workingSetName, IProject[] projects) {
- IWorkingSetManager manager = CVSUIPlugin.getPlugin().getWorkbench().getWorkingSetManager();
+ IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
IWorkingSet oldSet = manager.getWorkingSet(workingSetName);
if (oldSet == null) {
IWorkingSet newSet = manager.createWorkingSet(workingSetName, projects);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java
index 37fb05a7b..818740afc 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java
@@ -248,7 +248,7 @@ public abstract class DiffOperation extends SingleCommandOperation {
}, recurse);
}
- final SortedSet<Object> allFiles = new TreeSet<Object>(COMPARATOR);
+ final SortedSet<Object> allFiles = new TreeSet<>(COMPARATOR);
allFiles.addAll(existingFiles);
allFiles.addAll(newFiles);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java
index 521acc8b0..2e5f4979b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java
@@ -66,7 +66,7 @@ public class RemoteLogOperation extends RepositoryLocationOperation {
*/
public ILogEntry[] getLogEntries(String path) {
Map<String, ILogEntry> map = internalGetLogEntries(path);
- return map.values().toArray(new ILogEntry[map.values().size()]);
+ return map.values().toArray(new ILogEntry[map.size()]);
}
private ILogEntry internalGetLogEntry(String path, String revision) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteOperation.java
index e42f45f7d..69b5ef017 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteOperation.java
@@ -32,9 +32,7 @@ public abstract class RemoteOperation extends CVSOperation {
public ICVSResource[] getCVSResources() {
ICVSResource[] cvsResources = new ICVSResource[remoteResources.length];
- for (int i = 0; i < remoteResources.length; i++) {
- cvsResources[i] = remoteResources[i];
- }
+ System.arraycopy(remoteResources, 0, cvsResources, 0, remoteResources.length);
return cvsResources;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteProjectFolder.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteProjectFolder.java
index 52544ba2d..0451584ab 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteProjectFolder.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteProjectFolder.java
@@ -55,6 +55,6 @@ public class RemoteProjectFolder extends RemoteFolder {
}
private boolean isProjectNameEmpty() {
- return projectName == null || projectName.equals(""); //$NON-NLS-1$
+ return projectName == null || projectName.isEmpty();
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java
index 2f9260afd..9c4bef7d7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,6 +16,7 @@ package org.eclipse.team.internal.ccvs.ui.operations;
import java.io.IOException;
import java.io.InputStream;
+import java.text.DateFormat;
import java.util.*;
import org.eclipse.core.resources.IFile;
@@ -50,8 +51,6 @@ import org.eclipse.ui.*;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
-import com.ibm.icu.text.DateFormat;
-
/**
* An operation to fetch the annotations for a file from the repository and
* display them in the annotations view.
@@ -139,6 +138,7 @@ public class ShowAnnotationOperation extends CVSOperation {
}
}
+ @SuppressWarnings("resource")
private AbstractDecoratedTextEditor getEditor(AnnotateListener listener) throws PartInitException {
IResource resource= fCVSResource.getIResource();
if (resource instanceof IFile){
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/NewCVSRepositoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/NewCVSRepositoryAction.java
index a2aa5f96f..529f1ee96 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/NewCVSRepositoryAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/NewCVSRepositoryAction.java
@@ -18,17 +18,18 @@ import org.eclipse.jface.action.Action;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.wizards.NewLocationWizard;
import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
/**
* Called from Welcome page only.
*/
public class NewCVSRepositoryAction extends Action {
+ @Override
public void run() {
Shell shell;
- IWorkbenchWindow window = CVSUIPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
shell = window.getShell();
} else {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/PasteConnectionStringAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/PasteConnectionStringAction.java
index cfc4fb050..70665dc2e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/PasteConnectionStringAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/PasteConnectionStringAction.java
@@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.repo;
+import java.util.StringTokenizer;
+
import org.eclipse.jface.action.IAction;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
@@ -22,8 +24,6 @@ import org.eclipse.ui.*;
import org.eclipse.ui.actions.ActionDelegate;
import org.eclipse.ui.actions.ActionFactory;
-import com.ibm.icu.util.StringTokenizer;
-
/**
* Try to paste a CVS connection string from clipboard as a repository location
*/
@@ -32,6 +32,7 @@ public class PasteConnectionStringAction extends ActionDelegate implements
private IAction action;
+ @Override
public void run(IAction action) {
Clipboard clipboard = new Clipboard(PlatformUI.getWorkbench()
.getDisplay());
@@ -57,11 +58,13 @@ public class PasteConnectionStringAction extends ActionDelegate implements
}
}
+ @Override
public void init(IAction action) {
super.init(action);
this.action = action;
}
+ @Override
public void init(IViewPart view) {
IActionBars actionBars = view.getViewSite().getActionBars();
actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), action);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoriesViewContentHandler.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoriesViewContentHandler.java
index 145c0539c..46e07dfad 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoriesViewContentHandler.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoriesViewContentHandler.java
@@ -79,29 +79,35 @@ public class RepositoriesViewContentHandler extends DefaultHandler {
throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_unmatchedTag, new String[] { elementName }));
}
- if (elementName.equals(REPOSITORIES_VIEW_TAG)) {
+ switch (elementName) {
+ case REPOSITORIES_VIEW_TAG:
// all done
- } else if (elementName.equals(REPOSITORY_TAG)) {
+ break;
+ case REPOSITORY_TAG:
if (!ignoreElements) {
manager.add(currentRepositoryRoot);
}
currentRepositoryRoot = null;
- } else if (elementName.equals(WORKING_SET_TAG)) {
+ break;
+ case WORKING_SET_TAG:
// This tag is no longer used
ignoreElements = false;
- } else if (elementName.equals(CURRENT_WORKING_SET_TAG)) {
+ break;
+ case CURRENT_WORKING_SET_TAG:
// This tag is no longer used
ignoreElements = false;
- } else if (elementName.equals(MODULE_TAG)) {
+ break;
+ case MODULE_TAG:
if (! ignoreElements && currentRepositoryRoot != null) {
- currentRepositoryRoot.addTags(currentRemotePath,
- (CVSTag[]) tags.toArray(new CVSTag[tags.size()]));
+ currentRepositoryRoot.addTags(currentRemotePath,
+ (CVSTag[]) tags.toArray(new CVSTag[tags.size()]));
if (lastAccessTime > 0)
currentRepositoryRoot.setLastAccessedTime(currentRemotePath, lastAccessTime);
currentRepositoryRoot.setAutoRefreshFiles(currentRemotePath,
- (String[]) autoRefreshFiles.toArray(new String[autoRefreshFiles.size()]));
+ (String[]) autoRefreshFiles.toArray(new String[autoRefreshFiles.size()]));
}
- }else if(elementName.equals(DATE_TAG_TAG)){
+ break;
+ case DATE_TAG_TAG:
if (! ignoreElements && currentRepositoryRoot != null) {
Iterator iter = dateTags.iterator();
while(iter.hasNext()){
@@ -109,6 +115,9 @@ public class RepositoriesViewContentHandler extends DefaultHandler {
currentRepositoryRoot.addDateTag(tag);
}
}
+ break;
+ default:
+ break;
}
tagStack.pop();
}
@@ -122,12 +131,15 @@ public class RepositoriesViewContentHandler extends DefaultHandler {
throws SAXException {
String elementName = getElementName(namespaceURI, localName, qName);
- if (elementName.equals(REPOSITORIES_VIEW_TAG)) {
+ switch (elementName) {
+ case REPOSITORIES_VIEW_TAG:
// just started
- } else if (elementName.equals(REPOSITORY_TAG)) {
+ break;
+ case REPOSITORY_TAG: {
String id = atts.getValue(ID_ATTRIBUTE);
if (id == null) {
- throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute, new String[] { REPOSITORY_TAG, ID_ATTRIBUTE }));
+ throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute,
+ new String[] { REPOSITORY_TAG, ID_ATTRIBUTE }));
}
ICVSRepositoryLocation root;
try {
@@ -136,33 +148,45 @@ public class RepositoriesViewContentHandler extends DefaultHandler {
KnownRepositories.getInstance().addRepository(root, false);
}
} catch (CVSException e) {
- throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_errorCreatingRoot, new String[] { id }), e);
+ throw new SAXException(
+ NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_errorCreatingRoot, new String[] { id }),
+ e);
}
currentRepositoryRoot = new RepositoryRoot(root);
String name = atts.getValue(NAME_ATTRIBUTE);
if (name != null) {
currentRepositoryRoot.setName(name);
}
- } else if(elementName.equals(DATE_TAGS_TAG)){
+ break;
+ }
+ case DATE_TAGS_TAG:
//prepare to collect date tag
dateTags = new ArrayList();
- } else if (elementName.equals(DATE_TAG_TAG)){
+ break;
+ case DATE_TAG_TAG: {
String name = atts.getValue(NAME_ATTRIBUTE);
if (name == null) {
- throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute, new String[] { DATE_TAGS_TAG, NAME_ATTRIBUTE }));
+ throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute,
+ new String[] { DATE_TAGS_TAG, NAME_ATTRIBUTE }));
}
dateTags.add(new CVSTag(name, CVSTag.DATE));
- }else if (elementName.equals(WORKING_SET_TAG)) {
+ break;
+ }
+ case WORKING_SET_TAG: {
String name = atts.getValue(NAME_ATTRIBUTE);
if (name == null) {
- throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute, new String[] { WORKING_SET_TAG, NAME_ATTRIBUTE }));
+ throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute,
+ new String[] { WORKING_SET_TAG, NAME_ATTRIBUTE }));
}
// Ignore any elements until the corresponding end tag is reached
ignoreElements = true;
- } else if (elementName.equals(MODULE_TAG)) {
+ break;
+ }
+ case MODULE_TAG: {
String path = atts.getValue(PATH_ATTRIBUTE);
if (path == null) {
- throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute, new String[] { MODULE_TAG, PATH_ATTRIBUTE }));
+ throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute,
+ new String[] { MODULE_TAG, PATH_ATTRIBUTE }));
}
String type = atts.getValue(TYPE_ATTRIBUTE);
if (type != null && type.equals(DEFINED_MODULE_TYPE)) {
@@ -179,23 +203,29 @@ public class RepositoriesViewContentHandler extends DefaultHandler {
}
}
startModule(path, cachedTime);
- } else if (elementName.equals(TAG_TAG)) {
+ break;
+ }
+ case TAG_TAG: {
String type = atts.getValue(TYPE_ATTRIBUTE);
if (type == null) {
type = DEFAULT_TAG_TYPE;
}
String name = atts.getValue(NAME_ATTRIBUTE);
if (name == null) {
- throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute, new String[] { TAG_TAG, NAME_ATTRIBUTE }));
+ throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute,
+ new String[] { TAG_TAG, NAME_ATTRIBUTE }));
}
tags.add(new CVSTag(name, getCVSTagType(type)));
- } else if (elementName.equals(AUTO_REFRESH_FILE_TAG)) {
+ break;
+ }
+ case AUTO_REFRESH_FILE_TAG: {
String path = atts.getValue(FULL_PATH_ATTRIBUTE);
if (path == null) {
// get the old path attribute format which was relative to the module
path = atts.getValue(PATH_ATTRIBUTE);
if (path == null) {
- throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute, new String[] { AUTO_REFRESH_FILE_TAG, FULL_PATH_ATTRIBUTE }));
+ throw new SAXException(NLS.bind(CVSUIMessages.RepositoriesViewContentHandler_missingAttribute,
+ new String[] { AUTO_REFRESH_FILE_TAG, FULL_PATH_ATTRIBUTE }));
}
if (RepositoryRoot.isDefinedModuleName(currentRemotePath)) {
path = null;
@@ -203,10 +233,17 @@ public class RepositoriesViewContentHandler extends DefaultHandler {
path = new Path(null, currentRemotePath).append(path).toString();
}
}
- if (path != null) autoRefreshFiles.add(path);
- } else if (elementName.equals(CURRENT_WORKING_SET_TAG)) {
+ if (path != null) {
+ autoRefreshFiles.add(path);
+ }
+ break;
+ }
+ case CURRENT_WORKING_SET_TAG:
// Ignore any elements until the corresponding end tag is reached
ignoreElements = true;
+ break;
+ default:
+ break;
}
// empty buffer
buffer = new StringBuffer();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java
index 6ef78e44d..3238e3e2c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java
@@ -405,13 +405,8 @@ public class RepositoryManager {
IPath pluginStateLocation = CVSUIPlugin.getPlugin().getStateLocation().append(REPOSITORIES_VIEW_FILE);
File file = pluginStateLocation.toFile();
if (file.exists()) {
- try {
- BufferedInputStream is = new BufferedInputStream(new FileInputStream(file));
- try {
- readState(is);
- } finally {
- is.close();
- }
+ try (BufferedInputStream is = new BufferedInputStream(new FileInputStream(file))) {
+ readState(is);
} catch (IOException e) {
CVSUIPlugin.log(IStatus.ERROR, CVSUIMessages.RepositoryManager_ioException, e);
} catch (TeamException e) {
@@ -422,11 +417,8 @@ public class RepositoryManager {
file = oldPluginStateLocation.toFile();
if (file.exists()) {
try {
- DataInputStream dis = new DataInputStream(new FileInputStream(file));
- try {
+ try (DataInputStream dis = new DataInputStream(new FileInputStream(file))) {
readOldState(dis);
- } finally {
- dis.close();
}
saveState();
file.delete();
@@ -442,13 +434,8 @@ public class RepositoryManager {
IPath pluginStateLocation = CVSUIPlugin.getPlugin().getStateLocation().append(COMMENT_HIST_FILE);
File file = pluginStateLocation.toFile();
if (!file.exists()) return;
- try {
- BufferedInputStream is = new BufferedInputStream(new FileInputStream(file));
- try {
- readCommentHistory(is);
- } finally {
- is.close();
- }
+ try (BufferedInputStream is = new BufferedInputStream(new FileInputStream(file))) {
+ readCommentHistory(is);
} catch (IOException e) {
CVSUIPlugin.log(IStatus.ERROR, CVSUIMessages.RepositoryManager_ioException, e);
} catch (TeamException e) {
@@ -459,13 +446,8 @@ public class RepositoryManager {
IPath pluginStateLocation = CVSUIPlugin.getPlugin().getStateLocation().append(COMMENT_TEMPLATES_FILE);
File file = pluginStateLocation.toFile();
if (!file.exists()) return;
- try {
- BufferedInputStream is = new BufferedInputStream(new FileInputStream(file));
- try {
- readCommentTemplates(is);
- } finally {
- is.close();
- }
+ try (BufferedInputStream is = new BufferedInputStream(new FileInputStream(file))) {
+ readCommentTemplates(is);
} catch (IOException e) {
CVSUIPlugin.log(IStatus.ERROR, CVSUIMessages.RepositoryManager_ioException, e);
} catch (TeamException e) {
@@ -478,11 +460,8 @@ public class RepositoryManager {
File tempFile = pluginStateLocation.append(REPOSITORIES_VIEW_FILE + ".tmp").toFile(); //$NON-NLS-1$
File stateFile = pluginStateLocation.append(REPOSITORIES_VIEW_FILE).toFile();
try {
- XMLWriter writer = new XMLWriter(new BufferedOutputStream(new FileOutputStream(tempFile)));
- try {
+ try (XMLWriter writer = new XMLWriter(new BufferedOutputStream(new FileOutputStream(tempFile)))) {
writeState(writer);
- } finally {
- writer.close();
}
if (stateFile.exists()) {
stateFile.delete();
@@ -600,11 +579,8 @@ public class RepositoryManager {
File tempFile = pluginStateLocation.append(COMMENT_HIST_FILE + ".tmp").toFile(); //$NON-NLS-1$
File histFile = pluginStateLocation.append(COMMENT_HIST_FILE).toFile();
try {
- XMLWriter writer = new XMLWriter(new BufferedOutputStream(new FileOutputStream(tempFile)));
- try {
+ try (XMLWriter writer = new XMLWriter(new BufferedOutputStream(new FileOutputStream(tempFile)))) {
writeCommentHistory(writer);
- } finally {
- writer.close();
}
if (histFile.exists()) {
histFile.delete();
@@ -944,12 +920,9 @@ public class RepositoryManager {
File histFile = pluginStateLocation.append(COMMENT_TEMPLATES_FILE)
.toFile();
try {
- XMLWriter writer = new XMLWriter(new BufferedOutputStream(
- new FileOutputStream(tempFile)));
- try {
+ try (XMLWriter writer = new XMLWriter(new BufferedOutputStream(
+ new FileOutputStream(tempFile)))) {
writeCommentTemplates(writer);
- } finally {
- writer.close();
}
if (histFile.exists()) {
histFile.delete();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
index 0a39c6ec8..6c8fd8136 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
+import java.text.DateFormat;
import java.util.Date;
import org.eclipse.core.resources.IResource;
@@ -39,8 +40,6 @@ import org.eclipse.team.internal.ui.synchronize.SyncInfoSetChangeSetCollector;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
-import com.ibm.icu.text.DateFormat;
-
/**
* Collector that fetches the log for incoming CVS change sets
*/
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java
index 60e423cab..60faf8242 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java
@@ -144,9 +144,7 @@ public class CVSParticipant extends SubscriberParticipant implements IChangeSetP
public static PreferencePage[] addCVSPreferencePages(PreferencePage[] inheritedPages) {
PreferencePage[] pages = new PreferencePage[inheritedPages.length + 1];
- for (int i = 0; i < inheritedPages.length; i++) {
- pages[i] = inheritedPages[i];
- }
+ System.arraycopy(inheritedPages, 0, pages, 0, inheritedPages.length);
pages[pages.length - 1] = new ComparePreferencePage();
pages[pages.length - 1].setTitle(CVSUIMessages.CVSParticipant_2);
return pages;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
index 629af4140..4413878bd 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
@@ -112,7 +112,7 @@ public class CompareParticipant extends CVSParticipant implements IPreferenceCha
private SyncInfoFilter createRegexFilter() {
if (isConsiderContents()) {
String pattern = CVSUIPlugin.getPlugin().getPreferenceStore().getString(ICVSUIConstants.PREF_SYNCVIEW_REGEX_FILTER_PATTERN);
- if (pattern != null && !pattern.equals("")) { //$NON-NLS-1$
+ if (pattern != null && !pattern.isEmpty()) {
return new RegexSyncInfoFilter(pattern);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OpenChangeSetAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OpenChangeSetAction.java
index b418330f3..f6ab31ca6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OpenChangeSetAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OpenChangeSetAction.java
@@ -14,6 +14,7 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.lang.reflect.InvocationTargetException;
+import java.text.DateFormat;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
@@ -33,8 +34,6 @@ import org.eclipse.team.internal.core.subscribers.CheckedInChangeSet;
import org.eclipse.team.internal.ui.synchronize.ChangeSetDiffNode;
import org.eclipse.team.ui.synchronize.*;
-import com.ibm.icu.text.DateFormat;
-
class OpenChangeSetAction extends SynchronizeModelAction {
protected OpenChangeSetAction(ISynchronizePageConfiguration configuration) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
index 6b1af9001..cc4f8232d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
@@ -244,7 +244,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
private SyncInfoFilter createRegexFilter() {
if (isConsiderContents()) {
String pattern = CVSUIPlugin.getPlugin().getPreferenceStore().getString(ICVSUIConstants.PREF_SYNCVIEW_REGEX_FILTER_PATTERN);
- if (pattern != null && !pattern.equals("")) { //$NON-NLS-1$
+ if (pattern != null && !pattern.isEmpty()) {
return new RegexSyncInfoFilter(pattern);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java
index 8d5bb6330..9a4e37e7d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java
@@ -102,8 +102,8 @@ public class AddWizard extends ResizableWizard {
@Override
public void addPages() {
- final Collection<String> names= new HashSet<String>();
- final Collection<String> extensions= new HashSet<String>();
+ final Collection<String> names= new HashSet<>();
+ final Collection<String> extensions= new HashSet<>();
getUnknownNamesAndExtension(unknowns, names, extensions);
if (names.size() + extensions.size() > 0) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java
index 0a76e6287..cebef6a75 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java
@@ -219,7 +219,7 @@ public class CVSScmUrlImportWizardPage extends WizardPage implements IScmUrlImpo
} else if (param.startsWith("version=")) { //$NON-NLS-1$
// ignore
} else {
- if (param != null && !param.equals("")) { //$NON-NLS-1$
+ if (param != null && !param.isEmpty()) {
sb.append(';').append(param);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java
index 2dc1197da..899c732f4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java
@@ -31,6 +31,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.operations.RemoteProjectFolder;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.views.navigator.ResourceComparator;
@@ -233,7 +234,7 @@ public abstract class CVSWizardPage extends WizardPage {
tree.setLabelProvider(
new DecoratingLabelProvider(
new WorkbenchLabelProvider(),
- CVSUIPlugin.getPlugin().getWorkbench().getDecoratorManager().getLabelDecorator()));
+ PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
tree.setComparator(new ResourceComparator(ResourceComparator.NAME));
GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java
index 55c630c0f..69812b4a3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java
@@ -39,7 +39,7 @@ import org.eclipse.ui.PlatformUI;
* @author Administrator
*
* To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
public class CheckoutAsLocationSelectionPage extends CVSWizardPage {
@@ -265,7 +265,7 @@ public class CheckoutAsLocationSelectionPage extends CVSWizardPage {
return null;
} else {
targetLocation = locationPathField.getText();
- if (targetLocation.equals("")) {//$NON-NLS-1$
+ if (targetLocation.isEmpty()) {
return(CVSUIMessages.CheckoutAsLocationSelectionPage_locationEmpty);
}
else{
@@ -359,7 +359,7 @@ public class CheckoutAsLocationSelectionPage extends CVSWizardPage {
}
String dirName = locationPathField.getText();
- if (!dirName.equals("")) {//$NON-NLS-1$
+ if (!dirName.isEmpty()) {
File path = new File(dirName);
if (path.exists())
dialog.setFilterPath(dirName);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardCommitPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardCommitPage.java
index b21d2ab19..bb13790b6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardCommitPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardCommitPage.java
@@ -292,7 +292,7 @@ public class CommitWizardCommitPage extends WizardPage implements IPropertyChang
if (allowEmptyComment.equals(MessageDialogWithToggle.NEVER)) {
/* but is empty */
final String comment = fCommentArea.getComment(false);
- if (comment.equals("")) { //$NON-NLS-1$
+ if (comment.isEmpty()) {
return false; // then the page is not complete
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
index 5975becf6..eccdadd13 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
@@ -253,7 +253,7 @@ public class GenerateDiffFileWizard extends Wizard {
private void validateDialog() {
String fileName = wsFilenameText.getText();
- if (fileName.equals("")) { //$NON-NLS-1$
+ if (fileName.isEmpty()) {
if (modified) {
setErrorMessage(CVSUIMessages.GenerateDiffFileWizard_2);
getButton(IDialogConstants.OK_ID).setEnabled(false);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java
index 2e9ce65b0..5337689fe 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java
@@ -841,7 +841,7 @@ public class ModeWizardSelectionPage extends WizardPage {
}
private void validatePage() {
- if (fCommentArea.getComment(false).equals("")) { //$NON-NLS-1$
+ if (fCommentArea.getComment(false).isEmpty()) {
final IPreferenceStore store = CVSUIPlugin.getPlugin()
.getPreferenceStore();
final String allowEmptyComment = store
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java
index bb81ea9df..1334726c0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java
@@ -222,7 +222,7 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage {
return text;
}
},
- CVSUIPlugin.getPlugin().getWorkbench().getDecoratorManager().getLabelDecorator()));
+ PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
tree.setComparator(new ResourceComparator(ResourceComparator.NAME));
tree.setInput(treeInput);
diff --git a/bundles/org.eclipse.team.genericeditor.diff.extension/.classpath b/bundles/org.eclipse.team.genericeditor.diff.extension/.classpath
index eca7bdba8..e801ebfb4 100644
--- a/bundles/org.eclipse.team.genericeditor.diff.extension/.classpath
+++ b/bundles/org.eclipse.team.genericeditor.diff.extension/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.jdt.core.prefs
index faaf2196b..f012c6ca7 100644
--- a/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.jdt.core.prefs
@@ -9,9 +9,9 @@ org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -25,6 +25,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
@@ -58,6 +59,7 @@ org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
@@ -79,7 +81,8 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
diff --git a/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.pde.prefs
index 85b2478a9..d3ef2b590 100644
--- a/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.team.genericeditor.diff.extension/.settings/org.eclipse.pde.prefs
@@ -1,32 +1,32 @@
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=0
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=0
-compilers.p.missing-version-export-package=2
-compilers.p.missing-version-import-package=2
-compilers.p.missing-version-require-bundle=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=1
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=0
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=0
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=1
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.team.genericeditor.diff.extension/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.genericeditor.diff.extension/META-INF/MANIFEST.MF
index 9450be05d..6f6ed3302 100644
--- a/bundles/org.eclipse.team.genericeditor.diff.extension/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.genericeditor.diff.extension/META-INF/MANIFEST.MF
@@ -2,16 +2,17 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.genericeditor.diff.extension;singleton:=true
-Bundle-Version: 1.0.400.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.ui.workbench.texteditor;bundle-version="[3.10.100,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.12.0,4.0.0)",
org.eclipse.core.filebuffers,
org.eclipse.jface.text;bundle-version="[3.11.100,4.0.0)",
org.eclipse.ui;bundle-version="[3.109.0,4.0.0)",
- org.eclipse.core.contenttype
+ org.eclipse.core.contenttype,
+ org.eclipse.ui.genericeditor
Export-Package: org.eclipse.team.internal.genericeditor.diff.extension.partitioner;x-internal:=true,
org.eclipse.team.internal.genericeditor.diff.extension.presentation;x-internal:=true,
org.eclipse.team.internal.genericeditor.diff.extension.rules;x-internal:=true
diff --git a/bundles/org.eclipse.team.genericeditor.diff.extension/plugin.xml b/bundles/org.eclipse.team.genericeditor.diff.extension/plugin.xml
index 12013bcf1..ddb35fef1 100644
--- a/bundles/org.eclipse.team.genericeditor.diff.extension/plugin.xml
+++ b/bundles/org.eclipse.team.genericeditor.diff.extension/plugin.xml
@@ -19,6 +19,12 @@
contentType="org.eclipse.team.genericeditor.diff.extension.patch">
</presentationReconciler>
</extension>
+ <extension point="org.eclipse.ui.editors">
+ <editorContentTypeBinding
+ contentTypeId="org.eclipse.team.genericeditor.diff.extension.patch"
+ editorId="org.eclipse.ui.genericeditor.GenericEditor">
+ </editorContentTypeBinding>
+ </extension>
<extension
point="org.eclipse.core.filebuffers.documentSetup">
<participant
@@ -31,7 +37,7 @@
point="org.eclipse.core.contenttype.contentTypes">
<content-type
base-type="org.eclipse.core.runtime.text"
- file-extensions="diff,patch"
+ file-extensions="patch,diff"
id="org.eclipse.team.genericeditor.diff.extension.patch"
name="%patch_ContentTypeName"
priority="normal">
diff --git a/bundles/org.eclipse.team.genericeditor.diff.extension/pom.xml b/bundles/org.eclipse.team.genericeditor.diff.extension/pom.xml
index 4d9f080ec..b7073885b 100644
--- a/bundles/org.eclipse.team.genericeditor.diff.extension/pom.xml
+++ b/bundles/org.eclipse.team.genericeditor.diff.extension/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.genericeditor.diff.extension</artifactId>
- <version>1.0.400-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.ui/.classpath b/bundles/org.eclipse.team.ui/.classpath
index 22f30643c..e801ebfb4 100644
--- a/bundles/org.eclipse.team.ui/.classpath
+++ b/bundles/org.eclipse.team.ui/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.team.ui/.cvsignore b/bundles/org.eclipse.team.ui/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/bundles/org.eclipse.team.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.team.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.team.ui/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.team.ui/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.team.ui/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.team.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.team.ui/.settings/org.eclipse.jdt.core.prefs
index eba1f9e5b..e9f572c96 100644
--- a/bundles/org.eclipse.team.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.team.ui/.settings/org.eclipse.jdt.core.prefs
@@ -18,9 +18,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -36,6 +36,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
@@ -92,6 +93,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
@@ -124,7 +126,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
diff --git a/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
index a9408598c..6fe5d2080 100644
--- a/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.ui; singleton:=true
-Bundle-Version: 3.8.600.qualifier
+Bundle-Version: 3.9.300.qualifier
Bundle-Activator: org.eclipse.team.internal.ui.TeamUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -33,7 +33,5 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.3.0,4.0.0)";resolution:=op
org.eclipse.ui.editors;bundle-version="[3.3.0,4.0.0)",
org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)"
Bundle-ActivationPolicy: lazy
-Import-Package: com.ibm.icu.text,
- com.ibm.icu.util
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.team.ui
diff --git a/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change.png b/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change.png
index e54535c9f..d48339527 100644
--- a/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change.png
+++ b/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change.png
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change@2x.png b/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change@2x.png
index 9d482043c..6dbbb4c38 100644
--- a/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change@2x.png
+++ b/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_change@2x.png
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history.png b/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history.png
index e54535c9f..d48339527 100644
--- a/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history.png
+++ b/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history.png
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history@2x.png b/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history@2x.png
index 9d482043c..6dbbb4c38 100644
--- a/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history@2x.png
+++ b/bundles/org.eclipse.team.ui/icons/full/dlcl16/filter_history@2x.png
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change.png b/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change.png
index 50b14d8e5..58faf49c8 100644
--- a/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change.png
+++ b/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change.png
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change@2x.png b/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change@2x.png
index 779bc07b1..062359255 100644
--- a/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change@2x.png
+++ b/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_change@2x.png
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history.png b/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history.png
index 50b14d8e5..58faf49c8 100644
--- a/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history.png
+++ b/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history.png
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history@2x.png b/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history@2x.png
index 779bc07b1..062359255 100644
--- a/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history@2x.png
+++ b/bundles/org.eclipse.team.ui/icons/full/elcl16/filter_history@2x.png
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/eview16/compare_view.gif b/bundles/org.eclipse.team.ui/icons/full/eview16/compare_view.gif
deleted file mode 100644
index dc549bce8..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/eview16/compare_view.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/eview16/history_view.gif b/bundles/org.eclipse.team.ui/icons/full/eview16/history_view.gif
deleted file mode 100644
index c5f904abb..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/eview16/history_view.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/eview16/synch_synch.gif b/bundles/org.eclipse.team.ui/icons/full/eview16/synch_synch.gif
deleted file mode 100644
index ae7726345..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/eview16/synch_synch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/plugin.properties b/bundles/org.eclipse.team.ui/plugin.properties
index 82c3d6c69..6225a40d9 100644
--- a/bundles/org.eclipse.team.ui/plugin.properties
+++ b/bundles/org.eclipse.team.ui/plugin.properties
@@ -26,7 +26,7 @@ PreferenceKeywords.IgnoredResources=team
PreferenceKeywords.Models=team
PreferenceKeywords.FileContent=team type
PreferenceKeywords.ProjectSet=repository
-TeamPreferencePage.name=Team
+TeamPreferencePage.name=Version Control (Team)
TextPreferencePage.name=File Content
IgnorePreferencePage.name=Ignored Resources
@@ -41,7 +41,7 @@ Command.applyPatch.description=Apply a patch to one or more workspace projects.
ImportProjectSet.label=Import Project &Set...
TeamGroupMenu.label=T&eam
-Team.viewCategory=Team
+Team.viewCategory=Version Control (Team)
Synchronizing.perspective=Team Synchronizing
Synchronizing.openPerspectiveDescription=Open the Team Synchronizing Perspective
@@ -53,8 +53,8 @@ ProjectSetImportWizard.description=Import a set of projects by fetching the proj
ProjectSetExportWizard.name=Team Project Set
ProjectSetExportWizard.description=Export a file containing the names and locations of the shared projects in the workspace.
-Command.category.name=Team
-Command.category.description=Actions that apply when working with a Team
+Command.category.name=Version control (Team)
+Command.category.description=Actions that apply when working with a version control system
Command.syncAll.name=Synchronize...
Command.syncAll.description=Synchronize resources in the workspace with another location
diff --git a/bundles/org.eclipse.team.ui/pom.xml b/bundles/org.eclipse.team.ui/pom.xml
index f3df655f6..fb7fb262e 100644
--- a/bundles/org.eclipse.team.ui/pom.xml
+++ b/bundles/org.eclipse.team.ui/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.ui</artifactId>
- <version>3.8.600-SNAPSHOT</version>
+ <version>3.9.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetImporter.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetImporter.java
index d8bcb7f67..fca3acd32 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetImporter.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetImporter.java
@@ -110,7 +110,7 @@ public class ProjectSetImporter {
}
} else {
UIProjectSetSerializationContext context = new UIProjectSetSerializationContext(shell, filename);
- List<TeamException> errors = new ArrayList<TeamException>();
+ List<TeamException> errors = new ArrayList<>();
IMemento[] providers = xmlMemento.getChildren("provider"); //$NON-NLS-1$
for (IMemento provider : providers) {
ArrayList<String> referenceStrings= new ArrayList<>();
@@ -152,7 +152,7 @@ public class ProjectSetImporter {
//try working sets
IMemento[] sets = xmlMemento.getChildren("workingSets"); //$NON-NLS-1$
- IWorkingSetManager wsManager = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager();
+ IWorkingSetManager wsManager = PlatformUI.getWorkbench().getWorkingSetManager();
boolean replaceAll = false;
boolean mergeAll = false;
boolean skipAll = false;
@@ -235,16 +235,10 @@ public class ProjectSetImporter {
private static XMLMemento stringToXMLMemento(String stringContents)
throws InvocationTargetException {
- StringReader reader = null;
- try {
- reader = new StringReader(stringContents);
+ try (StringReader reader = new StringReader(stringContents)) {
return XMLMemento.createReadRoot(reader);
} catch (WorkbenchException e) {
throw new InvocationTargetException(e);
- } finally {
- if (reader != null) {
- reader.close();
- }
}
}
@@ -283,7 +277,7 @@ public class ProjectSetImporter {
IAdaptable[] oldElements = oldWs.getElements();
IAdaptable[] newElements = newWs.getElements();
- Set<IAdaptable> combinedElements = new HashSet<IAdaptable>();
+ Set<IAdaptable> combinedElements = new HashSet<>();
combinedElements.addAll(Arrays.asList(oldElements));
combinedElements.addAll(Arrays.asList(newElements));
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/PropertyChangeHandler.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/PropertyChangeHandler.java
index 1237e8395..10735b43b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/PropertyChangeHandler.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/PropertyChangeHandler.java
@@ -24,7 +24,7 @@ import org.eclipse.jface.util.PropertyChangeEvent;
* Helper class for implementing property change handling
*/
public class PropertyChangeHandler {
- private ListenerList<IPropertyChangeListener> fListeners = new ListenerList<IPropertyChangeListener>(ListenerList.IDENTITY);
+ private ListenerList<IPropertyChangeListener> fListeners = new ListenerList<>(ListenerList.IDENTITY);
/**
* Notifies listeners of property changes, handling any exceptions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/SWTUtils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/SWTUtils.java
index 348f34989..68f7a244b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/SWTUtils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/SWTUtils.java
@@ -14,6 +14,7 @@
package org.eclipse.team.internal.ui;
+import java.text.MessageFormat;
import java.util.Iterator;
import org.eclipse.core.runtime.Assert;
@@ -41,9 +42,6 @@ import org.eclipse.ui.dialogs.PreferenceLinkArea;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import com.ibm.icu.text.MessageFormat;
-
-
public class SWTUtils {
public static final int MARGINS_DEFAULT= -1;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java
index c4aea1529..3be899dfe 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java
@@ -69,7 +69,7 @@ public class TeamCapabilityHelper {
* for workspace changes and promote activities accordingly.
*/
private TeamCapabilityHelper() {
- providerIdToPluginId = new HashMap<String, IPluginContribution>();
+ providerIdToPluginId = new HashMap<>();
loadRepositoryProviderIds();
// crawl the initial projects
@@ -142,7 +142,7 @@ public class TeamCapabilityHelper {
return;
IActivityManager activityManager = workbenchActivitySupport
.getActivityManager();
- Set activities = new HashSet<>(activityManager.getEnabledActivityIds());
+ Set<String> activities = new HashSet<>(activityManager.getEnabledActivityIds());
boolean changed = false;
IPluginContribution contribution = providerIdToPluginId.get(id);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
index 978e134ec..f783ad069 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
@@ -19,7 +19,6 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -82,13 +81,13 @@ public class TeamUIPlugin extends AbstractUIPlugin {
public static final String TRIGGER_POINT_ID = "org.eclipse.team.ui.activityTriggerPoint"; //$NON-NLS-1$
- private static List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<IPropertyChangeListener>(5);
+ private static List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<>(5);
- private Hashtable<String, ImageDescriptor> imageDescriptors = new Hashtable<String, ImageDescriptor>(20);
+ private Hashtable<String, ImageDescriptor> imageDescriptors = new Hashtable<>(20);
private WorkspaceTeamStateProvider provider;
- private Map<String, TeamStateProvider> decoratedStateProviders = new HashMap<String, TeamStateProvider>();
+ private Map<String, TeamStateProvider> decoratedStateProviders = new HashMap<>();
// manages synchronize participants
private SynchronizeManager synchronizeManager;
@@ -152,7 +151,7 @@ public class TeamUIPlugin extends AbstractUIPlugin {
* @return the active workbench page
*/
public static IWorkbenchPage getActivePage() {
- IWorkbenchWindow window = getPlugin().getWorkbench().getActiveWorkbenchWindow();
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) return null;
return window.getActivePage();
}
@@ -258,8 +257,8 @@ public class TeamUIPlugin extends AbstractUIPlugin {
if (provider != null) {
provider.dispose();
}
- for (Iterator<TeamStateProvider> iter = decoratedStateProviders.values().iterator(); iter.hasNext();) {
- SubscriberTeamStateProvider sdsp = (SubscriberTeamStateProvider) iter.next();
+ for (TeamStateProvider teamStateProvider : decoratedStateProviders.values()) {
+ SubscriberTeamStateProvider sdsp = (SubscriberTeamStateProvider) teamStateProvider;
sdsp.dispose();
}
}
@@ -285,8 +284,7 @@ public class TeamUIPlugin extends AbstractUIPlugin {
* @param event the property change event object
*/
public static void broadcastPropertyChange(PropertyChangeEvent event) {
- for (Iterator<IPropertyChangeListener> it = propertyChangeListeners.iterator(); it.hasNext();) {
- IPropertyChangeListener listener = it.next();
+ for (IPropertyChangeListener listener : propertyChangeListeners) {
listener.propertyChange(event);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
index 7ea7072ce..2c4ceb2b2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
@@ -21,7 +21,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
@@ -311,7 +310,7 @@ public class Utils {
if (!shell.isDisposed())
return shell;
}
- IWorkbench workbench = TeamUIPlugin.getPlugin().getWorkbench();
+ IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench != null) {
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
if (window != null) {
@@ -708,8 +707,7 @@ public class Utils {
* descendants match the given filter
*/
public static boolean hasMatchingDescendant(IStructuredSelection selection, FastSyncInfoFilter filter) {
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
- Object o = iter.next();
+ for (Object o : selection) {
if (o instanceof ISynchronizeModelElement) {
if (hasMatchingDescendant((ISynchronizeModelElement)o, filter)) {
return true;
@@ -844,7 +842,7 @@ public class Utils {
int subStrLen = (maxWidth - ellipsis.length()) / 2;
int addtl = (maxWidth - ellipsis.length()) % 2;
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder(maxWidth);
sb.append(textValue.substring(0, subStrLen));
sb.append(ellipsis);
sb.append(textValue.substring(length - subStrLen - addtl));
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareAction.java
index 2cdc74a6c..c63db3767 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareAction.java
@@ -115,7 +115,7 @@ public class CompareAction extends TeamAction {
// see
// org.eclipse.compare.internal.ResourceCompareInput.SelectAncestorDialog
- private class SelectAncestorDialog extends MessageDialog {
+ private static class SelectAncestorDialog extends MessageDialog {
private IResource[] theResources;
IResource ancestorResource;
IResource leftResource;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenWithMenu.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenWithMenu.java
index 8e0a1efa2..77773c264 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenWithMenu.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenWithMenu.java
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.actions;
+import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -53,8 +54,6 @@ import org.eclipse.ui.statushandlers.IStatusAdapterConstants;
import org.eclipse.ui.statushandlers.StatusAdapter;
import org.eclipse.ui.statushandlers.StatusManager;
-import com.ibm.icu.text.Collator;
-
/**
* A menu for opening file revisions in the workbench.
* <p>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
index b7e6d1513..12f99ce0e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
@@ -63,6 +63,7 @@ import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.ide.ResourceUtil;
@@ -100,7 +101,11 @@ public abstract class TeamAction extends AbstractHandler implements IObjectActio
@Override
public void partClosed(IWorkbenchPartReference partRef) {
- if (targetPart == partRef.getPart(false)) {
+ if(targetPart == null) {
+ return;
+ }
+ IWorkbenchPart part = partRef.getPart(false);
+ if (targetPart == part) {
targetPart = null;
}
}
@@ -277,7 +282,7 @@ public abstract class TeamAction extends AbstractHandler implements IObjectActio
} else if (window != null) {
return window.getShell();
} else {
- IWorkbench workbench = TeamUIPlugin.getPlugin().getWorkbench();
+ IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench == null) return null;
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
if (window == null) return null;
@@ -425,8 +430,17 @@ public abstract class TeamAction extends AbstractHandler implements IObjectActio
* @return IWorkbenchPage
*/
protected IWorkbenchPage getTargetPage() {
- if (getTargetPart() == null) return TeamUIPlugin.getActivePage();
- return getTargetPart().getSite().getPage();
+ IWorkbenchPart target = getTargetPart();
+ if (target == null) {
+ return TeamUIPlugin.getActivePage();
+ }
+ IWorkbenchPage page = target.getSite().getPage();
+ if(page == null) {
+ // part was disposed => null targetPart to avoid memory leak
+ targetPart = null;
+ return TeamUIPlugin.getActivePage();
+ }
+ return page;
}
/**
@@ -466,7 +480,6 @@ public abstract class TeamAction extends AbstractHandler implements IObjectActio
@Override
public void dispose() {
- super.dispose();
if(window != null) {
window.getSelectionService().removePostSelectionListener(selectionListener);
if (window.getActivePage() != null) {
@@ -479,6 +492,7 @@ public abstract class TeamAction extends AbstractHandler implements IObjectActio
window = null;
targetPart = null;
shell = null;
+ super.dispose();
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java
index 24ec1f7fe..d4d619581 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.dialogs;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.dialogs.Dialog;
@@ -44,7 +43,7 @@ public abstract class DialogArea {
* Create a dialog area
*/
protected DialogArea() {
- this.listeners = new ArrayList<IPropertyChangeListener>();
+ this.listeners = new ArrayList<>();
}
/**
@@ -69,8 +68,7 @@ public abstract class DialogArea {
protected void firePropertyChangeChange(String property, Object oldValue, Object newValue) {
PropertyChangeEvent event = new PropertyChangeEvent(this, property, oldValue, newValue);
- for (Iterator<IPropertyChangeListener> iter = listeners.iterator(); iter.hasNext();) {
- IPropertyChangeListener listener = iter.next();
+ for (IPropertyChangeListener listener : listeners) {
listener.propertyChange(event);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
index 1303f383e..842213897 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
@@ -75,7 +75,7 @@ public class PreferencePageContainerDialog extends TrayDialog
private Button fOkButton;
- private ListenerList<IPageChangedListener> pageChangedListeners = new ListenerList<IPageChangedListener>();
+ private ListenerList<IPageChangedListener> pageChangedListeners = new ListenerList<>();
/**
* The Composite in which a page is shown.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PromptingDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PromptingDialog.java
index 4b08473c5..f52f40054 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PromptingDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PromptingDialog.java
@@ -17,7 +17,6 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.widgets.Shell;
/**
@@ -41,12 +40,7 @@ public class PromptingDialog extends MultipleYesNoPrompter {
}
public PromptingDialog(final Shell shell, IResource[] resources, IPromptCondition condition, String title, boolean allOrNothing) {
- super(new IShellProvider() {
- @Override
- public Shell getShell() {
- return shell;
- }
- }, title, resources.length > 1, allOrNothing);
+ super(() -> shell, title, resources.length > 1, allOrNothing);
this.resources = resources;
this.condition = condition;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea.java
index 361c256c0..c7f1839c5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea.java
@@ -177,7 +177,7 @@ public class ResourceMappingResourceDisplayArea extends DialogArea {
try {
if (resource.getType() != IResource.FILE) {
IResource[] members = members(((IContainer)resource));
- List<ResourceTraversalElement> result = new ArrayList<ResourceTraversalElement>();
+ List<ResourceTraversalElement> result = new ArrayList<>();
for (IResource child : members) {
if ((includeFolders || child.getType() == IResource.FILE)
&& isIncludedInFilter(child, traversal))
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/DateHistoryCategory.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/DateHistoryCategory.java
index e855d0647..05ff480cc 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/DateHistoryCategory.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/DateHistoryCategory.java
@@ -14,11 +14,10 @@
package org.eclipse.team.internal.ui.history;
import java.util.ArrayList;
+import java.util.Calendar;
import org.eclipse.team.core.history.IFileRevision;
-import com.ibm.icu.util.Calendar;
-
public class DateHistoryCategory extends AbstractHistoryCategory {
private String name;
private Calendar fromDate;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java
index 56722d06f..60dd19d61 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.history;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -63,7 +62,7 @@ public class EditionHistoryPage extends LocalHistoryPage {
private LocalResourceTypedElement localFileElement;
private IStructureCreator structureCreator;
- private Map<IFileRevision, ITypedElement> editions = new HashMap<IFileRevision, ITypedElement>();
+ private Map<IFileRevision, ITypedElement> editions = new HashMap<>();
private ITypedElement localEdition;
private String name;
@@ -241,7 +240,7 @@ public class EditionHistoryPage extends LocalHistoryPage {
private IFileRevision[] filterRevisions(ITypedElement localEdition, IFileRevision[] revisions,
IProgressMonitor monitor) {
ITypedElement previousEdition = localEdition;
- List<IFileRevision> result = new ArrayList<IFileRevision>();
+ List<IFileRevision> result = new ArrayList<>();
sortDescending(revisions);
editions.clear();
for (IFileRevision revision : revisions) {
@@ -379,8 +378,7 @@ public class EditionHistoryPage extends LocalHistoryPage {
private Object getRevisionFor(Object object) {
if (object == localEdition)
return localFileElement;
- for (Iterator<IFileRevision> iterator = editions.keySet().iterator(); iterator.hasNext();) {
- IFileRevision revision = iterator.next();
+ for (IFileRevision revision : editions.keySet()) {
if (editions.get(revision) == object) {
return revision;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java
index f44a392f5..0530d865e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java
@@ -15,6 +15,7 @@ package org.eclipse.team.internal.ui.history;
import java.io.InputStream;
import java.net.URI;
+import java.text.DateFormat;
import java.util.Date;
import org.eclipse.core.resources.IEncodedStorage;
@@ -34,8 +35,6 @@ import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.model.IWorkbenchAdapter;
-import com.ibm.icu.text.DateFormat;
-
public class FileRevisionEditorInput extends PlatformObject implements IWorkbenchAdapter, IStorageEditorInput {
private final Object fileRevision;
private final IStorage storage;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionTypedElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionTypedElement.java
index df6a3db50..82a29407e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionTypedElement.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionTypedElement.java
@@ -14,6 +14,7 @@
package org.eclipse.team.internal.ui.history;
import java.net.URI;
+import java.text.DateFormat;
import java.util.Date;
import org.eclipse.compare.ITypedElement;
@@ -25,8 +26,6 @@ import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.internal.ui.StorageTypedElement;
import org.eclipse.ui.IEditorInput;
-import com.ibm.icu.text.DateFormat;
-
/**
* An {@link ITypedElement} wrapper for {@link IFileRevision} for use with the
* Compare framework.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryTableProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryTableProvider.java
index 29874301a..6fc6302c0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryTableProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryTableProvider.java
@@ -14,6 +14,7 @@
package org.eclipse.team.internal.ui.history;
+import java.text.DateFormat;
import java.util.Date;
import org.eclipse.core.resources.IFile;
@@ -46,8 +47,6 @@ import org.eclipse.team.core.history.IFileHistory;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.internal.ui.TeamUIMessages;
-import com.ibm.icu.text.DateFormat;
-
public class GenericHistoryTableProvider {
private IFileHistory currentFileHistory;
private IFile currentFile;
@@ -167,9 +166,8 @@ public class GenericHistoryTableProvider {
if (e1 == null || e2 == null) {
result = super.compare(viewer, o1, o2);
} else {
- int[] columnSortOrder = SORT_ORDERS_BY_COLUMN[columnNumber];
- for (int i = 0; i < columnSortOrder.length; ++i) {
- result = compareColumnValue(columnSortOrder[i], e1, e2);
+ for (int columnSortOrder : SORT_ORDERS_BY_COLUMN[columnNumber]) {
+ result = compareColumnValue(columnSortOrder, e1, e2);
if (result != 0)
break;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java
index e6d3b622a..09234355f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java
@@ -14,6 +14,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.history;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -74,9 +75,6 @@ import org.eclipse.ui.part.PluginTransfer;
import org.eclipse.ui.part.ResourceTransfer;
import org.eclipse.ui.part.ShowInContext;
-import com.ibm.icu.text.SimpleDateFormat;
-
-
public class GenericHistoryView extends PageBookView implements IHistoryView, IPropertyChangeListener, IShowInTarget {
private static final String HISTORY_VIEW_GROUP = "org.eclipse.team.ui.historyView"; //$NON-NLS-1$
private static final String NAVIGATION_GROUP = "org.eclipse.team.ui.navigation"; //$NON-NLS-1$
@@ -218,7 +216,7 @@ public class GenericHistoryView extends PageBookView implements IHistoryView, IP
}
}
- abstract class MenuCreator implements IMenuCreator {
+ abstract static class MenuCreator implements IMenuCreator {
private MenuManager menuManager;
@Override
@@ -284,7 +282,7 @@ public class GenericHistoryView extends PageBookView implements IHistoryView, IP
private IAction[] createActions() {
NavigationHistoryEntry[] entries = getDropDownEntries();
- List<NavigationHistoryEntryAction> actions = new ArrayList<NavigationHistoryEntryAction>();
+ List<NavigationHistoryEntryAction> actions = new ArrayList<>();
for (NavigationHistoryEntry navigationHistoryEntry : entries) {
actions.add(new NavigationHistoryEntryAction(navigationHistoryEntry));
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
index 24fcddc09..58e1c4953 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
@@ -15,7 +15,9 @@ package org.eclipse.team.internal.ui.history;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
@@ -93,9 +95,6 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.progress.IProgressConstants;
-import com.ibm.icu.text.SimpleDateFormat;
-import com.ibm.icu.util.Calendar;
-
public class LocalHistoryPage extends HistoryPage implements IHistoryCompareAdapter {
public static final int ON = 1;
public static final int OFF = 2;
@@ -132,7 +131,7 @@ public class LocalHistoryPage extends HistoryPage implements IHistoryCompareAdap
private IFileRevision currentSelection;
- private final class LocalHistoryContentProvider implements ITreeContentProvider {
+ private static final class LocalHistoryContentProvider implements ITreeContentProvider {
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof IFileHistory) {
@@ -497,7 +496,7 @@ public class LocalHistoryPage extends HistoryPage implements IHistoryCompareAdap
//Contribute actions to popup menu
MenuManager menuMgr = new MenuManager();
Menu menu = menuMgr.createContextMenu(treeViewer.getTree());
- menuMgr.addMenuListener(menuMgr1 -> fillTableMenu(menuMgr1));
+ menuMgr.addMenuListener(this::fillTableMenu);
menuMgr.setRemoveAllWhenShown(true);
treeViewer.getTree().setMenu(menu);
@@ -878,7 +877,7 @@ public class LocalHistoryPage extends HistoryPage implements IHistoryCompareAdap
//Everything before after week is previous
tempCategories[3] = new DateHistoryCategory(TeamUIMessages.HistoryPage_Previous, null, monthCal);
- ArrayList<AbstractHistoryCategory> finalCategories = new ArrayList<AbstractHistoryCategory>();
+ ArrayList<AbstractHistoryCategory> finalCategories = new ArrayList<>();
for (DateHistoryCategory tempCategory : tempCategories) {
tempCategory.collectFileRevisions(revisions, false);
if (tempCategory.hasRevisions()) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java
index 04931882e..713f85d71 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.history;
+import java.text.DateFormat;
import java.util.Date;
import org.eclipse.compare.IModificationDate;
@@ -50,8 +51,6 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.themes.ITheme;
-import com.ibm.icu.text.DateFormat;
-
public class LocalHistoryTableProvider {
/* private */ static final int COL_DATE = 0;
@@ -208,9 +207,8 @@ public class LocalHistoryTableProvider {
if (date1 == -1 || date2 == -1) {
result = super.compare(compareViewer, o1, o2);
} else {
- int[] columnSortOrder = SORT_ORDERS_BY_COLUMN[columnNumber];
- for (int i = 0; i < columnSortOrder.length; ++i) {
- result = compareColumnValue(columnSortOrder[i], date1, date2);
+ for (int columnSortOrder : SORT_ORDERS_BY_COLUMN[columnNumber]) {
+ result = compareColumnValue(columnSortOrder, date1, date2);
if (result != 0)
break;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java
index 60101a8ae..88eea79ec 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java
@@ -27,6 +27,7 @@ import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorRegistry;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
public class OpenLocalFileAction extends BaseSelectionListenerAction {
@@ -61,7 +62,7 @@ public class OpenLocalFileAction extends BaseSelectionListenerAction {
}
/* private */String getEditorID(String fileName, InputStream contents) {
- IWorkbench workbench = TeamUIPlugin.getPlugin().getWorkbench();
+ IWorkbench workbench = PlatformUI.getWorkbench();
IEditorRegistry registry = workbench.getEditorRegistry();
IContentType type = null;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/AbstractCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/AbstractCompareInput.java
index 400e3a6b6..bf4e84167 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/AbstractCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/AbstractCompareInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -32,7 +32,7 @@ public abstract class AbstractCompareInput implements ICompareInput {
private ITypedElement left;
private ITypedElement right;
private int kind;
- private final ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
+ private final ListenerList<ICompareInputChangeListener> listeners = new ListenerList<>(ListenerList.IDENTITY);
public AbstractCompareInput(int kind,
ITypedElement ancestor,
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CompareInputChangeNotifier.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CompareInputChangeNotifier.java
index db7fc0229..7029c72ce 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CompareInputChangeNotifier.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CompareInputChangeNotifier.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2017 IBM Corporation and others.
+ * Copyright (c) 2006, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -57,7 +57,7 @@ public abstract class CompareInputChangeNotifier implements
private Map<ICompareInput, CompareInputConnecton> inputs = new HashMap<>();
private InputChangeEventHandler eventHandler;
- private class CompareInputConnecton {
+ private static class CompareInputConnecton {
private int connections;
public void increment() {
connections++;
@@ -89,7 +89,7 @@ public abstract class CompareInputChangeNotifier implements
private class InputChangeEventHandler extends BackgroundEventHandler {
private final Set<ICompareInput> changedInputs = new HashSet<>();
- private final List pendingRunnables = new ArrayList();
+ private final List<Event> pendingRunnables = new ArrayList<>();
protected InputChangeEventHandler() {
super(TeamUIMessages.CompareInputChangeNotifier_0, TeamUIMessages.CompareInputChangeNotifier_1);
@@ -105,7 +105,7 @@ public abstract class CompareInputChangeNotifier implements
if (changedInputs.isEmpty() && pendingRunnables.isEmpty())
return false;
toDispatch = changedInputs.toArray(new ICompareInput[changedInputs.size()]);
- events = (RunnableEvent[]) pendingRunnables.toArray(new RunnableEvent[pendingRunnables.size()]);
+ events = pendingRunnables.toArray(new RunnableEvent[pendingRunnables.size()]);
changedInputs.clear();
pendingRunnables.clear();
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/FuzzFactorDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/FuzzFactorDialog.java
index 8859663e0..9133bc5a7 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/FuzzFactorDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/FuzzFactorDialog.java
@@ -78,7 +78,7 @@ public class FuzzFactorDialog extends Dialog {
valueText.addModifyListener(e -> validateInput());
fuzzFactor = patcher.getFuzz();
if (fuzzFactor >= 0)
- valueText.setText(Integer.valueOf(fuzzFactor).toString());
+ valueText.setText(Integer.toString(fuzzFactor));
Button guessButton = new Button(composite, SWT.NONE);
guessButton.setText(TeamUIMessages.FuzzFactorDialog_guess);
@@ -93,7 +93,7 @@ public class FuzzFactorDialog extends Dialog {
patcher.setFuzz(-1);
int fuzz = guessFuzzFactor();
if (fuzz >= 0) {
- String value = Integer.valueOf(fuzz).toString();
+ String value = Integer.toString(fuzz);
valueText.setText(value);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/IgnoreLeadingPathSegmentsAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/IgnoreLeadingPathSegmentsAction.java
index 7d9e4580c..b26d78766 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/IgnoreLeadingPathSegmentsAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/IgnoreLeadingPathSegmentsAction.java
@@ -56,7 +56,7 @@ public class IgnoreLeadingPathSegmentsAction extends Action {
InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(),
TeamUIMessages.IgnoreLeadingPathSegmentsDialog_title,
NLS.bind(TeamUIMessages.IgnoreLeadingPathSegmentsDialog_message, Integer.valueOf(maxValue)),
- Integer.valueOf(oldValue).toString(), input -> {
+ Integer.toString(oldValue), input -> {
try {
int i = Integer.parseInt(input);
if (i < 0 || i > maxValue)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelCompareEditorInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelCompareEditorInput.java
index c857fb7db..a3e90b8f2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelCompareEditorInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelCompareEditorInput.java
@@ -189,7 +189,7 @@ public class ModelCompareEditorInput extends SaveableCompareEditorInput implemen
super.registerContextMenu(menu, provider);
Saveable saveable = getSaveable();
if (saveable instanceof LocalResourceSaveableComparison) {
- menu.addMenuListener(manager -> handleMenuAboutToShow(manager));
+ menu.addMenuListener(this::handleMenuAboutToShow);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java
index 55e3a64eb..f663816c6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2017 IBM Corporation and others.
+ * Copyright (c) 2006, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.mapping;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IResource;
@@ -166,7 +165,7 @@ public class ModelElementSelectionPage extends GlobalRefreshElementSelectionPage
@Override
protected boolean checkWorkingSetElements() {
- List allWorkingSetElements = new ArrayList();
+ List<Object> allWorkingSetElements = new ArrayList<>();
IWorkingSet[] workingSets = getWorkingSets();
for (IWorkingSet set : workingSets) {
allWorkingSetElements.addAll(computeSelectedResources(new StructuredSelection(set.getElements())));
@@ -175,10 +174,9 @@ public class ModelElementSelectionPage extends GlobalRefreshElementSelectionPage
return !allWorkingSetElements.isEmpty();
}
- private Collection computeSelectedResources(StructuredSelection selection) {
- List result = new ArrayList();
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
- Object element = iter.next();
+ private Collection<Object> computeSelectedResources(StructuredSelection selection) {
+ List<Object> result = new ArrayList<>();
+ for (Object element : selection) {
ResourceMapping mapping = Utils.getResourceMapping(element);
if (mapping != null && scopeContainsMapping(mapping)) {
result.add(element);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelEnablementPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelEnablementPreferencePage.java
index 99697694f..0a9662dc3 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelEnablementPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelEnablementPreferencePage.java
@@ -17,7 +17,6 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -104,7 +103,7 @@ public class ModelEnablementPreferencePage extends PreferencePage implements IWo
private String getTextFor(ITeamContentProviderDescriptor teamContentDescriptor) {
String name = teamContentDescriptor.getName();
- if (name != null && !name.equals("")) //$NON-NLS-1$
+ if (name != null && !name.isEmpty())
return name;
String modelProviderID = teamContentDescriptor.getModelProviderId();
@@ -134,8 +133,8 @@ public class ModelEnablementPreferencePage extends PreferencePage implements IWo
}
@Override
public void dispose() {
- for (Iterator iter = images.values().iterator(); iter.hasNext();) {
- Image image = (Image) iter.next();
+ for (Object element : images.values()) {
+ Image image = (Image) element;
image.dispose();
}
super.dispose();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java
index 1bac330f9..41ae3d3df 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java
@@ -15,7 +15,6 @@ package org.eclipse.team.internal.ui.mapping;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IResource;
@@ -115,8 +114,7 @@ public class RemoveFromViewAction extends ResourceModelParticipantAction {
// Only enable if the selected elements adapt to IResource
if (selection.isEmpty())
return false;
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
- Object element = iter.next();
+ for (Object element : selection) {
if (Utils.getResource(element) == null) {
return false;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java
index 181852bd0..67bb7d2af 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java
@@ -14,7 +14,6 @@
******************************************************************************/
package org.eclipse.team.internal.ui.mapping;
-import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -82,8 +81,7 @@ public class ResourceDragAdapterAssistant extends CommonDragAdapterAssistant {
if (actualLength < length) {
String[] tempFileNames = fileNames;
fileNames = new String[actualLength];
- for (int i = 0; i < actualLength; i++)
- fileNames[i] = tempFileNames[i];
+ System.arraycopy(tempFileNames, 0, fileNames, 0, actualLength);
}
anEvent.data = fileNames;
@@ -101,8 +99,7 @@ public class ResourceDragAdapterAssistant extends CommonDragAdapterAssistant {
private IResource[] getSelectedResources(IStructuredSelection aSelection) {
Set<IResource> resources = new LinkedHashSet<>();
IResource resource = null;
- for (Iterator iter = aSelection.iterator(); iter.hasNext();) {
- Object selected = iter.next();
+ for (Object selected : aSelection) {
resource = adaptToResource(selected);
if (resource != null) {
resources.add(resource);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMarkAsMergedHandler.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMarkAsMergedHandler.java
index 499292554..5359ffe2a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMarkAsMergedHandler.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMarkAsMergedHandler.java
@@ -101,7 +101,7 @@ public class ResourceMarkAsMergedHandler extends ResourceMergeActionHandler {
IDiff[] diffs = getTargetDiffs();
if (diffs.length == 1)
return TeamUIMessages.ResourceMarkAsMergedHandler_0;
- return NLS.bind(TeamUIMessages.ResourceMarkAsMergedHandler_1, Integer.valueOf(diffs.length).toString());
+ return NLS.bind(TeamUIMessages.ResourceMarkAsMergedHandler_1, Integer.toString(diffs.length));
}
};
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMergeHandler.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMergeHandler.java
index 9c2e1272f..abebccc2e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMergeHandler.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceMergeHandler.java
@@ -88,12 +88,12 @@ public class ResourceMergeHandler extends ResourceMergeActionHandler {
if (overwrite) {
if (diffs.length == 1)
return TeamUIMessages.ResourceMergeHandler_0;
- return NLS.bind(TeamUIMessages.ResourceMergeHandler_1, Integer.valueOf(diffs.length).toString());
+ return NLS.bind(TeamUIMessages.ResourceMergeHandler_1, Integer.toString(diffs.length));
}
if (diffs.length == 1)
return TeamUIMessages.ResourceMergeHandler_2;
- return NLS.bind(TeamUIMessages.ResourceMergeHandler_3, Integer.valueOf(diffs.length).toString());
+ return NLS.bind(TeamUIMessages.ResourceMergeHandler_3, Integer.toString(diffs.length));
}
};
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java
index a64b04009..99cbff4ab 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.mapping;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -451,8 +450,7 @@ public class ResourceModelContentProvider extends SynchronizationContentProvider
if (!removals.isEmpty())
viewer.remove(viewer.getInput(), removals.toArray());
if (!refreshes.isEmpty()) {
- for (Iterator iter = refreshes.iterator(); iter.hasNext();) {
- Object element = iter.next();
+ for (Object element : refreshes) {
viewer.refresh(element);
}
}
@@ -560,9 +558,8 @@ public class ResourceModelContentProvider extends SynchronizationContentProvider
result.add(resource);
} else {
// We need to check the list of displayed resources to see if one matches the given path
- for (Iterator iterator = existingResources.iterator(); iterator
- .hasNext();) {
- resource = (IResource) iterator.next();
+ for (Object element : existingResources) {
+ resource = (IResource) element;
if (resource.getFullPath().equals(path)) {
result.add(resource);
break;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java
index ab8a0989c..7dddda2a0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java
@@ -94,6 +94,7 @@ public class ResourceModelLabelProvider extends
return provider ;
}
+ @Override
protected IDiff getDiff(Object elementOrPath) {
IResource resource = getResource(elementOrPath);
IResourceDiffTree tree = getDiffTree(elementOrPath);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java
index 2f503e029..085af140c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.mapping;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.resources.IResource;
@@ -60,8 +59,7 @@ public abstract class ResourceModelParticipantAction extends ModelParticipantAct
traversal.addTraversals(traversals);
}
} else {
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
- Object element = iter.next();
+ for (Object element : selection) {
ResourceTraversal[] traversals = getTraversals(element, Policy.subMonitorFor(monitor, 100));
traversal.addTraversals(traversals);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index 29cb8203c..a41a4808a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -189,12 +189,12 @@ StatisticsPanel_numbersTooltip=The number of ''{0}'' changes in the entire works
StatisticsPanel_numberTotalSingular={0} change
StatisticsPanel_numberTotalPlural={0} changes
-SyncViewerPreferencePage_0=Choose the presentation to be used when displaying Workspace projects
+SyncViewerPreferencePage_0=Choose the presentation to be used when displaying workspace projects
SyncViewerPreferencePage_1=&Flat
SyncViewerPreferencePage_2=T&ree
SyncViewerPreferencePage_3=&Compressed Folders
SyncViewerPreferencePage_6=&Team
-SyncViewerPreferencePage_7=General Team Preferences:
+SyncViewerPreferencePage_7=General Version Control Preferences:
SyncViewerPreferencePage_13=Open the associated perspective when a synchronize operation completes
SyncViewerPreferencePage_14=Al&ways
SyncViewerPreferencePage_15=Perspectives
@@ -204,8 +204,8 @@ SyncViewerPreferencePage_42=&Never
SyncViewerPreferencePage_43=Show the &file author in compare editors
SyncViewerPreferencePage_44=When &editing file in non-shared projects, automatically make files writable if prompting is not possible
SyncViewerPreferencePage_45=Re&use open compare editors when opening comparisons
-SyncViewerPreferencePage_46=Run Project Set import in the &background
-SyncViewerPreferencePage_47=&Apply patch in Synchronize view
+SyncViewerPreferencePage_46=Run 'Project Set' import in the &background
+SyncViewerPreferencePage_47=&Apply patch in 'Synchronize' view
PreferencePageContainerDialog_6=Synchronize Preferences
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/FileTypeTable.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/FileTypeTable.java
index dec006fa7..c91dad7fe 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/FileTypeTable.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/FileTypeTable.java
@@ -31,6 +31,7 @@ import org.eclipse.osgi.util.TextProcessor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
@@ -114,8 +115,10 @@ public class FileTypeTable implements ICellModifier, IStructuredContentProvider,
/**
* Create a table.
*/
- final Table table = new Table(composite, SWT.V_SCROLL | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
- table.setLayoutData(SWTUtils.createHVFillGridData());
+ final Table table = new Table(composite, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+ var gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.heightHint = 300;
+ table.setLayoutData(gd);
table.setLinesVisible(true);
table.setHeaderVisible(true);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java
index 25540e020..06db65da9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java
@@ -158,7 +158,7 @@ public class IgnorePreferencePage extends PreferencePage implements IWorkbenchPr
dialog.open();
if (dialog.getReturnCode() != Window.OK) return;
String pattern = dialog.getValue();
- if (pattern.equals("")) return; //$NON-NLS-1$
+ if (pattern.isEmpty()) return;
// Check if the item already exists
TableItem[] items = ignoreTable.getItems();
for (TableItem item : items) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
index 71d3d5ac7..3613a47c6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.preferences;
+import java.text.Collator;
import java.util.Arrays;
import java.util.Comparator;
@@ -40,8 +41,6 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
-import com.ibm.icu.text.Collator;
-
/**
* This preference page allows to configure various aspects of the Synchronize View.
*/
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
index 40bab1aa1..10458adb7 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
@@ -19,7 +19,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -33,6 +32,7 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.team.core.IFileContentManager;
import org.eclipse.team.core.IStringMapping;
import org.eclipse.team.core.Team;
@@ -190,12 +190,13 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
fRemoveButton= new Button(buttonsComposite, SWT.PUSH);
fRemoveButton.setText(TeamUIMessages.TextPreferencePage_remove);
- SWTUtils.createLabel(composite, TeamUIMessages.TextPreferencePage_1, 2);
+ final var label = new Label(composite, SWT.WRAP);
+ label.setText(TeamUIMessages.TextPreferencePage_1);
+ label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1));
/**
* Calculate and set the button size
*/
- applyDialogFont(composite);
final int buttonWidth= SWTUtils.calculateControlSize(converter, new Button [] { addExtensionButton, addNameButton, fChangeButton, fRemoveButton });
addExtensionButton.setLayoutData(SWTUtils.createGridData(buttonWidth, SWT.DEFAULT, SWT.FILL, SWT.FILL, false, false));
addNameButton.setLayoutData(SWTUtils.createGridData(buttonWidth, SWT.DEFAULT, SWT.FILL, SWT.FILL, false, false));
@@ -211,8 +212,6 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
fRemoveButton.setEnabled(false);
fRemoveButton.addListener(SWT.Selection, e -> removePattern());
- Dialog.applyDialogFont(parent);
-
// set F1 help
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.FILE_TYPE_PREFERENCE_PAGE);
@@ -240,8 +239,8 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
final ArrayList<String> namesList= new ArrayList<>();
final ArrayList<Integer> namesModesList= new ArrayList<>();
- for (final Iterator iter = fItems.iterator(); iter.hasNext();) {
- final FileTypeTable.Item item= (FileTypeTable.Item) iter.next();
+ for (Object element : fItems) {
+ final FileTypeTable.Item item= (FileTypeTable.Item) element;
if (item instanceof FileTypeTable.Extension) {
extensionsList.add(item.name);
@@ -269,8 +268,8 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
private static int [] integerListToIntArray(List integers) {
final int [] array= new int [integers.size()];
int index= 0;
- for (Iterator iter = integers.iterator(); iter.hasNext();)
- array[index++]= ((Integer)iter.next()).intValue();
+ for (Object element : integers)
+ array[index++]= ((Integer)element).intValue();
return array;
}
@@ -331,8 +330,8 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
if (selection == null)
return;
- for (final Iterator it = selection.iterator(); it.hasNext(); ) {
- final FileTypeTable.Item item= (FileTypeTable.Item)it.next();
+ for (Object element : selection) {
+ final FileTypeTable.Item item= (FileTypeTable.Item)element;
if (item.contributed)
continue;
fItems.remove(item);
@@ -348,8 +347,8 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
if (selection == null)
return;
- for (final Iterator it = selection.iterator(); it.hasNext(); ) {
- final FileTypeTable.Item item= (FileTypeTable.Item)it.next();
+ for (Object element : selection) {
+ final FileTypeTable.Item item= (FileTypeTable.Item)element;
item.mode= item.mode == Team.TEXT ? Team.BINARY : Team.TEXT;
fTable.getViewer().refresh(item);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
index 888303a47..ee5a4815a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
@@ -107,7 +107,7 @@ public class SynchronizeParticipantDescriptor implements ISynchronizeParticipant
if(persistentString == null) {
persistent = true;
} else {
- persistent = Boolean.valueOf(persistentString).booleanValue();
+ persistent = Boolean.parseBoolean(persistentString);
}
helpContextId = configElement.getAttribute(ATT_HELP_CONTEXT_ID);
// Sanity check.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java
index 61328c5af..83ac72b1c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java
@@ -79,8 +79,7 @@ public class TeamContentProviderDescriptor implements ITeamContentProviderDescri
String supportsFlatLayoutString = element
.getAttribute(ATT_SUPPORTS_FLAT_LAYOUT);
if (supportsFlatLayoutString != null) {
- supportsFlatLayout = Boolean.valueOf(
- supportsFlatLayoutString).booleanValue();
+ supportsFlatLayout = Boolean.parseBoolean(supportsFlatLayoutString);
}
contentProviderName = extension.getLabel();
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderManager.java
index 690f330a1..a5c262b74 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderManager.java
@@ -15,7 +15,6 @@ package org.eclipse.team.internal.ui.registry;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -81,10 +80,10 @@ public class TeamContentProviderManager implements ITeamContentProviderManager {
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(TeamUIPlugin.ID, PT_TEAM_CONTENT_PROVIDERS);
IExtension[] extensions = point.getExtensions();
descriptors = new HashMap<>(extensions.length * 2);
- for (int i = 0, imax = extensions.length; i < imax; i++) {
+ for (IExtension extension : extensions) {
ITeamContentProviderDescriptor desc = null;
try {
- desc = new TeamContentProviderDescriptor(extensions[i]);
+ desc = new TeamContentProviderDescriptor(extension);
} catch (CoreException e) {
TeamUIPlugin.log(e);
}
@@ -127,8 +126,8 @@ public class TeamContentProviderManager implements ITeamContentProviderManager {
@Override
public void setEnabledDescriptors(ITeamContentProviderDescriptor[] descriptors) {
List<ITeamContentProviderDescriptor> previouslyEnabled = new ArrayList<>();
- for (Iterator iter = this.descriptors.values().iterator(); iter.hasNext();) {
- TeamContentProviderDescriptor descriptor = (TeamContentProviderDescriptor) iter.next();
+ for (Object element : this.descriptors.values()) {
+ TeamContentProviderDescriptor descriptor = (TeamContentProviderDescriptor) element;
if (descriptor.isEnabled()) {
previouslyEnabled.add(descriptor);
descriptor.setEnabled(false);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamDecoratorManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamDecoratorManager.java
index cf123a754..2cf9b30f0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamDecoratorManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamDecoratorManager.java
@@ -53,10 +53,10 @@ public class TeamDecoratorManager {
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(TeamUIPlugin.ID, PT_TEAM_DECORATORS);
IExtension[] extensions = point.getExtensions();
descriptors = new HashMap<>(extensions.length * 2 + 1);
- for (int i = 0, imax = extensions.length; i < imax; i++) {
+ for (IExtension extension : extensions) {
TeamDecoratorDescription desc = null;
try {
- desc = new TeamDecoratorDescription(extensions[i]);
+ desc = new TeamDecoratorDescription(extension);
} catch (CoreException e) {
TeamUIPlugin.log(e);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
index 12d68ac5d..9eb6b6fa2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.synchronize;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -366,7 +365,7 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
// Only refresh the view if there is now background update in
// progress. If there is, the background update will refresh
if (!updateHandler.isPerformingBackgroundUpdate()) {
- Utils.asyncExec((Runnable) () -> refreshModelRoot(), getViewer());
+ Utils.asyncExec((Runnable) this::refreshModelRoot, getViewer());
}
}
}
@@ -515,8 +514,8 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
return new IResource[0];
IContainer container = ResourcesPlugin.getWorkspace().getRoot();
ArrayList<IResource> resources = new ArrayList<>();
- for (Iterator it = paths.iterator(); it.hasNext();) {
- String path = (String) it.next();
+ for (Object path2 : paths) {
+ String path = (String) path2;
IResource resource = getResourceForPath(container, path);
if (resource != null) {
resources.add(resource);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java
index 0528a8d41..4721bb42d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java
@@ -245,7 +245,7 @@ public abstract class AbstractSynchronizePage extends Page implements ISynchroni
};
}
if (key == IShowInTargetList.class) {
- return (T) (IShowInTargetList) () -> new String[] { IPageLayout.ID_RES_NAV };
+ return (T) (IShowInTargetList) () -> new String[] { IPageLayout.ID_PROJECT_EXPLORER };
}
return null;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector.java
index aed41a072..7b77db39a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.synchronize;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -234,8 +233,8 @@ public class ActiveChangeSetCollector implements IDiffChangeListener {
* @param resources the resources to be removed
*/
protected void remove(IResource[] resources) {
- for (Iterator iter = activeSets.values().iterator(); iter.hasNext();) {
- SyncInfoSet set = (SyncInfoSet) iter.next();
+ for (Object element : activeSets.values()) {
+ SyncInfoSet set = (SyncInfoSet) element;
set.removeAll(resources);
}
rootSet.removeAll(resources);
@@ -412,8 +411,8 @@ public class ActiveChangeSetCollector implements IDiffChangeListener {
}
private ChangeSet getChangeSet(IDiffTree tree) {
- for (Iterator iter = activeSets.keySet().iterator(); iter.hasNext();) {
- ChangeSet changeSet = (ChangeSet) iter.next();
+ for (Object element : activeSets.keySet()) {
+ ChangeSet changeSet = (ChangeSet) element;
if (((DiffChangeSet)changeSet).getDiffTree() == tree) {
return changeSet;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java
index 768f6df1e..c926c6058 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java
@@ -17,7 +17,6 @@ package org.eclipse.team.internal.ui.synchronize;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -173,8 +172,8 @@ public class CompressedFoldersModelProvider extends HierarchicalModelProvider {
}
}
}
- for (Iterator iter = resourcesToShow.iterator(); iter.hasNext();) {
- IResource resource = (IResource) iter.next();
+ for (Object element : resourcesToShow) {
+ IResource resource = (IResource) element;
result.add(createModelObject(parent, resource));
}
@@ -260,7 +259,7 @@ public class CompressedFoldersModelProvider extends HierarchicalModelProvider {
}
IResource[] resources = event.getRemovedResources();
- List<IResource> resourcesToRemove = new ArrayList<IResource>();
+ List<IResource> resourcesToRemove = new ArrayList<>();
List<SyncInfo> resourcesToAdd = new ArrayList<>();
for (IResource resource : resources) {
if (!removedProjects.contains(resource.getProject())) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java
index 99381f2d3..1fffb4b7e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java
@@ -39,12 +39,9 @@ public class ConfigureRefreshScheduleDialog extends DetailsDialog {
@Override
protected void createMainDialogArea(Composite parent) {
- IPageValidator validator = new IPageValidator() {
- @Override
- public void setComplete(String errorMessage) {
- setPageComplete(errorMessage == null);
- setErrorMessage(errorMessage);
- }
+ IPageValidator validator = errorMessage -> {
+ setPageComplete(errorMessage == null);
+ setErrorMessage(errorMessage);
};
scheduleComposite = new ConfigureSynchronizeScheduleComposite(parent, schedule, validator);
Dialog.applyDialogFont(parent);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java
index 8ae43d9cd..da1c052ca 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java
@@ -15,6 +15,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
+import java.util.Calendar;
import java.util.Date;
import org.eclipse.jface.dialogs.Dialog;
@@ -39,8 +40,6 @@ import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import com.ibm.icu.util.Calendar;
-
/**
* A composite that allows editing a subscriber refresh schedule. A validator can be used to allow
* containers to show page completion.
@@ -156,8 +155,8 @@ public class ConfigureSynchronizeScheduleComposite extends Composite {
String string = e.text;
char[] chars = new char[string.length()];
string.getChars(0, chars.length, chars, 0);
- for (int i = 0; i < chars.length; i++) {
- if (!('0' <= chars[i] && chars[i] <= '9')) {
+ for (char element : chars) {
+ if (!('0' <= element && element <= '9')) {
e.doit = false;
return;
}
@@ -165,7 +164,7 @@ public class ConfigureSynchronizeScheduleComposite extends Composite {
});
hoursOrMinutes = new Combo(area, SWT.READ_ONLY);
- hoursOrMinutes.setItems(new String[] { TeamUIMessages.ConfigureRefreshScheduleDialog_5, TeamUIMessages.ConfigureRefreshScheduleDialog_6 }); //
+ hoursOrMinutes.setItems(TeamUIMessages.ConfigureRefreshScheduleDialog_5, TeamUIMessages.ConfigureRefreshScheduleDialog_6); //
hoursOrMinutes.setLayoutData(new GridData());
final Label label = new Label(area, SWT.WRAP);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
index 01580ddd6..1acd5adf0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
@@ -245,11 +245,11 @@ public class FlatModelProvider extends SynchronizeModelProvider {
protected IDiffElement[] buildModelObjects(ISynchronizeModelElement node) {
if (node == getModelRoot());
SyncInfo[] infos = getSyncInfoSet().getSyncInfos();
- List result = new ArrayList();
+ List<IDiffElement> result = new ArrayList<>();
for (SyncInfo info : infos) {
result.add(createModelObject(node, info));
}
- return (IDiffElement[]) result.toArray(new IDiffElement[result.size()]);
+ return result.toArray(new IDiffElement[result.size()]);
}
@Override
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java
index 63719d1ab..f94339809 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java
@@ -33,12 +33,12 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.team.internal.ui.IHelpContextIds;
import org.eclipse.team.internal.ui.TeamUIMessages;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
+import org.osgi.framework.FrameworkUtil;
public abstract class GlobalRefreshElementSelectionPage extends WizardPage {
@@ -69,7 +69,7 @@ public abstract class GlobalRefreshElementSelectionPage extends WizardPage {
protected GlobalRefreshElementSelectionPage(String pageName) {
super(pageName);
- IDialogSettings s = TeamUIPlugin.getPlugin().getDialogSettings();
+ IDialogSettings s = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(GlobalRefreshElementSelectionPage.class)).getDialogSettings();
this.settings = s.getSection(STORE_SECTION);
if(settings == null) {
settings = s.addNewSection(STORE_SECTION);
@@ -245,7 +245,7 @@ public abstract class GlobalRefreshElementSelectionPage extends WizardPage {
*/
public Object[] getRootElement() {
TreeItem[] item = fViewer.getTree().getItems();
- List checked = new ArrayList();
+ List<Object> checked = new ArrayList<>();
for (TreeItem child : item) {
collectCheckedItems(child, checked);
}
@@ -254,7 +254,7 @@ public abstract class GlobalRefreshElementSelectionPage extends WizardPage {
protected void initializeScopingHint() {
String working_sets = settings.get(STORE_WORKING_SETS);
- if (working_sets == null || working_sets.equals("")) { //$NON-NLS-1$
+ if (working_sets == null || working_sets.isEmpty()) {
participantScope.setSelection(true);
updateParticipantScope();
} else {
@@ -262,7 +262,7 @@ public abstract class GlobalRefreshElementSelectionPage extends WizardPage {
ArrayList<IWorkingSet> ws = new ArrayList<>();
while (st.hasMoreTokens()) {
String workingSetName = st.nextToken();
- if (workingSetName != null && workingSetName.equals("") == false) { //$NON-NLS-1$
+ if (workingSetName != null && !workingSetName.isEmpty()) {
IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
IWorkingSet workingSet = workingSetManager.getWorkingSet(workingSetName);
if (workingSet != null) {
@@ -341,7 +341,7 @@ public abstract class GlobalRefreshElementSelectionPage extends WizardPage {
protected abstract boolean checkWorkingSetElements();
- private void collectCheckedItems(TreeItem item, List checked) {
+ private void collectCheckedItems(TreeItem item, List<Object> checked) {
if(item.getChecked() && !item.getGrayed()) {
checked.add(item.getData());
} else if(item.getGrayed()) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java
index 0750c74cb..390ad1f79 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java
@@ -59,7 +59,7 @@ public class GlobalRefreshResourceSelectionPage extends GlobalRefreshElementSele
@Override
public Object[] getChildren(Object element) {
if(element instanceof List) {
- return ((List)element).toArray(new IResource[((List)element).size()]);
+ return ((List<?>)element).toArray(new IResource[((List)element).size()]);
}
return super.getChildren(element);
}
@@ -123,7 +123,7 @@ public class GlobalRefreshResourceSelectionPage extends GlobalRefreshElementSele
@Override
protected boolean checkWorkingSetElements() {
- List allWorkingSetResources = new ArrayList();
+ List<IResource> allWorkingSetResources = new ArrayList<>();
IWorkingSet[] workingSets = getWorkingSets();
for (IWorkingSet set : workingSets) {
allWorkingSetResources.addAll(IDE.computeSelectedResources(new StructuredSelection(set.getElements())));
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java
index cf3d4c1d8..8846b315d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java
@@ -15,7 +15,6 @@
package org.eclipse.team.internal.ui.synchronize;
import java.util.HashSet;
-import java.util.Iterator;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IProject;
@@ -195,8 +194,8 @@ public class HierarchicalModelProvider extends SynchronizeModelProvider {
for (SyncInfo info : infos) {
set.add(info.getLocal().getProject());
}
- for (Iterator it = set.iterator(); it.hasNext(); ) {
- addResource((IResource)it.next());
+ for (Object element : set) {
+ addResource((IResource)element);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
index b48b1fe68..3db08cd12 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.synchronize;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IResource;
@@ -26,7 +25,7 @@ import org.eclipse.team.internal.core.subscribers.SubscriberSyncInfoCollector;
import org.eclipse.team.internal.ui.synchronize.RefreshParticipantJob.IChangeDescription;
public class RefreshChangeListener implements ISubscriberChangeListener, IChangeDescription {
- private List changes = new ArrayList();
+ private List<ISubscriberChangeEvent> changes = new ArrayList<>();
private SubscriberSyncInfoCollector collector;
private IResource[] resources;
@@ -43,16 +42,15 @@ public class RefreshChangeListener implements ISubscriberChangeListener, IChange
}
}
public SyncInfo[] getChanges() {
- List changedSyncInfos = new ArrayList();
+ List<SyncInfo> changedSyncInfos = new ArrayList<>();
SyncInfoSet set = collector.getSyncInfoSet();
- for (Iterator it = changes.iterator(); it.hasNext();) {
- ISubscriberChangeEvent delta = (ISubscriberChangeEvent) it.next();
+ for (ISubscriberChangeEvent delta : changes) {
SyncInfo info = set.getSyncInfo(delta.getResource());
if (info != null && interestingChange(info)) {
changedSyncInfos.add(info);
}
}
- return (SyncInfo[]) changedSyncInfos.toArray(new SyncInfo[changedSyncInfos.size()]);
+ return changedSyncInfos.toArray(new SyncInfo[changedSyncInfos.size()]);
}
private boolean interestingChange(SyncInfo info) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshModelParticipantJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshModelParticipantJob.java
index ac10c047b..c93707016 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshModelParticipantJob.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshModelParticipantJob.java
@@ -40,7 +40,7 @@ public class RefreshModelParticipantJob extends RefreshParticipantJob {
private IProgressMonitor group;
private int groupTicks;
- public class ChangeDescription implements IChangeDescription, IDiffChangeListener {
+ public static class ChangeDescription implements IChangeDescription, IDiffChangeListener {
Map<IPath, IDiff> changes = new HashMap<>();
@Override
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java
index b2e9c8e63..d5d442462 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java
@@ -176,7 +176,7 @@ public abstract class RefreshParticipantJob extends Job {
/**
* Notification for safely notifying listeners of refresh lifecycle.
*/
- private abstract class Notification implements ISafeRunnable {
+ private abstract static class Notification implements ISafeRunnable {
private IRefreshSubscriberListener listener;
@Override
public void handleException(Throwable exception) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java
index 43542dfd9..0d0ba9d04 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java
@@ -103,7 +103,7 @@ public class SaveablesCompareEditorInput extends CompareEditorInput implements
private ITypedElement fRightElement;
private final IWorkbenchPage page;
- private final ListenerList inputChangeListeners = new ListenerList(
+ private final ListenerList<ICompareInputChangeListener> inputChangeListeners = new ListenerList<>(
ListenerList.IDENTITY);
private ICompareInputChangeListener compareInputChangeListener;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java
index 946ae0f5c..762dcad51 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java
@@ -59,6 +59,7 @@ import org.eclipse.ui.actions.ActionGroup;
* viewer can be configured to show object contributions for random id schemes.
* To enable declarative action contributions for a configuration there are two
* steps required:
+ * </p>
* <ul>
* <li>Create a viewer contribution with a <code>targetID</code> that groups
* sets of actions that are related. A common practice for synchronize view
@@ -74,7 +75,7 @@ import org.eclipse.ui.actions.ActionGroup;
* <li>Create a configuration instance with a <code>menuID</code> that
* matches the targetID in the viewer contribution.
* </ul>
- * </p><p>
+ * <p>
* Clients may subclass to add behavior for concrete structured viewers.
* </p>
*
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java
index 18e0cd275..24810031a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java
@@ -14,6 +14,8 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
+import java.text.DateFormat;
+import java.util.Calendar;
import java.util.Date;
import org.eclipse.core.runtime.Adapters;
@@ -25,9 +27,6 @@ import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.actions.ActionFactory;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.util.Calendar;
-
/**
* Schedule to refresh a subscriber at a specified interval. The schedule can be disabled or enabled
* and will create the refresh job.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
index 7cd1eb76d..7c465f864 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
@@ -25,7 +25,6 @@ import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -76,25 +75,31 @@ import org.eclipse.ui.XMLMemento;
* of dynamic participants, and the re-creation of persisted participants.
* <p>
* A participant is defined in a plugin manifest and can have several properties:
- * - static: means that they always exist and don't have to be added to the manager
- * - dynamic: will be added to the manager at some later time
+ * <ul>
+ * <li>static: means that they always exist and don't have to be added to the manager
+ * <li>dynamic: will be added to the manager at some later time
+ * </ul>
*
* Part (title, id, icon, composite) - described in plugin.xml (IPartInstance)
- * Can have multiple parts of the same type at runtime -> (IPart)
- * - must acquire a part (IPartInstance.createPart())
- * - must released to part when done (IPartInstance.releasePart())
+ * Can have multiple parts of the same type at runtime -&gt; (IPart)
+ * <ul>
+ * <li>must acquire a part (IPartInstance.createPart())
+ * <li>must released to part when done (IPartInstance.releasePart())
+ * </ul>
* Some parts can added dynamically to the registry and events are fired to listeners. Listeners can create the newly added part via
* the #createPart() method.
* Parts can be persisted/restored with some state
*
*
- *
+ * <p>
* Lifecycle:
- * startup -> registry read and stored in a participant instance
- * createParticipant(id) ->
- * releaseParticipant(IParticipantDescriptor) ->
- * getParticipantRegistry -> return IParticipantDescriptors that describe the participants
- * shutdown -> persist all settings
+ * </p><p>
+ * startup -&gt; registry read and stored in a participant instance
+ * createParticipant(id) -&gt;
+ * releaseParticipant(IParticipantDescriptor) -&gt;
+ * getParticipantRegistry -&gt; return IParticipantDescriptors that describe the participants
+ * shutdown -&gt; persist all settings
+ * </p>
*
* @see ISynchronizeView
* @see ISynchronizeParticipant
@@ -118,7 +123,7 @@ public class SynchronizeManager implements ISynchronizeManager {
/**
* Contains a table of the state saved between sessions for a participant. The set is keyed
- * as such {String key -> ISynchronizeParticipantReference}.
+ * as such {String key -&gt; ISynchronizeParticipantReference}.
*/
private Map<String, ISynchronizeParticipantReference> participantReferences = Collections.synchronizedMap(new HashMap<>(10));
@@ -454,12 +459,12 @@ public class SynchronizeManager implements ISynchronizeManager {
@Override
public synchronized ISynchronizeParticipantReference[] getSynchronizeParticipants() {
- return participantReferences.values().toArray(new ISynchronizeParticipantReference[participantReferences.values().size()]);
+ return participantReferences.values().toArray(new ISynchronizeParticipantReference[participantReferences.size()]);
}
@Override
public ISynchronizeView showSynchronizeViewInActivePage() {
- IWorkbench workbench = TeamUIPlugin.getPlugin().getWorkbench();
+ IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
boolean switchPerspectives = promptForPerspectiveSwitch();
@@ -576,8 +581,8 @@ public class SynchronizeManager implements ISynchronizeManager {
public void dispose() {
// save state and settings for existing participants.
saveState();
- for (Iterator it = participantReferences.values().iterator(); it.hasNext();) {
- ParticipantInstance ref = (ParticipantInstance) it.next();
+ for (Object element : participantReferences.values()) {
+ ParticipantInstance ref = (ParticipantInstance) element;
if((ref).isInstantiated()) {
try {
ref.getParticipant().dispose();
@@ -625,8 +630,8 @@ public class SynchronizeManager implements ISynchronizeManager {
*/
private void saveState() {
XMLMemento xmlMemento = XMLMemento.createWriteRoot(CTX_PARTICIPANTS);
- for (Iterator it = participantReferences.values().iterator(); it.hasNext(); ) {
- ParticipantInstance ref = (ParticipantInstance) it.next();
+ for (Object element : participantReferences.values()) {
+ ParticipantInstance ref = (ParticipantInstance) element;
// Participants can opt out of being saved between sessions
if(! ref.getDescriptor().isPersistent()) continue;
// Create the state placeholder for a participant
@@ -641,11 +646,8 @@ public class SynchronizeManager implements ISynchronizeManager {
ref.save(participantData);
}
try {
- Writer writer = new BufferedWriter(new FileWriter(getStateFile()));
- try {
+ try (Writer writer = new BufferedWriter(new FileWriter(getStateFile()))) {
xmlMemento.save(writer);
- } finally {
- writer.close();
}
} catch (IOException e) {
TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, TeamUIMessages.SynchronizeManager_10, e));
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement.java
index 9b94b40d6..6a89b6e13 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement.java
@@ -177,14 +177,21 @@ public abstract class SynchronizeModelElement extends DiffNode implements IAdapt
}
private int getFlag(String propertyName) {
- if (propertyName == BUSY_PROPERTY) {
+ if (propertyName == null) {
+ return 0;
+ }
+
+ switch (propertyName) {
+ case BUSY_PROPERTY:
return BUSY_FLAG;
- } else if (propertyName == PROPAGATED_CONFLICT_PROPERTY) {
+ case PROPAGATED_CONFLICT_PROPERTY:
return PROPAGATED_CONFLICT_FLAG;
- } else if(propertyName == PROPAGATED_ERROR_MARKER_PROPERTY) {
+ case PROPAGATED_ERROR_MARKER_PROPERTY:
return PROPAGATED_ERROR_FLAG;
- } else if(propertyName == PROPAGATED_WARNING_MARKER_PROPERTY) {
+ case PROPAGATED_WARNING_MARKER_PROPERTY:
return PROPAGATED_WARNING_FLAG;
+ default:
+ break;
}
return 0;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java
index f9ad69236..bcc9d7c62 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java
@@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -49,9 +51,6 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
-
/**
* Handler that serializes the updating of a synchronize model provider.
* All modifications to the synchronize model are performed in this
@@ -79,7 +78,7 @@ public class SynchronizeModelUpdateHandler extends BackgroundEventHandler implem
/**
* Custom event for posting marker changes
*/
- class MarkerChangeEvent extends Event {
+ static class MarkerChangeEvent extends Event {
private final ISynchronizeModelElement[] elements;
public MarkerChangeEvent(ISynchronizeModelElement[] elements) {
super(MARKERS_CHANGED);
@@ -93,7 +92,7 @@ public class SynchronizeModelUpdateHandler extends BackgroundEventHandler implem
/**
* Custom event for posting busy state changes
*/
- class BusyStateChangeEvent extends Event {
+ static class BusyStateChangeEvent extends Event {
private final ISynchronizeModelElement element;
private final boolean isBusy;
@@ -113,7 +112,7 @@ public class SynchronizeModelUpdateHandler extends BackgroundEventHandler implem
/**
* Custom event for posting sync info set changes
*/
- class SyncInfoSetChangeEvent extends Event {
+ static class SyncInfoSetChangeEvent extends Event {
private final ISyncInfoSetChangeEvent event;
public SyncInfoSetChangeEvent(ISyncInfoSetChangeEvent event) {
super(SYNC_INFO_SET_CHANGED);
@@ -257,7 +256,7 @@ public class SynchronizeModelUpdateHandler extends BackgroundEventHandler implem
if (pendingLabelUpdates.isEmpty()) {
return false;
} else {
- Utils.asyncExec((Runnable) () -> firePendingLabelUpdates(), getViewer());
+ Utils.asyncExec((Runnable) this::firePendingLabelUpdates, getViewer());
return true;
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java
index 1013d8cbd..fbeffcc58 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java
@@ -440,13 +440,14 @@ public class SynchronizePageConfiguration extends SynchronizePageActionGroup imp
}
protected String[] getDefault(String menuPropertyId) {
- if (menuPropertyId.equals(P_CONTEXT_MENU)) {
+ switch (menuPropertyId) {
+ case P_CONTEXT_MENU:
return DEFAULT_CONTEXT_MENU;
- } else if (menuPropertyId.equals(P_VIEW_MENU)) {
+ case P_VIEW_MENU:
return DEFAULT_VIEW_MENU;
- } else if (menuPropertyId.equals(P_TOOLBAR_MENU)) {
+ case P_TOOLBAR_MENU:
return DEFAULT_TOOLBAR_MENU;
- } else {
+ default:
return new String[0];
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java
index 08935bb8a..e85ebc025 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java
@@ -17,7 +17,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
@@ -112,6 +111,7 @@ import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.part.PageBookView;
import org.eclipse.ui.part.ShowInContext;
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
+import org.osgi.framework.FrameworkUtil;
/**
* Implements a Synchronize View that contains multiple synchronize participants.
@@ -569,9 +569,9 @@ public class SynchronizeView extends PageBookView implements ISynchronizeView, I
ISynchronizeManager manager = TeamUI.getSynchronizeManager();
List participants = Arrays.asList(getParticipants());
boolean errorOccurred = false;
- for (int i = 0; i < participants.size(); i++) {
+ for (Object participant : participants) {
try {
- ISynchronizeParticipantReference ref = (ISynchronizeParticipantReference)participants.get(i);
+ ISynchronizeParticipantReference ref = (ISynchronizeParticipantReference)participant;
participantsAdded(new ISynchronizeParticipant[] {ref.getParticipant()});
} catch (TeamException e) {
errorOccurred = true;
@@ -645,7 +645,7 @@ public class SynchronizeView extends PageBookView implements ISynchronizeView, I
* Return the dialog settings for the view
*/
private IDialogSettings getDialogSettings() {
- IDialogSettings workbenchSettings = TeamUIPlugin.getPlugin().getDialogSettings();
+ IDialogSettings workbenchSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(SynchronizeView.class)).getDialogSettings();
IDialogSettings syncViewSettings = workbenchSettings.getSection(KEY_SETTINGS_SECTION);
if (syncViewSettings == null) {
syncViewSettings = workbenchSettings.addNewSection(KEY_SETTINGS_SECTION);
@@ -682,8 +682,8 @@ public class SynchronizeView extends PageBookView implements ISynchronizeView, I
@Override
public Saveable[] getSaveables() {
Set<Saveable> result = new HashSet<>();
- for (Iterator iter = fPartToParticipant.keySet().iterator(); iter.hasNext();) {
- SynchronizeViewWorkbenchPart part = (SynchronizeViewWorkbenchPart) iter.next();
+ for (Object element : fPartToParticipant.keySet()) {
+ SynchronizeViewWorkbenchPart part = (SynchronizeViewWorkbenchPart) element;
Saveable saveable = getSaveable(part.getParticipant());
if (saveable != null) {
result.add(saveable);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java
index 6fe2c9cc6..613acd584 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java
@@ -335,7 +335,7 @@ public class ChangeSetActionGroup extends SynchronizePageActionGroup {
if (getChangeSetCapability().supportsActiveChangeSets()) {
addToChangeSet = new MenuManager(TeamUIMessages.ChangeLogModelProvider_12);
addToChangeSet.setRemoveAllWhenShown(true);
- addToChangeSet.addMenuListener(manager -> addChangeSets(manager));
+ addToChangeSet.addMenuListener(this::addChangeSets);
createChangeSet = new CreateChangeSetAction(configuration);
addToChangeSet.add(createChangeSet);
addToChangeSet.add(new Separator());
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java
index 5efd85260..80c5d9c24 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java
@@ -99,8 +99,7 @@ class CopyToClipboardAction extends SelectionListenerAction {
}
}
} else {
- for (Iterator it = structuredSelection.iterator(); it.hasNext();) {
- Object element = it.next();
+ for (Object element : structuredSelection) {
if (element instanceof ITypedElement) {
if (i > 0)
buf.append(EOL);
@@ -163,8 +162,7 @@ class CopyToClipboardAction extends SelectionListenerAction {
if (actualLength < length) {
String[] tempFileNames = fileNames;
fileNames = new String[actualLength];
- for (int i = 0; i < actualLength; i++)
- fileNames[i] = tempFileNames[i];
+ System.arraycopy(tempFileNames, 0, fileNames, 0, actualLength);
}
setClipboard(resources, fileNames, text);
}
@@ -179,7 +177,7 @@ class CopyToClipboardAction extends SelectionListenerAction {
private void setClipboard(IResource[] resources, String[] fileNames, String names) {
try {
// set the clipboard contents
- List data = new ArrayList();
+ List<Object> data = new ArrayList<>();
List<Transfer> dataTypes = new ArrayList<>();
if (resources.length > 0) {
data.add(resources);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java
index 864bbbf88..6f1cf63d8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.synchronize.actions;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.action.Action;
@@ -36,7 +35,7 @@ import org.eclipse.ui.actions.ActionGroup;
public class DirectionFilterActionGroup extends ActionGroup implements IPropertyChangeListener {
// The list of created actions
- private List actions = new ArrayList(3);
+ private List<DirectionFilterAction> actions = new ArrayList<>(3);
// The modes
private DirectionFilterAction incomingMode;
@@ -143,8 +142,8 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
public void fillActionBars(IActionBars actionBars, String group) {
super.fillActionBars(actionBars);
IToolBarManager toolBar = actionBars.getToolBarManager();
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction) it.next();
+ for (Object action2 : actions) {
+ DirectionFilterAction action = (DirectionFilterAction) action2;
if(group != null) {
toolBar.appendToGroup(group, action);
} else {
@@ -154,22 +153,22 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
}
public void fillToolBar(String groupId, IToolBarManager toolBar) {
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction) it.next();
+ for (Object action2 : actions) {
+ DirectionFilterAction action = (DirectionFilterAction) action2;
toolBar.appendToGroup(groupId, action);
}
}
public void fillMenu(IContributionManager manager) {
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction) it.next();
+ for (Object action2 : actions) {
+ DirectionFilterAction action = (DirectionFilterAction) action2;
manager.add(action);
}
}
private void checkMode(int mode) {
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction)it.next();
+ for (Object action2 : actions) {
+ DirectionFilterAction action = (DirectionFilterAction)action2;
if(action.getModeId() == mode) {
action.setChecked(true);
} else {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
index 366b2f6a3..b31aab2a1 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.synchronize.actions;
import java.lang.reflect.InvocationTargetException;
-import java.util.Iterator;
import org.eclipse.compare.CompareEditorInput;
import org.eclipse.compare.CompareUI;
@@ -71,8 +70,7 @@ public class OpenInCompareAction extends Action {
return;
boolean reuseEditorIfPossible = ((IStructuredSelection) selection).size()==1;
- for (Iterator iterator = ((IStructuredSelection) selection).iterator(); iterator.hasNext();) {
- Object obj = iterator.next();
+ for (Object obj : ((IStructuredSelection) selection)) {
if (obj instanceof SyncInfoModelElement) {
SyncInfo info = ((SyncInfoModelElement) obj).getSyncInfo();
if (info != null) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java
index 1fff5e791..bc358d972 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.synchronize.actions;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -161,7 +160,7 @@ public class RemoveSynchronizeParticipantAction extends Action {
} else {
ListSelectionDialog dlg = new ListSelectionDialog(
view.getSite().getShell(), dirtyModels,
- new ArrayContentProvider(),
+ ArrayContentProvider.getInstance(),
new WorkbenchPartLabelProvider(), TeamUIMessages.RemoveSynchronizeParticipantAction_4);
dlg.setInitialSelections(dirtyModels.toArray());
dlg.setTitle(TeamUIMessages.RemoveSynchronizeParticipantAction_5);
@@ -182,8 +181,8 @@ public class RemoveSynchronizeParticipantAction extends Action {
final List finalModels = dirtyModels;
IRunnableWithProgress progressOp = monitor -> {
monitor.beginTask(null, finalModels.size());
- for (Iterator i = finalModels.iterator(); i.hasNext();) {
- Saveable model = (Saveable) i.next();
+ for (Object finalModel : finalModels) {
+ Saveable model = (Saveable) finalModel;
if (model.isDirty()) {
try {
model.doSave(SubMonitor.convert(monitor, 1));
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java
index 38cb6b325..b424ac8de 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java
@@ -88,9 +88,9 @@ public abstract class StatusLineContributionGroup extends ActionGroup {
TeamUIPlugin.getStandardDisplay().asyncExec(() -> {
if (isThreeWay()) {
- conflicting.setText(Integer.valueOf(workspaceConflicting).toString());
- incoming.setText(Integer.valueOf(workspaceIncoming).toString());
- outgoing.setText(Integer.valueOf(workspaceOutgoing).toString());
+ conflicting.setText(Integer.toString(workspaceConflicting));
+ incoming.setText(Integer.toString(workspaceIncoming));
+ outgoing.setText(Integer.toString(workspaceOutgoing));
conflicting.setTooltip(NLS.bind(TeamUIMessages.StatisticsPanel_numbersTooltip, new String[] { TeamUIMessages.StatisticsPanel_conflicting }));
outgoing.setTooltip(NLS.bind(TeamUIMessages.StatisticsPanel_numbersTooltip, new String[] { TeamUIMessages.StatisticsPanel_outgoing }));
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchModelSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchModelSynchronizeParticipant.java
index a922426ab..48454450a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchModelSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchModelSynchronizeParticipant.java
@@ -129,9 +129,7 @@ public class ApplyPatchModelSynchronizeParticipant extends
return enabledProviders;
}
ModelProvider[] extended = new ModelProvider[enabledProviders.length + 1];
- for (int i = 0; i < enabledProviders.length; i++) {
- extended[i] = enabledProviders[i];
- }
+ System.arraycopy(enabledProviders, 0, extended, 0, enabledProviders.length);
PatchModelProvider provider = PatchModelProvider.getProvider();
if (provider == null)
return enabledProviders;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java
index 91a9d2c92..a3a1ef280 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java
@@ -51,6 +51,7 @@ import org.eclipse.ui.activities.WorkbenchActivityHelper;
import org.eclipse.ui.model.AdaptableList;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.osgi.framework.FrameworkUtil;
/**
* The main page of the configure project wizard. It contains a table
@@ -183,7 +184,7 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
showAllToggle.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- ArrayList all = new ArrayList(Arrays.asList(wizards.getChildren()));
+ ArrayList<Object> all = new ArrayList<>(Arrays.asList(wizards.getChildren()));
if(showAllToggle.getSelection()) {
all.addAll(Arrays.asList(disabledWizards.getChildren()));
}
@@ -194,7 +195,7 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
if(wizards.size() == 0 && showAllToggle != null) {
showAllToggle.setSelection(true);
- ArrayList all = new ArrayList(Arrays.asList(wizards.getChildren()));
+ ArrayList<Object> all = new ArrayList<>(Arrays.asList(wizards.getChildren()));
all.addAll(Arrays.asList(disabledWizards.getChildren()));
viewer.setInput(new AdaptableList(all));
} else {
@@ -248,7 +249,7 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
private void initializeWizardSelection() {
String selectedWizardId = null;
- IDialogSettings dialogSettings = TeamUIPlugin.getPlugin().getDialogSettings();
+ IDialogSettings dialogSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(ConfigureProjectWizardMainPage.class)).getDialogSettings();
this.settings = dialogSettings.getSection("ConfigureProjectWizard"); //$NON-NLS-1$
if (this.settings == null) {
this.settings = dialogSettings.addNewSection("ConfigureProjectWizard"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetLocationPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetLocationPage.java
index 4809f5dad..43a61d5f9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetLocationPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetLocationPage.java
@@ -388,7 +388,7 @@ public class ExportProjectSetLocationPage extends TeamWizardPage {
wsFilenameText.addModifyListener(e -> {
String patchName = wsFilenameText.getText();
- if (patchName.trim().equals("")) { //$NON-NLS-1$
+ if (patchName.trim().isEmpty()) {
okButton.setEnabled(false);
setErrorMessage(TeamUIMessages.ExportProjectSetMainPage_WorkspaceDialogErrorNoFilename);
} else if (!(ResourcesPlugin.getWorkspace().validateName(patchName, IResource.FILE)).isOK()) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java
index 04c8b274f..d2ace141c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java
@@ -18,7 +18,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -57,7 +56,6 @@ import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.internal.ui.IHelpContextIds;
import org.eclipse.team.internal.ui.SWTUtils;
import org.eclipse.team.internal.ui.TeamUIMessages;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
@@ -96,7 +94,7 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
public TreePath[] getParents(Object element) {
if (element instanceof IProject){
ArrayList<IWorkingSet> treePaths = new ArrayList<>();
- IWorkingSet[] workingSets = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager().getWorkingSets();
+ IWorkingSet[] workingSets = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets();
for (IWorkingSet workingSet : workingSets) {
IAdaptable[] elements = workingSet.getElements();
for (IAdaptable d : elements) {
@@ -154,8 +152,8 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
} else if (inputElement instanceof HashSet){
Set<IProject> tempList = new HashSet<>();
HashSet inputElementSet = (HashSet) inputElement;
- for (Iterator iterator = inputElementSet.iterator(); iterator.hasNext();) {
- IProject[] projects = getProjectsForObject(iterator.next());
+ for (Object element : inputElementSet) {
+ IProject[] projects = getProjectsForObject(element);
if (projects != null)
tempList.addAll(Arrays.asList(projects));
}
@@ -257,8 +255,8 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
// filter out unexportable projects
List passedInExportableProjects = new ArrayList();
- for (Iterator iterator = passedInSelectedProjects.iterator(); iterator.hasNext();) {
- IProject project = (IProject) iterator.next();
+ for (Object element : passedInSelectedProjects) {
+ IProject project = (IProject) element;
if (isProjectExportable(project))
passedInExportableProjects.add(project);
}
@@ -556,7 +554,7 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
updateEnablement();
});
- wsTableViewer.setInput(TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager());
+ wsTableViewer.setInput(PlatformUI.getWorkbench().getWorkingSetManager());
}
private void addButtons(Composite projectComposite){
@@ -621,7 +619,7 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
newWorkingSet.setLayoutData(data);
newWorkingSet.setText(TeamUIMessages.ExportProjectSetMainPage_EditButton);
newWorkingSet.addListener(SWT.Selection, event -> {
- final IWorkingSetManager workingSetManager = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager();
+ final IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
IWorkingSetSelectionDialog wsWizard = workingSetManager.createWorkingSetSelectionDialog(getShell(), false);
if (wsWizard != null) {
IPropertyChangeListener propListener = null;
@@ -669,7 +667,7 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
}
public void refresh(){
- wsTableViewer.setInput(TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager());
+ wsTableViewer.setInput(PlatformUI.getWorkbench().getWorkingSetManager());
}
private void updateEnablement() {
@@ -680,9 +678,8 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
// check if there is at least one exportable project selected
if (complete || !pageShown) {
complete = false;
- for (Iterator iterator = selectedProjects.iterator(); iterator
- .hasNext();) {
- IProject selectedProject = (IProject) iterator.next();
+ for (Object element : selectedProjects) {
+ IProject selectedProject = (IProject) element;
if (isProjectExportable(selectedProject)) {
complete = true;
} else {
@@ -746,8 +743,7 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
if (!tempSet.isEmpty()) {
selectedProjects.removeAll(tempSet);
- for (Iterator iterator = tempSet.iterator(); iterator.hasNext();) {
- Object element = iterator.next();
+ for (Object element : tempSet) {
referenceCountProjects.remove(element);
}
selectedProjects.addAll(referenceCountProjects);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java
index 67c5a6ba1..b0a9a7bf0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.wizards;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -111,8 +110,8 @@ public class GlobalRefreshWizardSelectionPage extends WizardPage implements IDou
@Override
public void dispose() {
if (createdImages != null) {
- for (Iterator it = createdImages.iterator(); it.hasNext();) {
- Image image = (Image) it.next();
+ for (Object element : createdImages) {
+ Image image = (Image) element;
image.dispose();
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalSynchronizeWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalSynchronizeWizard.java
index 0764a54ee..b79362f7d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalSynchronizeWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalSynchronizeWizard.java
@@ -18,10 +18,11 @@ import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.team.internal.ui.ITeamUIImages;
import org.eclipse.team.internal.ui.TeamUIMessages;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.TeamImages;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipantReference;
import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.FrameworkUtil;
/**
* The wizard for synchronizing a synchronize participant.
@@ -42,7 +43,7 @@ public class GlobalSynchronizeWizard extends Wizard {
setForcePreviousAndNextButtons(true);
setNeedsProgressMonitor(false);
- final IDialogSettings pluginSettings= TeamUIPlugin.getPlugin().getDialogSettings();
+ final IDialogSettings pluginSettings= PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(GlobalSynchronizeWizard.class)).getDialogSettings();
IDialogSettings wizardSettings= pluginSettings.getSection(DIALOG_SETTINGS_SECTION);
if (wizardSettings == null) {
pluginSettings.addNewSection(DIALOG_SETTINGS_SECTION);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ImportProjectSetOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ImportProjectSetOperation.java
index f8d5c95d6..fef25a7f6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ImportProjectSetOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ImportProjectSetOperation.java
@@ -21,10 +21,10 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.team.internal.ui.ProjectSetImporter;
import org.eclipse.team.internal.ui.TeamUIMessages;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.TeamOperation;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
+import org.eclipse.ui.PlatformUI;
public class ImportProjectSetOperation extends TeamOperation {
@@ -39,7 +39,7 @@ public class ImportProjectSetOperation extends TeamOperation {
*
* @param context
* a runnable context,
- * <code>null</null> for running in background
+ * <code>null</code> for running in background
* @param psfFileContents
* the psf file content to load
* @param urlString
@@ -112,7 +112,7 @@ public class ImportProjectSetOperation extends TeamOperation {
}
private void createWorkingSet(IWorkingSet[] workingSets, IProject[] projects) {
- IWorkingSetManager manager = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager();
+ IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
String workingSetName;
for (IWorkingSet workingSet : workingSets) {
workingSetName = workingSet.getName();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PatchInaccessibleProjectsPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PatchInaccessibleProjectsPage.java
index baceab88c..0572e8c52 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PatchInaccessibleProjectsPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PatchInaccessibleProjectsPage.java
@@ -71,7 +71,7 @@ public class PatchInaccessibleProjectsPage extends WizardPage {
checkList = CheckboxTableViewer.newCheckList(composite, SWT.H_SCROLL
| SWT.V_SCROLL | SWT.BORDER);
- checkList.setContentProvider(new ArrayContentProvider());
+ checkList.setContentProvider(ArrayContentProvider.getInstance());
checkList.setLabelProvider(new WorkbenchLabelProvider() {
@Override
public Color getForeground(Object element) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java
index 4f98146e8..274c19434 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java
@@ -143,7 +143,7 @@ public class ProjectSetExportWizard extends Wizard implements IExportWizard {
//
XMLMemento xmlMemento = getXMLMementoRoot();
Iterator it = map.keySet().iterator();
- monitor.beginTask(null, 1000 * map.keySet().size());
+ monitor.beginTask(null, 1000 * map.size());
while (it.hasNext()) {
String id = (String)it.next();
IMemento memento = xmlMemento.createChild("provider"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PsfStore.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PsfStore.java
index 226269af8..dabfcc982 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PsfStore.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/PsfStore.java
@@ -16,7 +16,8 @@ package org.eclipse.team.internal.ui.wizards;
import java.util.Vector;
import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.FrameworkUtil;
public abstract class PsfStore {
// Most recently used filename is first in the array.
@@ -87,7 +88,7 @@ public abstract class PsfStore {
if (_section != null)
return _section;
- IDialogSettings settings = TeamUIPlugin.getPlugin().getDialogSettings();
+ IDialogSettings settings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(PsfStore.class)).getDialogSettings();
_section = settings.getSection(STORE_SECTION);
if (_section != null)
return _section;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/WorkingSetsDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/WorkingSetsDialog.java
index 001fed4c1..11584643d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/WorkingSetsDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/WorkingSetsDialog.java
@@ -35,8 +35,8 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.team.internal.ui.TeamUIMessages;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.PlatformUI;
public class WorkingSetsDialog extends TitleAreaDialog {
@@ -88,9 +88,9 @@ public class WorkingSetsDialog extends TitleAreaDialog {
gd.heightHint = 250;
wsTableViewer.getTable().setLayoutData(gd);
- wsTableViewer.setContentProvider(new ArrayContentProvider());
+ wsTableViewer.setContentProvider(ArrayContentProvider.getInstance());
wsTableViewer.setLabelProvider(new WorkingSetLabelProvider());
- wsTableViewer.setInput(TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager().getWorkingSets());
+ wsTableViewer.setInput(PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets());
setupListeners();
@@ -101,7 +101,7 @@ public class WorkingSetsDialog extends TitleAreaDialog {
protected void okPressed() {
selectedWorkingSet = wsNameText.getText();
- if (selectedWorkingSet.equals("")) { //$NON-NLS-1$
+ if (selectedWorkingSet.isEmpty()) {
setErrorMessage(TeamUIMessages.WorkingSetsDialog_ErrorMessage);
return;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageCompareEditorInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageCompareEditorInput.java
index 2017ccd88..cb0dd3d9f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageCompareEditorInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageCompareEditorInput.java
@@ -275,7 +275,7 @@ public abstract class PageCompareEditorInput extends CompareEditorInput implemen
* @param input the input
* @param configuration the compare configuration
* @param monitor a progress monitor
- * @throws InvocationTargetException
+ * @throws InvocationTargetException if an error occurs
*/
protected abstract void prepareInput(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor) throws InvocationTargetException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageSaveablePart.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageSaveablePart.java
index 2221dad7e..bd5d1d270 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageSaveablePart.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/PageSaveablePart.java
@@ -285,7 +285,7 @@ public abstract class PageSaveablePart extends SaveablePartAdapter implements IC
* @param input the input
* @param configuration the compare configuration
* @param monitor a progress monitor
- * @throws InvocationTargetException
+ * @throws InvocationTargetException if an error occurs
*/
protected abstract void prepareInput(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor) throws InvocationTargetException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/SaveablePartDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/SaveablePartDialog.java
index 75c82f340..621fc0690 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/SaveablePartDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/SaveablePartDialog.java
@@ -28,8 +28,8 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.TeamUIMessages;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.FrameworkUtil;
/**
* A dialog that displays a {@link org.eclipse.team.ui.ISaveableWorkbenchPart} and
@@ -108,7 +108,7 @@ public class SaveablePartDialog extends TrayDialog {
@Override
protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings compareSettings = TeamUIPlugin.getPlugin().getDialogSettings();
+ IDialogSettings compareSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(SaveablePartDialog.class)).getDialogSettings();
String sectionName = this.getClass().getName();
IDialogSettings dialogSettings = compareSettings.getSection(sectionName);
if (dialogSettings == null) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/ElementLocalHistoryPageSource.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/ElementLocalHistoryPageSource.java
index 8bbb71e63..d911a08b2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/ElementLocalHistoryPageSource.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/ElementLocalHistoryPageSource.java
@@ -31,7 +31,7 @@ public abstract class ElementLocalHistoryPageSource extends HistoryPageSource {
* @param file the file containing the element
* @param element the element
* @return the previous edition of the element from the local history or <code>null</code>
- * @throws TeamException
+ * @throws TeamException if an error occurs
*/
public static ITypedElement getPreviousEdition(IFile file, Object element) throws TeamException {
return EditionHistoryPage.getPreviousState(file, element);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPageCompareEditorInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPageCompareEditorInput.java
index 7ba671538..79b87f5e7 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPageCompareEditorInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPageCompareEditorInput.java
@@ -47,7 +47,7 @@ public class HistoryPageCompareEditorInput extends PageCompareEditorInput {
private DialogHistoryPageSite site;
private final Object object;
private final IHistoryPageSource pageSource;
- private final IPropertyChangeListener changeListener = event -> handlePropertyChange(event);
+ private final IPropertyChangeListener changeListener = this::handlePropertyChange;
private boolean isReplace;
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java
index aba0d322e..b76de29f6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java
@@ -100,7 +100,7 @@ public abstract class RevisionAnnotationController {
* @param file
* the file to be edited
* @return the open editor on the file
- * @throws PartInitException
+ * @throws PartInitException swallowed
*/
public static AbstractDecoratedTextEditor openEditor(IWorkbenchPage page, IFile file) throws PartInitException {
if (file == null)
@@ -153,7 +153,7 @@ public abstract class RevisionAnnotationController {
* @param storage
* the storage that provides access to the contents of the file revision
* @return the open editor on the file revision
- * @throws PartInitException
+ * @throws PartInitException if an error occurs
*/
public static AbstractDecoratedTextEditor openEditor(IWorkbenchPage page,
Object fileRevision, IStorage storage) throws PartInitException {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareAdapter.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareAdapter.java
index 2cfd69929..55b5abcfe 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareAdapter.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareAdapter.java
@@ -123,7 +123,7 @@ public interface ISynchronizationCompareAdapter {
* a progress monitor
* @return the synchronization state of the element or -1 if the calculation
* of the state should be done using the resources of the mapping.
- * @throws CoreException
+ * @throws CoreException on failures; depends on concrete implementation
*
* @since 3.3
*/
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareInput.java
index a913a43c6..160a41125 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ISynchronizationCompareInput.java
@@ -45,7 +45,7 @@ public interface ISynchronizationCompareInput extends ICompareInput {
* the compare configuration.
* @param configuration the compare configuration for the editor that will display the input
* @param monitor a progress monitor
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
void prepareInput(CompareConfiguration configuration, IProgressMonitor monitor) throws CoreException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamContentProviderDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamContentProviderDescriptor.java
index 01b26bbe0..25f8fa19a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamContentProviderDescriptor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamContentProviderDescriptor.java
@@ -56,7 +56,7 @@ public interface ITeamContentProviderDescriptor {
* the content provider of this extension.
* @return a preference page that can be displayed to configure
* the content provider of this extension
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
public IPreferencePage createPreferencePage() throws CoreException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamStateProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamStateProvider.java
index 9cdcf528c..f2ebcacfc 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamStateProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/ITeamStateProvider.java
@@ -70,7 +70,7 @@ public interface ITeamStateProvider {
* @param element
* the element being decorated
* @return whether the given element has any decorated state
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
public boolean hasDecoratedState(Object element) throws CoreException;
@@ -137,7 +137,7 @@ public interface ITeamStateProvider {
* @param monitor
* a progress monitor
* @return the state for the given element or <code>null</code>
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
public ITeamStateDescription getStateDescription(Object element,
int stateMask, String[] properties, IProgressMonitor monitor)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/MergeActionHandler.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/MergeActionHandler.java
index 3fa1c6e39..09f0d3d4a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/MergeActionHandler.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/MergeActionHandler.java
@@ -46,7 +46,7 @@ public abstract class MergeActionHandler extends AbstractHandler {
private final ISynchronizePageConfiguration configuration;
private boolean enabled = false;
private IStructuredSelection selection;
- private ISelectionChangedListener listener = event -> updatedEnablement(event);
+ private ISelectionChangedListener listener = this::updatedEnablement;
/**
* Return an instance of the default handler for the given merge action id.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationActionProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationActionProvider.java
index 700eb483b..15bc91b37 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationActionProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationActionProvider.java
@@ -14,7 +14,6 @@
package org.eclipse.team.ui.mapping;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.core.commands.IHandler;
@@ -193,8 +192,8 @@ public class SynchronizationActionProvider extends CommonActionProvider {
public void dispose() {
super.dispose();
if (openWithActions != null) openWithActions.dispose();
- for (Iterator iter = handlers.values().iterator(); iter.hasNext();) {
- IHandler handler = (IHandler) iter.next();
+ for (Object element : handlers.values()) {
+ IHandler handler = (IHandler) element;
if (handler instanceof MergeActionHandler) {
MergeActionHandler mah = (MergeActionHandler) handler;
mah.dispose();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationCompareAdapter.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationCompareAdapter.java
index 1a47ec6ae..51b256d51 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationCompareAdapter.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationCompareAdapter.java
@@ -159,7 +159,7 @@ public abstract class SynchronizationCompareAdapter implements ISynchronizationC
* a progress monitor
* @return the synchronization state of the element or -1 if the calculation
* of the state should be done using the resources of the mapping.
- * @throws CoreException
+ * @throws CoreException on failures
*
* @since 3.3
*/
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationOperation.java
index 6086f3b90..3d1e6a2f6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationOperation.java
@@ -170,8 +170,8 @@ public abstract class SynchronizationOperation extends TeamOperation {
* execute method. Clients should call either {@link #run()} or {@link #run(IProgressMonitor)}
* to invoke the operation.
* @param monitor a progress monitor
- * @throws InvocationTargetException
- * @throws InterruptedException
+ * @throws InvocationTargetException if an error occurs
+ * @throws InterruptedException if operation is interrupted
*/
protected abstract void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationStateTester.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationStateTester.java
index 3b76935e2..4f17db818 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationStateTester.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationStateTester.java
@@ -151,7 +151,7 @@ public class SynchronizationStateTester {
* present
* @param monitor a progress monitor
* @return the synchronization state of the given element
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
public int getState(Object element, int stateMask, IProgressMonitor monitor) throws CoreException {
ITeamStateDescription desc = getTeamStateProvider().getStateDescription(element, stateMask, new String[0], monitor);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
index 37c1b851b..1199053cd 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
@@ -279,7 +279,7 @@ public abstract class AbstractSynchronizeParticipant extends PlatformObject impl
@Override
public void init(String secondaryId, IMemento memento) throws PartInitException {
setSecondaryId(secondaryId);
- pinned = Boolean.valueOf(memento.getString(CTX_PINNED)).booleanValue();
+ pinned = Boolean.parseBoolean(memento.getString(CTX_PINNED));
}
@Override
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java
index 5e6d7317a..01d853fe0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java
@@ -45,7 +45,7 @@ public abstract class AbstractSynchronizeScope implements ISynchronizeScope {
/*
* Scope change listeners
*/
- private ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
+ private ListenerList<IPropertyChangeListener> listeners = new ListenerList<>(ListenerList.IDENTITY);
/**
* Save the scope to the given memento
@@ -193,11 +193,11 @@ public abstract class AbstractSynchronizeScope implements ISynchronizeScope {
* @since 3.2
*/
public ResourceMapping[] getMappings() {
- List result = new ArrayList();
+ List<ResourceMapping> result = new ArrayList<>();
IResource[] roots = getRoots();
for (IResource resource : roots) {
result.add(resource.getAdapter(ResourceMapping.class));
}
- return (ResourceMapping[]) result.toArray(new ResourceMapping[result.size()]);
+ return result.toArray(new ResourceMapping[result.size()]);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePage.java
index 095e9caf0..e9d0e4db9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePage.java
@@ -32,7 +32,7 @@ public interface ISynchronizePage {
* but before <code>Page#createControl(Composite)</code>
*
* @param site the workbench part for the view containing the page
- * @throws PartInitException
+ * @throws PartInitException if an error occurs
*/
public void init(ISynchronizePageSite site) throws PartInitException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelMergeOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelMergeOperation.java
index 2c3d941cf..050d0e866 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelMergeOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelMergeOperation.java
@@ -199,7 +199,7 @@ public abstract class ModelMergeOperation extends ModelOperation {
* method must return an instance of {@link IMergeContext}
* that is fully initialized.
* @param monitor a progress monitor
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
protected abstract void initializeContext(IProgressMonitor monitor) throws CoreException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelOperation.java
index 0888ad168..3df4fdfc2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelOperation.java
@@ -127,7 +127,7 @@ public abstract class ModelOperation extends TeamOperation {
* {@link ISynchronizationScopeManager} for this operation
* is initialized if it was not previously initialized.
* @param monitor a progress monitor
- * @throws InvocationTargetException
+ * @throws InvocationTargetException if an error occurs
*/
protected void beginOperation(IProgressMonitor monitor) throws InvocationTargetException {
initializeScope(monitor);
@@ -410,8 +410,8 @@ public abstract class ModelOperation extends TeamOperation {
* Execute the operation. This method is invoked after the
* scope has been generated.
* @param monitor a progress monitor
- * @throws InvocationTargetException
- * @throws InterruptedException
+ * @throws InvocationTargetException if an error occurs
+ * @throws InterruptedException if operation is interrupted
*/
protected abstract void execute(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java
index 70a645c86..211afc667 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java
@@ -144,8 +144,8 @@ public abstract class ModelParticipantAction extends BaseSelectionListenerAction
* Check to see if the target saveable differs from the currently
* active saveable. If it does, prompt to save changes in the
* active saveable if it is dirty.
- * @throws InterruptedException
- * @throws InvocationTargetException
+ * @throws InterruptedException if operation is interrupted
+ * @throws InvocationTargetException if an error occurs
*/
protected void handleTargetSaveableChange() throws InvocationTargetException, InterruptedException {
final SaveableComparison targetSaveable = getTargetSaveable();
@@ -171,8 +171,8 @@ public abstract class ModelParticipantAction extends BaseSelectionListenerAction
* @param activeSaveable the current saveable
* @param allowCancel whether canceling the action is an option
* @param monitor a progress monitor
- * @throws CoreException
- * @throws InterruptedException
+ * @throws CoreException if an error occurs
+ * @throws InterruptedException if operation is interrupted
*/
public static void handleTargetSaveableChange(Shell shell, SaveableComparison targetSaveable, SaveableComparison activeSaveable, boolean allowCancel, IProgressMonitor monitor) throws CoreException, InterruptedException {
if (activeSaveable != null && targetSaveable != activeSaveable) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipant.java
index d58d58b73..ebb642e29 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipant.java
@@ -547,7 +547,7 @@ public class ModelSynchronizeParticipant extends
* with a progress monitor, long running operations should be avoided.
* @param manager the restored scope
* @return the context for this participant
- * @throws CoreException
+ * @throws CoreException if restoring context failed
*/
protected MergeContext restoreContext(ISynchronizationScopeManager manager) throws CoreException {
throw new PartInitException(NLS.bind(TeamUIMessages.ModelSynchronizeParticipant_1, getId()));
@@ -619,7 +619,7 @@ public class ModelSynchronizeParticipant extends
* @param cancelAllowed whether the display of the compare input can be canceled
* @param monitor a progress monitor or <code>null</code> if progress reporting is not required
* @return whether the user choose to continue with the display of the given compare input
- * @throws CoreException
+ * @throws CoreException if an error occurs
*/
public boolean checkForBufferChange(Shell shell, ISynchronizationCompareInput input, boolean cancelAllowed, IProgressMonitor monitor) throws CoreException {
SaveableComparison currentBuffer = getActiveSaveable();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipantActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipantActionGroup.java
index 0c8c023c3..0541b0eae 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipantActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipantActionGroup.java
@@ -221,22 +221,33 @@ public class ModelSynchronizeParticipantActionGroup extends SynchronizePageActio
* @param action the action for the given id
*/
protected void configureMergeAction(String mergeActionId, Action action) {
- if (mergeActionId == SynchronizationActionProvider.MERGE_ACTION_ID) {
+ if (mergeActionId == null) {
+ return;
+ }
+
+ switch (mergeActionId) {
+ case SynchronizationActionProvider.MERGE_ACTION_ID:
Utils.initAction(action, "action.merge."); //$NON-NLS-1$
- } else if (mergeActionId == SynchronizationActionProvider.OVERWRITE_ACTION_ID) {
+ break;
+ case SynchronizationActionProvider.OVERWRITE_ACTION_ID:
if (isTwoWayMerge()) {
Utils.initAction(action, "action.replace."); //$NON-NLS-1$
} else {
Utils.initAction(action, "action.overwrite."); //$NON-NLS-1$
}
- } else if (mergeActionId == SynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID) {
+ break;
+ case SynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID:
Utils.initAction(action, "action.markAsMerged."); //$NON-NLS-1$
- } else if (mergeActionId == MERGE_ALL_ACTION_ID) {
+ break;
+ case MERGE_ALL_ACTION_ID:
if (isTwoWayMerge()) {
Utils.initAction(action, "action.replaceAll."); //$NON-NLS-1$
} else {
Utils.initAction(action, "action.mergeAll."); //$NON-NLS-1$
}
+ break;
+ default:
+ break;
}
}
@@ -262,18 +273,26 @@ public class ModelSynchronizeParticipantActionGroup extends SynchronizePageActio
* @param manager the context menu manager
*/
protected void addToContextMenu(String mergeActionId, Action action, IMenuManager manager) {
- IContributionItem group = null;;
- if (mergeActionId == SynchronizationActionProvider.MERGE_ACTION_ID) {
- group = manager.find(MERGE_ACTION_GROUP);
- } else if (mergeActionId == SynchronizationActionProvider.OVERWRITE_ACTION_ID) {
- group = manager.find(MERGE_ACTION_GROUP);
- } else if (mergeActionId == SynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID) {
- group = manager.find(OTHER_ACTION_GROUP);
- }
- if (group != null) {
- manager.appendToGroup(group.getId(), action);
- } else {
- manager.add(action);
+ IContributionItem group = null;
+ if (mergeActionId != null) {
+ switch (mergeActionId) {
+ case SynchronizationActionProvider.MERGE_ACTION_ID:
+ group = manager.find(MERGE_ACTION_GROUP);
+ break;
+ case SynchronizationActionProvider.OVERWRITE_ACTION_ID:
+ group = manager.find(MERGE_ACTION_GROUP);
+ break;
+ case SynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID:
+ group = manager.find(OTHER_ACTION_GROUP);
+ break;
+ default:
+ break;
+ }
+ if (group != null) {
+ manager.appendToGroup(group.getId(), action);
+ } else {
+ manager.add(action);
+ }
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SaveableCompareEditorInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SaveableCompareEditorInput.java
index 91a6ca488..ae1bf61e6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SaveableCompareEditorInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SaveableCompareEditorInput.java
@@ -310,8 +310,8 @@ public abstract class SaveableCompareEditorInput extends CompareEditorInput impl
*
* @param monitor a progress monitor
* @return the compare input
- * @throws InvocationTargetException
- * @throws InterruptedException
+ * @throws InvocationTargetException if an error occurs
+ * @throws InterruptedException if operation is interrupted
*/
protected abstract ICompareInput prepareCompareInput(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java
index 84e913422..8e898417a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java
@@ -169,12 +169,12 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
/**
* Refresh this participants synchronization state and displays the result in a model dialog.
- * @param shell
*
+ * @param shell parent shell for the dialog
* @param resources the resources to be refreshed.
- * @param jobName
+ * @param jobName the job name or <code>null</code>
* @param taskName the task name to be shown to the user
- * @param configuration
+ * @param configuration the configuration
* @param site the site in which to run the refresh
*/
public final void refreshInDialog(Shell shell, IResource[] resources, String jobName, String taskName, ISynchronizePageConfiguration configuration, IWorkbenchSite site) {
@@ -205,9 +205,10 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
/**
* Refresh a participant. The returned status describes the result of the refresh.
- * @param resources
- * @param taskName
- * @param monitor
+ *
+ * @param resources the resources to be refreshed.
+ * @param taskName the task name to be shown to the user
+ * @param monitor monitor for job progress
* @return a status
*/
public final IStatus refreshNow(IResource[] resources, String taskName, IProgressMonitor monitor) {
@@ -412,7 +413,7 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
* Returns the long task name to describe the behavior of the
* refresh operation to the user. This is typically shown in the status line when this subscriber is refreshed
* in the background.
- * @param resources
+ * @param resources resources we are working on to get meaningful task name from
* @return the long task name
* @since 3.1
*/
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberTeamStateProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberTeamStateProvider.java
index 23e5562d7..93db55a95 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberTeamStateProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberTeamStateProvider.java
@@ -86,7 +86,7 @@ public class SubscriberTeamStateProvider extends TeamStateProvider implements IS
* @param stateMask the state mask that indicates which state flags are desired
* @param monitor a progress monitor
* @return the synchronization state of the element
- * @throws CoreException
+ * @throws CoreException if operation failed
*/
protected final int getSynchronizationState(Object element, int stateMask,
IProgressMonitor monitor) throws CoreException {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java
index 1a7392e8f..f9f55302c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java
@@ -106,8 +106,8 @@ public abstract class SynchronizeModelAction extends BaseSelectionListenerAction
* by calling <code>getSubscriberOperation</code> and then run. Subclasses may
* override.
*
- * @throws InvocationTargetException
- * @throws InterruptedException
+ * @throws InvocationTargetException if an error occurs
+ * @throws InterruptedException if operation is interrupted
* @since 3.1
*/
protected void runOperation() throws InvocationTargetException, InterruptedException {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
index de5f8c35e..d79165e3e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
@@ -15,7 +15,6 @@ package org.eclipse.team.ui.synchronize;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -83,7 +82,7 @@ public abstract class SynchronizePageActionGroup extends ActionGroup {
* page. Selection changed events are sent out when the model roots change
* or their visible children change
*/
- private class VisibleRootsSelectionProvider extends SynchronizePageActionGroup implements ISelectionProvider {
+ private static class VisibleRootsSelectionProvider extends SynchronizePageActionGroup implements ISelectionProvider {
private ListenerList<ISelectionChangedListener> selectionChangedListeners = new ListenerList<>(ListenerList.IDENTITY);
private ISelection selection;
@@ -340,8 +339,7 @@ public abstract class SynchronizePageActionGroup extends ActionGroup {
for (String groupId : groups.keySet()) {
List actions = groups.get(groupId);
if (actions != null) {
- for (Iterator iter2 = actions.iterator(); iter2.hasNext();) {
- Object element = iter2.next();
+ for (Object element : actions) {
if (element instanceof IAction) {
// Call the internal method to avoid registering the action
// as a global handler since it would have been registered
diff --git a/bundles/org.eclipse.ui.net/.classpath b/bundles/org.eclipse.ui.net/.classpath
index 22f30643c..e801ebfb4 100644
--- a/bundles/org.eclipse.ui.net/.classpath
+++ b/bundles/org.eclipse.ui.net/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.ui.net/.cvsignore b/bundles/org.eclipse.ui.net/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/bundles/org.eclipse.ui.net/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.ui.net/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.ui.net/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/bundles/org.eclipse.ui.net/.settings/org.eclipse.core.runtime.prefs
+++ b/bundles/org.eclipse.ui.net/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs
index 2a8d15bb3..769d3be1b 100644
--- a/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs
@@ -18,9 +18,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -37,6 +37,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
@@ -94,6 +95,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warn
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
@@ -130,7 +132,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,NORMAL
org.eclipse.jdt.core.compiler.taskTags=TODO,XXX
diff --git a/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
index 30deba204..d04333256 100644
--- a/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
@@ -2,15 +2,14 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.ui.net; singleton:=true
-Bundle-Version: 1.3.500.qualifier
-Bundle-Activator: org.eclipse.ui.internal.net.Activator
+Bundle-Version: 1.4.0.qualifier
Bundle-Vendor: %PLUGIN_PROVIDER
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui;bundle-version="[3.3.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
org.eclipse.core.net;bundle-version="[1.0.0,2.0.0)"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.eclipse.ui.internal.net;x-internal:=true,
org.eclipse.ui.internal.net.auth;x-internal:=true
Automatic-Module-Name: org.eclipse.ui.net
diff --git a/bundles/org.eclipse.ui.net/pom.xml b/bundles/org.eclipse.ui.net/pom.xml
index 84d5e441d..55e19e012 100644
--- a/bundles/org.eclipse.ui.net/pom.xml
+++ b/bundles/org.eclipse.ui.net/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.ui.net</artifactId>
- <version>1.3.500-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/Activator.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/Activator.java
deleted file mode 100644
index f0e9709f0..000000000
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/Activator.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2017 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20070201 154100 pmoogk@ca.ibm.com - Peter Moogk, Port internet code from WTP to Eclipse base.
- *******************************************************************************/
-package org.eclipse.ui.internal.net;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.ui.net"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- plugin = this;
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
-}
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java
index b897488cd..9542e4b6d 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java
@@ -45,6 +45,8 @@ public class ProxyEntryDialog extends StatusDialog {
private Label passwordLabel;
private Text passwordText;
+ private static final String PLUGIN_ID = "org.eclipse.ui.net"; //$NON-NLS-1$
+
public ProxyEntryDialog(Shell parent, ProxyData data, String[] addedArray,
String title) {
super(parent);
@@ -184,12 +186,14 @@ public class ProxyEntryDialog extends StatusDialog {
URI uri = new URI(hostText.getText());
scheme = uri.getScheme();
} catch (URISyntaxException e) {
- updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ updateStatus(new Status(IStatus.ERROR,
+ PLUGIN_ID,
IStatus.OK, NetUIMessages.ProxyEntryDialog_10, null));
return false;
}
if (scheme != null) {
- updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ updateStatus(new Status(IStatus.ERROR,
+ PLUGIN_ID,
IStatus.OK, NetUIMessages.ProxyEntryDialog_13, null));
return false;
}
@@ -221,7 +225,8 @@ public class ProxyEntryDialog extends StatusDialog {
String type = typeText.getText();
for (String addedType : addedTypes) {
if (addedType.equalsIgnoreCase(type)) {
- updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ updateStatus(new Status(IStatus.ERROR,
+ PLUGIN_ID,
IStatus.OK, NetUIMessages.ProxyEntryDialog_9, null));
return;
}
@@ -230,25 +235,28 @@ public class ProxyEntryDialog extends StatusDialog {
return;
}
if (hostText.getText().length() == 0) {
- updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ updateStatus(new Status(IStatus.ERROR,
+ PLUGIN_ID,
IStatus.OK, NetUIMessages.ProxyEntryDialog_10, null));
return;
}
try {
int port = Integer.parseInt(portText.getText());
if (port < 0) {
- updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ updateStatus(new Status(IStatus.ERROR,
+ PLUGIN_ID,
IStatus.OK, NetUIMessages.ProxyEntryDialog_11, null));
return;
}
} catch (NumberFormatException e) {
- updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ updateStatus(new Status(IStatus.ERROR,
+ PLUGIN_ID,
IStatus.OK, NetUIMessages.ProxyEntryDialog_11, null));
return;
}
if (requiresAuthentificationButton.getSelection()) {
if (userIdText.getText().length() == 0) {
- updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ updateStatus(new Status(IStatus.ERROR, PLUGIN_ID,
IStatus.OK, NetUIMessages.ProxyEntryDialog_12, null));
return;
}
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java
index 6746e875a..21000ba35 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java
@@ -61,8 +61,12 @@ public class UserValidationDialog extends Dialog {
}
return uio.authentication;
}
+
/**
- * Gets user and password from a user Must be called from UI thread
+ * Gets user and password from a user. Must be called from UI thread.
+ *
+ * @param host the host name
+ * @param message the message to be displayed when prompting
*
* @return UserAuthentication that contains the userid and the password or
* <code>null</code> if the dialog has been cancelled
@@ -73,11 +77,13 @@ public class UserValidationDialog extends Dialog {
ui.open();
return ui.getAuthentication();
}
+
/**
* Creates a new UserValidationDialog.
*
- * @param parentShell
- * parent Shell or null
+ * @param parentShell parent Shell or <code>null</code>
+ * @param host the host name
+ * @param message the message to be displayed when prompting
*/
protected UserValidationDialog(Shell parentShell, String host,
String message) {
@@ -126,8 +132,11 @@ public class UserValidationDialog extends Dialog {
"org.eclipse.update.ui.UserValidationDialog"); //$NON-NLS-1$
return main;
}
+
/**
* Creates the three widgets that represent the user name entry area.
+ *
+ * @param parent
*/
protected void createPasswordFields(Composite parent) {
new Label(parent, SWT.NONE).setText(NetUIMessages.UserValidationDialog_2);
@@ -139,8 +148,11 @@ public class UserValidationDialog extends Dialog {
new Label(parent, SWT.NONE); //spacer
}
+
/**
* Creates the three widgets that represent the user name entry area.
+ *
+ * @param parent
*/
protected void createUsernameFields(Composite parent) {
new Label(parent, SWT.NONE).setText(NetUIMessages.UserValidationDialog_3);
diff --git a/examples/org.eclipse.compare.examples.xml/.classpath b/examples/org.eclipse.compare.examples.xml/.classpath
index 13dd0fb17..6248f62f7 100644
--- a/examples/org.eclipse.compare.examples.xml/.classpath
+++ b/examples/org.eclipse.compare.examples.xml/.classpath
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="tests"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/examples/org.eclipse.compare.examples.xml/.cvsignore b/examples/org.eclipse.compare.examples.xml/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/examples/org.eclipse.compare.examples.xml/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.core.runtime.prefs b/examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.core.runtime.prefs
+++ b/examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.jdt.core.prefs
index 2f635f468..035f3d5a5 100644
--- a/examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/org.eclipse.compare.examples.xml/.settings/org.eclipse.jdt.core.prefs
@@ -8,9 +8,9 @@ org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -21,6 +21,7 @@ org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -48,6 +49,7 @@ org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
@@ -65,6 +67,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/examples/org.eclipse.compare.examples.xml/IdMaps/idmap.dtd b/examples/org.eclipse.compare.examples.xml/IdMaps/idmap.dtd
index b60a2faae..69ef654eb 100644
--- a/examples/org.eclipse.compare.examples.xml/IdMaps/idmap.dtd
+++ b/examples/org.eclipse.compare.examples.xml/IdMaps/idmap.dtd
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!ELEMENT idmap (element)*>
-<!ATTLIST idmat
- name CDATA #REQUIRED>
-<!ELEMENT element EMPTY>
-<!ATTLIST element
- signature ID #REQUIRED
- id_attr CDATA #REQUIRED>
+<?xml version="1.0" encoding="UTF-8"?>
+<!ELEMENT idmap (element)*>
+<!ATTLIST idmat
+ name CDATA #REQUIRED>
+<!ELEMENT element EMPTY>
+<!ATTLIST element
+ signature ID #REQUIRED
+ id_attr CDATA #REQUIRED>
diff --git a/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF b/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
index c34aaf8ec..ee3f8b2da 100644
--- a/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare.examples.xml; singleton:=true
-Bundle-Version: 3.4.700.qualifier
+Bundle-Version: 3.5.0.qualifier
Bundle-Activator: org.eclipse.compare.examples.xml.XMLPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -15,5 +15,5 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jface.text,
org.junit
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.compare.examples.xml
diff --git a/examples/org.eclipse.compare.examples.xml/pom.xml b/examples/org.eclipse.compare.examples.xml/pom.xml
index c37972eb9..426c5a565 100644
--- a/examples/org.eclipse.compare.examples.xml/pom.xml
+++ b/examples/org.eclipse.compare.examples.xml/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.compare</groupId>
<artifactId>org.eclipse.compare.examples.xml</artifactId>
- <version>3.4.700-SNAPSHOT</version>
+ <version>3.5.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java
index 41e19227c..82057fc77 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java
@@ -160,7 +160,7 @@ public abstract class AbstractMatching {
}
/* represents a matching between a node in the Left tree and a node in the Right tree */
- class Match {
+ static class Match {
public XMLNode fx;
public XMLNode fy;
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/CreateNewIdMapAction.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/CreateNewIdMapAction.java
index 4ecaf135a..ffb22b164 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/CreateNewIdMapAction.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/CreateNewIdMapAction.java
@@ -58,7 +58,7 @@ public class CreateNewIdMapAction extends Action {
if (dialog.open() == Window.OK) {
if (!fIdMaps.containsKey(idmap.getName())) {
fIdMaps.put(idmap.getName(),new HashMap());
- if (!idmap.getExtension().equals("")) //$NON-NLS-1$
+ if (!idmap.getExtension().isEmpty())
fIdExtensionToName.put(idmap.getExtension(),idmap.getName());
XMLPlugin.getDefault().setIdMaps(fIdMaps,fIdExtensionToName,null,false);
}
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/Messages.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/Messages.java
index 1ff1b671e..cf0feb019 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/Messages.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/Messages.java
@@ -23,7 +23,7 @@ import java.text.MessageFormat;
public class Messages {
public static String format(String message, Object object) {
- return MessageFormat.format(message, new Object[] { object});
+ return MessageFormat.format(message, object);
}
public static String format(String message, Object[] objects) {
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLComparePreferencePage.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLComparePreferencePage.java
index f4eb8115d..584804472 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLComparePreferencePage.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLComparePreferencePage.java
@@ -405,7 +405,7 @@ public class XMLComparePreferencePage extends PreferencePage implements IWorkben
if (dialog.open() == Window.OK) {
if (!fIdMaps.containsKey(idmap.getName())) {
fIdMaps.put(idmap.getName(),new HashMap());
- if (!idmap.getExtension().equals("")) //$NON-NLS-1$
+ if (!idmap.getExtension().isEmpty())
fIdExtensionToName.put(idmap.getExtension(),idmap.getName());
newIdMapsTableItem(idmap,true);
}
@@ -424,7 +424,7 @@ public class XMLComparePreferencePage extends PreferencePage implements IWorkben
fIdMaps.remove(old_name);
fIdExtensionToName.remove(old_extension);
fIdMaps.put(idmap.getName(),idmapHS);
- if (!idmap.getExtension().equals("")) //$NON-NLS-1$
+ if (!idmap.getExtension().isEmpty())
fIdExtensionToName.put(idmap.getExtension(),idmap.getName());
fIdMapsTable.remove(fIdMapsTable.indexOf(itemsIdMaps[0]));
newIdMapsTableItem(idmap,true);
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java
index 84de2798f..fb5b808e0 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java
@@ -35,13 +35,13 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* This class is the plug-in runtime class for the
* <code>"org.eclipse.compare.xml"</code> plug-in.
- * </p>
*/
public final class XMLPlugin extends AbstractUIPlugin {
@@ -157,7 +157,7 @@ public final class XMLPlugin extends AbstractUIPlugin {
IdMapAttribute = CurrentIdMap.substring(end_of_signature+1,end_of_attribute);
String IdMapExtension= CurrentIdMap.substring(end_of_attribute+1,CurrentIdMap.length());
//if extension already associated, do not associate with this idmap
- if (!IdMapExtension.equals("") && !fIdExtensionToName.containsKey(IdMapExtension)) { //$NON-NLS-1$
+ if (!IdMapExtension.isEmpty() && !fIdExtensionToName.containsKey(IdMapExtension)) {
fIdExtensionToName.put(IdMapExtension,IdMapName);
CompareUI.addStructureViewerAlias(DEFAULT_PREFIX, IdMapExtension);
}
@@ -307,8 +307,8 @@ public final class XMLPlugin extends AbstractUIPlugin {
String attribute= mapping.getAttribute(MAPPING_ID_ATTRIBUTE);
String idsource= mapping.getAttribute(MAPPING_ID_SOURCE);
String bodyid= ""; //$NON-NLS-1$
- if (signature != null && !signature.equals("") //$NON-NLS-1$
- && attribute != null && !attribute.equals("")) { //$NON-NLS-1$
+ if (signature != null && !signature.isEmpty()
+ && attribute != null && !attribute.isEmpty()) {
if (idsource != null && idsource.equals(MAPPING_ID_SOURCE_BODY))
bodyid= (Character.valueOf(XMLStructureCreator.ID_TYPE_BODY)).toString();
idmapHM.put(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR
@@ -323,7 +323,7 @@ public final class XMLPlugin extends AbstractUIPlugin {
//add SIGN_SEPARATOR at the end because not contained in signatures of plugin.xml
//also add prefix at beginning
String signature= ordered.getAttribute(ORDERED_SIGNATURE_ATTRIBUTE);
- if (signature != null && !signature.equals("")) //$NON-NLS-1$
+ if (signature != null && !signature.isEmpty())
orderedAL.add(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + signature + XMLStructureCreator.SIGN_SEPARATOR);
}
if (orderedAL.size() > 0)
@@ -352,7 +352,7 @@ public final class XMLPlugin extends AbstractUIPlugin {
}
public static IWorkbenchWindow getActiveWorkbenchWindow() {
- IWorkbenchWindow window= fgXMLPlugin.getWorkbench().getActiveWorkbenchWindow();
+ IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
final WindowRef windowRef= new WindowRef();
Display.getDefault().syncExec(() -> setActiveWorkbenchWindow(windowRef));
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java
index f78e35de7..3d7531925 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java
@@ -249,7 +249,7 @@ public class XMLStructureCreator implements IStructureCreator {
} catch (Exception e) {
value= ""; //$NON-NLS-1$
}
- if (value.equals("")) //$NON-NLS-1$
+ if (value.isEmpty())
found= true;
else if (value.equals(attr_value)) {
id_index= element_string.lastIndexOf(attr_name, first_quotes - 1);
@@ -328,7 +328,7 @@ public class XMLStructureCreator implements IStructureCreator {
System.out.println("Body Location: line " + locator.getLineNumber() + " column " + locator.getColumnNumber()); //$NON-NLS-2$ //$NON-NLS-1$
//if text contains only white space, it will be ignored.
- if (!trimWhiteSpace(chars).equals("")) { //$NON-NLS-1$
+ if (!trimWhiteSpace(chars).isEmpty()) {
if (XMLStructureCreator.DEBUG_MODE)
System.out.println("Adding body"); //$NON-NLS-1$
try {
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ui/MessageLine.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ui/MessageLine.java
index a22427702..f44338a9c 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ui/MessageLine.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ui/MessageLine.java
@@ -89,7 +89,7 @@ public class MessageLine extends CLabel {
/**
* Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
+ * @return The message. If no message is displayed <code>null</code> is returned.
*/
public String getMessage() {
return fMessageText;
@@ -115,7 +115,6 @@ public class MessageLine extends CLabel {
} else {
if (fErrorColor == null) {
fErrorColor= new Color(getDisplay(), fErrorRGB);
- addDisposeListener(e -> fErrorColor.dispose());
}
setForeground(fErrorColor);
setText(message);
diff --git a/examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/AllXMLCompareTests.java b/examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/AllXMLCompareTests.java
index c3d2002ee..b4f638edd 100644
--- a/examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/AllXMLCompareTests.java
+++ b/examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/AllXMLCompareTests.java
@@ -13,21 +13,17 @@
*******************************************************************************/
package org.eclipse.compare.examples.xml;
-import junit.framework.*;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
/**
* TestSuite that runs all the XML Compare tests.
*/
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ TestXMLStructureCreator.class
+})
public class AllXMLCompareTests {
-
- public static void main (String[] args) {
- junit.textui.TestRunner.run (suite());
- }
-
- public static Test suite ( ) {
- TestSuite suite= new TestSuite("All XML Compare Tests"); //$NON-NLS-1$
- suite.addTest(TestXMLStructureCreator.suite());
- return suite;
- }
+ //test suite
}
diff --git a/examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/TestXMLStructureCreator.java b/examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/TestXMLStructureCreator.java
index d94c686af..7bd6bb308 100644
--- a/examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/TestXMLStructureCreator.java
+++ b/examples/org.eclipse.compare.examples.xml/tests/org/eclipse/compare/examples/xml/TestXMLStructureCreator.java
@@ -13,203 +13,286 @@
*******************************************************************************/
package org.eclipse.compare.examples.xml;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-
-import junit.framework.*;
-
-import org.eclipse.jface.text.Document;
+import java.nio.charset.StandardCharsets;
import org.eclipse.compare.IEncodedStreamContentAccessor;
-import org.eclipse.compare.examples.xml.XMLChildren;
-import org.eclipse.compare.examples.xml.XMLNode;
-import org.eclipse.compare.examples.xml.XMLStructureCreator;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.Document;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestXMLStructureCreator {
-public class TestXMLStructureCreator extends TestCase {
-
Document fdoc;
XMLStructureCreator fsc;
-
- public class TestStream implements IEncodedStreamContentAccessor {
+
+ public static class TestStream implements IEncodedStreamContentAccessor {
String fString;
-
+
public TestStream(String string) {
- fString= string;
+ fString = string;
}
-
+
@Override
public InputStream getContents() throws CoreException {
- try {
- return new ByteArrayInputStream(fString.getBytes("UTF-16")); //$NON-NLS-1$
- } catch (Exception e) {
- return new ByteArrayInputStream(fString.getBytes());
- }
+ return new ByteArrayInputStream(fString.getBytes(StandardCharsets.UTF_16));
}
-
+
@Override
public String getCharset() {
return "UTF-16"; //$NON-NLS-1$
}
}
-
- public TestXMLStructureCreator(String name) {
- super(name);
- }
- @Override
- protected void setUp() {
- System.out.println("TestXMLStructureCreator.name()==" + getName()); //$NON-NLS-1$
+ @Before
+ public void setUp() {
fdoc = new Document();
fsc = new XMLStructureCreator();
}
-
- @Override
- protected void tearDown() throws Exception {
- //remove set-up
- }
-
- public static Test suite() {
- return new TestSuite(TestXMLStructureCreator.class);
- }
+ @Test
public void test0() {
- TestStream s= new TestStream("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<a attr1=\"&lt;b&gt;&lt;/b&gt;\"\nattr2=\"he\n ll\n o2\" attr3=\"hello3\"\nattr4=\"hello4\"><b attr=\n\"battr\" attr2=\"battr2\">\n<c/>\n</b>\n<b2/>\n</a>\n"); //$NON-NLS-1$
- XMLChildren Tree= (XMLChildren) fsc.getStructure(s);
+ TestStream s = new TestStream(
+ "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<a attr1=\"&lt;b&gt;&lt;/b&gt;\"\nattr2=\"he\n ll\n o2\" attr3=\"hello3\"\nattr4=\"hello4\"><b attr=\n\"battr\" attr2=\"battr2\">\n<c/>\n</b>\n<b2/>\n</a>\n"); //$NON-NLS-1$
+ XMLChildren Tree = (XMLChildren) fsc.getStructure(s);
- XMLChildren ExpectedTree = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,XMLStructureCreator.ROOT_ID, "",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$
- //create Expected Tree
- XMLChildren parent = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,"a<[1]","<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<a attr1=\"&lt;b&gt;&lt;/b&gt;\"\nattr2=\"he\n ll\n o2\" attr3=\"hello3\"\nattr4=\"hello4\"><b attr=\n\"battr\" attr2=\"battr2\">\n<c/>\n</b>\n<b2/>\n</a>\n",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ XMLChildren ExpectedTree = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, XMLStructureCreator.ROOT_ID, "", //$NON-NLS-1$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
+ // create Expected Tree
+ XMLChildren parent = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, "a<[1]", //$NON-NLS-1$
+ "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<a attr1=\"&lt;b&gt;&lt;/b&gt;\"\nattr2=\"he\n ll\n o2\" attr3=\"hello3\"\nattr4=\"hello4\"><b attr=\n\"battr\" attr2=\"battr2\">\n<c/>\n</b>\n<b2/>\n</a>\n", //$NON-NLS-1$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
parent.setName("a [1]"); //$NON-NLS-1$
ExpectedTree.addChild(parent);
parent.setParent(ExpectedTree);
- XMLChildren current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE,"attr1","<b></b>",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + "attr1" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ATTRIBUTE), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ XMLChildren current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE, "attr1", "<b></b>", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "attr1" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_ATTRIBUTE),
+ fdoc, 0, 0);
current.setName("attr1"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE,"attr2","he ll o2",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + "attr2" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ATTRIBUTE), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE, "attr2", "he ll o2", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "attr2" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_ATTRIBUTE),
+ fdoc, 0, 0);
current.setName("attr2"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE,"attr3","hello3",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + "attr3" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ATTRIBUTE), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE, "attr3", "hello3", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "attr3" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_ATTRIBUTE),
+ fdoc, 0, 0);
current.setName("attr3"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE,"attr4","hello4",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + "attr4" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ATTRIBUTE), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE, "attr4", "hello4", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "attr4" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_ATTRIBUTE),
+ fdoc, 0, 0);
current.setName("attr4"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,"b<[1]","<b attr=\n\"battr\" attr2=\"battr2\">\n<c/>\n</b>\n",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR +"b" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, "b<[1]", //$NON-NLS-1$
+ "<b attr=\n\"battr\" attr2=\"battr2\">\n<c/>\n</b>\n", //$NON-NLS-1$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
current.setName("b [1]"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
parent = current;
- current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE,"attr","battr",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "attr" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ATTRIBUTE), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE, "attr", "battr", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "attr" //$NON-NLS-1$ //$NON-NLS-2$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ATTRIBUTE),
+ fdoc, 0, 0);
current.setName("attr"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE,"attr2","battr2",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "attr2" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ATTRIBUTE), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ATTRIBUTE, "attr2", "battr2", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "attr2" //$NON-NLS-1$ //$NON-NLS-2$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ATTRIBUTE),
+ fdoc, 0, 0);
current.setName("attr2"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,"c<[1]","<c/>",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, "c<[1]", "<c/>", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" //$NON-NLS-1$ //$NON-NLS-2$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
current.setName("c [1]"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
parent = (XMLChildren) parent.getParent();
- current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,"b2<[1]","<b2/>",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR +"b2" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, "b2<[1]", "<b2/>", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b2" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
current.setName("b2 [1]"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
-
- checkTrees(Tree,ExpectedTree);
+
+ checkTrees(Tree, ExpectedTree);
}
-
+
+ @Test
public void test1() {
- TestStream s= new TestStream("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<a>body_a_1\n <b>body_b_1\n <c>body_c_1\n <d2>body_d2\n </d2>\nbody_c_2\n </c>\nbody_b_2\n </b>\nbody_a_2\n <b2>\n </b2>\nbody_a_3\n</a>"); //$NON-NLS-1$
- XMLChildren Tree= (XMLChildren) fsc.getStructure(s);
+ TestStream s = new TestStream(
+ "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<a>body_a_1\n <b>body_b_1\n <c>body_c_1\n <d2>body_d2\n </d2>\nbody_c_2\n </c>\nbody_b_2\n </b>\nbody_a_2\n <b2>\n </b2>\nbody_a_3\n</a>"); //$NON-NLS-1$
+ XMLChildren Tree = (XMLChildren) fsc.getStructure(s);
- XMLChildren ExpectedTree = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,XMLStructureCreator.ROOT_ID, "",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$
- //create Expected Tree
- XMLChildren parent = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,"a<[1]","<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<a>body_a_1\n <b>body_b_1\n <c>body_c_1\n <d2>body_d2\n </d2>\nbody_c_2\n </c>\nbody_b_2\n </b>\nbody_a_2\n <b2>\n </b2>\nbody_a_3\n</a>",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ XMLChildren ExpectedTree = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, XMLStructureCreator.ROOT_ID, "", //$NON-NLS-1$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
+ // create Expected Tree
+ XMLChildren parent = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, "a<[1]", //$NON-NLS-1$
+ "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<a>body_a_1\n <b>body_b_1\n <c>body_c_1\n <d2>body_d2\n </d2>\nbody_c_2\n </c>\nbody_b_2\n </b>\nbody_a_2\n <b2>\n </b2>\nbody_a_3\n</a>", //$NON-NLS-1$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
parent.setName("a [1]"); //$NON-NLS-1$
ExpectedTree.addChild(parent);
parent.setParent(ExpectedTree);
- XMLChildren current = new XMLChildren(XMLStructureCreator.TYPE_TEXT,"body_(1)","body_a_1\n ",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ XMLChildren current = new XMLChildren(XMLStructureCreator.TYPE_TEXT, "body_(1)", "body_a_1\n ", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT),
+ fdoc, 0, 0);
current.setName("body (1)"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,"b<[1]","<b>body_b_1\n <c>body_c_1\n <d2>body_d2\n </d2>\nbody_c_2\n </c>\nbody_b_2\n </b>\n",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, "b<[1]", //$NON-NLS-1$
+ "<b>body_b_1\n <c>body_c_1\n <d2>body_d2\n </d2>\nbody_c_2\n </c>\nbody_b_2\n </b>\n", //$NON-NLS-1$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
current.setName("b [1]"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
parent = current;
- current = new XMLChildren(XMLStructureCreator.TYPE_TEXT,"body_(1)","body_b_1\n ",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ current = new XMLChildren(XMLStructureCreator.TYPE_TEXT, "body_(1)", "body_b_1\n ", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_TEXT),
+ fdoc, 0, 0);
current.setName("body (1)"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,"c<[1]","<c>body_c_1\n <d2>body_d2\n </d2>\nbody_c_2\n </c>\n",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR +"a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, "c<[1]", //$NON-NLS-1$
+ "<c>body_c_1\n <d2>body_d2\n </d2>\nbody_c_2\n </c>\n", //$NON-NLS-1$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" //$NON-NLS-1$ //$NON-NLS-2$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
current.setName("c [1]"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
parent = current;
- current = new XMLChildren(XMLStructureCreator.TYPE_TEXT,"body_(1)","body_c_1\n ",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ current = new XMLChildren(XMLStructureCreator.TYPE_TEXT, "body_(1)", "body_c_1\n ", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" //$NON-NLS-1$ //$NON-NLS-2$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT),
+ fdoc, 0, 0);
current.setName("body (1)"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,"d2<[1]","<d2>body_d2\n </d2>\n",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" + XMLStructureCreator.SIGN_SEPARATOR + "d2" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, "d2<[1]", "<d2>body_d2\n </d2>\n", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" //$NON-NLS-1$ //$NON-NLS-2$
+ + XMLStructureCreator.SIGN_SEPARATOR + "d2" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
current.setName("d2 [1]"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
parent = current;
- current = new XMLChildren(XMLStructureCreator.TYPE_TEXT,"body_(1)","body_d2\n ",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" + XMLStructureCreator.SIGN_SEPARATOR + "d2" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ current = new XMLChildren(XMLStructureCreator.TYPE_TEXT, "body_(1)", "body_d2\n ", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" //$NON-NLS-1$ //$NON-NLS-2$
+ + XMLStructureCreator.SIGN_SEPARATOR + "d2" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_TEXT),
+ fdoc, 0, 0);
current.setName("body (1)"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
parent = (XMLChildren) parent.getParent();
- current = new XMLChildren(XMLStructureCreator.TYPE_TEXT,"body_(2)","\nbody_c_2\n ",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ current = new XMLChildren(XMLStructureCreator.TYPE_TEXT, "body_(2)", "\nbody_c_2\n ", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + "c" //$NON-NLS-1$ //$NON-NLS-2$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT),
+ fdoc, 0, 0);
current.setName("body (2)"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
parent = (XMLChildren) parent.getParent();
- current = new XMLChildren(XMLStructureCreator.TYPE_TEXT,"body_(2)","\nbody_b_2\n ",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ current = new XMLChildren(XMLStructureCreator.TYPE_TEXT, "body_(2)", "\nbody_b_2\n ", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_TEXT),
+ fdoc, 0, 0);
current.setName("body (2)"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
parent = (XMLChildren) parent.getParent();
- current = new XMLChildren(XMLStructureCreator.TYPE_TEXT,"body_(2)","\nbody_a_2\n ",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ current = new XMLChildren(XMLStructureCreator.TYPE_TEXT, "body_(2)", "\nbody_a_2\n ", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT),
+ fdoc, 0, 0);
current.setName("body (2)"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT,"b2<[1]","<b2>\n </b2>\n",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + "b2" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_ELEMENT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ current = new XMLChildren(XMLStructureCreator.TYPE_ELEMENT, "b2<[1]", "<b2>\n </b2>\n", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + "b2" + XMLStructureCreator.SIGN_SEPARATOR //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_ELEMENT),
+ fdoc, 0, 0);
current.setName("b2 [1]"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- current = new XMLChildren(XMLStructureCreator.TYPE_TEXT,"body_(3)","\nbody_a_3\n",(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT), fdoc, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ current = new XMLChildren(XMLStructureCreator.TYPE_TEXT, "body_(3)", "\nbody_a_3\n", //$NON-NLS-1$ //$NON-NLS-2$
+ (XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + "a" //$NON-NLS-1$
+ + XMLStructureCreator.SIGN_SEPARATOR + XMLStructureCreator.SIGN_TEXT),
+ fdoc, 0, 0);
current.setName("body (2)"); //$NON-NLS-1$
parent.addChild(current);
current.setParent(parent);
- checkTrees(Tree,ExpectedTree);
+ checkTrees(Tree, ExpectedTree);
}
-
+
protected void checkTrees(XMLNode left, XMLNode right) {
if (left != null && right != null) {
- //System.out.println(left.getName() + ", " + right.getName());
- //System.out.println(">" + left.getValue() + "<\n>" + right.getValue() + "<");
+ // System.out.println(left.getName() + ", " + right.getName());
+ // System.out.println(">" + left.getValue() + "<\n>" + right.getValue() + "<");
assertTrue(left.testEquals(right));
Object[] leftChildren = left.getChildren();
Object[] rightChildren = right.getChildren();
if (leftChildren != null && rightChildren != null) {
if (leftChildren.length == rightChildren.length) {
- for (int i=0; i<leftChildren.length; i++)
+ for (int i = 0; i < leftChildren.length; i++)
checkTrees((XMLNode) leftChildren[i], (XMLNode) rightChildren[i]);
} else
- assertTrue(false);
+ fail();
}
- } else if ( ((left == null) && (right != null)) || ((left != null) && (right == null)) ) {
- assertTrue(false);
+ } else if (((left == null) && (right != null)) || ((left != null) && (right == null))) {
+ fail();
}
}
}
-
diff --git a/examples/org.eclipse.compare.examples/.classpath b/examples/org.eclipse.compare.examples/.classpath
index 01836c484..e801ebfb4 100644
--- a/examples/org.eclipse.compare.examples/.classpath
+++ b/examples/org.eclipse.compare.examples/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/examples/org.eclipse.compare.examples/.cvsignore b/examples/org.eclipse.compare.examples/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/examples/org.eclipse.compare.examples/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/examples/org.eclipse.compare.examples/.settings/org.eclipse.core.runtime.prefs b/examples/org.eclipse.compare.examples/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/examples/org.eclipse.compare.examples/.settings/org.eclipse.core.runtime.prefs
+++ b/examples/org.eclipse.compare.examples/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/examples/org.eclipse.compare.examples/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.compare.examples/.settings/org.eclipse.jdt.core.prefs
index 2f635f468..035f3d5a5 100644
--- a/examples/org.eclipse.compare.examples/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/org.eclipse.compare.examples/.settings/org.eclipse.jdt.core.prefs
@@ -8,9 +8,9 @@ org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -21,6 +21,7 @@ org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -48,6 +49,7 @@ org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
@@ -65,6 +67,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/examples/org.eclipse.compare.examples/META-INF/MANIFEST.MF b/examples/org.eclipse.compare.examples/META-INF/MANIFEST.MF
index 3f05cedf7..d9756e056 100644
--- a/examples/org.eclipse.compare.examples/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.compare.examples/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare.examples; singleton:=true
-Bundle-Version: 3.2.300.qualifier
+Bundle-Version: 3.3.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.compare.examples.structurecreator
@@ -12,5 +12,5 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.jface.text,
org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.compare.examples
diff --git a/examples/org.eclipse.compare.examples/pom.xml b/examples/org.eclipse.compare.examples/pom.xml
index 2f79df01d..9e6b63a33 100644
--- a/examples/org.eclipse.compare.examples/pom.xml
+++ b/examples/org.eclipse.compare.examples/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.compare</groupId>
<artifactId>org.eclipse.compare.examples</artifactId>
- <version>3.2.300-SNAPSHOT</version>
+ <version>3.3.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/examples/org.eclipse.team.examples.filesystem/.classpath b/examples/org.eclipse.team.examples.filesystem/.classpath
index 01836c484..e801ebfb4 100644
--- a/examples/org.eclipse.team.examples.filesystem/.classpath
+++ b/examples/org.eclipse.team.examples.filesystem/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/examples/org.eclipse.team.examples.filesystem/.cvsignore b/examples/org.eclipse.team.examples.filesystem/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/examples/org.eclipse.team.examples.filesystem/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.core.runtime.prefs b/examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.core.runtime.prefs
+++ b/examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.jdt.core.prefs
index c281c8a64..eacdf1798 100644
--- a/examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/org.eclipse.team.examples.filesystem/.settings/org.eclipse.jdt.core.prefs
@@ -10,9 +10,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -27,6 +27,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
@@ -72,6 +73,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
@@ -109,13 +111,14 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
org.eclipse.jdt.core.formatter.align_with_spaces=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -123,21 +126,24 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@@ -229,11 +235,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -264,6 +271,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -288,13 +297,17 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -342,6 +355,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -378,9 +393,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -419,9 +437,13 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/examples/org.eclipse.team.examples.filesystem/META-INF/MANIFEST.MF b/examples/org.eclipse.team.examples.filesystem/META-INF/MANIFEST.MF
index 81f1dd2ce..1520cfb60 100644
--- a/examples/org.eclipse.team.examples.filesystem/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.team.examples.filesystem/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.examples.filesystem; singleton:=true
-Bundle-Version: 3.5.500.qualifier
+Bundle-Version: 3.6.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.team.examples.filesystem,
@@ -31,5 +31,5 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui.navigator
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.team.examples.filesystem.FileSystemPlugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.team.examples.filesystem
diff --git a/examples/org.eclipse.team.examples.filesystem/pom.xml b/examples/org.eclipse.team.examples.filesystem/pom.xml
index b412a8d91..2bfa9076a 100644
--- a/examples/org.eclipse.team.examples.filesystem/pom.xml
+++ b/examples/org.eclipse.team.examples.filesystem/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.examples.filesystem</artifactId>
- <version>3.5.500-SNAPSHOT</version>
+ <version>3.6.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java
index 46276b40a..91afa6e69 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java
@@ -272,21 +272,15 @@ public class FileSystemOperations {
// so nothing needs to be done
return;
}
- try {
- //Copy from the local file to the remote file:
- InputStream source = null;
- try {
- // Get the remote file content.
- source = remote.getContents();
- // Set the local file content to be the same as the remote file.
- if (localFile.exists())
- localFile.setContents(source, false, false, progress);
- else
- localFile.create(source, false, progress);
- } finally {
- if (source != null)
- source.close();
- }
+ // Copy from the local file to the remote file:
+ // Get the remote file content.
+ try (InputStream source = remote.getContents()) {
+ // Set the local file content to be the same as the remote file.
+ if (localFile.exists())
+ localFile.setContents(source, false, false, progress);
+ else
+ localFile.create(source, false, progress);
+
// Mark as read-only to force a checkout before editing
localFile.setReadOnly(true);
synchronizer.setBaseBytes(localFile, remote.asBytes());
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemPlugin.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemPlugin.java
index f3a333330..df44644ac 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemPlugin.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemPlugin.java
@@ -25,7 +25,7 @@ import org.osgi.framework.BundleContext;
/**
* This is the plugin class for the file system examples. It provides the following:
- *
+ *
* <ol>
* <li>public fields for the plugin and provider IDs as defined in the plugin.xml
* <li>initialization on startup of Policy class that provides internationalization of strings
@@ -34,24 +34,24 @@ import org.osgi.framework.BundleContext;
* </ol>
*/
public class FileSystemPlugin extends AbstractUIPlugin {
-
+
/**
* This is the ID of the plugin as defined in the plugin.xml
*/
public static final String ID = "org.eclipse.team.examples.filesystem"; //$NON-NLS-1$
-
+
/**
* This is the provider ID of the plugin as defined in the plugin.xml
*/
public static final String PROVIDER_ID = ID + ".FileSystemProvider"; //$NON-NLS-1$
-
+
// This static field will hold the singleton instance of the plugin class
private static FileSystemPlugin plugin;
-
+
private PessimisticFilesystemProviderPlugin pessPlugin;
-
+
private PluginManifestChangeTracker tracker;
-
+
/**
* Override the standard plugin constructor.
*/
@@ -62,22 +62,22 @@ public class FileSystemPlugin extends AbstractUIPlugin {
// Instanctiate pessimistic provider
pessPlugin = new PessimisticFilesystemProviderPlugin();
}
-
+
/**
* Return the singlton instance of the plugin class to allow other
- * classes in the plugin access to plugin instance methods such as
+ * classes in the plugin access to plugin instance methods such as
* those for logging errors, etc.
*/
public static FileSystemPlugin getPlugin() {
return plugin;
}
-
+
/**
* Helper method to convert a CoreException into a TeamException.
* We do this to maintain the core status and code. This type of
- * mapping may not be appropriate in more complicated exception
+ * mapping may not be appropriate in more complicated exception
* handling situations.
- *
+ *
* @param e the CoreException
*/
public static TeamException wrapException(CoreException e) {
@@ -86,25 +86,25 @@ public class FileSystemPlugin extends AbstractUIPlugin {
/**
* Helper method to convert an IOException into a TeamException.
- * This type of mapping may not be appropriate in more complicated
+ * This type of mapping may not be appropriate in more complicated
* exception handling situations.
- *
+ *
* @param e the CoreException
*/
public static TeamException wrapException(IOException e) {
- return new TeamException(new Status(IStatus.ERROR, FileSystemPlugin.ID,
+ return new TeamException(new Status(IStatus.ERROR, FileSystemPlugin.ID,
TeamException.IO_FAILED, e.getMessage(), e));
}
-
+
/**
* Helper method to log an exception status.
- *
+ *
* @param status the status to be logged
*/
public static void log(IStatus status) {
plugin.getLog().log(status);
}
-
+
/**
* Returns the standard display to be used. The method first checks, if
* the thread calling this method has an associated display. If so, this
@@ -115,9 +115,10 @@ public class FileSystemPlugin extends AbstractUIPlugin {
if (display == null) {
display= Display.getDefault();
}
- return display;
+ return display;
}
-
+
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
//Call startup on the Pessimistic Plugin
@@ -125,7 +126,8 @@ public class FileSystemPlugin extends AbstractUIPlugin {
tracker = new PluginManifestChangeTracker();
tracker.start();
}
-
+
+ @Override
public void stop(BundleContext context) throws Exception {
try {
if (pessPlugin != null)
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProvider.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProvider.java
index ea1fe81b7..11bccccab 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProvider.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProvider.java
@@ -38,7 +38,7 @@ import org.eclipse.team.examples.filesystem.subscriber.FileSystemSubscriber;
* to register this provider with the Team extension point <code>org.eclipse.team.core.repository</code>.
* The plugin.xml file also contains examples of how to filter menu items using a repository provider's
* ID.
- *
+ *
* <p>
* This example provider illustrates the following:
* <ol>
@@ -46,7 +46,7 @@ import org.eclipse.team.examples.filesystem.subscriber.FileSystemSubscriber;
* <li>storage of a persistent property with the project (which provides the target location for the provider)
* <li>access to an instance of <code>SimpleAccessOperations</code> for performing simple file operations
* </ol>
- *
+ *
* <p>
* Additional functionality that will be illustrated in the future include:
* <ol>
@@ -57,38 +57,38 @@ import org.eclipse.team.examples.filesystem.subscriber.FileSystemSubscriber;
* <li>Use of decorators
* <li>combining streams and progress monitors to get responsive UI
* </ol>
- *
+ *
*/
public class FileSystemProvider extends RepositoryProvider {
-
+
/*
* Create a custom rule factory to allow more optimistic concurrency
*/
private static final ResourceRuleFactory RESOURCE_RULE_FACTORY = new ResourceRuleFactory() {
// Just need a subclass to instantiate
};
-
+
// The location of the folder on file system where the repository is stored.
private IPath root;
-
+
// The QualifiedName that is used to persist the location across workspace as a persistent property on a resource
private static QualifiedName FILESYSTEM_REPO_LOC = new QualifiedName(FileSystemPlugin.ID, "disk_location"); //$NON-NLS-1$
private static FileSystemHistoryProvider fileHistoryProvider;
-
+
/**
* Create a new FileSystemProvider.
*/
public FileSystemProvider() {
super();
}
-
+
/**
* This method is invoked when the provider is mapped to a project.
- * Although we have access to the project at this point (using
+ * Although we have access to the project at this point (using
* <code>getProject()</code>, we don't know the root location so
* there is nothing we can do yet.
- *
+ *
* @see org.eclipse.team.core.RepositoryProvider#configureProject()
*/
@Override
@@ -99,7 +99,7 @@ public class FileSystemProvider extends RepositoryProvider {
/**
* This method is invoked when the provider is unmapped from its
* project.
- *
+ *
* @see org.eclipse.core.resources.IProjectNature#deconfigure()
*/
@Override
@@ -111,33 +111,33 @@ public class FileSystemProvider extends RepositoryProvider {
/**
* Return the provider ID as specified in the plugin.xml
- *
+ *
* @see RepositoryProvider#getID()
*/
@Override
public String getID() {
return FileSystemPlugin.PROVIDER_ID;
}
-
+
/**
- * Set the file system location for the provider. This mist be invoked after
- * the provider is mapped and configured but before the provider is used to
+ * Set the file system location for the provider. This mist be invoked after
+ * the provider is mapped and configured but before the provider is used to
* perform any operations.
- *
+ *
* @param location the path representing the location where the project contents will be stored.
* @throws TeamException
*/
public void setTargetLocation(String location) throws TeamException {
-
+
// set the instance variable to the provided path
root = new Path(location);
-
+
// ensure that the location is a folder (if it exists)
File file = new File(location);
if (file.exists() && !file.isDirectory()) {
throw new TeamException(Policy.bind("FileSystemProvider.mustBeFolder", location)); //$NON-NLS-1$
}
-
+
// record the location as a persistant property so it will be remembered across platform invokations
try {
getProject().setPersistentProperty(FILESYSTEM_REPO_LOC, location);
@@ -145,12 +145,12 @@ public class FileSystemProvider extends RepositoryProvider {
throw FileSystemPlugin.wrapException(e);
}
}
-
+
/**
* Returns the folder in the file system to which the provider is connected.
* Return <code>null</code> if there is no location or there was a problem
* determining it.
- *
+ *
* @return IPath The path to the root of the repository.
*/
public IPath getRoot() {
@@ -171,13 +171,13 @@ public class FileSystemProvider extends RepositoryProvider {
}
/**
- * Return an object that provides the operations for transfering data
+ * Return an object that provides the operations for transfering data
* to and from the provider's location.
*/
public FileSystemOperations getOperations() {
return new FileSystemOperations(this);
}
-
+
@Override
public IFileModificationValidator getFileModificationValidator() {
return getFileModificationValidator2();
@@ -187,7 +187,7 @@ public class FileSystemProvider extends RepositoryProvider {
public FileModificationValidator getFileModificationValidator2() {
return new org.eclipse.team.examples.filesystem.FileModificationValidator(this);
}
-
+
/**
* Return the resource variant for the local resource using the bytes to
* identify the variant.
@@ -201,7 +201,7 @@ public class FileSystemProvider extends RepositoryProvider {
if (file == null) return null;
return new FileSystemResourceVariant(file, bytes);
}
-
+
/**
* Return the resource variant for the local resource.
* @param resource the resource
@@ -212,7 +212,7 @@ public class FileSystemProvider extends RepositoryProvider {
if (file == null || !file.exists()) return null;
return new FileSystemResourceVariant(file);
}
-
+
/**
* Return the <code>java.io.File</code> that the given resource maps to.
* Return <code>null</code> if the resource is not a child of this provider's
@@ -227,12 +227,12 @@ public class FileSystemProvider extends RepositoryProvider {
}
return null;
}
-
+
@Override
public IResourceRuleFactory getRuleFactory() {
return RESOURCE_RULE_FACTORY;
}
-
+
@Override
public IFileHistoryProvider getFileHistoryProvider() {
if (FileSystemProvider.fileHistoryProvider == null) {
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProviderType.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProviderType.java
index 0f518fb6c..6bede669a 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProviderType.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProviderType.java
@@ -20,7 +20,7 @@ import org.eclipse.team.core.RepositoryProviderType;
* The file system repository provider types
*/
public class FileSystemProviderType extends RepositoryProviderType {
-
+
@Override
public ProjectSetCapability getProjectSetCapability() {
// Create an empty project set capability to test backwards compatibility
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/Policy.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/Policy.java
index 2e66c29ae..e977971f7 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/Policy.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/Policy.java
@@ -22,27 +22,27 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
/**
- * This class is a clone of the Policy classes many Eclipse plugin use to
+ * This class is a clone of the Policy classes many Eclipse plugin use to
* provide NLSing of strings and aid in proper progress monitoring.
*/
public class Policy {
-
+
private static ResourceBundle bundle = null;
private static final String bundleName = "org.eclipse.team.examples.filesystem.messages"; //$NON-NLS-1$
/*
- * Returns a resource bundle, creating one if it none is available.
+ * Returns a resource bundle, creating one if it none is available.
*/
private static ResourceBundle getResourceBundle() {
// thread safety
ResourceBundle tmpBundle = bundle;
if (tmpBundle != null)
return tmpBundle;
- // always create a new classloader to be passed in
+ // always create a new classloader to be passed in
// in order to prevent ResourceBundle caching
return bundle = ResourceBundle.getBundle(bundleName);
}
-
+
/**
* Lookup the message with the given ID in this catalog and bind its
* substitution locations with the given string.
@@ -50,7 +50,7 @@ public class Policy {
public static String bind(String id, String binding) {
return bind(id, new String[] { binding });
}
-
+
/**
* Lookup the message with the given ID in this catalog and bind its
* substitution locations with the given strings.
@@ -58,7 +58,7 @@ public class Policy {
public static String bind(String id, String binding1, String binding2) {
return bind(id, new String[] { binding1, binding2 });
}
-
+
/**
* Gets a string from the resource bundle. We don't want to crash because of a missing String.
* Returns the key if not found.
@@ -72,9 +72,9 @@ public class Policy {
return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
/**
- * Gets a string from the resource bundle and binds it with the given arguments. If the key is
+ * Gets a string from the resource bundle and binds it with the given arguments. If the key is
* not found, return the key.
*/
public static String bind(String key, Object[] args) {
@@ -86,7 +86,7 @@ public class Policy {
return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
/**
* Progress monitor helpers
*/
@@ -94,10 +94,10 @@ public class Policy {
if (monitor.isCanceled())
throw new OperationCanceledException();
}
-
+
public static IProgressMonitor monitorFor(IProgressMonitor monitor) {
if (monitor == null)
return new NullProgressMonitor();
return monitor;
- }
+ }
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemFileRevision.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemFileRevision.java
index 50dbe8b35..dde68d250 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemFileRevision.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemFileRevision.java
@@ -32,17 +32,21 @@ public class FileSystemFileRevision extends FileRevision {
this.remoteFile = file;
}
+ @Override
public String getName() {
return remoteFile.getName();
}
+ @Override
public long getTimestamp() {
return remoteFile.lastModified();
}
+ @Override
public IStorage getStorage(IProgressMonitor monitor) {
return new IStorage() {
+ @Override
public InputStream getContents() {
try {
return new FileInputStream(remoteFile);
@@ -53,18 +57,22 @@ public class FileSystemFileRevision extends FileRevision {
return null;
}
+ @Override
public IPath getFullPath() {
return new Path(remoteFile.getAbsolutePath());
}
+ @Override
public String getName() {
return remoteFile.getName();
}
+ @Override
public boolean isReadOnly() {
return true;
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
return null;
}
@@ -72,14 +80,17 @@ public class FileSystemFileRevision extends FileRevision {
};
}
+ @Override
public boolean isPropertyMissing() {
return false;
}
+ @Override
public IFileRevision withAllProperties(IProgressMonitor monitor) {
return null;
}
+ @Override
public String getContentIdentifier() {
return "[File System Revision]"; //$NON-NLS-1$
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistory.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistory.java
index 2ff916cc1..47906f937 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistory.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistory.java
@@ -35,18 +35,22 @@ public class FileSystemHistory extends FileHistory {
this.file = file;
}
+ @Override
public IFileRevision[] getContributors(IFileRevision revision) {
return null;
}
+ @Override
public IFileRevision getFileRevision(String id) {
return null;
}
+ @Override
public IFileRevision[] getFileRevisions() {
return revisions;
}
+ @Override
public IFileRevision[] getTargets(IFileRevision revision) {
return null;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistoryProvider.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistoryProvider.java
index 69a08b8a4..ac0379d2e 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistoryProvider.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemHistoryProvider.java
@@ -22,14 +22,17 @@ import org.eclipse.team.core.history.provider.FileHistoryProvider;
public class FileSystemHistoryProvider extends FileHistoryProvider {
+ @Override
public IFileHistory getFileHistoryFor(IResource resource, int flags, IProgressMonitor monitor) {
return null;
}
+ @Override
public IFileHistory getFileHistoryFor(IFileStore store, int flags, IProgressMonitor monitor) {
return null;
}
+ @Override
public IFileRevision getWorkspaceFileRevision(IResource resource) {
return null;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemMergeContext.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemMergeContext.java
index 2e8d003ed..b34651638 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemMergeContext.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemMergeContext.java
@@ -61,12 +61,12 @@ public class FileSystemMergeContext extends SubscriberMergeContext {
throws CoreException {
markAsMerged(diff, false, monitor);
}
-
+
@Override
public ISchedulingRule getMergeRule(IDiff node) {
return ResourceDiffTree.getResourceFor(node).getProject();
}
-
+
@Override
public IStatus merge(IDiff diff, boolean ignoreLocalChanges, IProgressMonitor monitor) throws CoreException {
// Only attempt the merge for non-conflicts. The reason we do this
@@ -83,5 +83,5 @@ public class FileSystemMergeContext extends SubscriberMergeContext {
}
return super.merge(diff, ignoreLocalChanges, monitor);
}
-
+
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemRemoteTree.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemRemoteTree.java
index a6dd1acce..ec48dda0f 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemRemoteTree.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemRemoteTree.java
@@ -26,7 +26,7 @@ import org.eclipse.team.examples.filesystem.FileSystemProvider;
* the ability to traverse the file system for the creation of resource variants.
*/
public class FileSystemRemoteTree extends ThreeWayRemoteTree {
-
+
/**
* Create the file system remote resource variant tree
* @param subscriber the file system subscriber
@@ -34,12 +34,12 @@ public class FileSystemRemoteTree extends ThreeWayRemoteTree {
public FileSystemRemoteTree(FileSystemSubscriber subscriber) {
super(subscriber);
}
-
+
@Override
protected IResourceVariant[] fetchMembers(IResourceVariant variant, IProgressMonitor progress) {
return ((FileSystemResourceVariant)variant).members();
}
-
+
@Override
protected IResourceVariant fetchVariant(IResource resource, int depth, IProgressMonitor monitor) {
RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject(), FileSystemPlugin.PROVIDER_ID);
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemResourceVariant.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemResourceVariant.java
index f52203578..768c85c87 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemResourceVariant.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemResourceVariant.java
@@ -33,10 +33,10 @@ import org.eclipse.team.examples.filesystem.FileSystemPlugin;
* cache the contents of the resource variant.
*/
public class FileSystemResourceVariant extends CachedResourceVariant {
-
+
private java.io.File ioFile;
private byte[] bytes;
-
+
/**
* Create a resource variant for the given file. The bytes will
* be calculated when they are accessed.
@@ -45,7 +45,7 @@ public class FileSystemResourceVariant extends CachedResourceVariant {
public FileSystemResourceVariant(java.io.File file) {
this.ioFile = file;
}
-
+
/**
* Create a resource variant for the given file and sync bytes.
* @param file the file
@@ -55,24 +55,24 @@ public class FileSystemResourceVariant extends CachedResourceVariant {
this.ioFile = file;
this.bytes = bytes;
}
-
+
@Override
protected void fetchContents(IProgressMonitor monitor) throws TeamException {
setContents(getContents(), monitor);
}
-
+
@Override
protected String getCachePath() {
// append the timestamp to the file path to give each variant a unique path
return getFilePath() + " " + ioFile.lastModified(); //$NON-NLS-1$
}
-
+
private String getFilePath() {
try {
return ioFile.getCanonicalPath();
} catch (IOException e) {
// Failed for some reason. Try the absolute path.
- FileSystemPlugin.log(new Status(IStatus.ERROR, FileSystemPlugin.ID, 0,
+ FileSystemPlugin.log(new Status(IStatus.ERROR, FileSystemPlugin.ID, 0,
"Failed to obtain canonical path for " + ioFile.getAbsolutePath(), e)); //$NON-NLS-1$
return ioFile.getAbsolutePath();
}
@@ -82,30 +82,30 @@ public class FileSystemResourceVariant extends CachedResourceVariant {
protected String getCacheId() {
return FileSystemPlugin.ID;
}
-
+
@Override
public String getName() {
return ioFile.getName();
}
-
+
@Override
public boolean isContainer() {
return ioFile.isDirectory();
}
-
+
@Override
public String getContentIdentifier() {
// Use the modification timestamp as the content identifier
return new Date(ioFile.lastModified()).toString();
}
-
+
@Override
public byte[] asBytes() {
if (bytes == null) {
// For simplicity, convert the timestamp to it's string representation.
// A more optimal storage format would be the 8 bytes that make up the long.
bytes = Long.toString(ioFile.lastModified()).getBytes();
- }
+ }
return bytes;
}
@@ -138,7 +138,7 @@ public class FileSystemResourceVariant extends CachedResourceVariant {
throw new TeamException("Failed to fetch contents for " + getFilePath(), e); //$NON-NLS-1$
}
}
-
+
public java.io.File getFile(){
return ioFile;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemSyncInfo.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemSyncInfo.java
index 6dfe3e7fa..612cc1016 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemSyncInfo.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/subscriber/FileSystemSyncInfo.java
@@ -20,7 +20,7 @@ import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.core.variants.IResourceVariantComparator;
/**
- * Provide a custom sync info that will report files that exist both
+ * Provide a custom sync info that will report files that exist both
* locally and remotely as in-sync and will return a null base if there
* is an incoming change.
*/
@@ -39,7 +39,7 @@ public class FileSystemSyncInfo extends SyncInfo {
}
return super.calculateKind();
}
-
+
@Override
public IResourceVariant getBase() {
// If the kind has been set and there is an incoming change
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ConfigurationWizard.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ConfigurationWizard.java
index 73826aa8b..1ecefd95b 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ConfigurationWizard.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ConfigurationWizard.java
@@ -34,11 +34,11 @@ import org.eclipse.ui.IWorkbench;
* in order to obtain a target location on disk.
*/
public class ConfigurationWizard extends Wizard implements IConfigurationWizard, IAdaptable {
-
+
IProject[] projects;
-
+
FileSystemMainPage mainPage;
-
+
public ConfigurationWizard() {
// retrieve the remembered dialog settings
IDialogSettings workbenchSettings = FileSystemPlugin.getPlugin().getDialogSettings();
@@ -51,13 +51,15 @@ public class ConfigurationWizard extends Wizard implements IConfigurationWizard,
/**
* Remember the project so we can map it on finish
- *
+ *
* @see org.eclipse.team.ui.IConfigurationWizard#init(IWorkbench, IProject)
*/
+ @Override
public void init(IWorkbench workbench, IProject project) {
setProjects(new IProject[] { project } );
}
-
+
+ @Override
public void addPages() {
mainPage = new FileSystemMainPage(
"FileSystemMainPage", //$NON-NLS-1$
@@ -66,11 +68,12 @@ public class ConfigurationWizard extends Wizard implements IConfigurationWizard,
null);
addPage(mainPage);
}
-
+
/*
* Using the information entered in the main page set the provider for
* the given project.
*/
+ @Override
public boolean performFinish() {
mainPage.finish(null);
try {
@@ -98,13 +101,10 @@ public class ConfigurationWizard extends Wizard implements IConfigurationWizard,
return true;
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
if (adapter == IConfigurationWizardExtension.class) {
- return adapter.cast(new IConfigurationWizardExtension(){
- public void init(IWorkbench workbench, IProject[] projects) {
- setProjects(projects);
- }
- });
+ return adapter.cast((IConfigurationWizardExtension) (workbench, projects) -> setProjects(projects));
}
return null;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/DisconnectAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/DisconnectAction.java
index b945dc303..1a8fd0eb8 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/DisconnectAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/DisconnectAction.java
@@ -25,7 +25,7 @@ import org.eclipse.team.internal.ui.actions.TeamAction;
* Action for getting the contents of the selected resources
*/
public class DisconnectAction extends TeamAction {
-
+
@Override
protected void execute(IAction action) {
IProject projects[] = getSelectedProjects();
@@ -35,9 +35,9 @@ public class DisconnectAction extends TeamAction {
}
} catch (TeamException e) {
ErrorDialog.openError(getShell(), Policy.bind("DisconnectAction.errorTitle"), null, e.getStatus()); //$NON-NLS-1$
- }
+ }
}
-
+
@Override
public boolean isEnabled() {
return true;
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPage.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPage.java
index 3353f807b..8d72fd443 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPage.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPage.java
@@ -72,13 +72,14 @@ public class FileSystemHistoryPage extends HistoryPage {
this.fileHistory = fileHistory;
}
+ @Override
public IStatus run(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
if (fileHistory != null && !shutdown) {
fileHistory.refresh(monitor);
- //Internal code used for convenience - you can use
+ //Internal code used for convenience - you can use
//your own here
Utils.asyncExec((Runnable) () -> tableViewer.setInput(fileHistory), tableViewer);
}
@@ -87,6 +88,7 @@ public class FileSystemHistoryPage extends HistoryPage {
}
}
+ @Override
public boolean inputSet() {
IFile tempFile = getFile();
this.file = tempFile;
@@ -118,6 +120,7 @@ public class FileSystemHistoryPage extends HistoryPage {
return null;
}
+ @Override
public void createControl(Composite parent) {
localComposite = new Composite(parent, SWT.NONE);
@@ -138,6 +141,7 @@ public class FileSystemHistoryPage extends HistoryPage {
private void contributeActions() {
openAction = new OpenFileSystemRevisionAction("Open"); //$NON-NLS-1$
tableViewer.getTable().addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
openAction.selectionChanged(tableViewer.getStructuredSelection());
}
@@ -159,6 +163,7 @@ public class FileSystemHistoryPage extends HistoryPage {
TableViewer viewer = fileSystemTableProvider.createTable(parent);
viewer.setContentProvider(new IStructuredContentProvider() {
+ @Override
public Object[] getElements(Object inputElement) {
// The entries of already been fetch so return them
if (entries != null)
@@ -170,11 +175,13 @@ public class FileSystemHistoryPage extends HistoryPage {
return entries;
}
+ @Override
public void dispose() {
// TODO Auto-generated method stub
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
entries = null;
}
@@ -183,14 +190,17 @@ public class FileSystemHistoryPage extends HistoryPage {
return viewer;
}
+ @Override
public Control getControl() {
return localComposite;
}
+ @Override
public void setFocus() {
localComposite.setFocus();
}
+ @Override
public String getDescription() {
if (file != null)
return file.getFullPath().toString();
@@ -198,6 +208,7 @@ public class FileSystemHistoryPage extends HistoryPage {
return null;
}
+ @Override
public String getName() {
if (file != null)
return file.getName();
@@ -205,6 +216,7 @@ public class FileSystemHistoryPage extends HistoryPage {
return ""; //$NON-NLS-1$
}
+ @Override
public boolean isValidInput(Object object) {
if (object instanceof IResource && ((IResource) object).getType() == IResource.FILE) {
@@ -216,6 +228,7 @@ public class FileSystemHistoryPage extends HistoryPage {
return false;
}
+ @Override
public void refresh() {
refreshHistory();
}
@@ -233,6 +246,7 @@ public class FileSystemHistoryPage extends HistoryPage {
Utils.schedule(refreshFileHistoryJob, getWorkbenchSite(parentSite));
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
return null;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPageSource.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPageSource.java
index cf3b73d0b..3089d0afa 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPageSource.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemHistoryPageSource.java
@@ -22,6 +22,7 @@ import org.eclipse.ui.part.Page;
public class FileSystemHistoryPageSource extends HistoryPageSource {
+ @Override
public boolean canShowHistoryFor(Object object) {
if (object instanceof IResource && ((IResource) object).getType() == IResource.FILE) {
RepositoryProvider provider = RepositoryProvider.getProvider(((IFile) object).getProject());
@@ -32,6 +33,7 @@ public class FileSystemHistoryPageSource extends HistoryPageSource {
return false;
}
+ @Override
public Page createPage(Object object) {
FileSystemHistoryPage page = new FileSystemHistoryPage();
return page;
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemPropertiesPage.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemPropertiesPage.java
index b837bc758..3af27bd35 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemPropertiesPage.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemPropertiesPage.java
@@ -23,16 +23,16 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.dialogs.PropertyPage;
/*
- * A property page which displays the file system specific properties
+ * A property page which displays the file system specific properties
* for the selected resource.
*/
public class FileSystemPropertiesPage extends PropertyPage {
// The resource to show properties for
protected IResource resource;
- /*
+ /*
* Creates a key-value property pair in the given parent.
- *
+ *
* @param parent the parent for the labels
* @param left the string for the left label
* @param right the string for the right label
@@ -40,7 +40,7 @@ public class FileSystemPropertiesPage extends PropertyPage {
protected void createPair(Composite parent, String left, String right) {
Label label = new Label(parent, SWT.NONE);
label.setText(left);
-
+
label = new Label(parent, SWT.NONE);
label.setText(right);
label.setToolTipText(right);
@@ -50,7 +50,7 @@ public class FileSystemPropertiesPage extends PropertyPage {
/*
* Returns the element selected when the properties was run
* @return the selected element
- */
+ */
protected IResource getSelectedElement() {
// get the resource that is the source of this property page
IResource resource = null;
@@ -65,7 +65,7 @@ public class FileSystemPropertiesPage extends PropertyPage {
}
return resource;
}
-
+
@Override
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
@@ -74,7 +74,7 @@ public class FileSystemPropertiesPage extends PropertyPage {
layout.marginHeight = layout.marginWidth = 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
+
return composite;
}
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemRevisionEditorInput.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemRevisionEditorInput.java
index aa64f1f51..64f1140d8 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemRevisionEditorInput.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemRevisionEditorInput.java
@@ -41,14 +41,17 @@ public class FileSystemRevisionEditorInput extends PlatformObject implements IWo
}
}
+ @Override
public Object[] getChildren(Object o) {
return new Object[0];
}
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
return null;
}
+ @Override
public String getLabel(Object o) {
if (storage != null) {
return storage.getName();
@@ -56,22 +59,27 @@ public class FileSystemRevisionEditorInput extends PlatformObject implements IWo
return ""; //$NON-NLS-1$
}
+ @Override
public Object getParent(Object o) {
return null;
}
+ @Override
public IStorage getStorage() {
return storage;
}
+ @Override
public boolean exists() {
return true;
}
+ @Override
public ImageDescriptor getImageDescriptor() {
return null;
}
+ @Override
public String getName() {
if (fileRevision != null)
return fileRevision.getName() + " " + fileRevision.getContentIdentifier(); //$NON-NLS-1$
@@ -82,10 +90,12 @@ public class FileSystemRevisionEditorInput extends PlatformObject implements IWo
return ""; //$NON-NLS-1$
}
+ @Override
public IPersistableElement getPersistable() {
return null;
}
+ @Override
public String getToolTipText() {
if (fileRevision != null)
return getStorage().getFullPath().toString();
@@ -96,6 +106,7 @@ public class FileSystemRevisionEditorInput extends PlatformObject implements IWo
return ""; //$NON-NLS-1$
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
if (adapter == IWorkbenchAdapter.class) {
return adapter.cast(this);
@@ -105,7 +116,7 @@ public class FileSystemRevisionEditorInput extends PlatformObject implements IWo
else if (adapter == IFileState.class){
if (storage != null && storage instanceof IFileState)
return adapter.cast(storage);
- }
+ }
return super.getAdapter(adapter);
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemSynchronizeParticipant.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemSynchronizeParticipant.java
index 6c6478f8f..3214002b0 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemSynchronizeParticipant.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemSynchronizeParticipant.java
@@ -69,7 +69,7 @@ public class FileSystemSynchronizeParticipant extends ModelSynchronizeParticipan
* A custom label decorator that will show the remote mapped path for each
* file.
*/
- public class FileSystemParticipantLabelDecorator extends LabelProvider implements ILabelDecorator {
+ public static class FileSystemParticipantLabelDecorator extends LabelProvider implements ILabelDecorator {
@Override
public Image decorateImage(Image image, Object element) {
return image;
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemTableProvider.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemTableProvider.java
index fbb9e5e13..b263f35cd 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemTableProvider.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemTableProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2017 IBM Corporation and others.
+ * Copyright (c) 2006, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -25,7 +25,7 @@ import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -63,9 +63,9 @@ public class FileSystemTableProvider {
viewer.setLabelProvider(new HistoryLabelProvider());
// By default, reverse sort by revision.
- HistorySorter sorter = new HistorySorter(COL_DATE);
+ HistoryComparator sorter = new HistoryComparator(COL_DATE);
sorter.setReversed(true);
- viewer.setSorter(sorter);
+ viewer.setComparator(sorter);
return viewer;
}
@@ -93,36 +93,41 @@ public class FileSystemTableProvider {
class HistoryLabelProvider extends LabelProvider implements ITableLabelProvider, IColorProvider, IFontProvider {
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
+ @Override
public String getColumnText(Object element, int columnIndex) {
IFileRevision entry = adaptToFileRevision(element);
if (entry == null)
return ""; //$NON-NLS-1$
switch (columnIndex) {
- case COL_TYPE :
- if (entry instanceof FileSystemFileRevision)
- return "FileSystem revision"; //$NON-NLS-1$
-
- return "Local history revision"; //$NON-NLS-1$
- case COL_DATE :
- long date = entry.getTimestamp();
- Date dateFromLong = new Date(date);
- return DateFormat.getInstance().format(dateFromLong);
+ case COL_TYPE :
+ if (entry instanceof FileSystemFileRevision)
+ return "FileSystem revision"; //$NON-NLS-1$
+
+ return "Local history revision"; //$NON-NLS-1$
+ case COL_DATE :
+ long date = entry.getTimestamp();
+ Date dateFromLong = new Date(date);
+ return DateFormat.getInstance().format(dateFromLong);
}
return ""; //$NON-NLS-1$
}
+ @Override
public Color getBackground(Object element) {
return null;
}
+ @Override
public Color getForeground(Object element) {
return null;
}
+ @Override
public Font getFont(Object element) {
return null;
}
@@ -132,19 +137,19 @@ public class FileSystemTableProvider {
/**
* The history sorter
*/
- class HistorySorter extends ViewerSorter {
+ class HistoryComparator extends ViewerComparator {
private boolean reversed = false;
private int columnNumber;
- // column headings: "Type" "Date"
+ // column headings: "Type" "Date"
private int[][] SORT_ORDERS_BY_COLUMN = { {COL_DATE, COL_TYPE} /* date */, {COL_TYPE, COL_DATE} /* type */
};
/**
* The constructor.
- * @param columnNumber
+ * @param columnNumber
*/
- public HistorySorter(int columnNumber) {
+ public HistoryComparator(int columnNumber) {
this.columnNumber = columnNumber;
}
@@ -152,6 +157,7 @@ public class FileSystemTableProvider {
* Compares two log entries, sorting first by the main column of this sorter,
* then by subsequent columns, depending on the column sort order.
*/
+ @Override
public int compare(Viewer compareViewer, Object o1, Object o2) {
/*if (o1 instanceof AbstractCVSHistoryCategory || o2 instanceof AbstractCVSHistoryCategory)
return 0;*/
@@ -163,8 +169,8 @@ public class FileSystemTableProvider {
result = super.compare(compareViewer, o1, o2);
} else {
int[] columnSortOrder = SORT_ORDERS_BY_COLUMN[columnNumber];
- for (int i = 0; i < columnSortOrder.length; ++i) {
- result = compareColumnValue(columnSortOrder[i], e1, e2);
+ for (int element : columnSortOrder) {
+ result = compareColumnValue(element, e1, e2);
if (result != 0)
break;
}
@@ -179,16 +185,16 @@ public class FileSystemTableProvider {
*/
int compareColumnValue(int columnNumber, IFileRevision e1, IFileRevision e2) {
switch (columnNumber) {
- case 0 : /* date */
- long date1 = e1.getTimestamp();
- long date2 = e2.getTimestamp();
- if (date1 == date2)
- return 0;
+ case 0 : /* date */
+ long date1 = e1.getTimestamp();
+ long date2 = e2.getTimestamp();
+ if (date1 == date2)
+ return 0;
- return date1 > date2 ? -1 : 1;
+ return date1 > date2 ? -1 : 1;
- default :
- return 0;
+ default :
+ return 0;
}
}
@@ -211,7 +217,7 @@ public class FileSystemTableProvider {
/**
* Sets the sorting order.
- * @param newReversed
+ * @param newReversed
*/
public void setReversed(boolean newReversed) {
reversed = newReversed;
@@ -250,15 +256,16 @@ public class FileSystemTableProvider {
* presses on the same column header will
* toggle sorting order (ascending/descending).
*/
+ @Override
public void widgetSelected(SelectionEvent e) {
// column selected - need to sort
int column = tableViewer.getTable().indexOf((TableColumn) e.widget);
- HistorySorter oldSorter = (HistorySorter) tableViewer.getSorter();
+ HistoryComparator oldSorter = (HistoryComparator) tableViewer.getComparator();
if (oldSorter != null && column == oldSorter.getColumnNumber()) {
oldSorter.setReversed(!oldSorter.isReversed());
tableViewer.refresh();
} else {
- tableViewer.setSorter(new HistorySorter(column));
+ tableViewer.setComparator(new HistoryComparator(column));
}
}
};
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetAction.java
index 29bffdd2d..9a00e7d48 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetAction.java
@@ -23,9 +23,10 @@ import org.eclipse.team.examples.filesystem.Policy;
*/
public class GetAction extends FileSystemAction {
+ @Override
protected void execute(IAction action) {
try {
- GetOperation operation = new GetOperation(getTargetPart(),
+ GetOperation operation = new GetOperation(getTargetPart(),
FileSystemOperation.createScopeManager(Policy.bind("GetAction.working"), getSelectedMappings())); //$NON-NLS-1$
operation.setOverwriteOutgoing(isOverwriteOutgoing());
operation.run();
@@ -35,7 +36,7 @@ public class GetAction extends FileSystemAction {
// Ignore
}
}
-
+
/**
* Indicate whether the action should overwrite outgoing changes.
* By default, the get action does not override local modifications.
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetOperation.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetOperation.java
index b22573688..6bda30314 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetOperation.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/GetOperation.java
@@ -65,7 +65,7 @@ public class GetOperation extends FileSystemOperation {
}
return false;
}
-
+
/**
* Indicate whether the operation should overwrite outgoing changes.
* By default, the get operation does not override local modifications.
@@ -82,7 +82,7 @@ public class GetOperation extends FileSystemOperation {
public void setOverwriteOutgoing(boolean overwriteOutgoing) {
this.overwriteOutgoing = overwriteOutgoing;
}
-
+
@Override
protected String getTaskName() {
return Policy.bind("GetAction.working"); //$NON-NLS-1$
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/MergeAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/MergeAction.java
index 28ea4f954..52eb9689d 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/MergeAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/MergeAction.java
@@ -22,11 +22,12 @@ import org.eclipse.team.ui.synchronize.ModelMergeOperation;
* This merge action is contributed as a a popupmenu objectContribution in
* the plugin.xml. You can change the value return from {@link #isUseSyncFramework()}
* to try out different dialogs.
- *
+ *
* @since 3.2
*/
public class MergeAction extends FileSystemAction {
+ @Override
protected void execute(IAction action) {
try {
ModelMergeOperation operation;
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergeDialog.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergeDialog.java
index bd1b7e676..005f98483 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergeDialog.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergeDialog.java
@@ -23,7 +23,7 @@ import org.eclipse.team.ui.ISaveableWorkbenchPart;
import org.eclipse.team.ui.SaveablePartDialog;
/**
- * A dialog that can be used to merge conflicting model elements without
+ * A dialog that can be used to merge conflicting model elements without
* using the Synchronization framework. This is experimental.
* See {@link NonSyncModelMergeOperation}
* for a description of this work flow and its shortcomings.
@@ -36,11 +36,12 @@ public class NonSyncMergeDialog extends SaveablePartDialog {
NonSyncMergeDialog dialog = new NonSyncMergeDialog(operation.getShell(), part);
dialog.open();
}
-
+
public NonSyncMergeDialog(Shell shell, ISaveableWorkbenchPart input) {
super(shell, input);
}
-
+
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == OK) {
NonSyncMergePart part = (NonSyncMergePart)getInput();
@@ -55,8 +56,9 @@ public class NonSyncMergeDialog extends SaveablePartDialog {
private boolean hasUnmergedChanges(IMergeContext context) {
return context.getDiffTree().hasMatchingDiffs(
- ResourcesPlugin.getWorkspace().getRoot().getFullPath(),
+ ResourcesPlugin.getWorkspace().getRoot().getFullPath(),
new FastDiffFilter() {
+ @Override
public boolean select(IDiff diff) {
if (diff instanceof IThreeWayDiff) {
IThreeWayDiff twd = (IThreeWayDiff) diff;
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergePart.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergePart.java
index 98d224c03..5738d2cae 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergePart.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncMergePart.java
@@ -39,7 +39,7 @@ import org.eclipse.team.ui.mapping.ISynchronizationCompareInput;
* to show a manual merge.
*/
public class NonSyncMergePart extends PageSaveablePart {
-
+
private final NonSyncModelMergePage page;
protected NonSyncMergePart(Shell shell, CompareConfiguration compareConfiguration, NonSyncModelMergePage page) {
@@ -47,15 +47,18 @@ public class NonSyncMergePart extends PageSaveablePart {
this.page = page;
}
+ @Override
protected Control createPage(Composite parent, ToolBarManager toolBarManager) {
page.createControl(parent);
return page.getControl();
}
+ @Override
protected ISelectionProvider getSelectionProvider() {
return page.getViewer();
}
+ @Override
protected ICompareInput getCompareInput(ISelection selection) {
ICompareInput compareInput = super.getCompareInput(selection);
if (compareInput != null)
@@ -70,7 +73,7 @@ public class NonSyncMergePart extends PageSaveablePart {
}
return null;
}
-
+
protected static ISynchronizationCompareAdapter getCompareAdapter(Object element) {
if (element instanceof ResourceMapping) {
ResourceMapping mapping = (ResourceMapping) element;
@@ -83,6 +86,7 @@ public class NonSyncMergePart extends PageSaveablePart {
return null;
}
+ @Override
protected void prepareInput(ICompareInput input,
CompareConfiguration configuration, IProgressMonitor monitor)
throws InvocationTargetException {
@@ -103,15 +107,18 @@ public class NonSyncMergePart extends PageSaveablePart {
return Adapters.adapt(input, ISynchronizationCompareInput.class);
}
+ @Override
public void contentChanged(IContentChangeNotifier source) {
// TODO Auto-generated method stub
}
+ @Override
public String getTitle() {
return "File System Provider Merge";
}
+ @Override
public Image getTitleImage() {
return null;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java
index a2453c77d..2bf8997e3 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java
@@ -64,7 +64,7 @@ public class NonSyncModelMergeOperation extends ModelMergeOperation {
// Create the context
context = new FileSystemMergeContext(getScopeManager());
// Refresh the context to get the latest remote state
- context.refresh(getScope().getTraversals(),
+ context.refresh(getScope().getTraversals(),
RemoteResourceMappingContext.FILE_CONTENTS_REQUIRED, SubMonitor.convert(monitor, 75));
// What for the context to asynchronously update the diff tree
try {
@@ -76,12 +76,12 @@ public class NonSyncModelMergeOperation extends ModelMergeOperation {
monitor.done();
}
}
-
+
@Override
protected ISynchronizationContext getContext() {
return context;
}
-
+
/**
* Handle the preview request by opening a dialog that allows the user to manually merge
* any changes.
@@ -93,7 +93,7 @@ public class NonSyncModelMergeOperation extends ModelMergeOperation {
// after the dialog closes
Display.getDefault().syncExec(() -> NonSyncMergeDialog.openFor(NonSyncModelMergeOperation.this));
}
-
+
@Override
public Shell getShell() {
// Change method to public
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergePage.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergePage.java
index b6cba56b9..2a816f9bf 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergePage.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergePage.java
@@ -232,7 +232,7 @@ public class NonSyncModelMergePage extends Page {
private void hookContextMenu(final TreeViewer viewer) {
final MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(manager -> fillContextMenu(manager));
+ menuMgr.addMenuListener(this::fillContextMenu);
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/OpenFileSystemRevisionAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/OpenFileSystemRevisionAction.java
index b76fd02a8..ffc379ba9 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/OpenFileSystemRevisionAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/OpenFileSystemRevisionAction.java
@@ -26,13 +26,11 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.core.history.IFileRevision;
-import org.eclipse.team.examples.filesystem.FileSystemPlugin;
import org.eclipse.team.ui.history.HistoryPage;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
import org.eclipse.ui.ide.IDE;
@@ -47,6 +45,7 @@ public class OpenFileSystemRevisionAction extends BaseSelectionListenerAction {
super(text);
}
+ @Override
public void run() {
IStructuredSelection structSel = selection;
@@ -90,8 +89,7 @@ public class OpenFileSystemRevisionAction extends BaseSelectionListenerAction {
}
/* private */String getEditorID(String fileName, InputStream contents) {
- IWorkbench workbench = FileSystemPlugin.getPlugin().getWorkbench();
- IEditorRegistry registry = workbench.getEditorRegistry();
+ IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
IContentType type = null;
if (contents != null) {
try {
@@ -114,6 +112,7 @@ public class OpenFileSystemRevisionAction extends BaseSelectionListenerAction {
return id;
}
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
this.selection = selection;
return shouldShow();
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/PutAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/PutAction.java
index 3eb0292cf..6820a1dbe 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/PutAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/PutAction.java
@@ -23,9 +23,10 @@ import org.eclipse.team.examples.filesystem.Policy;
*/
public class PutAction extends FileSystemAction {
+ @Override
protected void execute(IAction action) {
try {
- PutOperation operation = new PutOperation(getTargetPart(),
+ PutOperation operation = new PutOperation(getTargetPart(),
FileSystemOperation.createScopeManager(Policy.bind("PutAction.working"), getSelectedMappings())); //$NON-NLS-1$
operation.setOverwriteIncoming(isOverrideIncoming());
operation.run();
@@ -35,7 +36,7 @@ public class PutAction extends FileSystemAction {
// Ignore
}
}
-
+
/**
* Indicate whether the put should override incoming changes.
* @return whether the put should override incoming changes.
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ReplaceAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ReplaceAction.java
index 5a068bbf4..ff3ae5e1a 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ReplaceAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ReplaceAction.java
@@ -18,7 +18,7 @@ package org.eclipse.team.examples.filesystem.ui;
* A replace is simply a get that overwrite local changes
*/
public class ReplaceAction extends GetAction {
-
+
@Override
protected boolean isOverwriteOutgoing() {
return true;
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ShowHistoryAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ShowHistoryAction.java
index bc320a60a..fe8419bcb 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ShowHistoryAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ShowHistoryAction.java
@@ -33,6 +33,7 @@ public class ShowHistoryAction extends ActionDelegate implements IObjectActionDe
IStructuredSelection fSelection;
+ @Override
public void run(IAction action) {
final Shell shell = Display.getDefault().getActiveShell();
try {
@@ -49,12 +50,14 @@ public class ShowHistoryAction extends ActionDelegate implements IObjectActionDe
}
}
+ @Override
public void selectionChanged(IAction action, ISelection sel) {
if (sel instanceof IStructuredSelection) {
fSelection = (IStructuredSelection) sel;
}
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
// do nothing
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeAction.java
index 12ae429ef..a52ba0af2 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeAction.java
@@ -26,7 +26,8 @@ import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
* in a file-system participant being added to the synchronize view.
*/
public class SynchronizeAction extends FileSystemAction {
-
+
+ @Override
protected void execute(IAction action) {
ResourceMapping[] mappings = getSelectedMappings();
if (mappings.length == 0)
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeWizard.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeWizard.java
index fab46cd5a..381844d55 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeWizard.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/SynchronizeWizard.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -27,7 +27,7 @@ import org.eclipse.team.ui.synchronize.ModelParticipantWizard;
*/
public class SynchronizeWizard extends ModelParticipantWizard {
private IWizard importWizard;
-
+
/*
* Default no-arg constructor
*/
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryParticipant.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryParticipant.java
index 2b041eb7c..459205b7a 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryParticipant.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryParticipant.java
@@ -36,24 +36,27 @@ import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
public class LocalHistoryParticipant extends SubscriberParticipant {
-
+
public static final String ID = "org.eclipse.team.synchronize.example"; //$NON-NLS-1$
public static final String CONTEXT_MENU_CONTRIBUTION_GROUP = "context_group_1"; //$NON-NLS-1$
-
+
private class LocalHistoryActionContribution extends SynchronizePageActionGroup {
+ @Override
public void initialize(ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
appendToGroup(
- ISynchronizePageConfiguration.P_CONTEXT_MENU, CONTEXT_MENU_CONTRIBUTION_GROUP,
+ ISynchronizePageConfiguration.P_CONTEXT_MENU, CONTEXT_MENU_CONTRIBUTION_GROUP,
new SynchronizeModelAction("Revert to latest in local history", configuration) { //$NON-NLS-1$
+ @Override
protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
return new RevertAllOperation(configuration, elements);
}
});
}
}
-
- private class LocalHistoryDecorator extends LabelProvider implements ILabelDecorator {
+
+ private static class LocalHistoryDecorator extends LabelProvider implements ILabelDecorator {
+ @Override
public String decorateText(String text, Object element) {
if(element instanceof ISynchronizeModelElement) {
ISynchronizeModelElement node = (ISynchronizeModelElement)element;
@@ -67,16 +70,18 @@ public class LocalHistoryParticipant extends SubscriberParticipant {
}
return text;
}
-
+
+ @Override
public Image decorateImage(Image image, Object element) {
return null;
}
}
-
+
public LocalHistoryParticipant() {
setSubscriber(new LocalHistorySubscriber());
}
-
+
+ @Override
protected void setSubscriber(Subscriber subscriber) {
super.setSubscriber(subscriber);
try {
@@ -87,23 +92,25 @@ public class LocalHistoryParticipant extends SubscriberParticipant {
// ignore
}
}
-
+
+ @Override
protected void initializeConfiguration(ISynchronizePageConfiguration configuration) {
super.initializeConfiguration(configuration);
configuration.addMenuGroup(
- ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
CONTEXT_MENU_CONTRIBUTION_GROUP);
configuration.addActionContribution(new LocalHistoryActionContribution());
- configuration.addLabelDecorator(new LocalHistoryDecorator());
+ configuration.addLabelDecorator(new LocalHistoryDecorator());
}
-
+
protected static SyncInfo getSyncInfo(ISynchronizeModelElement element) {
if (element instanceof IAdaptable) {
return ((IAdaptable)element).getAdapter(SyncInfo.class);
}
return null;
}
-
+
+ @Override
public void prepareCompareInput(ISynchronizeModelElement element,
CompareConfiguration config, IProgressMonitor monitor)
throws TeamException {
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySyncInfo.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySyncInfo.java
index 0e8d9d307..130f9eb36 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySyncInfo.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySyncInfo.java
@@ -20,11 +20,12 @@ import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.core.variants.IResourceVariantComparator;
public class LocalHistorySyncInfo extends SyncInfo {
-
+
public LocalHistorySyncInfo(IResource local, IResourceVariant remote, IResourceVariantComparator comparator) {
super(local, null, remote, comparator);
}
+ @Override
protected int calculateKind() throws TeamException {
if (getRemote() == null)
return IN_SYNC;
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySynchronizeWizard.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySynchronizeWizard.java
index 5955ef028..faf121e4d 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySynchronizeWizard.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistorySynchronizeWizard.java
@@ -31,11 +31,12 @@ import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
public class LocalHistorySynchronizeWizard extends Wizard {
- private class MessagePage extends WizardPage {
+ private class MessagePage extends WizardPage {
protected MessagePage(String pageName, String title, ImageDescriptor titleImage) {
super(pageName, title, titleImage);
}
+ @Override
public void createControl(Composite parent) {
Composite top = new Composite(parent, SWT.NONE);
top.setLayout(new GridLayout());
@@ -46,15 +47,17 @@ public class LocalHistorySynchronizeWizard extends Wizard {
setControl(top);
}
}
-
+
public LocalHistorySynchronizeWizard() {
super();
}
-
+
+ @Override
public void addPages() {
addPage(new MessagePage("Local History", "Create a local history synchronization", TeamImages.getImageDescriptor(ITeamUIImages.IMG_WIZBAN_SHARE))); //$NON-NLS-1$//$NON-NLS-2$
}
+ @Override
public boolean performFinish() {
LocalHistoryParticipant participant = new LocalHistoryParticipant();
ISynchronizeManager manager = TeamUI.getSynchronizeManager();
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariant.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariant.java
index c9f9880ab..8b8a63dd2 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariant.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariant.java
@@ -28,27 +28,32 @@ public class LocalHistoryVariant implements IResourceVariant {
public LocalHistoryVariant(IFileState state) {
this.state = state;
}
-
+
+ @Override
public String getName() {
return state.getName();
}
+ @Override
public boolean isContainer() {
return false;
}
+ @Override
public IStorage getStorage(IProgressMonitor monitor) {
return state;
}
+ @Override
public String getContentIdentifier() {
return DateFormat.getDateTimeInstance().format(new Date(state.getModificationTime()));
}
+ @Override
public byte[] asBytes() {
return null;
}
-
+
public IFileState getFileState() {
return state;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariantComparator.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariantComparator.java
index 2780f5adb..700d3bcec 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariantComparator.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryVariantComparator.java
@@ -18,14 +18,17 @@ import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.core.variants.IResourceVariantComparator;
public class LocalHistoryVariantComparator implements IResourceVariantComparator {
+ @Override
public boolean compare(IResource local, IResourceVariant remote) {
return false;
}
+ @Override
public boolean compare(IResourceVariant base, IResourceVariant remote) {
return false;
}
+ @Override
public boolean isThreeWay() {
return false;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java
index 17a163aac..e650304cc 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java
@@ -27,16 +27,19 @@ public class RevertAllOperation extends SynchronizeModelOperation {
protected RevertAllOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
super(configuration, elements);
}
-
+
+ @Override
protected boolean canRunAsJob() {
return true;
}
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
final SyncInfo infos[] = getSyncInfoSet().getSyncInfos();
if(infos.length == 0) return;
-
+
WorkspaceModifyOperation operation= new WorkspaceModifyOperation() {
+ @Override
public void execute(IProgressMonitor pm) throws InvocationTargetException {
try {
pm.beginTask("Reverting from local history", 100 * infos.length); //$NON-NLS-1$
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelFile.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelFile.java
index bc90f164e..0aac29aae 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelFile.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelFile.java
@@ -20,7 +20,8 @@ public abstract class ModelFile extends ModelResource {
protected ModelFile(IFile file) {
super(file);
}
-
+
+ @Override
public String getName() {
String name = super.getName();
int index = name.lastIndexOf(".");
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObject.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObject.java
index a6f9101aa..b6d13889d 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObject.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObject.java
@@ -34,7 +34,7 @@ public abstract class ModelObject extends PlatformObject {
}
return null;
}
-
+
/**
* Return the name of the model object.
* @return the name of the model object
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObjectElementFile.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObjectElementFile.java
index c6a54c4b5..8dd497f0b 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObjectElementFile.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObjectElementFile.java
@@ -20,26 +20,29 @@ import org.eclipse.core.runtime.CoreException;
public class ModelObjectElementFile extends ModelFile {
public static final String MODEL_OBJECT_ELEMENTFILE_EXTENSION = "moe";
-
+
private final ModelObjectDefinitionFile parent;
public static boolean isMoeFile(IResource resource) {
return resource instanceof IFile && MODEL_OBJECT_ELEMENTFILE_EXTENSION.equals(resource.getFileExtension());
}
-
+
public ModelObjectElementFile(ModelObjectDefinitionFile parent, IFile file) {
super(file);
this.parent = parent;
}
+ @Override
public ModelObject[] getChildren() {
return new ModelObject[0];
}
-
+
+ @Override
public ModelObject getParent() {
return parent;
}
-
+
+ @Override
public void delete() throws CoreException {
parent.remove(this);
super.delete();
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelResource.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelResource.java
index 47f12a6e2..8be1f3e96 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelResource.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelResource.java
@@ -33,11 +33,11 @@ import org.eclipse.core.runtime.CoreException;
* <li>Model object folders correspond to workspace folders but only show child
* folders and MOD files when expanded.</li>
* </ol>
- *
+ *
*/
public abstract class ModelResource extends ModelObject{
private final IResource resource;
-
+
protected ModelResource(IResource resource) {
this.resource = resource;
}
@@ -45,22 +45,22 @@ public abstract class ModelResource extends ModelObject{
public IResource getResource() {
return resource;
}
-
+
@Override
public String getName() {
return getResource().getName();
}
-
+
@Override
public String getPath() {
return getResource().getFullPath().makeRelative().toString();
}
-
+
@Override
public ModelObject getParent() {
return ModelObject.create(getResource().getParent());
}
-
+
@Override
public boolean equals(Object obj) {
if (obj instanceof ModelResource) {
@@ -69,17 +69,17 @@ public abstract class ModelResource extends ModelObject{
}
return super.equals(obj);
}
-
+
@Override
public int hashCode() {
return getResource().hashCode();
}
-
+
@Override
public void delete() throws CoreException {
getResource().delete(false, null);
}
-
+
@Override
public ModelProject getProject() {
return (ModelProject)ModelObject.create(getResource().getProject());
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelWorkspace.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelWorkspace.java
index 38c74c7de..1e772005b 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelWorkspace.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelWorkspace.java
@@ -20,11 +20,13 @@ public class ModelWorkspace extends ModelContainer {
protected ModelWorkspace() {
super(ResourcesPlugin.getWorkspace().getRoot());
}
-
+
+ @Override
public String getName() {
return "Model Root";
}
-
+
+ @Override
public ModelObject getParent() {
return null;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelContainerResourceMapping.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelContainerResourceMapping.java
index 29e096830..c0bc16a25 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelContainerResourceMapping.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelContainerResourceMapping.java
@@ -31,8 +31,8 @@ public class ModelContainerResourceMapping extends ModelResourceMapping {
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context,
IProgressMonitor monitor) {
- return new ResourceTraversal[] {
- new ResourceTraversal(new IResource[] {
+ return new ResourceTraversal[] {
+ new ResourceTraversal(new IResource[] {
getResource()
}, IResource.DEPTH_INFINITE, IResource.NONE)
};
@@ -41,7 +41,7 @@ public class ModelContainerResourceMapping extends ModelResourceMapping {
private IResource getResource() {
return ((ModelContainer)getModelObject()).getResource();
}
-
+
@Override
public boolean contains(ResourceMapping mapping) {
if (mapping instanceof ModelResourceMapping) {
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelResourceMapping.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelResourceMapping.java
index c5177587b..9de525a3d 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelResourceMapping.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelResourceMapping.java
@@ -36,11 +36,11 @@ public abstract class ModelResourceMapping extends ResourceMapping {
}
return null;
}
-
+
protected ModelResourceMapping(ModelObject object) {
this.object = object;
}
-
+
@Override
public Object getModelObject() {
return object;
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/MoeResourceMapping.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/MoeResourceMapping.java
index 0c515c4a6..41f5b10da 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/MoeResourceMapping.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/MoeResourceMapping.java
@@ -30,8 +30,8 @@ public class MoeResourceMapping extends ModelResourceMapping {
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context,
IProgressMonitor monitor) {
- return new ResourceTraversal[] {
- new ResourceTraversal(new IResource[] {
+ return new ResourceTraversal[] {
+ new ResourceTraversal(new IResource[] {
getResource()
}, IResource.DEPTH_ZERO, IResource.NONE)
};
@@ -40,7 +40,7 @@ public class MoeResourceMapping extends ModelResourceMapping {
private IResource getResource() {
return ((ModelResource)getModelObject()).getResource();
}
-
+
@Override
public boolean contains(ResourceMapping mapping) {
if (mapping.equals(this))
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/AdapterFactory.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/AdapterFactory.java
index 06a1f7688..05f5923c1 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/AdapterFactory.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/AdapterFactory.java
@@ -32,7 +32,8 @@ public class AdapterFactory implements IAdapterFactory {
private ModelMerger modelMerger;
private CompareAdapter compareAdapter;
private static Object historyPageSource = new FileSystemHistoryPageSource();
-
+
+ @Override
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (adapterType == IWorkbenchAdapter.class && adaptableObject instanceof ModelObject)
return adapterType.cast(modelAdapter);
@@ -50,14 +51,15 @@ public class AdapterFactory implements IAdapterFactory {
}
return adapterType.cast(compareAdapter);
}
-
+
if (adapterType == IHistoryPageSource.class){
return adapterType.cast(historyPageSource);
}
-
+
return null;
}
+ @Override
public Class<?>[] getAdapterList() {
return new Class[] { IWorkbenchAdapter.class, ResourceMapping.class, IResourceMappingMerger.class, ISynchronizationCompareAdapter.class };
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelNavigatorActionProvider.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelNavigatorActionProvider.java
index 2b4b7a191..0ed08bc66 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelNavigatorActionProvider.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelNavigatorActionProvider.java
@@ -48,7 +48,8 @@ public class ModelNavigatorActionProvider extends CommonActionProvider {
public ModelNavigatorActionProvider() {
super();
}
-
+
+ @Override
public void init(ICommonActionExtensionSite aSite) {
super.init(aSite);
createActions();
@@ -56,6 +57,7 @@ public class ModelNavigatorActionProvider extends CommonActionProvider {
private void createActions() {
deleteAction = new Action("Delete") {
+ @Override
public void run() {
IStructuredSelection selection = (IStructuredSelection)getContext().getSelection();
try {
@@ -72,6 +74,7 @@ public class ModelNavigatorActionProvider extends CommonActionProvider {
}
};
newFolderAction = new Action("Create Folder") {
+ @Override
public void run() {
IContainer container = getSelectedContainer();
if (container != null) {
@@ -97,6 +100,7 @@ public class ModelNavigatorActionProvider extends CommonActionProvider {
}
};
newModAction = new Action("Create MOD File") {
+ @Override
public void run() {
IContainer container = getSelectedContainer();
if (container != null) {
@@ -124,6 +128,7 @@ public class ModelNavigatorActionProvider extends CommonActionProvider {
}
};
newMoeAction = new Action("Create MOE File") {
+ @Override
public void run() {
ModelObjectDefinitionFile modFile = getSelectedModFile();
if (modFile != null) {
@@ -153,6 +158,7 @@ public class ModelNavigatorActionProvider extends CommonActionProvider {
}
};
makeDirty = new Action("Make Dirty") {
+ @Override
public void run() {
IStructuredSelection selection = (IStructuredSelection)getContext().getSelection();
for (Iterator iter = selection.iterator(); iter.hasNext();) {
@@ -171,11 +177,12 @@ public class ModelNavigatorActionProvider extends CommonActionProvider {
}
};
}
-
+
protected Shell getShell() {
return getActionSite().getViewSite().getShell();
}
+ @Override
public void fillContextMenu(IMenuManager menu) {
super.fillContextMenu(menu);
menu.add(deleteAction);
@@ -202,7 +209,7 @@ public class ModelNavigatorActionProvider extends CommonActionProvider {
}
return null;
}
-
+
ModelObjectDefinitionFile getSelectedModFile() {
IStructuredSelection selection = (IStructuredSelection)getContext().getSelection();
if (selection.size() == 1) {
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelSaveable.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelSaveable.java
index 17feb69c5..286115dcb 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelSaveable.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelSaveable.java
@@ -35,6 +35,7 @@ public class ModelSaveable extends Saveable {
modelObject = mo;
}
+ @Override
public boolean equals(Object object) {
if (object instanceof ModelSaveable) {
ModelSaveable other = (ModelSaveable) object;
@@ -47,26 +48,32 @@ public class ModelSaveable extends Saveable {
return modelObject;
}
+ @Override
public ImageDescriptor getImageDescriptor() {
return ModelWorkbenchAdapter.createImageDescriptor("obj/mod_obj.gif");
}
+ @Override
public String getName() {
return modelObject.getName();
}
+ @Override
public String getToolTipText() {
return "Saveable for " + getName();
}
+ @Override
public int hashCode() {
return modelObject.hashCode();
}
+ @Override
public boolean isDirty() {
return dirty;
}
-
+
+ @Override
public void doSave(IProgressMonitor monitor) {
dirty = false;
modelSaveablesProvider.saved(this);
@@ -76,6 +83,7 @@ public class ModelSaveable extends Saveable {
dirty = true;
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
if (adapter == ResourceMapping.class) {
return Adapters.adapt(getModelObject(), adapter);
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelWorkbenchAdapter.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelWorkbenchAdapter.java
index 8f4d7587b..81ca6cd20 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelWorkbenchAdapter.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelWorkbenchAdapter.java
@@ -35,7 +35,7 @@ public class ModelWorkbenchAdapter implements IWorkbenchAdapter {
// image path
private static final String ICON_PATH = "$nl$/icons/full/"; //$NON-NLS-1$
-
+
@Override
public Object[] getChildren(Object o) {
if (o instanceof ModelObject) {
@@ -86,7 +86,7 @@ public class ModelWorkbenchAdapter implements IWorkbenchAdapter {
}
return null;
}
-
+
/**
* Creates an image descriptor.
*/
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java
index 8fc7b5ac9..ea5267f40 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java
@@ -32,20 +32,22 @@ import org.eclipse.ui.internal.wizards.newresource.ResourceMessages;
public class NewModelProjectWizard extends Wizard implements INewWizard {
private WizardNewProjectCreationPage mainPage;
-
+
public NewModelProjectWizard() {
super();
}
-
+
+ @Override
public void addPages() {
super.addPages();
-
+
mainPage = new WizardNewProjectCreationPage("basicNewProjectPage");//$NON-NLS-1$
mainPage.setTitle(ResourceMessages.NewProject_title);
mainPage.setDescription(ResourceMessages.NewProject_description);
this.addPage(mainPage);
}
+ @Override
public boolean performFinish() {
// get a project handle
final IProject newProjectHandle = mainPage.getProjectHandle();
@@ -64,6 +66,7 @@ public class NewModelProjectWizard extends Wizard implements INewWizard {
// create the new project operation
WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+ @Override
protected void execute(IProgressMonitor monitor)
throws CoreException {
createProject(description, newProjectHandle, monitor);
@@ -95,14 +98,14 @@ public class NewModelProjectWizard extends Wizard implements INewWizard {
/**
* Creates a project resource given the project handle and description.
- *
+ *
* @param description
* the project description to create a project resource for
* @param projectHandle
* the project handle to create a project resource for
* @param monitor
* the progress monitor to show visual progress with
- *
+ *
* @exception CoreException
* if the operation fails
* @exception OperationCanceledException
@@ -127,7 +130,8 @@ public class NewModelProjectWizard extends Wizard implements INewWizard {
monitor.done();
}
}
-
+
+ @Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
// Nothing to do
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncActionProvider.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncActionProvider.java
index 2ae215a22..1c0d1f56f 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncActionProvider.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncActionProvider.java
@@ -20,7 +20,7 @@ import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
* The action provider that is used for synchronizations.
*/
public class ModelSyncActionProvider extends SynchronizationActionProvider {
-
+
public ModelSyncActionProvider() {
super();
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncLabelProvider.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncLabelProvider.java
index 53cf0ecde..a7c32b569 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncLabelProvider.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/ModelSyncLabelProvider.java
@@ -31,7 +31,7 @@ import org.eclipse.ui.navigator.ICommonContentExtensionSite;
* overlay hints for isBusy, conflict propagation and markers.
*/
public class ModelSyncLabelProvider extends SynchronizationLabelProvider {
-
+
private ModelNavigatorLabelProvider delegate;
public ModelSyncLabelProvider() {
@@ -44,19 +44,19 @@ public class ModelSyncLabelProvider extends SynchronizationLabelProvider {
delegate = new ModelNavigatorLabelProvider();
delegate.init(site);
}
-
+
@Override
public void dispose() {
super.dispose();
if (delegate != null)
delegate.dispose();
}
-
+
@Override
protected ILabelProvider getDelegateLabelProvider() {
return delegate;
}
-
+
@Override
protected IDiff getDiff(Object element) {
if (element instanceof ModelResource) {
@@ -65,12 +65,12 @@ public class ModelSyncLabelProvider extends SynchronizationLabelProvider {
}
return super.getDiff(element);
}
-
+
@Override
protected boolean isIncludeOverlays() {
return true;
}
-
+
@Override
protected boolean isBusy(Object element) {
if (element instanceof ModelResource) {
@@ -93,7 +93,7 @@ public class ModelSyncLabelProvider extends SynchronizationLabelProvider {
}
return super.isBusy(element);
}
-
+
@Override
protected boolean hasDecendantConflicts(Object element) {
if (element instanceof ModelResource) {
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IPessimisticFilesystemConstants.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IPessimisticFilesystemConstants.java
index 1c04de8d2..ce2d9b6c7 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IPessimisticFilesystemConstants.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IPessimisticFilesystemConstants.java
@@ -16,7 +16,7 @@ package org.eclipse.team.examples.pessimistic;
/**
* Preference constants for the <code>PessimisticFilesystemProvider</code>.
*/
-public interface IPessimisticFilesystemConstants {
+public interface IPessimisticFilesystemConstants {
/**
* Preference name's prefix
*/
@@ -46,7 +46,7 @@ public interface IPessimisticFilesystemConstants {
* Preference name for the option to add files to the repository provider.
*/
String PREF_ADD_TO_CONTROL= PREFIX + "AddToControl";
-
+
/**
* Preference option indicating that the user should be prompted.
*/
@@ -67,5 +67,5 @@ public interface IPessimisticFilesystemConstants {
/**
* Status flag indicating that resources need to be reloaded.
*/
- int STATUS_PROMPT_FOR_RELOAD = 2;
+ int STATUS_PROMPT_FOR_RELOAD = 2;
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IResourceStateListener.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IResourceStateListener.java
index 6eee9aeee..e65900bf1 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IResourceStateListener.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/IResourceStateListener.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.team.examples.pessimistic;
-
+
import org.eclipse.core.resources.IResource;
/**
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProvider.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProvider.java
index e85f5fff1..26179976c 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProvider.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -68,7 +68,7 @@ public class PessimisticFilesystemProvider extends RepositoryProvider {
private FileModificationValidator validator;
/**
* The cache of resources that are currently controlled.
- * The cache is a map of parent resource -> set of controlled children.
+ * The cache is a map of parent resource -&amp; set of controlled children.
*/
Map<IContainer, Set<IResource>> fControlledResources;
@@ -311,8 +311,8 @@ public class PessimisticFilesystemProvider extends RepositoryProvider {
DataOutputStream out= new DataOutputStream(byteOut);
try {
out.writeInt(controlledResources.size());
- for (Iterator i= controlledResources.iterator(); i.hasNext();) {
- IResource resource= (IResource) i.next();
+ for (Object element : controlledResources) {
+ IResource resource= (IResource) element;
out.writeUTF(resource.getProjectRelativePath().toString());
}
out.flush();
@@ -602,12 +602,9 @@ public class PessimisticFilesystemProvider extends RepositoryProvider {
public static String getFileContents(IFile file) throws IOException, CoreException {
StringBuilder buf = new StringBuilder();
- Reader reader = new InputStreamReader(new BufferedInputStream(file.getContents()));
- try {
+ try (Reader reader = new InputStreamReader(new BufferedInputStream(file.getContents()))) {
int c;
while ((c = reader.read()) != -1) buf.append((char)c);
- } finally {
- reader.close();
}
return buf.toString();
}
@@ -675,7 +672,7 @@ public class PessimisticFilesystemProvider extends RepositoryProvider {
* Answers a collection of all of the resources contained below
* the given resource and the resource itself.
*/
- private Collection getSubtreeMembers(IResource resource) {
+ private Collection<IResource> getSubtreeMembers(IResource resource) {
final Set<IResource> resources = new HashSet<>(1);
IResourceVisitor visitor= resource1 -> {
switch (resource1.getType()) {
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/BlankPage.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/BlankPage.java
index 14b8d8e03..2233f2c13 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/BlankPage.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/BlankPage.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.team.examples.pessimistic.ui;
-
+
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
@@ -36,6 +36,7 @@ public class BlankPage extends WizardPage {
/**
* Creates an empty control.
*/
+ @Override
public void createControl(Composite parent) {
Composite client = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckInAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckInAction.java
index 0168b9932..e1a92c15a 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckInAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckInAction.java
@@ -12,21 +12,21 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.team.examples.pessimistic.ui;
-
+
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.examples.pessimistic.PessimisticFilesystemProvider;
/**
- * Performs a check in on the selected resources. If a folder is
+ * Performs a check in on the selected resources. If a folder is
* selected all of its children are recursively checked in.
*/
public class CheckInAction extends SourceManagementAction {
/**
- * Answers <code>true</code> if and only if the resource is
+ * Answers <code>true</code> if and only if the resource is
* not null, controlled, not ignored, and is checked out.
- *
+ *
* @see PessimisticProviderAction#shouldEnableFor(IResource)
*/
@Override
@@ -39,7 +39,7 @@ public class CheckInAction extends SourceManagementAction {
if (!provider.isControlled(resource))
return false;
if (provider.isIgnored(resource))
- return false;
+ return false;
return provider.isCheckedout(resource);
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckOutAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckOutAction.java
index 38ca10a8e..be9666f86 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckOutAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/CheckOutAction.java
@@ -12,20 +12,20 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.team.examples.pessimistic.ui;
-
+
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.examples.pessimistic.PessimisticFilesystemProvider;
/**
- * Performs a check out on the selected resources. If a folder is
+ * Performs a check out on the selected resources. If a folder is
* selected all of its children are recursively checked out.
*/
public class CheckOutAction extends SourceManagementAction {
/**
* Answers <code>true</code> if and only if the <code>resource</code>
* is not <code>null</code>, controlled, not ignored and not checked out.
- *
+ *
* @see PessimisticProviderAction#shouldEnableFor(IResource)
*/
@Override
@@ -41,7 +41,7 @@ public class CheckOutAction extends SourceManagementAction {
return false;
return !provider.isCheckedout(resource);
}
-
+
@Override
protected void manageResources(PessimisticFilesystemProvider provider, IResource[] resources, IProgressMonitor monitor) {
provider.checkout(resources, monitor);
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/ConfigurationWizard.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/ConfigurationWizard.java
index 14c058d13..4a9354ed6 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/ConfigurationWizard.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/ConfigurationWizard.java
@@ -12,7 +12,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.team.examples.pessimistic.ui;
-
+
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.team.core.RepositoryProvider;
@@ -30,7 +30,7 @@ public class ConfigurationWizard extends Wizard implements IConfigurationWizard
* The project in question.
*/
private IProject project;
-
+
@Override
public void addPages() {
// workaround the wizard problem
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticDecorator.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticDecorator.java
index 463fe03bd..a6355314a 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticDecorator.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticDecorator.java
@@ -35,6 +35,7 @@ public class PessimisticDecorator extends LabelProvider implements ILabelDecorat
PessimisticFilesystemProviderPlugin.getInstance().addProviderListener(this);
}
+ @Override
public String decorateText(String text, Object element) {
IResource resource= getResource(element);
if (resource == null)
@@ -55,6 +56,7 @@ public class PessimisticDecorator extends LabelProvider implements ILabelDecorat
return "(not controlled) " + text;
}
+ @Override
public Image decorateImage(Image image, Object element) {
return image;
}
@@ -96,11 +98,13 @@ public class PessimisticDecorator extends LabelProvider implements ILabelDecorat
}
}
+ @Override
public void dispose() {
PessimisticFilesystemProviderPlugin.getInstance().removeProviderListener(this);
super.dispose();
}
+ @Override
public void stateChanged(IResource[] resources) {
if (resources.length > 0) {
LabelProviderChangedEvent[] events= new LabelProviderChangedEvent[resources.length];
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticPreferencesPage.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticPreferencesPage.java
index d11067e20..0b11a2f64 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticPreferencesPage.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/PessimisticPreferencesPage.java
@@ -42,7 +42,7 @@ public class PessimisticPreferencesPage
/*
* Widget for the files are edited without a context preference
*/
- private Combo filesAreEditedNoPromptCombo;
+ private Combo filesAreEditedNoPromptCombo;
/*
* Widget for the files are saved preference
*/
@@ -59,47 +59,47 @@ public class PessimisticPreferencesPage
* Widget for the fail validate edit preference
*/
private Button failValidateEdit;
-
+
/*
* Option strings for the files are edited preference.
*/
- private static final String[] EDIT_OPTION_STRINGS=
- new String[] {
- "Prompt to checkout",
- "Checkout",
+ private static final String[] EDIT_OPTION_STRINGS=
+ new String[] {
+ "Prompt to checkout",
+ "Checkout",
"Do nothing", };
/*
* Option values for the files are edited preference.
*/
private static final int[] EDIT_OPTION_KEYS=
- new int[] {
+ new int[] {
IPessimisticFilesystemConstants.OPTION_PROMPT,
IPessimisticFilesystemConstants.OPTION_AUTOMATIC,
IPessimisticFilesystemConstants.OPTION_DO_NOTHING, };
-
+
/*
* Option strings for the files are edited without a context preference.
*/
- private static final String[] EDIT_NO_PROMPT_OPTION_STRINGS=
- new String[] {
- "Checkout",
- "Do nothing", };
+ private static final String[] EDIT_NO_PROMPT_OPTION_STRINGS=
+ new String[] {
+ "Checkout",
+ "Do nothing", };
/*
* Option strings for the files are saved preference.
*/
- private static final String[] SAVE_OPTION_STRINGS=
- new String[] {
- "Checkout",
+ private static final String[] SAVE_OPTION_STRINGS=
+ new String[] {
+ "Checkout",
"Do nothing", };
/*
* Option values for the files are saved preference.
*/
private static final int[] SAVE_OPTION_KEYS=
- new int[] {
+ new int[] {
IPessimisticFilesystemConstants.OPTION_AUTOMATIC,
IPessimisticFilesystemConstants.OPTION_DO_NOTHING, };
-
+
/*
* Option strings for the add to control preference.
*/
@@ -112,11 +112,11 @@ public class PessimisticPreferencesPage
* Option values for the add to control preference.
*/
private static final int[] ADD_TO_CONTROL_OPTION_KEYS=
- new int[] {
+ new int[] {
IPessimisticFilesystemConstants.OPTION_PROMPT,
IPessimisticFilesystemConstants.OPTION_AUTOMATIC,
- IPessimisticFilesystemConstants.OPTION_DO_NOTHING, };
-
+ IPessimisticFilesystemConstants.OPTION_DO_NOTHING, };
+
@Override
protected IPreferenceStore doGetPreferenceStore() {
@@ -161,13 +161,13 @@ public class PessimisticPreferencesPage
gridData = new GridData();
gridData.horizontalSpan = 1;
gridData.horizontalAlignment = GridData.FILL;
- label.setLayoutData(gridData);
+ label.setLayoutData(gridData);
filesAreEditedCombo= new Combo(options, SWT.BORDER | SWT.READ_ONLY);
gridData = new GridData();
gridData.horizontalSpan= 1;
gridData.horizontalAlignment = GridData.FILL;
- filesAreEditedCombo.setLayoutData(gridData);
+ filesAreEditedCombo.setLayoutData(gridData);
filesAreEditedCombo.setItems(EDIT_OPTION_STRINGS);
label = new Label(options, SWT.NONE);
@@ -175,22 +175,22 @@ public class PessimisticPreferencesPage
gridData = new GridData();
gridData.horizontalSpan = 1;
gridData.horizontalAlignment = GridData.FILL;
- label.setLayoutData(gridData);
+ label.setLayoutData(gridData);
filesAreEditedNoPromptCombo= new Combo(options, SWT.BORDER | SWT.READ_ONLY);
gridData = new GridData();
gridData.horizontalSpan= 1;
gridData.horizontalAlignment = GridData.FILL;
- filesAreEditedNoPromptCombo.setLayoutData(gridData);
+ filesAreEditedNoPromptCombo.setLayoutData(gridData);
filesAreEditedNoPromptCombo.setItems(EDIT_NO_PROMPT_OPTION_STRINGS);
-
+
label = new Label(options, SWT.NONE);
label.setText("When checked in files are saved:");
gridData = new GridData();
gridData.horizontalSpan = 1;
gridData.horizontalAlignment = GridData.FILL;
label.setLayoutData(gridData);
-
+
filesAreSavedCombo= new Combo(options, SWT.BORDER | SWT.READ_ONLY);
gridData = new GridData();
gridData.horizontalSpan = 1;
@@ -204,7 +204,7 @@ public class PessimisticPreferencesPage
gridData.horizontalSpan = 1;
gridData.horizontalAlignment = GridData.FILL;
label.setLayoutData(gridData);
-
+
addToControlCombo= new Combo(options, SWT.BORDER | SWT.READ_ONLY);
gridData = new GridData();
gridData.horizontalSpan = 1;
@@ -253,7 +253,7 @@ public class PessimisticPreferencesPage
filesAreSavedCombo.select(
getSaveOptionIndex(store.getDefaultInt(IPessimisticFilesystemConstants.PREF_CHECKED_IN_FILES_SAVED)));
addToControlCombo.select(
- getAddToControlOptionIndex(store.getDefaultInt(IPessimisticFilesystemConstants.PREF_ADD_TO_CONTROL)));
+ getAddToControlOptionIndex(store.getDefaultInt(IPessimisticFilesystemConstants.PREF_ADD_TO_CONTROL)));
failValidateEdit.setSelection(
store.getDefaultBoolean(IPessimisticFilesystemConstants.PREF_FAIL_VALIDATE_EDIT));
changeFileContents.setSelection(
@@ -286,8 +286,8 @@ public class PessimisticPreferencesPage
IPessimisticFilesystemConstants.PREF_ADD_TO_CONTROL,
ADD_TO_CONTROL_OPTION_KEYS[selectionIndex]);
store.setValue(
- IPessimisticFilesystemConstants.PREF_FAIL_VALIDATE_EDIT,
- failValidateEdit.getSelection());
+ IPessimisticFilesystemConstants.PREF_FAIL_VALIDATE_EDIT,
+ failValidateEdit.getSelection());
store.setValue(
IPessimisticFilesystemConstants.PREF_TOUCH_DURING_VALIDATE_EDIT,
changeFileContents.getSelection());
@@ -303,7 +303,7 @@ public class PessimisticPreferencesPage
filesAreEditedCombo.select(
getEditOptionIndex(store.getInt(IPessimisticFilesystemConstants.PREF_CHECKED_IN_FILES_EDITED)));
filesAreEditedNoPromptCombo.select(
- getEditNoPromptOptionIndex(store.getInt(IPessimisticFilesystemConstants.PREF_CHECKED_IN_FILES_EDITED_NOPROMPT)));
+ getEditNoPromptOptionIndex(store.getInt(IPessimisticFilesystemConstants.PREF_CHECKED_IN_FILES_EDITED_NOPROMPT)));
filesAreSavedCombo.select(
getSaveOptionIndex(store.getInt(IPessimisticFilesystemConstants.PREF_CHECKED_IN_FILES_SAVED)));
addToControlCombo.select(
@@ -313,10 +313,10 @@ public class PessimisticPreferencesPage
changeFileContents.setSelection(
store.getBoolean(IPessimisticFilesystemConstants.PREF_TOUCH_DURING_VALIDATE_EDIT));
}
-
+
/*
* Answers the index of the given key.
- */
+ */
protected int getEditOptionIndex(int key) {
for(int i= 0; i < EDIT_OPTION_KEYS.length; i++) {
if (EDIT_OPTION_KEYS[i] == key)
@@ -324,10 +324,10 @@ public class PessimisticPreferencesPage
}
return -1;
}
-
+
/*
* Answers the index of the given key.
- */
+ */
protected int getSaveOptionIndex(int key) {
for(int i= 0; i < SAVE_OPTION_KEYS.length; i++) {
if (SAVE_OPTION_KEYS[i] == key)
@@ -335,21 +335,21 @@ public class PessimisticPreferencesPage
}
return -1;
}
-
+
/*
* Answers the index of the given key.
- */
+ */
protected int getEditNoPromptOptionIndex(int key) {
for(int i= 0; i < SAVE_OPTION_KEYS.length; i++) {
if (SAVE_OPTION_KEYS[i] == key)
return i;
}
return -1;
- }
-
+ }
+
/*
* Answers the index of the given key.
- */
+ */
protected int getAddToControlOptionIndex(int key) {
for(int i= 0; i < ADD_TO_CONTROL_OPTION_KEYS.length; i++) {
if (ADD_TO_CONTROL_OPTION_KEYS[i] == key)
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/UncheckOutAction.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/UncheckOutAction.java
index a06bf4668..721b34381 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/UncheckOutAction.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/ui/UncheckOutAction.java
@@ -18,7 +18,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.examples.pessimistic.PessimisticFilesystemProvider;
/**
- * Performs an uncheck out on the selected resources. If a folder is
+ * Performs an uncheck out on the selected resources. If a folder is
* selected all of its children are recursively unchecked out.
*/
public class UncheckOutAction extends CheckInAction {
diff --git a/features/org.eclipse.cvs-feature/.settings/org.eclipse.core.runtime.prefs b/features/org.eclipse.cvs-feature/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/features/org.eclipse.cvs-feature/.settings/org.eclipse.core.runtime.prefs
+++ b/features/org.eclipse.cvs-feature/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/features/org.eclipse.cvs-feature/feature.properties b/features/org.eclipse.cvs-feature/feature.properties
index ab6f824aa..fdabd9a2d 100644
--- a/features/org.eclipse.cvs-feature/feature.properties
+++ b/features/org.eclipse.cvs-feature/feature.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2011 IBM Corporation and others.
+# Copyright (c) 2000, 2020 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
@@ -28,7 +28,7 @@ description=Eclipse CVS Client (binary runtime and user documentation).
# "copyright" property - text of the "Feature Update Copyright"
copyright=\
-Copyright (c) 2000, 2011 IBM Corporation and others.\n\
+Copyright (c) 2000, 2020 IBM Corporation and others.\n\
\n\
This program and the accompanying materials\n\
are made available under the terms of the Eclipse Public License 2.0\n\
diff --git a/features/org.eclipse.cvs-feature/feature.xml b/features/org.eclipse.cvs-feature/feature.xml
index 75ed50e52..2cea56ac9 100644
--- a/features/org.eclipse.cvs-feature/feature.xml
+++ b/features/org.eclipse.cvs-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cvs"
label="%featureName"
- version="1.4.1000.qualifier"
+ version="1.4.2100.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/features/org.eclipse.cvs-feature/pom.xml b/features/org.eclipse.cvs-feature/pom.xml
index 2a6ba7172..60b58e44b 100644
--- a/features/org.eclipse.cvs-feature/pom.xml
+++ b/features/org.eclipse.cvs-feature/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2017 Eclipse Foundation and others.
+ Copyright (c) 2012, 2019 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -14,26 +14,26 @@
<parent>
<artifactId>eclipse.platform.team</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.cvs.feature</groupId>
<artifactId>org.eclipse.cvs</artifactId>
- <version>1.4.1000-SNAPSHOT</version>
+ <version>1.4.2100-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<build>
<plugins>
<plugin>
- <groupId>org.eclipse.tycho.extras</groupId>
- <artifactId>tycho-source-feature-plugin</artifactId>
- <version>${tycho-extras.version}</version>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ <version>${tycho.version}</version>
<executions>
<execution>
<phase>package</phase>
- <id>source-feature</id>
+ <id>feature-source</id>
<goals>
- <goal>source-feature</goal>
+ <goal>feature-source</goal>
</goals>
<configuration>
<excludes>
@@ -49,7 +49,7 @@
<version>${tycho.version}</version>
<executions>
<execution>
- <id>attached-p2-metadata</id>
+ <id>attach-p2-metadata</id>
<phase>package</phase>
<goals>
<goal>p2-metadata</goal>
diff --git a/pom.xml b/pom.xml
index 65b203a0e..ac287360c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,17 +15,16 @@
<parent>
<groupId>org.eclipse</groupId>
<artifactId>eclipse-platform-parent</artifactId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>../eclipse-platform-parent</relativePath>
</parent>
<groupId>eclipse.platform.team</groupId>
<artifactId>eclipse.platform.team</artifactId>
- <version>4.13.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
- <tycho.scmUrl>scm:git:git://git.eclipse.org/gitroot/platform/eclipse.platform.team.git</tycho.scmUrl>
+ <tycho.scmUrl>scm:git:https://git.eclipse.org/r/platform/eclipse.platform.team.git</tycho.scmUrl>
<code.ignoredWarnings>-warn:-deprecation,raw,unchecked,warningToken</code.ignoredWarnings>
</properties>
@@ -56,14 +55,10 @@
<module>bundles/org.eclipse.compare</module>
<module>bundles/org.eclipse.compare.win32</module>
<module>bundles/org.eclipse.compare.core</module>
- <module>bundles/org.eclipse.cvs</module>
<module>bundles/org.eclipse.core.net</module>
<module>bundles/org.eclipse.jsch.core</module>
<module>bundles/org.eclipse.jsch.ui</module>
<module>bundles/org.eclipse.team.core</module>
- <module>bundles/org.eclipse.team.cvs.core</module>
- <module>bundles/org.eclipse.team.cvs.ssh2</module>
- <module>bundles/org.eclipse.team.cvs.ui</module>
<module>bundles/org.eclipse.team.ui</module>
<module>bundles/org.eclipse.team.genericeditor.diff.extension</module>
<module>bundles/org.eclipse.ui.net</module>
@@ -71,10 +66,9 @@
<module>examples/org.eclipse.compare.examples.xml</module>
<module>examples/org.eclipse.team.examples.filesystem</module>
- <module>features/org.eclipse.cvs-feature</module>
-
<!-- fragments -->
- <module>bundles/org.eclipse.core.net.linux.x86_64</module>
+ <module>bundles/org.eclipse.core.net.linux</module>
+ <module>bundles/org.eclipse.core.net.win32</module>
<module>bundles/org.eclipse.core.net.win32.x86_64</module>
<module>tests</module>
diff --git a/tests/org.eclipse.compare.tests/.classpath b/tests/org.eclipse.compare.tests/.classpath
index eca7bdba8..a42a828e0 100644
--- a/tests/org.eclipse.compare.tests/.classpath
+++ b/tests/org.eclipse.compare.tests/.classpath
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/tests/org.eclipse.compare.tests/.cvsignore b/tests/org.eclipse.compare.tests/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/tests/org.eclipse.compare.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/tests/org.eclipse.compare.tests/.settings/org.eclipse.core.runtime.prefs b/tests/org.eclipse.compare.tests/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/tests/org.eclipse.compare.tests/.settings/org.eclipse.core.runtime.prefs
+++ b/tests/org.eclipse.compare.tests/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/tests/org.eclipse.compare.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.compare.tests/.settings/org.eclipse.jdt.core.prefs
index 2a1fa004c..101f2580b 100644
--- a/tests/org.eclipse.compare.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/org.eclipse.compare.tests/.settings/org.eclipse.jdt.core.prefs
@@ -1,134 +1,136 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.APILeak=warning
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
-org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
-org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
-org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/tests/org.eclipse.compare.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.compare.tests/META-INF/MANIFEST.MF
index 8f9317bf8..7638cd57c 100644
--- a/tests/org.eclipse.compare.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.compare.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare.tests;singleton:=true
-Bundle-Version: 3.6.600.qualifier
+Bundle-Version: 3.7.0.qualifier
Require-Bundle: org.junit,
org.eclipse.compare,
org.eclipse.jface.text,
@@ -18,7 +18,7 @@ Require-Bundle: org.junit,
Bundle-Activator: org.eclipse.compare.tests.CompareTestPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Localization: plugin
Export-Package: org.eclipse.compare.tests,
org.eclipse.compare.tests.performance
diff --git a/tests/org.eclipse.compare.tests/patchdata/bug150591_cr_crlf_cr/patch.txt b/tests/org.eclipse.compare.tests/patchdata/bug150591_cr_crlf_cr/patch.txt
index 1c6d6822c..ebe945ea1 100644
--- a/tests/org.eclipse.compare.tests/patchdata/bug150591_cr_crlf_cr/patch.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/bug150591_cr_crlf_cr/patch.txt
@@ -1,20 +1,20 @@
---- old.txt 2005-05-07 00:16:20.000000000 +0200
-+++ new.txt 2005-05-07 00:16:32.000000000 +0200
-@@ -3,2 +3,4 @@
- [c]
-+[c1]
-+[c2]
- [d]
-@@ -8,3 +10,3 @@
- [h]
--[i]
-+[i1]
- [j]
-@@ -14,3 +16,2 @@
- [n]
--[o]
- [p]
-@@ -19,2 +20,3 @@
- [s]
-+[s1]
- [t]
+--- old.txt 2005-05-07 00:16:20.000000000 +0200
++++ new.txt 2005-05-07 00:16:32.000000000 +0200
+@@ -3,2 +3,4 @@
+ [c]
++[c1]
++[c2]
+ [d]
+@@ -8,3 +10,3 @@
+ [h]
+-[i]
++[i1]
+ [j]
+@@ -14,3 +16,2 @@
+ [n]
+-[o]
+ [p]
+@@ -19,2 +20,3 @@
+ [s]
++[s1]
+ [t]
diff --git a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.patched.txt b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.patched.txt
index 4aed4b55c..c13853369 100644
--- a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.patched.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.patched.txt
@@ -1,25 +1,25 @@
-[a]
-[b]
-[c]
-[c1]
-[c2]
-[d]
-[e]
-[f]
-[g]
-[h]
-[i1]
-[j]
-[k]
-[l]
-[m]
-[n]
-[p]
-[q]
-[r]
-[s]
-[s1]
-[t]
-[u]
-[v]
-[w]
+[a]
+[b]
+[c]
+[c1]
+[c2]
+[d]
+[e]
+[f]
+[g]
+[h]
+[i1]
+[j]
+[k]
+[l]
+[m]
+[n]
+[p]
+[q]
+[r]
+[s]
+[s1]
+[t]
+[u]
+[v]
+[w]
diff --git a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.txt b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.txt
index a758d109a..1b8d4c7ca 100644
--- a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/context_crlf.txt
@@ -1,23 +1,23 @@
-[a]
-[b]
-[c]
-[d]
-[e]
-[f]
-[g]
-[h]
-[i]
-[j]
-[k]
-[l]
-[m]
-[n]
-[o]
-[p]
-[q]
-[r]
-[s]
-[t]
-[u]
-[v]
-[w]
+[a]
+[b]
+[c]
+[d]
+[e]
+[f]
+[g]
+[h]
+[i]
+[j]
+[k]
+[l]
+[m]
+[n]
+[o]
+[p]
+[q]
+[r]
+[s]
+[t]
+[u]
+[v]
+[w]
diff --git a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/patch.txt b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/patch.txt
index 1c6d6822c..ebe945ea1 100644
--- a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/patch.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_crlf_crlf/patch.txt
@@ -1,20 +1,20 @@
---- old.txt 2005-05-07 00:16:20.000000000 +0200
-+++ new.txt 2005-05-07 00:16:32.000000000 +0200
-@@ -3,2 +3,4 @@
- [c]
-+[c1]
-+[c2]
- [d]
-@@ -8,3 +10,3 @@
- [h]
--[i]
-+[i1]
- [j]
-@@ -14,3 +16,2 @@
- [n]
--[o]
- [p]
-@@ -19,2 +20,3 @@
- [s]
-+[s1]
- [t]
+--- old.txt 2005-05-07 00:16:20.000000000 +0200
++++ new.txt 2005-05-07 00:16:32.000000000 +0200
+@@ -3,2 +3,4 @@
+ [c]
++[c1]
++[c2]
+ [d]
+@@ -8,3 +10,3 @@
+ [h]
+-[i]
++[i1]
+ [j]
+@@ -14,3 +16,2 @@
+ [n]
+-[o]
+ [p]
+@@ -19,2 +20,3 @@
+ [s]
++[s1]
+ [t]
diff --git a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.patched.txt b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.patched.txt
index 4aed4b55c..c13853369 100644
--- a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.patched.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.patched.txt
@@ -1,25 +1,25 @@
-[a]
-[b]
-[c]
-[c1]
-[c2]
-[d]
-[e]
-[f]
-[g]
-[h]
-[i1]
-[j]
-[k]
-[l]
-[m]
-[n]
-[p]
-[q]
-[r]
-[s]
-[s1]
-[t]
-[u]
-[v]
-[w]
+[a]
+[b]
+[c]
+[c1]
+[c2]
+[d]
+[e]
+[f]
+[g]
+[h]
+[i1]
+[j]
+[k]
+[l]
+[m]
+[n]
+[p]
+[q]
+[r]
+[s]
+[s1]
+[t]
+[u]
+[v]
+[w]
diff --git a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.txt b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.txt
index a758d109a..1b8d4c7ca 100644
--- a/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/bug150591_crlf_lf_crlf/context_crlf.txt
@@ -1,23 +1,23 @@
-[a]
-[b]
-[c]
-[d]
-[e]
-[f]
-[g]
-[h]
-[i]
-[j]
-[k]
-[l]
-[m]
-[n]
-[o]
-[p]
-[q]
-[r]
-[s]
-[t]
-[u]
-[v]
-[w]
+[a]
+[b]
+[c]
+[d]
+[e]
+[f]
+[g]
+[h]
+[i]
+[j]
+[k]
+[l]
+[m]
+[n]
+[o]
+[p]
+[q]
+[r]
+[s]
+[t]
+[u]
+[v]
+[w]
diff --git a/tests/org.eclipse.compare.tests/patchdata/bug150591_lf_crlf_lf/patch.txt b/tests/org.eclipse.compare.tests/patchdata/bug150591_lf_crlf_lf/patch.txt
index 1c6d6822c..ebe945ea1 100644
--- a/tests/org.eclipse.compare.tests/patchdata/bug150591_lf_crlf_lf/patch.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/bug150591_lf_crlf_lf/patch.txt
@@ -1,20 +1,20 @@
---- old.txt 2005-05-07 00:16:20.000000000 +0200
-+++ new.txt 2005-05-07 00:16:32.000000000 +0200
-@@ -3,2 +3,4 @@
- [c]
-+[c1]
-+[c2]
- [d]
-@@ -8,3 +10,3 @@
- [h]
--[i]
-+[i1]
- [j]
-@@ -14,3 +16,2 @@
- [n]
--[o]
- [p]
-@@ -19,2 +20,3 @@
- [s]
-+[s1]
- [t]
+--- old.txt 2005-05-07 00:16:20.000000000 +0200
++++ new.txt 2005-05-07 00:16:32.000000000 +0200
+@@ -3,2 +3,4 @@
+ [c]
++[c1]
++[c2]
+ [d]
+@@ -8,3 +10,3 @@
+ [h]
+-[i]
++[i1]
+ [j]
+@@ -14,3 +16,2 @@
+ [n]
+-[o]
+ [p]
+@@ -19,2 +20,3 @@
+ [s]
++[s1]
+ [t]
diff --git a/tests/org.eclipse.compare.tests/patchdata/context_full.txt b/tests/org.eclipse.compare.tests/patchdata/context_full.txt
index ff06fcb44..6646db5ef 100644
--- a/tests/org.eclipse.compare.tests/patchdata/context_full.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/context_full.txt
@@ -1,52 +1,52 @@
-[a]
-[b]
-[c]
-[d]
-[e]
-[f]
-[g]
-[h]
-[i]
-[j]
-[k]
-[l]
-[m]
-[n]
-[o]
-[p]
-[q]
-[r]
-[s]
-[t]
-[u]
-[v]
-[w]
-[x]
-[y]
-[z]
-[A]
-[B]
-[C]
-[D]
-[E]
-[F]
-[G]
-[H]
-[I]
-[J]
-[K]
-[L]
-[M]
-[N]
-[O]
-[P]
-[Q]
-[R]
-[S]
-[T]
-[U]
-[V]
-[W]
-[X]
-[Y]
+[a]
+[b]
+[c]
+[d]
+[e]
+[f]
+[g]
+[h]
+[i]
+[j]
+[k]
+[l]
+[m]
+[n]
+[o]
+[p]
+[q]
+[r]
+[s]
+[t]
+[u]
+[v]
+[w]
+[x]
+[y]
+[z]
+[A]
+[B]
+[C]
+[D]
+[E]
+[F]
+[G]
+[H]
+[I]
+[J]
+[K]
+[L]
+[M]
+[N]
+[O]
+[P]
+[Q]
+[R]
+[S]
+[T]
+[U]
+[V]
+[W]
+[X]
+[Y]
[Z] \ No newline at end of file
diff --git a/tests/org.eclipse.compare.tests/patchdata/exp_addHunks.txt b/tests/org.eclipse.compare.tests/patchdata/exp_addHunks.txt
index 3d09ef1ad..0324ad338 100644
--- a/tests/org.eclipse.compare.tests/patchdata/exp_addHunks.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/exp_addHunks.txt
@@ -1,59 +1,59 @@
-[a1]
-[a2]
-[a]
-[b]
-[c]
-[d]
-[d1]
-[d2]
-[d3]
-[d4]
-[e]
-[f]
-[g]
-[h]
-[i]
-[j]
-[k]
-[l]
-[m]
-[n]
-[o]
-[p]
-[q]
-[r]
-[s]
-[t]
-[u]
-[v]
-[y]
-[z]
-[A]
-[B]
-[C]
-[D]
-[E]
-[F]
-[G]
-[H]
-[I]
-[J]
-[K]
-[L]
-[N]
-[N1]
-[N2]
-[O]
-[P]
-[Q]
-[R]
-[S]
-[T]
-[U]
-[V]
-[W]
-[W1]
-[W2]
-[W3]
-[Y]
+[a1]
+[a2]
+[a]
+[b]
+[c]
+[d]
+[d1]
+[d2]
+[d3]
+[d4]
+[e]
+[f]
+[g]
+[h]
+[i]
+[j]
+[k]
+[l]
+[m]
+[n]
+[o]
+[p]
+[q]
+[r]
+[s]
+[t]
+[u]
+[v]
+[y]
+[z]
+[A]
+[B]
+[C]
+[D]
+[E]
+[F]
+[G]
+[H]
+[I]
+[J]
+[K]
+[L]
+[N]
+[N1]
+[N2]
+[O]
+[P]
+[Q]
+[R]
+[S]
+[T]
+[U]
+[V]
+[W]
+[W1]
+[W2]
+[W3]
+[Y]
[Z] \ No newline at end of file
diff --git a/tests/org.eclipse.compare.tests/patchdata/exp_createFilePatch.txt b/tests/org.eclipse.compare.tests/patchdata/exp_createFilePatch.txt
index 7d137a8e3..dc7a3d4f8 100644
--- a/tests/org.eclipse.compare.tests/patchdata/exp_createFilePatch.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/exp_createFilePatch.txt
@@ -1,27 +1,27 @@
-[a1]
-[a2]
-[a3]
-[a]
-[b]
-[c]
-[f]
-[g]
-[h]
-[h1]
-[i]
-[j]
-[j1]
-[j2]
-[k]
-[l]
-[m]
-[n]
-[o]
-[p]
-[q]
-[r]
-[s]
-[t]
-[u]
-[v]
-[w]
+[a1]
+[a2]
+[a3]
+[a]
+[b]
+[c]
+[f]
+[g]
+[h]
+[h1]
+[i]
+[j]
+[j1]
+[j2]
+[k]
+[l]
+[m]
+[n]
+[o]
+[p]
+[q]
+[r]
+[s]
+[t]
+[u]
+[v]
+[w]
diff --git a/tests/org.eclipse.compare.tests/patchdata/exp_modifyHunks.txt b/tests/org.eclipse.compare.tests/patchdata/exp_modifyHunks.txt
index c3e64d74b..f42aa7381 100644
--- a/tests/org.eclipse.compare.tests/patchdata/exp_modifyHunks.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/exp_modifyHunks.txt
@@ -1,28 +1,28 @@
-[a]
-[b]
-[c]
-[d]
-[d1]
-[d2]
-[d3]
-[d4]
-[e]
-[f]
-[g]
-[h]
-[i1]
-[j]
-[k]
-[l]
-[m]
-[n]
-[o]
-[p]
-[q]
-[r]
-[s]
-[s1]
-[t]
-[u]
-[v]
-[w]
+[a]
+[b]
+[c]
+[d]
+[d1]
+[d2]
+[d3]
+[d4]
+[e]
+[f]
+[g]
+[h]
+[i1]
+[j]
+[k]
+[l]
+[m]
+[n]
+[o]
+[p]
+[q]
+[r]
+[s]
+[s1]
+[t]
+[u]
+[v]
+[w]
diff --git a/tests/org.eclipse.compare.tests/patchdata/exp_removeHunks.txt b/tests/org.eclipse.compare.tests/patchdata/exp_removeHunks.txt
index 68fc86fcd..96a93f485 100644
--- a/tests/org.eclipse.compare.tests/patchdata/exp_removeHunks.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/exp_removeHunks.txt
@@ -1,51 +1,51 @@
-[a]
-[b]
-[c]
-[d]
-[e]
-[f]
-[g]
-[h]
-[i]
-[j]
-[k]
-[l]
-[m]
-[n]
-[o]
-[p]
-[q]
-[r]
-[s]
-[t]
-[u]
-[v]
-[y]
-[z]
-[A]
-[B]
-[C]
-[D]
-[E]
-[F]
-[I]
-[J]
-[J1]
-[K]
-[L]
-[M]
-[N]
-[O]
-[P]
-[Q]
-[R]
-[S]
-[T]
-[U]
-[V]
-[W]
-[W1]
-[W2]
-[W3]
-[Y]
+[a]
+[b]
+[c]
+[d]
+[e]
+[f]
+[g]
+[h]
+[i]
+[j]
+[k]
+[l]
+[m]
+[n]
+[o]
+[p]
+[q]
+[r]
+[s]
+[t]
+[u]
+[v]
+[y]
+[z]
+[A]
+[B]
+[C]
+[D]
+[E]
+[F]
+[I]
+[J]
+[J1]
+[K]
+[L]
+[M]
+[N]
+[O]
+[P]
+[Q]
+[R]
+[S]
+[T]
+[U]
+[V]
+[W]
+[W1]
+[W2]
+[W3]
+[Y]
[Z] \ No newline at end of file
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_addHunks.txt b/tests/org.eclipse.compare.tests/patchdata/patch_addHunks.txt
index 4c75b3d6e..3d51d344a 100644
--- a/tests/org.eclipse.compare.tests/patchdata/patch_addHunks.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_addHunks.txt
@@ -1,34 +1,34 @@
-### Eclipse Workspace Patch 1.0
-#P Bug202944
-Index: tmp/context_full.txt
-===================================================================
-RCS file: /TEST/Bug202944/tmp/context_full.txt,v
-retrieving revision 1.1
-diff -u -r1.1 context_full.txt
---- tmp/context_full.txt 23 Feb 2009 09:39:56 -0000 1.1
-+++ tmp/context_full.txt 23 Feb 2009 09:40:51 -0000
-@@ -1,3 +1,5 @@
-+[a1]
-+[a2]
- [a]
- [b]
- [c]
-@@ -20,8 +22,6 @@
- [t]
- [u]
- [v]
--[w]
--[x]
- [y]
- [z]
- [A]
-@@ -47,6 +47,8 @@
- [U]
- [V]
- [W]
--[X]
-+[W1]
-+[W2]
-+[W3]
- [Y]
- [Z]
+### Eclipse Workspace Patch 1.0
+#P Bug202944
+Index: tmp/context_full.txt
+===================================================================
+RCS file: /TEST/Bug202944/tmp/context_full.txt,v
+retrieving revision 1.1
+diff -u -r1.1 context_full.txt
+--- tmp/context_full.txt 23 Feb 2009 09:39:56 -0000 1.1
++++ tmp/context_full.txt 23 Feb 2009 09:40:51 -0000
+@@ -1,3 +1,5 @@
++[a1]
++[a2]
+ [a]
+ [b]
+ [c]
+@@ -20,8 +22,6 @@
+ [t]
+ [u]
+ [v]
+-[w]
+-[x]
+ [y]
+ [z]
+ [A]
+@@ -47,6 +47,8 @@
+ [U]
+ [V]
+ [W]
+-[X]
++[W1]
++[W2]
++[W3]
+ [Y]
+ [Z]
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_createHunk0.txt b/tests/org.eclipse.compare.tests/patchdata/patch_createHunk0.txt
index f1de92aaf..68ddedb1e 100644
--- a/tests/org.eclipse.compare.tests/patchdata/patch_createHunk0.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_createHunk0.txt
@@ -1,19 +1,19 @@
-### Eclipse Workspace Patch 1.0
-#P Bug202944
-Index: tmp/list.txt
-===================================================================
-RCS file: /TEST/Bug202944/tmp/list.txt,v
-retrieving revision 1.2
-diff -u -r1.2 list.txt
---- tmp/list.txt 20 Feb 2009 11:02:27 -0000 1.2
-+++ tmp/list.txt 20 Feb 2009 11:03:29 -0000
-@@ -1,6 +1,8 @@
-+[a1]
-+[a2]
-+[a3]
- [a]
- [b]
--[c]
- [d]
- [e]
- [f]
+### Eclipse Workspace Patch 1.0
+#P Bug202944
+Index: tmp/list.txt
+===================================================================
+RCS file: /TEST/Bug202944/tmp/list.txt,v
+retrieving revision 1.2
+diff -u -r1.2 list.txt
+--- tmp/list.txt 20 Feb 2009 11:02:27 -0000 1.2
++++ tmp/list.txt 20 Feb 2009 11:03:29 -0000
+@@ -1,6 +1,8 @@
++[a1]
++[a2]
++[a3]
+ [a]
+ [b]
+-[c]
+ [d]
+ [e]
+ [f]
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_createHunk1.txt b/tests/org.eclipse.compare.tests/patchdata/patch_createHunk1.txt
index 7b0fb2930..9a1e3b060 100644
--- a/tests/org.eclipse.compare.tests/patchdata/patch_createHunk1.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_createHunk1.txt
@@ -1,26 +1,26 @@
-### Eclipse Workspace Patch 1.0
-#P Bug202944
-Index: tmp/list.txt
-===================================================================
-RCS file: /TEST/Bug202944/tmp/list.txt,v
-retrieving revision 1.2
-diff -u -r1.2 list.txt
---- tmp/list.txt 20 Feb 2009 11:02:27 -0000 1.2
-+++ tmp/list.txt 20 Feb 2009 11:32:47 -0000
-@@ -1,13 +1,14 @@
- [a]
- [b]
--[c]
- [d]
--[e]
- [f]
- [g]
- [h]
-+[h1]
- [i]
- [j]
-+[j1]
-+[j2]
- [k]
- [l]
- [m]
+### Eclipse Workspace Patch 1.0
+#P Bug202944
+Index: tmp/list.txt
+===================================================================
+RCS file: /TEST/Bug202944/tmp/list.txt,v
+retrieving revision 1.2
+diff -u -r1.2 list.txt
+--- tmp/list.txt 20 Feb 2009 11:02:27 -0000 1.2
++++ tmp/list.txt 20 Feb 2009 11:32:47 -0000
+@@ -1,13 +1,14 @@
+ [a]
+ [b]
+-[c]
+ [d]
+-[e]
+ [f]
+ [g]
+ [h]
++[h1]
+ [i]
+ [j]
++[j1]
++[j2]
+ [k]
+ [l]
+ [m]
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_createHunk2.txt b/tests/org.eclipse.compare.tests/patchdata/patch_createHunk2.txt
index 2f64be799..3ad99b923 100644
--- a/tests/org.eclipse.compare.tests/patchdata/patch_createHunk2.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_createHunk2.txt
@@ -1,12 +1,12 @@
-### Eclipse Workspace Patch 1.0
-#P Bug202944
-Index: tmp/a.txt
-===================================================================
-RCS file: tmp/a.txt
-diff -N tmp/a.txt
---- /dev/null 1 Jan 1970 00:00:00 -0000
-+++ tmp/a.txt 1 Jan 1970 00:00:00 -0000
-@@ -0,0 +1,3 @@
-+[aa]
-+[bb]
-+[cc]
+### Eclipse Workspace Patch 1.0
+#P Bug202944
+Index: tmp/a.txt
+===================================================================
+RCS file: tmp/a.txt
+diff -N tmp/a.txt
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ tmp/a.txt 1 Jan 1970 00:00:00 -0000
+@@ -0,0 +1,3 @@
++[aa]
++[bb]
++[cc]
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_createHunk3.txt b/tests/org.eclipse.compare.tests/patchdata/patch_createHunk3.txt
index 0bec1a205..39f9dccd7 100644
--- a/tests/org.eclipse.compare.tests/patchdata/patch_createHunk3.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_createHunk3.txt
@@ -1,14 +1,14 @@
-### Eclipse Workspace Patch 1.0
-#P Bug202944
-Index: tmp/a.txt
-===================================================================
-RCS file: /TEST/Bug202944/tmp/a.txt,v
-retrieving revision 1.1
-diff -u -r1.1 a.txt
---- tmp/a.txt 20 Feb 2009 11:37:35 -0000 1.1
-+++ tmp/a.txt 20 Feb 2009 11:38:40 -0000
-@@ -1,4 +0,0 @@
--[aa]
--[bb]
--[cc]
--[dd]
+### Eclipse Workspace Patch 1.0
+#P Bug202944
+Index: tmp/a.txt
+===================================================================
+RCS file: /TEST/Bug202944/tmp/a.txt,v
+retrieving revision 1.1
+diff -u -r1.1 a.txt
+--- tmp/a.txt 20 Feb 2009 11:37:35 -0000 1.1
++++ tmp/a.txt 20 Feb 2009 11:38:40 -0000
+@@ -1,4 +0,0 @@
+-[aa]
+-[bb]
+-[cc]
+-[dd]
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_modifyHunks.txt b/tests/org.eclipse.compare.tests/patchdata/patch_modifyHunks.txt
index 917b62b9b..87d5174f1 100644
--- a/tests/org.eclipse.compare.tests/patchdata/patch_modifyHunks.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_modifyHunks.txt
@@ -1,25 +1,25 @@
---- old.txt 2005-05-07 00:16:20.000000000 +0200
-+++ new.txt 2005-05-07 00:16:32.000000000 +0200
-@@ -3,2 +3,4 @@
- [c]
-+[c1]
-+[c2]
- [d]
-@@ -8,3 +10,3 @@
- [h]
--[i]
-+[i1]
- [j]
-@@ -14,3 +16,2 @@
- [n]
--[o]
- [p]
-@@ -19,2 +20,3 @@
- [s]
-+[s1]
- [t]
-@@ -29,2 +31,3 @@
- [yy]
-+[xx]
- [yy]
+--- old.txt 2005-05-07 00:16:20.000000000 +0200
++++ new.txt 2005-05-07 00:16:32.000000000 +0200
+@@ -3,2 +3,4 @@
+ [c]
++[c1]
++[c2]
+ [d]
+@@ -8,3 +10,3 @@
+ [h]
+-[i]
++[i1]
+ [j]
+@@ -14,3 +16,2 @@
+ [n]
+-[o]
+ [p]
+@@ -19,2 +20,3 @@
+ [s]
++[s1]
+ [t]
+@@ -29,2 +31,3 @@
+ [yy]
++[xx]
+ [yy]
\ No newline at end of file
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_removeHunks.txt b/tests/org.eclipse.compare.tests/patchdata/patch_removeHunks.txt
index 860e39ad7..f17393b69 100644
--- a/tests/org.eclipse.compare.tests/patchdata/patch_removeHunks.txt
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_removeHunks.txt
@@ -1,55 +1,55 @@
-### Eclipse Workspace Patch 1.0
-#P Bug202944
-Index: tmp/context_full.txt
-===================================================================
-RCS file: /TEST/Bug202944/tmp/context_full.txt,v
-retrieving revision 1.1
-diff -u -r1.1 context_full.txt
---- tmp/context_full.txt 23 Feb 2009 09:39:56 -0000 1.1
-+++ tmp/context_full.txt 23 Feb 2009 10:03:51 -0000
-@@ -1,3 +1,5 @@
-+[a1]
-+[a2]
- [a]
- [b]
- [c]
-@@ -11,6 +13,8 @@
- [k]
- [l]
- [m]
-+[m1]
-+[m2]
- [n]
- [o]
- [p]
-@@ -20,8 +24,6 @@
- [t]
- [u]
- [v]
--[w]
--[x]
- [y]
- [z]
- [A]
-@@ -30,10 +32,9 @@
- [D]
- [E]
- [F]
--[G]
--[H]
- [I]
- [J]
-+[J1]
- [K]
- [L]
- [M]
-@@ -47,6 +48,8 @@
- [U]
- [V]
- [W]
--[X]
-+[W1]
-+[W2]
-+[W3]
- [Y]
- [Z]
+### Eclipse Workspace Patch 1.0
+#P Bug202944
+Index: tmp/context_full.txt
+===================================================================
+RCS file: /TEST/Bug202944/tmp/context_full.txt,v
+retrieving revision 1.1
+diff -u -r1.1 context_full.txt
+--- tmp/context_full.txt 23 Feb 2009 09:39:56 -0000 1.1
++++ tmp/context_full.txt 23 Feb 2009 10:03:51 -0000
+@@ -1,3 +1,5 @@
++[a1]
++[a2]
+ [a]
+ [b]
+ [c]
+@@ -11,6 +13,8 @@
+ [k]
+ [l]
+ [m]
++[m1]
++[m2]
+ [n]
+ [o]
+ [p]
+@@ -20,8 +24,6 @@
+ [t]
+ [u]
+ [v]
+-[w]
+-[x]
+ [y]
+ [z]
+ [A]
+@@ -30,10 +32,9 @@
+ [D]
+ [E]
+ [F]
+-[G]
+-[H]
+ [I]
+ [J]
++[J1]
+ [K]
+ [L]
+ [M]
+@@ -47,6 +48,8 @@
+ [U]
+ [V]
+ [W]
+-[X]
++[W1]
++[W2]
++[W3]
+ [Y]
+ [Z]
diff --git a/tests/org.eclipse.compare.tests/pom.xml b/tests/org.eclipse.compare.tests/pom.xml
index 095c97a63..e4470a767 100644
--- a/tests/org.eclipse.compare.tests/pom.xml
+++ b/tests/org.eclipse.compare.tests/pom.xml
@@ -14,12 +14,12 @@
<parent>
<artifactId>eclipse.platform.team.tests</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.eclipse.compare</groupId>
<artifactId>org.eclipse.compare.tests</artifactId>
- <version>3.6.600-SNAPSHOT</version>
+ <version>3.7.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AsyncExecTests.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AsyncExecTests.java
index 79d1c6944..9028f8369 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AsyncExecTests.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AsyncExecTests.java
@@ -13,29 +13,22 @@
*******************************************************************************/
package org.eclipse.compare.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import java.util.ArrayList;
import java.util.List;
import org.eclipse.compare.internal.WorkQueue;
import org.eclipse.compare.internal.Worker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.junit.Test;
-import junit.framework.TestCase;
-
-
-public class AsyncExecTests extends TestCase {
-
- public AsyncExecTests() {
- super();
- }
-
- public AsyncExecTests(String name) {
- super(name);
- }
+public class AsyncExecTests {
+ @Test
public void testQueueAdd() {
WorkQueue q = new WorkQueue();
assertTrue(q.isEmpty());
@@ -78,6 +71,7 @@ public class AsyncExecTests extends TestCase {
assertTrue(q.isEmpty());
}
+ @Test
public void testWorker() {
final Worker w = new Worker("");
final List<IRunnableWithProgress> worked = new ArrayList<>();
@@ -140,6 +134,7 @@ public class AsyncExecTests extends TestCase {
assertEquals(r2, worked.get(0));
}
+ @Test
public void testCancelOnRequeue() {
final Worker w = new Worker("");
final List<IRunnableWithProgress> worked = new ArrayList<>();
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareFileRevisionEditorInputTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareFileRevisionEditorInputTest.java
index 4efd43153..44347c748 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareFileRevisionEditorInputTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareFileRevisionEditorInputTest.java
@@ -21,11 +21,10 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.team.internal.ui.history.CompareFileRevisionEditorInput;
import org.eclipse.ui.IWorkbenchPage;
+import org.junit.Test;
-import junit.framework.TestCase;
-
-public class CompareFileRevisionEditorInputTest extends TestCase {
-
+public class CompareFileRevisionEditorInputTest {
+ @Test
public void testPrepareCompareInputWithNonLocalResourceTypedElements()
throws InvocationTargetException, InterruptedException {
TestFriendlyCompareFileRevisionEditorInput input = new TestFriendlyCompareFileRevisionEditorInput(
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareUIPluginTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareUIPluginTest.java
index 9439682cc..f531b7e14 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareUIPluginTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareUIPluginTest.java
@@ -13,102 +13,119 @@
*******************************************************************************/
package org.eclipse.compare.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-import junit.framework.TestCase;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.IStreamContentAccessor;
-import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.*;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.ViewerDescriptor;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.graphics.Image;
+import org.junit.Test;
-public class CompareUIPluginTest extends TestCase {
+public class CompareUIPluginTest {
private static class UnknownTypedElement implements ITypedElement {
+ @Override
public Image getImage() {
return null;
}
+ @Override
public String getName() {
return "test";
}
+ @Override
public String getType() {
return UNKNOWN_TYPE;
}
}
private static class TextTypedElement implements ITypedElement {
+ @Override
public Image getImage() {
return null;
}
+ @Override
public String getName() {
return "test";
}
+ @Override
public String getType() {
return TEXT_TYPE;
}
}
private static class TextTypedElementStreamAccessor implements ITypedElement, IStreamContentAccessor {
+ @Override
public Image getImage() {
return null;
}
+ @Override
public String getName() {
return "test";
}
+ @Override
public String getType() {
return TEXT_TYPE;
}
+ @Override
public InputStream getContents() throws CoreException {
/*
- * Whatever we return has no importance as long as it is not "null", this is only to make
- * CompareUIPlugin#guessType happy. However, it is only happy if what we return resembles a text.
+ * Whatever we return has no importance as long as it is not "null", this is
+ * only to make CompareUIPlugin#guessType happy. However, it is only happy if
+ * what we return resembles a text.
*/
- return new ByteArrayInputStream(new byte[] {' '});
+ return new ByteArrayInputStream(new byte[] { ' ' });
}
}
+ @Test
public void testFindContentViewerDescriptor_UnknownType() {
CompareConfiguration cc = new CompareConfiguration();
DiffNode in = new DiffNode(new UnknownTypedElement(), new UnknownTypedElement());
ViewerDescriptor[] result = CompareUIPlugin.getDefault().findContentViewerDescriptor(null, in, cc);
- // API Compatibility : "no descriptor found" should return a null array instead of a 0-lengthed one.
+ // API Compatibility : "no descriptor found" should return a null array instead
+ // of a 0-lengthed one.
assertNull(result);
}
+ @Test
public void testFindContentViewerDescriptor_TextType_NotStreamAccessor() {
CompareConfiguration cc = new CompareConfiguration();
DiffNode in = new DiffNode(new TextTypedElement(), new TextTypedElement());
ViewerDescriptor[] result = CompareUIPlugin.getDefault().findContentViewerDescriptor(null, in, cc);
/*
- * "TextTypedElement" is "text" typed : it thus has a Content Viewer attached. However, this content
- * viewer is currently NOT returned because of bug 293926
+ * "TextTypedElement" is "text" typed : it thus has a Content Viewer attached.
+ * However, this content viewer is currently NOT returned because of bug 293926
*/
assertNotNull(result);
assertEquals(1, result.length);
}
+ @Test
public void testFindContentViewerDescriptorForTextType_StreamAccessor() {
CompareConfiguration cc = new CompareConfiguration();
DiffNode in = new DiffNode(new TextTypedElementStreamAccessor(), new TextTypedElementStreamAccessor());
ViewerDescriptor[] result = CompareUIPlugin.getDefault().findContentViewerDescriptor(null, in, cc);
/*
- * "TextTypedElement" is "text" typed : it thus has a Content Viewer attached. However, the content
- * viewer will only be returned because we made our "ITypedElement" be an IStreamContentAccessor.
+ * "TextTypedElement" is "text" typed : it thus has a Content Viewer attached.
+ * However, the content viewer will only be returned because we made our
+ * "ITypedElement" be an IStreamContentAccessor.
*/
assertNotNull(result);
assertEquals(1, result.length);
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DiffTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DiffTest.java
index 092e9be33..43babda70 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DiffTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DiffTest.java
@@ -13,44 +13,33 @@
*******************************************************************************/
package org.eclipse.compare.tests;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertTrue;
import org.eclipse.compare.internal.DocLineComparator;
import org.eclipse.compare.internal.core.TextLineLCS;
-import org.eclipse.compare.rangedifferencer.IRangeComparator;
-import org.eclipse.compare.rangedifferencer.RangeDifference;
-import org.eclipse.compare.rangedifferencer.RangeDifferencer;
+import org.eclipse.compare.rangedifferencer.*;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
+import org.junit.Test;
-public class DiffTest extends TestCase {
+public class DiffTest {
- private static final String ABC= "abc"; //$NON-NLS-1$
- private static final String DEF= "def"; //$NON-NLS-1$
- //private static final String BAR= "bar"; //$NON-NLS-1$
- //private static final String FOO= "foo"; //$NON-NLS-1$
- private static final String XYZ= "xyz"; //$NON-NLS-1$
- private static final String _123= "123"; //$NON-NLS-1$
- //private static final String _456= "456"; //$NON-NLS-1$
+ private static final String ABC = "abc"; //$NON-NLS-1$
+ private static final String DEF = "def"; //$NON-NLS-1$
+ // private static final String BAR= "bar"; //$NON-NLS-1$
+ // private static final String FOO= "foo"; //$NON-NLS-1$
+ private static final String XYZ = "xyz"; //$NON-NLS-1$
+ private static final String _123 = "123"; //$NON-NLS-1$
+ // private static final String _456= "456"; //$NON-NLS-1$
- static final String SEPARATOR= System.getProperty("line.separator"); //$NON-NLS-1$
-
- public DiffTest() {
- super();
- }
-
- public DiffTest(String name) {
- super(name);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
+ static final String SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
+ @Test
public void testLineAddition() {
- String s1= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String s2= ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
+ String s1 = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String s2 = ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
TextLineLCS.TextLine[] l1 = TextLineLCS.getTextLines(s1);
TextLineLCS.TextLine[] l2 = TextLineLCS.getTextLines(s2);
TextLineLCS lcs = new TextLineLCS(l1, l2);
@@ -69,9 +58,10 @@ public class DiffTest extends TestCase {
assertTrue(result[1][2].lineNumber() == 3);
}
+ @Test
public void testLineDeletion() {
- String s1= ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
- String s2= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String s1 = ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
+ String s2 = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
TextLineLCS.TextLine[] l1 = TextLineLCS.getTextLines(s1);
TextLineLCS.TextLine[] l2 = TextLineLCS.getTextLines(s2);
TextLineLCS lcs = new TextLineLCS(l1, l2);
@@ -89,9 +79,10 @@ public class DiffTest extends TestCase {
assertTrue(result[1][2].lineNumber() == 2);
}
+ @Test
public void testLineAppendEnd() {
- String s1= ABC + SEPARATOR + DEF;
- String s2= ABC + SEPARATOR + DEF + SEPARATOR + _123;
+ String s1 = ABC + SEPARATOR + DEF;
+ String s2 = ABC + SEPARATOR + DEF + SEPARATOR + _123;
TextLineLCS.TextLine[] l1 = TextLineLCS.getTextLines(s1);
TextLineLCS.TextLine[] l2 = TextLineLCS.getTextLines(s2);
TextLineLCS lcs = new TextLineLCS(l1, l2);
@@ -108,9 +99,10 @@ public class DiffTest extends TestCase {
assertTrue(result[1][1].lineNumber() == 1);
}
+ @Test
public void testLineDeleteEnd() {
- String s1= ABC + SEPARATOR + DEF + SEPARATOR + _123;
- String s2= ABC + SEPARATOR + DEF;
+ String s1 = ABC + SEPARATOR + DEF + SEPARATOR + _123;
+ String s2 = ABC + SEPARATOR + DEF;
TextLineLCS.TextLine[] l1 = TextLineLCS.getTextLines(s1);
TextLineLCS.TextLine[] l2 = TextLineLCS.getTextLines(s2);
TextLineLCS lcs = new TextLineLCS(l1, l2);
@@ -127,9 +119,10 @@ public class DiffTest extends TestCase {
assertTrue(result[1][1].lineNumber() == 1);
}
+ @Test
public void testLineAppendStart() {
- String s1= ABC + SEPARATOR + DEF;
- String s2= _123 + SEPARATOR + ABC + SEPARATOR + DEF;
+ String s1 = ABC + SEPARATOR + DEF;
+ String s2 = _123 + SEPARATOR + ABC + SEPARATOR + DEF;
TextLineLCS.TextLine[] l1 = TextLineLCS.getTextLines(s1);
TextLineLCS.TextLine[] l2 = TextLineLCS.getTextLines(s2);
TextLineLCS lcs = new TextLineLCS(l1, l2);
@@ -146,9 +139,10 @@ public class DiffTest extends TestCase {
assertTrue(result[1][1].lineNumber() == 2);
}
+ @Test
public void testLineDeleteStart() {
- String s1= _123 + SEPARATOR + ABC + SEPARATOR + DEF;
- String s2= ABC + SEPARATOR + DEF;
+ String s1 = _123 + SEPARATOR + ABC + SEPARATOR + DEF;
+ String s2 = ABC + SEPARATOR + DEF;
TextLineLCS.TextLine[] l1 = TextLineLCS.getTextLines(s1);
TextLineLCS.TextLine[] l2 = TextLineLCS.getTextLines(s2);
TextLineLCS lcs = new TextLineLCS(l1, l2);
@@ -166,27 +160,24 @@ public class DiffTest extends TestCase {
}
private IRangeComparator toRangeComparator(String s) {
- IDocument doc1= new Document();
+ IDocument doc1 = new Document();
doc1.set(s);
return new DocLineComparator(doc1, null, true);
}
private RangeDifference[] getDifferences(String s1, String s2) {
- IRangeComparator comp1= toRangeComparator(s1);
- IRangeComparator comp2= toRangeComparator(s2);
+ IRangeComparator comp1 = toRangeComparator(s1);
+ IRangeComparator comp2 = toRangeComparator(s2);
RangeDifference[] differences = RangeDifferencer.findDifferences(comp1, comp2);
RangeDifference[] oldDifferences = RangeDifferencer.findDifferences(comp1, comp2);
- assertTrue(differences.length == oldDifferences.length);
- for (int i = 0; i < oldDifferences.length; i++) {
- assertEquals(oldDifferences[i], differences[i]);
-
- }
+ assertArrayEquals(differences, oldDifferences);
return differences;
}
+ @Test
public void testDocAddition() {
- String s1= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String s2= ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
+ String s1 = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String s2 = ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
RangeDifference[] result = getDifferences(s1, s2);
@@ -197,9 +188,10 @@ public class DiffTest extends TestCase {
assertTrue(result[0].rightLength() == 1);
}
+ @Test
public void testDocDeletion() {
- String s1= ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
- String s2= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String s1 = ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
+ String s2 = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
RangeDifference[] result = getDifferences(s1, s2);
@@ -210,9 +202,10 @@ public class DiffTest extends TestCase {
assertTrue(result[0].rightLength() == 0);
}
+ @Test
public void testDocAppendStart() {
- String s1= ABC + SEPARATOR + DEF;
- String s2= _123 + SEPARATOR + ABC + SEPARATOR + DEF;
+ String s1 = ABC + SEPARATOR + DEF;
+ String s2 = _123 + SEPARATOR + ABC + SEPARATOR + DEF;
RangeDifference[] result = getDifferences(s1, s2);
@@ -223,9 +216,10 @@ public class DiffTest extends TestCase {
assertTrue(result[0].rightLength() == 1);
}
+ @Test
public void testDocDeleteStart() {
- String s1= _123 + SEPARATOR + ABC + SEPARATOR + DEF;
- String s2= ABC + SEPARATOR + DEF;
+ String s1 = _123 + SEPARATOR + ABC + SEPARATOR + DEF;
+ String s2 = ABC + SEPARATOR + DEF;
RangeDifference[] result = getDifferences(s1, s2);
@@ -236,9 +230,10 @@ public class DiffTest extends TestCase {
assertTrue(result[0].rightLength() == 0);
}
+ @Test
public void testDocAppendEnd() {
- String s1= ABC + SEPARATOR + DEF;
- String s2= ABC + SEPARATOR + DEF + SEPARATOR + _123;
+ String s1 = ABC + SEPARATOR + DEF;
+ String s2 = ABC + SEPARATOR + DEF + SEPARATOR + _123;
RangeDifference[] result = getDifferences(s1, s2);
@@ -249,9 +244,10 @@ public class DiffTest extends TestCase {
assertTrue(result[0].rightLength() == 1);
}
+ @Test
public void testDocDeleteEnd() {
- String s1= ABC + SEPARATOR + DEF + SEPARATOR + _123;
- String s2= ABC + SEPARATOR + DEF;
+ String s1 = ABC + SEPARATOR + DEF + SEPARATOR + _123;
+ String s2 = ABC + SEPARATOR + DEF;
RangeDifference[] result = getDifferences(s1, s2);
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java
index 50123fb89..842743b33 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java
@@ -15,57 +15,44 @@ package org.eclipse.compare.tests;
import java.util.HashMap;
-import junit.framework.TestCase;
-
import org.eclipse.compare.ICompareFilter;
import org.eclipse.compare.internal.DocLineComparator;
import org.eclipse.compare.rangedifferencer.IRangeComparator;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.*;
import org.junit.Assert;
+import org.junit.Test;
-public class DocLineComparatorTest extends TestCase {
-
- public DocLineComparatorTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- // empty
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
+public class DocLineComparatorTest {
+ @Test
public void testRangesEqual() {
- IDocument doc1= new Document();
+ IDocument doc1 = new Document();
doc1.set("if (s.strip))"); //$NON-NLS-1$
- IDocument doc2= new Document();
+ IDocument doc2 = new Document();
doc2.set("if (s.strip)"); //$NON-NLS-1$
- IRangeComparator comp1= new DocLineComparator(doc1, null, true);
- IRangeComparator comp2= new DocLineComparator(doc2, null, true);
+ IRangeComparator comp1 = new DocLineComparator(doc1, null, true);
+ IRangeComparator comp2 = new DocLineComparator(doc2, null, true);
Assert.assertFalse(comp1.rangesEqual(0, comp2, 0));
}
+ @Test
public void testWhitespaceAtEnd() {
- IDocument doc1= new Document();
+ IDocument doc1 = new Document();
doc1.set("if (s.strip))"); //$NON-NLS-1$
- IDocument doc2= new Document();
+ IDocument doc2 = new Document();
doc2.set("if (s.strip)) "); //$NON-NLS-1$
- IRangeComparator comp1= new DocLineComparator(doc1, null, true);
- IRangeComparator comp2= new DocLineComparator(doc2, null, true);
+ IRangeComparator comp1 = new DocLineComparator(doc1, null, true);
+ IRangeComparator comp2 = new DocLineComparator(doc2, null, true);
Assert.assertTrue(comp1.rangesEqual(0, comp2, 0));
}
+ @Test
public void testOneCompareFilter() {
IDocument doc1 = new Document();
doc1.set("if (s.strip))"); //$NON-NLS-1$
@@ -78,44 +65,41 @@ public class DocLineComparatorTest extends TestCase {
ICompareFilter filter = new ICompareFilter() {
- public void setInput(Object input, Object ancestor, Object left,
- Object right) {
+ @Override
+ public void setInput(Object input, Object ancestor, Object left, Object right) {
// EMPTY
}
+ @Override
public IRegion[] getFilteredRegions(HashMap lineComparison) {
- return new IRegion[] { new Region(0, 2), new Region(4, 1),
- new Region(8, 2) };
+ return new IRegion[] { new Region(0, 2), new Region(4, 1), new Region(8, 2) };
}
+ @Override
public boolean isEnabledInitially() {
return false;
}
+ @Override
public boolean canCacheFilteredRegions() {
return false;
}
};
- IRangeComparator comp1 = new DocLineComparator(doc1, null, false,
- new ICompareFilter[] { filter }, 'L');
- IRangeComparator comp2 = new DocLineComparator(doc2, null, false,
- new ICompareFilter[] { filter }, 'R');
+ IRangeComparator comp1 = new DocLineComparator(doc1, null, false, new ICompareFilter[] { filter }, 'L');
+ IRangeComparator comp2 = new DocLineComparator(doc2, null, false, new ICompareFilter[] { filter }, 'R');
Assert.assertTrue(comp1.rangesEqual(0, comp2, 0));
- IRangeComparator comp3 = new DocLineComparator(doc1, null, true,
- new ICompareFilter[] { filter }, 'L');
- IRangeComparator comp4 = new DocLineComparator(doc3, null, true,
- new ICompareFilter[] { filter }, 'R');
+ IRangeComparator comp3 = new DocLineComparator(doc1, null, true, new ICompareFilter[] { filter }, 'L');
+ IRangeComparator comp4 = new DocLineComparator(doc3, null, true, new ICompareFilter[] { filter }, 'R');
Assert.assertTrue(comp3.rangesEqual(0, comp4, 0));
- IRangeComparator comp5 = new DocLineComparator(doc1, null, false,
- new ICompareFilter[] { filter }, 'L');
- IRangeComparator comp6 = new DocLineComparator(doc3, null, false,
- new ICompareFilter[] { filter }, 'R');
+ IRangeComparator comp5 = new DocLineComparator(doc1, null, false, new ICompareFilter[] { filter }, 'L');
+ IRangeComparator comp6 = new DocLineComparator(doc3, null, false, new ICompareFilter[] { filter }, 'R');
Assert.assertFalse(comp5.rangesEqual(0, comp6, 0));
}
+ @Test
public void testMultipleCompareFilters() {
IDocument doc1 = new Document();
doc1.set("if (s.strip))"); //$NON-NLS-1$
@@ -125,19 +109,22 @@ public class DocLineComparatorTest extends TestCase {
ICompareFilter filter1 = new ICompareFilter() {
- public void setInput(Object input, Object ancestor, Object left,
- Object right) {
+ @Override
+ public void setInput(Object input, Object ancestor, Object left, Object right) {
// EMPTY
}
+ @Override
public IRegion[] getFilteredRegions(HashMap lineComparison) {
return new IRegion[] { new Region(0, 2) };
}
+ @Override
public boolean isEnabledInitially() {
return false;
}
+ @Override
public boolean canCacheFilteredRegions() {
return false;
}
@@ -145,19 +132,22 @@ public class DocLineComparatorTest extends TestCase {
ICompareFilter filter2 = new ICompareFilter() {
- public void setInput(Object input, Object ancestor, Object left,
- Object right) {
+ @Override
+ public void setInput(Object input, Object ancestor, Object left, Object right) {
// EMPTY
}
+ @Override
public IRegion[] getFilteredRegions(HashMap lineComparison) {
return new IRegion[] { new Region(4, 1) };
}
+ @Override
public boolean isEnabledInitially() {
return false;
}
+ @Override
public boolean canCacheFilteredRegions() {
return false;
}
@@ -165,19 +155,22 @@ public class DocLineComparatorTest extends TestCase {
ICompareFilter filter3 = new ICompareFilter() {
- public void setInput(Object input, Object ancestor, Object left,
- Object right) {
+ @Override
+ public void setInput(Object input, Object ancestor, Object left, Object right) {
// EMPTY
}
+ @Override
public IRegion[] getFilteredRegions(HashMap lineComparison) {
return new IRegion[] { new Region(8, 2) };
}
+ @Override
public boolean isEnabledInitially() {
return false;
}
+ @Override
public boolean canCacheFilteredRegions() {
return false;
}
@@ -189,13 +182,14 @@ public class DocLineComparatorTest extends TestCase {
new ICompareFilter[] { filter1, filter2, filter3 }, 'R');
Assert.assertTrue(comp1.rangesEqual(0, comp2, 0));
- IRangeComparator comp3 = new DocLineComparator(doc1, null, false,
- new ICompareFilter[] { filter2, filter3 }, 'L');
- IRangeComparator comp4 = new DocLineComparator(doc2, null, false,
- new ICompareFilter[] { filter2, filter3 }, 'R');
+ IRangeComparator comp3 = new DocLineComparator(doc1, null, false, new ICompareFilter[] { filter2, filter3 },
+ 'L');
+ IRangeComparator comp4 = new DocLineComparator(doc2, null, false, new ICompareFilter[] { filter2, filter3 },
+ 'R');
Assert.assertFalse(comp3.rangesEqual(0, comp4, 0));
}
+ @Test
public void testWhitespace() {
IDocument[] docs = new IDocument[6];
docs[0] = new Document();
@@ -206,61 +200,63 @@ public class DocLineComparatorTest extends TestCase {
docs[5] = new Document();
docs[0].set("if (s.strip))\r\n");//$NON-NLS-1$
- docs[1].set("if (s.strip))\n"); //$NON-NLS-1$
+ docs[1].set("if (s.strip))\n"); //$NON-NLS-1$
docs[2].set("if (s .strip))\n"); //$NON-NLS-1$
docs[3].set("if (s.str ip))\r"); //$NON-NLS-1$
- docs[4].set("if (s.strip))"); //$NON-NLS-1$
- docs[5].set("if (s.stri p))"); //$NON-NLS-1$
+ docs[4].set("if (s.strip))"); //$NON-NLS-1$
+ docs[5].set("if (s.stri p))"); //$NON-NLS-1$
ICompareFilter[][] filters = new ICompareFilter[3][];
filters[0] = null;
- filters[1] = new ICompareFilter[]{
- new ICompareFilter() {
+ filters[1] = new ICompareFilter[] { new ICompareFilter() {
- public void setInput(Object input, Object ancestor, Object left,
- Object right) {
- // EMPTY
- }
+ @Override
+ public void setInput(Object input, Object ancestor, Object left, Object right) {
+ // EMPTY
+ }
- public IRegion[] getFilteredRegions(HashMap lineComparison) {
- return new IRegion[] { new Region(0, 2) };
- }
+ @Override
+ public IRegion[] getFilteredRegions(HashMap lineComparison) {
+ return new IRegion[] { new Region(0, 2) };
+ }
- public boolean isEnabledInitially() {
- return false;
- }
+ @Override
+ public boolean isEnabledInitially() {
+ return false;
+ }
- public boolean canCacheFilteredRegions() {
- return true; // cache-able
- }
- }
- };
+ @Override
+ public boolean canCacheFilteredRegions() {
+ return true; // cache-able
+ }
+ } };
- filters[2] = new ICompareFilter[]{
- new ICompareFilter() {
+ filters[2] = new ICompareFilter[] { new ICompareFilter() {
- public void setInput(Object input, Object ancestor, Object left,
- Object right) {
- // EMPTY
- }
+ @Override
+ public void setInput(Object input, Object ancestor, Object left, Object right) {
+ // EMPTY
+ }
- public IRegion[] getFilteredRegions(HashMap lineComparison) {
- return new IRegion[] { new Region(0, 2) };
- }
+ @Override
+ public IRegion[] getFilteredRegions(HashMap lineComparison) {
+ return new IRegion[] { new Region(0, 2) };
+ }
- public boolean isEnabledInitially() {
- return false;
- }
+ @Override
+ public boolean isEnabledInitially() {
+ return false;
+ }
- public boolean canCacheFilteredRegions() {
- return false; // not cache-able
- }
- }
- };
+ @Override
+ public boolean canCacheFilteredRegions() {
+ return false; // not cache-able
+ }
+ } };
IRangeComparator l, r;
- for (int i=0;i<docs.length;i++)
- for (int j=i+1;j<docs.length;j++)
+ for (int i = 0; i < docs.length; i++)
+ for (int j = i + 1; j < docs.length; j++)
for (ICompareFilter[] filter : filters) {
l = new DocLineComparator(docs[i], null, false, filter, 'L');
r = new DocLineComparator(docs[j], null, false, filter, 'R');
@@ -268,67 +264,72 @@ public class DocLineComparatorTest extends TestCase {
l = new DocLineComparator(docs[i], null, true, filter, 'L');
r = new DocLineComparator(docs[j], null, true, filter, 'R');
Assert.assertTrue(l.rangesEqual(0, r, 0));
- }
+ }
}
+ @Test
public void testEmpty() {
- IDocument doc1= new Document();
+ IDocument doc1 = new Document();
doc1.set(""); //$NON-NLS-1$
- IDocument doc2= new Document();
+ IDocument doc2 = new Document();
doc2.set(" "); //$NON-NLS-1$
- IRangeComparator comp1= new DocLineComparator(doc1, null, true);
- IRangeComparator comp2= new DocLineComparator(doc2, null, true);
+ IRangeComparator comp1 = new DocLineComparator(doc1, null, true);
+ IRangeComparator comp2 = new DocLineComparator(doc2, null, true);
Assert.assertTrue(comp1.rangesEqual(0, comp2, 0));
}
+ @Test
public void testNoContent() {
- IDocument doc= new Document();
+ IDocument doc = new Document();
- IRangeComparator comp1= new DocLineComparator(doc, null, true);
- IRangeComparator comp2= new DocLineComparator(doc, new Region(0, doc.getLength()), true);
+ IRangeComparator comp1 = new DocLineComparator(doc, null, true);
+ IRangeComparator comp2 = new DocLineComparator(doc, new Region(0, doc.getLength()), true);
Assert.assertTrue(comp1.rangesEqual(0, comp2, 0));
Assert.assertEquals(comp1.getRangeCount(), comp2.getRangeCount());
Assert.assertEquals(1, comp2.getRangeCount());
}
+ @Test
public void testOneLine() {
IDocument doc = new Document();
doc.set("line1"); //$NON-NLS-1$
- IRangeComparator comp1= new DocLineComparator(doc, null, true);
- IRangeComparator comp2= new DocLineComparator(doc, new Region(0, doc.getLength()), true);
+ IRangeComparator comp1 = new DocLineComparator(doc, null, true);
+ IRangeComparator comp2 = new DocLineComparator(doc, new Region(0, doc.getLength()), true);
Assert.assertEquals(comp1.getRangeCount(), comp2.getRangeCount());
Assert.assertEquals(1, comp2.getRangeCount());
}
+ @Test
public void testTwoLines() {
IDocument doc = new Document();
doc.set("line1\nline2"); //$NON-NLS-1$
- IRangeComparator comp1= new DocLineComparator(doc, null, true);
- IRangeComparator comp2= new DocLineComparator(doc, new Region(0, doc.getLength()), true);
+ IRangeComparator comp1 = new DocLineComparator(doc, null, true);
+ IRangeComparator comp2 = new DocLineComparator(doc, new Region(0, doc.getLength()), true);
Assert.assertEquals(comp1.getRangeCount(), comp2.getRangeCount());
Assert.assertEquals(2, comp2.getRangeCount());
- IRangeComparator comp3= new DocLineComparator(doc, new Region(0, "line1".length()), true);
+ IRangeComparator comp3 = new DocLineComparator(doc, new Region(0, "line1".length()), true);
Assert.assertEquals(1, comp3.getRangeCount());
- comp3= new DocLineComparator(doc, new Region(0, "line1".length()+1), true);
+ comp3 = new DocLineComparator(doc, new Region(0, "line1".length() + 1), true);
Assert.assertEquals(2, comp3.getRangeCount()); // two lines
}
+ @Test
public void testBug259422() {
IDocument doc = new Document();
doc.set(""); //$NON-NLS-1$
- IRangeComparator comp1= new DocLineComparator(doc, null, true);
- IRangeComparator comp2= new DocLineComparator(doc, new Region(0, doc.getLength()), true);
+ IRangeComparator comp1 = new DocLineComparator(doc, null, true);
+ IRangeComparator comp2 = new DocLineComparator(doc, new Region(0, doc.getLength()), true);
Assert.assertEquals(comp1.getRangeCount(), comp2.getRangeCount());
}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FilterTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FilterTest.java
index 6867ef719..88e4b46a1 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FilterTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FilterTest.java
@@ -15,40 +15,39 @@ package org.eclipse.compare.tests;
import org.eclipse.compare.internal.CompareResourceFilter;
import org.junit.Assert;
+import org.junit.Test;
-import junit.framework.TestCase;
-
-public class FilterTest extends TestCase {
+public class FilterTest {
CompareResourceFilter fFilter;
- public FilterTest(String name) {
- super(name);
- }
-
+ @Test
public void testFilterFile() {
- CompareResourceFilter f= new CompareResourceFilter();
+ CompareResourceFilter f = new CompareResourceFilter();
f.setFilters("*.class"); //$NON-NLS-1$
Assert.assertTrue("file foo.class should be filtered", f.filter("foo.class", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
Assert.assertFalse("file foo.java shouldn't be filtered", f.filter("foo.java", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Test
public void testFilterDotFile() {
- CompareResourceFilter f= new CompareResourceFilter();
+ CompareResourceFilter f = new CompareResourceFilter();
f.setFilters(".cvsignore"); //$NON-NLS-1$
Assert.assertTrue("file .cvsignore should be filtered", f.filter(".cvsignore", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
Assert.assertFalse("file foo.cvsignore shouldn't be filtered", f.filter("foo.cvsignore", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Test
public void testFilterFolder() {
- CompareResourceFilter f= new CompareResourceFilter();
+ CompareResourceFilter f = new CompareResourceFilter();
f.setFilters("bin/"); //$NON-NLS-1$
Assert.assertTrue("folder bin should be filtered", f.filter("bin", true, false)); //$NON-NLS-1$ //$NON-NLS-2$
Assert.assertFalse("file bin shouldn't be filtered", f.filter("bin", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Test
public void testMultiFilter() {
- CompareResourceFilter f= new CompareResourceFilter();
+ CompareResourceFilter f = new CompareResourceFilter();
f.setFilters("*.class, .cvsignore, bin/, src/"); //$NON-NLS-1$
Assert.assertTrue("file foo.class should be filtered", f.filter("foo.class", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
Assert.assertFalse("file foo.java shouldn't be filtered", f.filter("foo.java", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
@@ -60,8 +59,11 @@ public class FilterTest extends TestCase {
Assert.assertFalse("file src shouldn't be filtered", f.filter("src", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Test
public void testVerify() {
- //Assert.assertNull("filters don't verify", Filter.validateResourceFilters("*.class, .cvsignore, bin/"));
- //Assert.assertNotNull("filters shouldn't verify", Filter.validateResourceFilters("bin//"));
+ // Assert.assertNull("filters don't verify",
+ // Filter.validateResourceFilters("*.class, .cvsignore, bin/"));
+ // Assert.assertNotNull("filters shouldn't verify",
+ // Filter.validateResourceFilters("bin//"));
}
}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
index f97b818c8..6f753333d 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
@@ -13,6 +13,10 @@
*******************************************************************************/
package org.eclipse.compare.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
@@ -25,23 +29,10 @@ import org.eclipse.compare.tests.PatchUtils.StringStorage;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.*;
import org.junit.Assert;
+import org.junit.Test;
-import junit.framework.TestCase;
-
-public class PatchBuilderTest extends TestCase {
-
- public PatchBuilderTest() {
-
- }
-
- protected void setUp() throws Exception {
- // Nothing to do
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
+public class PatchBuilderTest {
+ @Test
public void testModifyHunks() throws CoreException, IOException {
IStorage patchStorage = new StringStorage("patch_modifyHunks.txt");
IStorage contextStorage = new StringStorage("context.txt");
@@ -50,9 +41,9 @@ public class PatchBuilderTest extends TestCase {
IHunk[] hunksBefore = patches[0].getHunks();
assertEquals(5, hunksBefore.length);
- String[] lines = new String[] { " [d]", "+[d1]", "+[d2]", "+[d3]",
- "+[d4]", " [e]" };
- addLineDelimiters(lines);
+ String[] lines = new String[] { " [d]", "+[d1]", "+[d2]", "+[d3]", "+[d4]", " [e]" };
+ String lineDelimiter = getLineDelimiter(patchStorage);
+ addLineDelimiters(lines, lineDelimiter);
IHunk[] toAdd = new IHunk[] { PatchBuilder.createHunk(3, lines) };
IFilePatch2 filePatch = PatchBuilder.addHunks(patches[0], toAdd);
@@ -70,8 +61,7 @@ public class PatchBuilderTest extends TestCase {
assertEquals(28, ((Hunk) hunksAfter[3]).getStart(false));
assertEquals(33, ((Hunk) hunksAfter[3]).getStart(true));
- IFilePatchResult result = filePatch.apply(Utilities
- .getReaderCreator(contextStorage), new PatchConfiguration(),
+ IFilePatchResult result = filePatch.apply(Utilities.getReaderCreator(contextStorage), new PatchConfiguration(),
new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
@@ -79,14 +69,14 @@ public class PatchBuilderTest extends TestCase {
InputStream actual = result.getPatchedContents();
- LineReader lr = new LineReader(PatchUtils
- .getReader("exp_modifyHunks.txt"));
+ LineReader lr = new LineReader(PatchUtils.getReader("exp_modifyHunks.txt"));
List<String> inLines = lr.readLines();
String expected = LineReader.createString(false, inLines);
assertEquals(expected, PatchUtils.asString(actual));
}
+ @Test
public void testAddHunks() throws CoreException, IOException {
IStorage patchStorage = new StringStorage("patch_addHunks.txt");
IStorage contextStorage = new StringStorage("context_full.txt");
@@ -95,14 +85,13 @@ public class PatchBuilderTest extends TestCase {
IHunk[] hunksBefore = patches[0].getHunks();
assertEquals(3, hunksBefore.length);
- String[] lines0 = new String[] { " [d]", "+[d1]", "+[d2]", "+[d3]",
- "+[d4]", " [e]" };
- addLineDelimiters(lines0);
+ String[] lines0 = new String[] { " [d]", "+[d1]", "+[d2]", "+[d3]", "+[d4]", " [e]" };
+ String lineDelimiter = getLineDelimiter(patchStorage);
+ addLineDelimiters(lines0, lineDelimiter);
IHunk hunk0 = PatchBuilder.createHunk(3, lines0);
- String[] lines1 = new String[] { " [K]", " [L]", "-[M]", " [N]",
- "+[N1]", "+[N2]", " [O]", " [P]" };
- addLineDelimiters(lines1);
+ String[] lines1 = new String[] { " [K]", " [L]", "-[M]", " [N]", "+[N1]", "+[N2]", " [O]", " [P]" };
+ addLineDelimiters(lines1, lineDelimiter);
IHunk hunk1 = PatchBuilder.createHunk(36, lines1);
IHunk[] toAdd = new IHunk[] { hunk0, hunk1 };
@@ -121,8 +110,7 @@ public class PatchBuilderTest extends TestCase {
assertEquals(46, ((Hunk) hunksAfter[4]).getStart(false));
assertEquals(51, ((Hunk) hunksAfter[4]).getStart(true));
- IFilePatchResult result = filePatch.apply(Utilities
- .getReaderCreator(contextStorage), new PatchConfiguration(),
+ IFilePatchResult result = filePatch.apply(Utilities.getReaderCreator(contextStorage), new PatchConfiguration(),
new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
@@ -137,6 +125,7 @@ public class PatchBuilderTest extends TestCase {
assertEquals(expected, PatchUtils.asString(actual));
}
+ @Test
public void testRemoveHunks() throws CoreException, IOException {
IStorage patchStorage = new StringStorage("patch_removeHunks.txt");
IStorage contextStorage = new StringStorage("context_full.txt");
@@ -157,8 +146,7 @@ public class PatchBuilderTest extends TestCase {
assertEquals(46, ((Hunk) hunksAfter[2]).getStart(false));
assertEquals(43, ((Hunk) hunksAfter[2]).getStart(true));
- IFilePatchResult result = filePatch.apply(Utilities
- .getReaderCreator(contextStorage), new PatchConfiguration(),
+ IFilePatchResult result = filePatch.apply(Utilities.getReaderCreator(contextStorage), new PatchConfiguration(),
new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
@@ -166,60 +154,58 @@ public class PatchBuilderTest extends TestCase {
InputStream actual = result.getPatchedContents();
- LineReader lr = new LineReader(PatchUtils
- .getReader("exp_removeHunks.txt"));
+ LineReader lr = new LineReader(PatchUtils.getReader("exp_removeHunks.txt"));
List<String> inLines = lr.readLines();
String expected = LineReader.createString(false, inLines);
assertEquals(expected, PatchUtils.asString(actual));
}
+ @Test
public void testCreateFilePatch() throws CoreException, IOException {
IStorage contextStorage = new StringStorage("context.txt");
String[] lines0 = new String[] { "+[a1]", "+[a2]", "+[a3]", " [a]" };
- addLineDelimiters(lines0);
+ String lineDelimiter = getLineDelimiter(contextStorage);
+ addLineDelimiters(lines0, lineDelimiter);
Hunk hunk0 = (Hunk) PatchBuilder.createHunk(0, lines0);
- String[] lines1 = new String[] { " [b]", " [c]", "-[d]", "-[e]",
- " [f]", " [g]", " [h]", "+[h1]", " [i]", " [j]", "+[j1]",
- "+[j2]", " [k]", " [l]" };
- addLineDelimiters(lines1);
+ String[] lines1 = new String[] { " [b]", " [c]", "-[d]", "-[e]", " [f]", " [g]", " [h]", "+[h1]", " [i]",
+ " [j]", "+[j1]", "+[j2]", " [k]", " [l]" };
+ addLineDelimiters(lines1, lineDelimiter);
Hunk hunk1 = (Hunk) PatchBuilder.createHunk(1, lines1);
IHunk[] hunks = new IHunk[] { hunk1, hunk0 };
- IFilePatch2 filePatch = PatchBuilder.createFilePatch(new Path(""),
- IFilePatch2.DATE_UNKNOWN, new Path(""),
+ IFilePatch2 filePatch = PatchBuilder.createFilePatch(new Path(""), IFilePatch2.DATE_UNKNOWN, new Path(""),
IFilePatch2.DATE_UNKNOWN, hunks);
assertEquals(2, filePatch.getHunks().length);
assertEquals(hunk0, filePatch.getHunks()[0]);
assertEquals(hunk1, filePatch.getHunks()[1]);
- IFilePatchResult result = filePatch.apply(Utilities
- .getReaderCreator(contextStorage), new PatchConfiguration(),
+ IFilePatchResult result = filePatch.apply(Utilities.getReaderCreator(contextStorage), new PatchConfiguration(),
new NullProgressMonitor());
InputStream actual = result.getPatchedContents();
- LineReader lr = new LineReader(PatchUtils
- .getReader("exp_createFilePatch.txt"));
+ LineReader lr = new LineReader(PatchUtils.getReader("exp_createFilePatch.txt"));
List<String> inLines = lr.readLines();
String expected = LineReader.createString(false, inLines);
assertEquals(expected, PatchUtils.asString(actual));
}
- public void testCreateHunk0() throws CoreException {
+ @Test
+ public void testCreateHunk0() throws CoreException, IOException {
IStorage patch = new StringStorage("patch_createHunk0.txt");
IFilePatch[] filePatches = ApplyPatchOperation.parsePatch(patch);
assertEquals(1, filePatches.length);
assertEquals(1, filePatches[0].getHunks().length);
- String[] lines = new String[] { "+[a1]", "+[a2]", "+[a3]", " [a]",
- " [b]", "-[c]", " [d]", " [e]", " [f]" };
- addLineDelimiters(lines);
+ String[] lines = new String[] { "+[a1]", "+[a2]", "+[a3]", " [a]", " [b]", "-[c]", " [d]", " [e]", " [f]" };
+ String lineDelimiter = getLineDelimiter(patch);
+ addLineDelimiters(lines, lineDelimiter);
Hunk hunk = (Hunk) PatchBuilder.createHunk(0, lines);
String[] actual = hunk.getUnifiedLines();
assertTrue(lines != actual);
@@ -228,16 +214,17 @@ public class PatchBuilderTest extends TestCase {
assertHunkEquals(hunk, (Hunk) filePatches[0].getHunks()[0]);
}
- public void testCreateHunk1() throws CoreException {
+ @Test
+ public void testCreateHunk1() throws CoreException, IOException {
IStorage patch = new StringStorage("patch_createHunk1.txt");
IFilePatch[] filePatches = ApplyPatchOperation.parsePatch(patch);
assertEquals(1, filePatches.length);
assertEquals(1, filePatches[0].getHunks().length);
- String[] lines = new String[] { " [a]", " [b]", "-[c]", " [d]", "-[e]",
- " [f]", " [g]", " [h]", "+[h1]", " [i]", " [j]", "+[j1]",
- "+[j2]", " [k]", " [l]", " [m]" };
- addLineDelimiters(lines);
+ String[] lines = new String[] { " [a]", " [b]", "-[c]", " [d]", "-[e]", " [f]", " [g]", " [h]", "+[h1]", " [i]",
+ " [j]", "+[j1]", "+[j2]", " [k]", " [l]", " [m]" };
+ String lineDelimiter = getLineDelimiter(patch);
+ addLineDelimiters(lines, lineDelimiter);
Hunk hunk = (Hunk) PatchBuilder.createHunk(0, lines);
String[] actual = hunk.getUnifiedLines();
assertTrue(lines != actual);
@@ -246,14 +233,16 @@ public class PatchBuilderTest extends TestCase {
assertHunkEquals(hunk, (Hunk) filePatches[0].getHunks()[0]);
}
- public void testCreateHunk2() throws CoreException {
+ @Test
+ public void testCreateHunk2() throws CoreException, IOException {
IStorage patch = new StringStorage("patch_createHunk2.txt");
IFilePatch[] filePatches = ApplyPatchOperation.parsePatch(patch);
assertEquals(1, filePatches.length);
assertEquals(1, filePatches[0].getHunks().length);
String[] lines = new String[] { "+[aa]", "+[bb]", "+[cc]" };
- addLineDelimiters(lines);
+ String lineDelimiter = getLineDelimiter(patch);
+ addLineDelimiters(lines, lineDelimiter);
Hunk hunk = (Hunk) PatchBuilder.createHunk(0, lines);
String[] actual = hunk.getUnifiedLines();
assertTrue(lines != actual);
@@ -262,14 +251,16 @@ public class PatchBuilderTest extends TestCase {
assertHunkEquals(hunk, (Hunk) filePatches[0].getHunks()[0]);
}
- public void testCreateHunk3() throws CoreException {
+ @Test
+ public void testCreateHunk3() throws CoreException, IOException {
IStorage patch = new StringStorage("patch_createHunk3.txt");
IFilePatch[] filePatches = ApplyPatchOperation.parsePatch(patch);
assertEquals(1, filePatches.length);
assertEquals(1, filePatches[0].getHunks().length);
String[] lines = new String[] { "-[aa]", "-[bb]", "-[cc]", "-[dd]" };
- addLineDelimiters(lines);
+ String lineDelimiter = getLineDelimiter(patch);
+ addLineDelimiters(lines, lineDelimiter);
Hunk hunk = (Hunk) PatchBuilder.createHunk(0, lines);
String[] actual = hunk.getUnifiedLines();
assertTrue(lines != actual);
@@ -294,9 +285,27 @@ public class PatchBuilderTest extends TestCase {
assertEquals(h1.getHunkType(true), h2.getHunkType(true));
}
- private void addLineDelimiters(String[] lines) {
+ private String getLineDelimiter(IStorage storage) throws CoreException, IOException {
+ InputStream in = null;
+ try {
+ in = storage.getContents();
+ int ch;
+ while ((ch = in.read()) != -1) {
+ if (ch == '\r') {
+ return "\r\n";
+ }
+ }
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+ return "\n";
+ }
+
+ private void addLineDelimiters(String[] lines, String lineDelimiter) {
for (int i = 0; i < lines.length; i++) {
- lines[i] = lines[i] + "\r\n";
+ lines[i] = lines[i] + lineDelimiter;
}
}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java
index 2f08d7731..86809c7e7 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java
@@ -13,66 +13,71 @@
*******************************************************************************/
package org.eclipse.compare.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
import java.io.BufferedReader;
import java.io.IOException;
import java.lang.reflect.Field;
-import junit.framework.TestCase;
-
import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.patch.WorkspacePatcher;
import org.eclipse.compare.patch.IHunk;
+import org.junit.Test;
-public class PatchLinesTest extends TestCase {
-
- public PatchLinesTest(String name) {
- super(name);
- }
+public class PatchLinesTest {
// unified diff format
-
+ @Test
public void test_196847() throws Exception {
int[] lines = parsePatch("196847/stuff_patch.txt");
assertEquals(6, lines[0]);
assertEquals(5, lines[1]);
}
+ @Test
public void test_deletion_autofuzz() throws Exception {
int[] lines = parsePatch("deletion_autofuzz/patch.txt");
assertEquals(0, lines[0]);
assertEquals(1, lines[1]);
}
+ @Test
public void test_patch_addition() throws Exception {
int[] lines = parsePatch("patch_addition.txt");
assertEquals(9, lines[0]);
assertEquals(0, lines[1]);
}
+ @Test
public void test_patch_context1() throws Exception {
int[] lines = parsePatch("patch_context1.txt");
assertEquals(4, lines[0]);
assertEquals(2, lines[1]);
}
+ @Test
public void test_patch_context3() throws Exception {
int[] lines = parsePatch("patch_context3.txt");
assertEquals(4, lines[0]);
assertEquals(2, lines[1]);
}
+ @Test
public void test_patch_workspacePatchAddition() throws Exception {
int[] lines = parsePatch("patch_workspacePatchAddition.txt");
assertEquals(31, lines[0]);
assertEquals(0, lines[1]);
}
+ @Test
public void test_patch_workspacePatchDelete() throws Exception {
int[] lines = parsePatch("patch_workspacePatchDelete.txt");
assertEquals(29, lines[0]);
assertEquals(46, lines[1]);
}
+ @Test
public void test_patch_workspacePatchMod() throws Exception {
int[] lines = parsePatch("patch_workspacePatchMod.txt");
assertEquals(33, lines[0]);
@@ -80,19 +85,21 @@ public class PatchLinesTest extends TestCase {
}
// context diff format
-
+ @Test
public void test_patch_addition_context() throws Exception {
int[] lines = parsePatch("patch_addition_context.txt");
assertEquals(9, lines[0]);
assertEquals(0, lines[1]);
}
+ @Test
public void test_patch_oneline_context() throws Exception {
int[] lines = parsePatch("patch_oneline_context.txt");
assertEquals(1, lines[0]);
assertEquals(0, lines[1]);
}
+ @Test
public void test_patch_context3_context() throws Exception {
int[] lines = parsePatch("patch_context3_context.txt");
assertEquals(4, lines[0]);
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java
index 026e8e433..fc835b645 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java
@@ -13,6 +13,12 @@
*******************************************************************************/
package org.eclipse.compare.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import java.io.*;
import java.net.JarURLConnection;
import java.net.URL;
@@ -29,18 +35,17 @@ import org.eclipse.compare.tests.PatchUtils.*;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.*;
import org.junit.Assert;
+import org.junit.Test;
import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
-public class PatchTest extends TestCase {
+public class PatchTest {
private static final String PATCH_CONFIGURATION = "patchConfiguration.properties";
Properties defaultPatchProperties;
- public PatchTest(String name) {
- super(name);
+ public PatchTest() {
defaultPatchProperties = new Properties();
defaultPatchProperties.setProperty("patchFile", "patch.txt");
defaultPatchProperties.setProperty("contextFile", "context.txt");
@@ -48,34 +53,32 @@ public class PatchTest extends TestCase {
defaultPatchProperties.setProperty("fuzzFactor", "-1");
}
- protected void setUp() throws Exception {
- // empty
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
+ @Test
public void testCreatePatch() throws CoreException, IOException {
patch("addition.txt", "patch_addition.txt", "exp_addition.txt"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ @Test
public void testUnterminatedCreatePatch() throws CoreException, IOException {
patch("addition.txt", "patch_addition2.txt", "exp_addition2.txt"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ @Test
public void testContext0Patch() throws CoreException, IOException {
patch("context.txt", "patch_context0.txt", "exp_context.txt"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ @Test
public void testContext1Patch() throws CoreException, IOException {
patch("context.txt", "patch_context1.txt", "exp_context.txt"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ @Test
public void testContext3Patch() throws CoreException, IOException {
patch("context.txt", "patch_context3.txt", "exp_context.txt"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ @Test
public void testHunkFilter() throws CoreException, IOException {
IStorage patchStorage = new StringStorage("patch_hunkFilter.txt");
IStorage expStorage = new StringStorage("context.txt");
@@ -86,8 +89,7 @@ public class PatchTest extends TestCase {
PatchConfiguration pc = new PatchConfiguration();
final IHunk toFilterOut = hunks[3];
pc.addHunkFilter(hunk -> hunk != toFilterOut);
- IFilePatchResult result = patches[0].apply(expStorage, pc,
- new NullProgressMonitor());
+ IFilePatchResult result = patches[0].apply(expStorage, pc, new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
assertEquals(2, rejects.length);
boolean aFiltered = pc.getHunkFilters()[0].select(rejects[0]);
@@ -103,12 +105,14 @@ public class PatchTest extends TestCase {
assertEquals(expected, PatchUtils.asString(actual));
}
+ @Test
public void testContext3PatchWithHeader() throws CoreException, IOException {
patch("context.txt", "patch_context3_header.txt", "exp_context.txt"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IStorage patchStorage = new StringStorage("patch_context3_header.txt");
IFilePatch[] patches = ApplyPatchOperation.parsePatch(patchStorage);
String header = patches[0].getHeader();
- LineReader reader = new LineReader(new BufferedReader(new InputStreamReader(new ByteArrayInputStream(header.getBytes()))));
+ LineReader reader = new LineReader(
+ new BufferedReader(new InputStreamReader(new ByteArrayInputStream(header.getBytes()))));
List<String> lines = reader.readLines();
List<String> expected = new ArrayList<>();
expected.add("Index: old.txt\n");
@@ -116,6 +120,7 @@ public class PatchTest extends TestCase {
assertEquals(LineReader.createString(false, expected), LineReader.createString(false, lines));
}
+ @Test
public void testDateUnknown() throws CoreException {
IStorage patchStorage = new StringStorage("patch_dateunknown.txt");
IFilePatch[] patches = ApplyPatchOperation.parsePatch(patchStorage);
@@ -123,6 +128,7 @@ public class PatchTest extends TestCase {
assertEquals(IFilePatch.DATE_UNKNOWN, patches[0].getAfterDate());
}
+ @Test
public void testDateError() throws CoreException {
IStorage patchStorage = new StringStorage("patch_dateerror.txt");
IFilePatch[] patches = ApplyPatchOperation.parsePatch(patchStorage);
@@ -130,6 +136,7 @@ public class PatchTest extends TestCase {
assertEquals(IFilePatch.DATE_UNKNOWN, patches[0].getAfterDate());
}
+ @Test
public void testDateKnown() throws CoreException {
IStorage patchStorage = new StringStorage("patch_datevalid.txt");
IFilePatch[] patches = ApplyPatchOperation.parsePatch(patchStorage);
@@ -137,57 +144,96 @@ public class PatchTest extends TestCase {
assertFalse(IFilePatch.DATE_UNKNOWN == patches[0].getAfterDate());
}
- //Test creation of new workspace patch
- public void testWorkspacePatch_Create(){
- //Note the order that exists in the array of expected results is based purely on the order of the files in the patch
- patchWorkspace(new String[]{"addition.txt", "addition.txt"}, "patch_workspacePatchAddition.txt", new String[] { "exp_workspacePatchAddition2.txt","exp_workspacePatchAddition.txt"}, false, 0); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ // Test creation of new workspace patch
+ @Test
+ public void testWorkspacePatch_Create() {
+ // Note the order that exists in the array of expected results is based purely
+ // on the order of the files in the patch
+ patchWorkspace(new String[] { "addition.txt", "addition.txt" }, "patch_workspacePatchAddition.txt", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ new String[] { "exp_workspacePatchAddition2.txt", "exp_workspacePatchAddition.txt" }, false, 0); //$NON-NLS-1$ //$NON-NLS-2$
}
- //Test applying the reverse of workspace creation patch
- public void testWorkspacePatch_Create_Reverse(){
- //Note the order that exists in the array of expected results is based purely on the order of the files in the patch
- patchWorkspace(new String[]{"exp_workspacePatchAddition2.txt","exp_workspacePatchAddition.txt"}, "patch_workspacePatchAddition.txt", new String[] {"addition.txt", "addition.txt"}, true, 0); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ // Test applying the reverse of workspace creation patch
+ @Test
+ public void testWorkspacePatch_Create_Reverse() {
+ // Note the order that exists in the array of expected results is based purely
+ // on the order of the files in the patch
+ patchWorkspace(new String[] { "exp_workspacePatchAddition2.txt", "exp_workspacePatchAddition.txt" }, //$NON-NLS-1$//$NON-NLS-2$
+ "patch_workspacePatchAddition.txt", new String[] { "addition.txt", "addition.txt" }, true, 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- //Test the patching of an already existing file, the creation of a new one and the deletion of elements in a file
- public void testWorkspacePatch_Modify(){
- //Note the order that exists in the array of expected results is based purely on the order of the files in the patch
- patchWorkspace(new String[]{"exp_workspacePatchAddition2.txt","exp_workspacePatchAddition.txt", "addition.txt"}, "patch_workspacePatchMod.txt", new String[] { "exp_workspacePatchMod1.txt","exp_workspacePatchMod2.txt", "exp_workspacePatchMod3.txt"}, false, 0 ); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+ // Test the patching of an already existing file, the creation of a new one and
+ // the deletion of elements in a file
+ @Test
+ public void testWorkspacePatch_Modify() {
+ // Note the order that exists in the array of expected results is based purely
+ // on the order of the files in the patch
+ patchWorkspace(
+ new String[] { "exp_workspacePatchAddition2.txt", "exp_workspacePatchAddition.txt", "addition.txt" }, //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ "patch_workspacePatchMod.txt", new String[] { "exp_workspacePatchMod1.txt", //$NON-NLS-1$ //$NON-NLS-2$
+ "exp_workspacePatchMod2.txt", "exp_workspacePatchMod3.txt" }, //$NON-NLS-1$ //$NON-NLS-2$
+ false, 0);
}
- //Test applying the reverse of a workspace modify patch
- public void testWorkspacePatch_Modify_Reverse(){
- //Note the order that exists in the array of expected results is based purely on the order of the files in the patch
- patchWorkspace(new String[]{ "exp_workspacePatchMod1.txt","exp_workspacePatchMod2.txt", "exp_workspacePatchMod3.txt"}, "patch_workspacePatchMod.txt", new String[] {"exp_workspacePatchAddition2.txt","exp_workspacePatchAddition.txt", "addition.txt"}, true, 0 ); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+ // Test applying the reverse of a workspace modify patch
+ @Test
+ public void testWorkspacePatch_Modify_Reverse() {
+ // Note the order that exists in the array of expected results is based purely
+ // on the order of the files in the patch
+ patchWorkspace(
+ new String[] { "exp_workspacePatchMod1.txt", "exp_workspacePatchMod2.txt", //$NON-NLS-1$//$NON-NLS-2$
+ "exp_workspacePatchMod3.txt" }, //$NON-NLS-1$
+ "patch_workspacePatchMod.txt", //$NON-NLS-1$
+ new String[] { "exp_workspacePatchAddition2.txt", "exp_workspacePatchAddition.txt", "addition.txt" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ true, 0);
}
- //Tests the deletion of an already existing file, and the modification of another file
- public void testWorkspacePatch_Delete(){
- //Note the order that exists in the array of expected results is based purely on the order of the files in the patch
- patchWorkspace(new String[]{"exp_workspacePatchMod2.txt","addition.txt", "exp_workspacePatchMod1.txt","addition.txt"}, "patch_workspacePatchDelete.txt", new String[] { "addition.txt","exp_workspacePatchDelete2.txt", "addition.txt", "exp_workspacePatchDelete1.txt"}, false, 0 ); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+ // Tests the deletion of an already existing file, and the modification of
+ // another file
+ @Test
+ public void testWorkspacePatch_Delete() {
+ // Note the order that exists in the array of expected results is based purely
+ // on the order of the files in the patch
+ patchWorkspace(
+ new String[] { "exp_workspacePatchMod2.txt", "addition.txt", "exp_workspacePatchMod1.txt", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ "addition.txt" }, //$NON-NLS-1$
+ "patch_workspacePatchDelete.txt", new String[] { "addition.txt", "exp_workspacePatchDelete2.txt", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "addition.txt", "exp_workspacePatchDelete1.txt" }, //$NON-NLS-1$ //$NON-NLS-2$
+ false, 0);
}
- //Test applying the reverse of a workspace deletion patch
- public void testWorkspacePatch_Delete_Reverse(){
- //Note the order that exists in the array of expected results is based purely on the order of the files in the patch
- patchWorkspace(new String[]{"addition.txt","exp_workspacePatchDelete2.txt", "addition.txt", "exp_workspacePatchDelete1.txt" }, "patch_workspacePatchDelete.txt", new String[] {"exp_workspacePatchMod2.txt","addition.txt", "exp_workspacePatchMod1.txt","addition.txt"}, true, 0 ); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+ // Test applying the reverse of a workspace deletion patch
+ @Test
+ public void testWorkspacePatch_Delete_Reverse() {
+ // Note the order that exists in the array of expected results is based purely
+ // on the order of the files in the patch
+ patchWorkspace(
+ new String[] { "addition.txt", "exp_workspacePatchDelete2.txt", "addition.txt", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ "exp_workspacePatchDelete1.txt" }, //$NON-NLS-1$
+ "patch_workspacePatchDelete.txt", new String[] { "exp_workspacePatchMod2.txt", "addition.txt", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "exp_workspacePatchMod1.txt", "addition.txt" }, //$NON-NLS-1$ //$NON-NLS-2$
+ true, 0);
}
// Keeps track of the failures
private List<AssertionError> failures = new ArrayList<>();
+ @Test
public void testPatchdataSubfolders() throws IOException, CoreException {
- URL patchdataUrl = new URL(PatchUtils.getBundle().getEntry("/"),
- new Path(PatchUtils.PATCHDATA).toString());
+ URL patchdataUrl = new URL(PatchUtils.getBundle().getEntry("/"), new Path(PatchUtils.PATCHDATA).toString());
patchdataUrl = FileLocator.resolve(patchdataUrl);
Map<String, PatchTestConfiguration> map = null;
- if (patchdataUrl.getProtocol().equals("file")) {
+ switch (patchdataUrl.getProtocol()) {
+ case "file":
map = extractNamesForFileProtocol(patchdataUrl);
- } else if (patchdataUrl.getProtocol().equals("jar")) {
+ break;
+ case "jar":
map = extractNamesForJarProtocol(patchdataUrl);
- } else {
+ break;
+ default:
fail("Unknown protocol");
+ break;
}
assertNotNull(map);
@@ -201,8 +247,7 @@ public class PatchTest extends TestCase {
PatchConfiguration pc = ptc.pc;
// create a message to distinguish tests from different subfolders
- String msg = "Test for subfolder [" + PatchUtils.PATCHDATA + "/"
- + sf + "] failed.";
+ String msg = "Test for subfolder [" + PatchUtils.PATCHDATA + "/" + sf + "] failed.";
try {
// test with expected result
@@ -220,8 +265,7 @@ public class PatchTest extends TestCase {
continue; // continue with a next subfolder
}
failures.add(new AssertionError(
- "\npatchWorkspace should fail for folder ["
- + PatchUtils.PATCHDATA + "/" + sf + "]."));
+ "\npatchWorkspace should fail for folder [" + PatchUtils.PATCHDATA + "/" + sf + "]."));
}
}
@@ -253,16 +297,16 @@ public class PatchTest extends TestCase {
/**
* @param patchdataUrl
* @return A map with subfolder name as a key and an array of objects as a
- * value. The first object in the array is another array (of
- * Strings) containing file names for the test. The last value in
- * this array can be <code>null</code> as testing against actual
- * result is optional. The second object is an instance of
- * <code>PatchConfiguration</code> class.
+ * value. The first object in the array is another array (of Strings)
+ * containing file names for the test. The last value in this array can
+ * be <code>null</code> as testing against actual result is optional.
+ * The second object is an instance of <code>PatchConfiguration</code>
+ * class.
* @throws IOException
* @throws CoreException
*/
- private Map<String, PatchTestConfiguration> extractNamesForJarProtocol(URL patchdataUrl) throws IOException,
- CoreException {
+ private Map<String, PatchTestConfiguration> extractNamesForJarProtocol(URL patchdataUrl)
+ throws IOException, CoreException {
JarFile jarFile = ((JarURLConnection) patchdataUrl.openConnection()).getJarFile();
// look for the patchdata folder entry
@@ -290,12 +334,13 @@ public class PatchTest extends TestCase {
// a subfolder found
ZipEntry patchConf = jarFile.getEntry(entryName + "/" + PATCH_CONFIGURATION);
if (patchConf != null) {
- JarEntryStorage jes = new JarEntryStorage(entry,jarFile);
+ JarEntryStorage jes = new JarEntryStorage(entry, jarFile);
Properties properties = new Properties();
try {
properties.load(jes.getContents());
} catch (IOException e) {
- fail("IOException occured while loading the Patch Configuration file for "+entryName.toString());
+ fail("IOException occured while loading the Patch Configuration file for "
+ + entryName.toString());
}
processProperties(result, properties, entryName);
} else {
@@ -307,16 +352,14 @@ public class PatchTest extends TestCase {
return result;
}
- private Map<String, PatchTestConfiguration> extractNamesForFileProtocol(URL patchdataUrl)
- throws CoreException {
+ private Map<String, PatchTestConfiguration> extractNamesForFileProtocol(URL patchdataUrl) throws CoreException {
Map<String, PatchTestConfiguration> result = new HashMap<>(); // configuration map
IPath patchdataFolderPath = new Path(patchdataUrl.getPath());
File patchdataFolderFile = patchdataFolderPath.toFile();
assertTrue(patchdataFolderFile.isDirectory());
- File[] listOfSubfolders = patchdataFolderFile
- .listFiles((FileFilter) pathname -> pathname.isDirectory());
+ File[] listOfSubfolders = patchdataFolderFile.listFiles((FileFilter) File::isDirectory);
for (File subfolder : listOfSubfolders) {
Path pcPath = new Path(subfolder.getPath() + "/" + PATCH_CONFIGURATION);
File pcFile = pcPath.toFile();
@@ -328,8 +371,7 @@ public class PatchTest extends TestCase {
try {
properties.load(new FileInputStream(pcFile));
} catch (IOException e) {
- fail("IOException occured while loading the Patch Configuration file for "
- + subfolder.toString());
+ fail("IOException occured while loading the Patch Configuration file for " + subfolder.toString());
}
processProperties(result, properties, subfolder.getName());
} else {
@@ -380,7 +422,7 @@ public class PatchTest extends TestCase {
tpc.originalFileNames = cf;
tpc.patchFileName = pf;
tpc.subfolderName = subfolderName;
- tpc.expectedFileNames= erf;
+ tpc.expectedFileNames = erf;
tpc.actualFileNames = arf;
tpc.pc = pc;
@@ -393,8 +435,8 @@ public class PatchTest extends TestCase {
}
private void filePatch(final String old, String patch, String expt) throws CoreException, IOException {
- LineReader lr= new LineReader(PatchUtils.getReader(expt));
- List<String> inLines= lr.readLines();
+ LineReader lr = new LineReader(PatchUtils.getReader(expt));
+ List<String> inLines = lr.readLines();
String expected = LineReader.createString(false, inLines);
IStorage oldStorage = new StringStorage(old);
@@ -410,30 +452,29 @@ public class PatchTest extends TestCase {
}
private void patcherPatch(String old, String patch, String expt) {
- LineReader lr= new LineReader(PatchUtils.getReader(old));
- List<String> inLines= lr.readLines();
+ LineReader lr = new LineReader(PatchUtils.getReader(old));
+ List<String> inLines = lr.readLines();
- WorkspacePatcher patcher= new WorkspacePatcher();
+ WorkspacePatcher patcher = new WorkspacePatcher();
try {
patcher.parse(PatchUtils.getReader(patch));
} catch (IOException e) {
e.printStackTrace();
}
- FilePatch2[] diffs= patcher.getDiffs();
+ FilePatch2[] diffs = patcher.getDiffs();
Assert.assertEquals(diffs.length, 1);
FileDiffResult diffResult = patcher.getDiffResult(diffs[0]);
diffResult.patch(inLines, null);
- LineReader expectedContents= new LineReader(PatchUtils.getReader(expt));
- List<String> expectedLines= expectedContents.readLines();
+ LineReader expectedContents = new LineReader(PatchUtils.getReader(expt));
+ List<String> expectedLines = expectedContents.readLines();
Assert.assertArrayEquals(expectedLines.toArray(), inLines.toArray());
}
- private void patchWorkspace(String[] originalFiles, String patch,
- String[] expectedOutcomeFiles, boolean reverse,
+ private void patchWorkspace(String[] originalFiles, String patch, String[] expectedOutcomeFiles, boolean reverse,
int fuzzFactor) {
PatchConfiguration pc = new PatchConfiguration();
pc.setReversed(reverse);
@@ -448,14 +489,15 @@ public class PatchTest extends TestCase {
* @param originalFiles
* @param patch
* @param expectedOutcomeFiles
- * @param patchConfiguration
- * The patch configuration to use. One of its parameters is fuzz
- * factor. If it equals <code>-1</code> it means that the fuzz
- * should be calculated automatically.
+ * @param patchConfiguration The patch configuration to use. One of its
+ * parameters is fuzz factor. If it equals
+ * <code>-1</code> it means that the fuzz should be
+ * calculated automatically.
*/
- private void patchWorkspace(String msg, String[] originalFiles, String patch, String[] expectedOutcomeFiles, PatchConfiguration patchConfiguration) {
+ private void patchWorkspace(String msg, String[] originalFiles, String patch, String[] expectedOutcomeFiles,
+ PatchConfiguration patchConfiguration) {
- //ensure that we have the same number of input files as we have expected files
+ // ensure that we have the same number of input files as we have expected files
Assert.assertEquals(originalFiles.length, expectedOutcomeFiles.length);
// Parse the passed in patch and extract all the Diffs
@@ -470,22 +512,23 @@ public class PatchTest extends TestCase {
e.printStackTrace();
}
- //Sort the diffs by project
- FilePatch2[] diffs= patcher.getDiffs();
+ // Sort the diffs by project
+ FilePatch2[] diffs = patcher.getDiffs();
- //Iterate through all of the original files, apply the diffs that belong to the file and compare
- //with the corresponding outcome file
+ // Iterate through all of the original files, apply the diffs that belong to the
+ // file and compare
+ // with the corresponding outcome file
for (int i = 0; i < originalFiles.length; i++) {
- LineReader lr= new LineReader(PatchUtils.getReader(originalFiles[i]));
- List<String> inLines= lr.readLines();
+ LineReader lr = new LineReader(PatchUtils.getReader(originalFiles[i]));
+ List<String> inLines = lr.readLines();
FileDiffResult diffResult = patcher.getDiffResult(diffs[i]);
diffResult.patch(inLines, null);
- LineReader expectedContents= new LineReader(PatchUtils.getReader(expectedOutcomeFiles[i]));
- List<String> expectedLines= expectedContents.readLines();
+ LineReader expectedContents = new LineReader(PatchUtils.getReader(expectedOutcomeFiles[i]));
+ List<String> expectedLines = expectedContents.readLines();
- Object[] expected= expectedLines.toArray();
+ Object[] expected = expectedLines.toArray();
String resultString = LineReader.createString(patcher.isPreserveLineDelimeters(), inLines);
LineReader resultReader = new LineReader(new BufferedReader(new StringReader(resultString)));
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUITest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUITest.java
index e58e32557..69c16203d 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUITest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUITest.java
@@ -13,6 +13,10 @@
*******************************************************************************/
package org.eclipse.compare.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
@@ -31,12 +35,11 @@ import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.swt.dnd.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.PlatformUI;
+import org.junit.*;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
-import junit.framework.TestCase;
-
-public class PatchUITest extends TestCase {
+public class PatchUITest {
private static final String TEST_PROJECT = "ApplyPatchTest";
@@ -46,23 +49,19 @@ public class PatchUITest extends TestCase {
private PatchWizardDialog wizardDialog = null;
private PatchWizard wizard = null;
- public PatchUITest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() throws Exception {
workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
testProject = workspaceRoot.getProject(TEST_PROJECT);
testProject.create(null);
testProject.open(null);
}
- protected void tearDown() throws Exception {
- super.tearDown();
+ @After
+ public void tearDown() throws Exception {
testProject.delete(true, null);
}
-
+@Test
public void testApplyClipboardPatch() throws CoreException {
// Clipboard support on Mac OS is not reliable when tests are run
// through an SSH session, see bug 272870 for details
@@ -90,7 +89,7 @@ public class PatchUITest extends TestCase {
InputStream actual = testProject.getFile("context.txt").getContents();
compareStreams(expected, actual);
}
-
+@Test
public void testApplyWorkspacePatch() throws CoreException {
copyIntoWorkspace("patch_addition.txt");
@@ -119,7 +118,7 @@ public class PatchUITest extends TestCase {
.getContents();
compareStreams(expected, actual);
}
-
+@Test
public void testApplyClipboardPatch_AdditionWithWindowsLD() throws Exception {
// Clipboard support on Mac OS is not reliable when tests are run
// through an SSH session, see bug 272870 for details
@@ -150,7 +149,7 @@ public class PatchUITest extends TestCase {
InputStream expectedIS = PatchUtils.asInputStream("exp_addition.txt");
InputStream actualIS = testProject.getFile("exp_addition.txt").getContents();
- String expected = PatchUtils.asString(expectedIS).replaceAll("\n", "\r\n");
+ String expected = PatchUtils.asString(expectedIS).replaceAll("\r?\n", "\r\n");
String actual = PatchUtils.asString(actualIS);
assertEquals(expected, actual);
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java
index f2ef14914..ee06b5f0d 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java
@@ -46,22 +46,27 @@ public class PatchUtils {
fileName = old;
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
return null;
}
+ @Override
public boolean isReadOnly() {
return false;
}
+ @Override
public String getName() {
return fileName;
}
+ @Override
public IPath getFullPath() {
return null;
}
+ @Override
public InputStream getContents() throws CoreException {
return new BufferedInputStream(asInputStream(fileName));
}
@@ -74,6 +79,7 @@ public class PatchUtils {
this.file = file;
}
+ @Override
public InputStream getContents() throws CoreException {
try {
return new FileInputStream(file);
@@ -83,18 +89,22 @@ public class PatchUtils {
return null;
}
+ @Override
public IPath getFullPath() {
return new Path(file.getAbsolutePath());
}
+ @Override
public String getName() {
return file.getName();
}
+ @Override
public boolean isReadOnly() {
return true;
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
return null;
}
@@ -109,6 +119,7 @@ public class PatchUtils {
this.jarFile = jarFile;
}
+ @Override
public InputStream getContents() throws CoreException {
try {
return jarFile.getInputStream(jarEntry);
@@ -118,18 +129,22 @@ public class PatchUtils {
return null;
}
+ @Override
public IPath getFullPath() {
return new Path(jarFile.getName());
}
+ @Override
public String getName() {
return jarEntry.getName();
}
+ @Override
public boolean isReadOnly() {
return true;
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
return null;
}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/RangeDifferencerThreeWayDiffTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/RangeDifferencerThreeWayDiffTest.java
index 59d990d75..4e770df19 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/RangeDifferencerThreeWayDiffTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/RangeDifferencerThreeWayDiffTest.java
@@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.compare.tests;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
import org.eclipse.compare.contentmergeviewer.ITokenComparator;
import org.eclipse.compare.internal.DocLineComparator;
@@ -21,22 +21,19 @@ import org.eclipse.compare.rangedifferencer.RangeDifference;
import org.eclipse.compare.rangedifferencer.RangeDifferencer;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.Document;
+import org.junit.Test;
+public class RangeDifferencerThreeWayDiffTest {
-public class RangeDifferencerThreeWayDiffTest extends TestCase {
-
- static final String S= System.getProperty("line.separator"); //$NON-NLS-1$
-
- public RangeDifferencerThreeWayDiffTest(String name) {
- super(name);
- }
+ static final String S = System.lineSeparator();
+ @Test
public void testInsertConflict() {
- String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
+ String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
String l = "A" + S + "B" + S + "x" + S + "C" + S + "D"; //$NON-NLS-1$
String r = "A" + S + "B" + S + "y" + S + "C" + S + "D"; //$NON-NLS-1$
- RangeDifference[] diffs= findRange(a, l, r);
+ RangeDifference[] diffs = findRange(a, l, r);
assertEquals(3, diffs.length);
assertEquals(RangeDifference.NOCHANGE, diffs[0].kind());
@@ -44,12 +41,13 @@ public class RangeDifferencerThreeWayDiffTest extends TestCase {
assertEquals(RangeDifference.NOCHANGE, diffs[2].kind());
}
+ @Test
public void testChangeConflict() {
- String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
+ String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
String l = "A" + S + "b1" + S + "C" + S + "D"; //$NON-NLS-1$
String r = "A" + S + "b2" + S + "C" + S + "D"; //$NON-NLS-1$
- RangeDifference[] diffs= findRange(a, l, r);
+ RangeDifference[] diffs = findRange(a, l, r);
assertEquals(3, diffs.length);
assertEquals(RangeDifference.NOCHANGE, diffs[0].kind());
@@ -57,12 +55,13 @@ public class RangeDifferencerThreeWayDiffTest extends TestCase {
assertEquals(RangeDifference.NOCHANGE, diffs[2].kind());
}
+ @Test
public void testDeleteAndChangeConflict() {
- String a = "A" + S + "B" + S + "C"; //$NON-NLS-1$
- String l = "A" + S + "C"; //$NON-NLS-1$
+ String a = "A" + S + "B" + S + "C"; //$NON-NLS-1$
+ String l = "A" + S + "C"; //$NON-NLS-1$
String r = "A" + S + "b1" + S + "C"; //$NON-NLS-1$
- RangeDifference[] diffs= findRange(a, l, r);
+ RangeDifference[] diffs = findRange(a, l, r);
assertEquals(3, diffs.length);
assertEquals(RangeDifference.NOCHANGE, diffs[0].kind());
@@ -70,12 +69,13 @@ public class RangeDifferencerThreeWayDiffTest extends TestCase {
assertEquals(RangeDifference.NOCHANGE, diffs[2].kind());
}
+ @Test
public void testInsertWithinMultilineChangeConflict() {
- String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
+ String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
String l = "A" + S + "B" + S + "x" + S + "C" + S + "D"; //$NON-NLS-1$
- String r = "A" + S + "x" + S + "y" + S + "D"; //$NON-NLS-1$
+ String r = "A" + S + "x" + S + "y" + S + "D"; //$NON-NLS-1$
- RangeDifference[] diffs= findRange(a, l, r);
+ RangeDifference[] diffs = findRange(a, l, r);
assertEquals(3, diffs.length);
assertEquals(RangeDifference.NOCHANGE, diffs[0].kind());
@@ -83,12 +83,13 @@ public class RangeDifferencerThreeWayDiffTest extends TestCase {
assertEquals(RangeDifference.NOCHANGE, diffs[2].kind());
}
+ @Test
public void testAdjoiningChangesNoConflict() {
- String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
- String l = "A" + S + "b1" + S + "C" + S + "D"; //$NON-NLS-1$
- String r = "A" + S + "B" + S + "c1" + S + "D"; //$NON-NLS-1$
+ String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
+ String l = "A" + S + "b1" + S + "C" + S + "D"; //$NON-NLS-1$
+ String r = "A" + S + "B" + S + "c1" + S + "D"; //$NON-NLS-1$
- RangeDifference[] diffs= findRange(a, l, r);
+ RangeDifference[] diffs = findRange(a, l, r);
assertEquals(4, diffs.length);
assertEquals(RangeDifference.NOCHANGE, diffs[0].kind());
@@ -97,12 +98,13 @@ public class RangeDifferencerThreeWayDiffTest extends TestCase {
assertEquals(RangeDifference.NOCHANGE, diffs[3].kind());
}
+ @Test
public void testAdjoiningInsertAndChangeNoConflict() {
- String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
- String l = "A" + S + "B" + S + "x" + S + "C" + S + "D"; //$NON-NLS-1$
- String r = "A" + S + "B" + S + "c1" + S + "D"; //$NON-NLS-1$
+ String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
+ String l = "A" + S + "B" + S + "x" + S + "C" + S + "D"; //$NON-NLS-1$
+ String r = "A" + S + "B" + S + "c1" + S + "D"; //$NON-NLS-1$
- RangeDifference[] diffs= findRange(a, l, r);
+ RangeDifference[] diffs = findRange(a, l, r);
assertEquals(4, diffs.length);
assertEquals(RangeDifference.NOCHANGE, diffs[0].kind());
@@ -111,13 +113,13 @@ public class RangeDifferencerThreeWayDiffTest extends TestCase {
assertEquals(RangeDifference.NOCHANGE, diffs[3].kind());
}
-
+ @Test
public void testAdjoiningMultilineChangeNoConflict() {
String a = "A" + S + "B" + S + "C" + S + "D"; //$NON-NLS-1$
String l = "A" + S + "x" + S + "y" + S + "D"; //$NON-NLS-1$
String r = "A" + S + "B" + S + "C" + S + "d1"; //$NON-NLS-1$
- RangeDifference[] diffs= findRange(a, l, r);
+ RangeDifference[] diffs = findRange(a, l, r);
assertEquals(3, diffs.length);
assertEquals(RangeDifference.NOCHANGE, diffs[0].kind());
@@ -126,9 +128,9 @@ public class RangeDifferencerThreeWayDiffTest extends TestCase {
}
private RangeDifference[] findRange(String a, String l, String r) {
- ITokenComparator ancestor= new DocLineComparator(new Document(a), null, false);
- ITokenComparator left= new DocLineComparator(new Document(l), null, false);
- ITokenComparator right= new DocLineComparator(new Document(r), null, false);
+ ITokenComparator ancestor = new DocLineComparator(new Document(a), null, false);
+ ITokenComparator left = new DocLineComparator(new Document(l), null, false);
+ ITokenComparator right = new DocLineComparator(new Document(r), null, false);
return RangeDifferencer.findRanges(new NullProgressMonitor(), ancestor, left, right);
}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java
index 406003315..d20e24960 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java
@@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.compare.tests;
+import static org.junit.Assert.assertEquals;
+
import java.io.*;
import java.nio.charset.StandardCharsets;
@@ -20,144 +22,147 @@ import org.eclipse.compare.IStreamMerger;
import org.eclipse.compare.internal.merge.TextStreamMerger;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.junit.Test;
-import junit.framework.TestCase;
-
-public class StreamMergerTest extends TestCase {
+public class StreamMergerTest {
- private static final String ABC= "abc"; //$NON-NLS-1$
- private static final String DEF= "def"; //$NON-NLS-1$
- private static final String BAR= "bar"; //$NON-NLS-1$
- private static final String FOO= "foo"; //$NON-NLS-1$
- private static final String XYZ= "xyz"; //$NON-NLS-1$
- private static final String _123= "123"; //$NON-NLS-1$
- private static final String _456= "456"; //$NON-NLS-1$
+ private static final String ABC = "abc"; //$NON-NLS-1$
+ private static final String DEF = "def"; //$NON-NLS-1$
+ private static final String BAR = "bar"; //$NON-NLS-1$
+ private static final String FOO = "foo"; //$NON-NLS-1$
+ private static final String XYZ = "xyz"; //$NON-NLS-1$
+ private static final String _123 = "123"; //$NON-NLS-1$
+ private static final String _456 = "456"; //$NON-NLS-1$
- String encoding= "UTF-8"; //$NON-NLS-1$
- static final String SEPARATOR= System.getProperty("line.separator"); //$NON-NLS-1$
-
- public StreamMergerTest(String name) {
- super(name);
- }
+ String encoding = "UTF-8"; //$NON-NLS-1$
+ static final String SEPARATOR = System.lineSeparator();
+ @Test
public void testIncomingAddition() {
- String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String t= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String o= ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
+ String a = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String t = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String o = ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
- StringBuffer output= new StringBuffer();
+ StringBuilder output = new StringBuilder();
- IStatus status= merge(output, a, t, o);
+ IStatus status = merge(output, a, t, o);
assertEquals(status.getSeverity(), IStatus.OK);
assertEquals(status.getCode(), IStatus.OK);
assertEquals(output.toString(), ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ + SEPARATOR);
}
+ @Test
public void testIncomingDeletion() {
- String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String t= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String o= ABC + SEPARATOR + XYZ;
+ String a = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String t = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String o = ABC + SEPARATOR + XYZ;
- StringBuffer output= new StringBuffer();
+ StringBuilder output = new StringBuilder();
- IStatus status= merge(output, a, t, o);
+ IStatus status = merge(output, a, t, o);
assertEquals(status.getSeverity(), IStatus.OK);
assertEquals(status.getCode(), IStatus.OK);
assertEquals(output.toString(), ABC + SEPARATOR + XYZ + SEPARATOR);
}
+ @Test
public void testIncomingReplacement() {
- String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String t= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String o= ABC + SEPARATOR + _123 + SEPARATOR + XYZ;
+ String a = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String t = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String o = ABC + SEPARATOR + _123 + SEPARATOR + XYZ;
- StringBuffer output= new StringBuffer();
+ StringBuilder output = new StringBuilder();
- IStatus status= merge(output, a, t, o);
+ IStatus status = merge(output, a, t, o);
assertEquals(status.getSeverity(), IStatus.OK);
assertEquals(status.getCode(), IStatus.OK);
assertEquals(output.toString(), ABC + SEPARATOR + _123 + SEPARATOR + XYZ + SEPARATOR);
}
+ @Test
public void testNonConflictingMerge() {
- String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String t= ABC + SEPARATOR + DEF + SEPARATOR + XYZ + SEPARATOR + FOO;
- String o= ABC + SEPARATOR + _123 + SEPARATOR + _456 + SEPARATOR + XYZ;
+ String a = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String t = ABC + SEPARATOR + DEF + SEPARATOR + XYZ + SEPARATOR + FOO;
+ String o = ABC + SEPARATOR + _123 + SEPARATOR + _456 + SEPARATOR + XYZ;
- StringBuffer output= new StringBuffer();
+ StringBuilder output = new StringBuilder();
- IStatus status= merge(output, a, t, o);
+ IStatus status = merge(output, a, t, o);
assertEquals(status.getSeverity(), IStatus.OK);
assertEquals(status.getCode(), IStatus.OK);
- assertEquals(output.toString(), ABC + SEPARATOR + _123 + SEPARATOR + _456 + SEPARATOR + XYZ + SEPARATOR + FOO + SEPARATOR);
+ assertEquals(output.toString(),
+ ABC + SEPARATOR + _123 + SEPARATOR + _456 + SEPARATOR + XYZ + SEPARATOR + FOO + SEPARATOR);
}
+ @Test
public void testConflictingReplacement() {
- String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String t= ABC + SEPARATOR + FOO + SEPARATOR + XYZ;
- String o= ABC + SEPARATOR + BAR + SEPARATOR + XYZ;
+ String a = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String t = ABC + SEPARATOR + FOO + SEPARATOR + XYZ;
+ String o = ABC + SEPARATOR + BAR + SEPARATOR + XYZ;
- StringBuffer output= new StringBuffer();
+ StringBuilder output = new StringBuilder();
- IStatus status= merge(output, a, t, o);
+ IStatus status = merge(output, a, t, o);
assertEquals(status.getSeverity(), IStatus.ERROR);
assertEquals(status.getCode(), IStreamMerger.CONFLICT);
}
+ @Test
public void testConflictingAddition() {
- String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String t= ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
- String o= ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
+ String a = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String t = ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
+ String o = ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ;
- StringBuffer output= new StringBuffer();
+ StringBuilder output = new StringBuilder();
- IStatus status= merge(output, a, t, o);
+ IStatus status = merge(output, a, t, o);
assertEquals(status.getSeverity(), IStatus.OK);
assertEquals(status.getCode(), IStatus.OK);
assertEquals(output.toString(), ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ + SEPARATOR);
}
+ @Test
public void testConflictingDeletion() {
- String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
- String t= ABC + SEPARATOR + XYZ;
- String o= ABC + SEPARATOR + XYZ;
+ String a = ABC + SEPARATOR + DEF + SEPARATOR + XYZ;
+ String t = ABC + SEPARATOR + XYZ;
+ String o = ABC + SEPARATOR + XYZ;
- StringBuffer output= new StringBuffer();
+ StringBuilder output = new StringBuilder();
- IStatus status= merge(output, a, t, o);
+ IStatus status = merge(output, a, t, o);
assertEquals(status.getSeverity(), IStatus.OK);
assertEquals(status.getCode(), IStatus.OK);
assertEquals(output.toString(), ABC + SEPARATOR + XYZ + SEPARATOR);
}
- private IStatus merge(StringBuffer output, String a, String m, String y) {
- InputStream ancestor= new ByteArrayInputStream(a.getBytes(StandardCharsets.UTF_8));
- InputStream target= new ByteArrayInputStream(m.getBytes(StandardCharsets.UTF_8));
- InputStream other= new ByteArrayInputStream(y.getBytes(StandardCharsets.UTF_8));
+ private IStatus merge(StringBuilder output, String a, String m, String y) {
+ InputStream ancestor = new ByteArrayInputStream(a.getBytes(StandardCharsets.UTF_8));
+ InputStream target = new ByteArrayInputStream(m.getBytes(StandardCharsets.UTF_8));
+ InputStream other = new ByteArrayInputStream(y.getBytes(StandardCharsets.UTF_8));
return merge(output, ancestor, target, other);
}
- private IStatus merge(StringBuffer output, InputStream ancestor,
- InputStream target, InputStream other) {
- ByteArrayOutputStream os= new ByteArrayOutputStream();
+ private IStatus merge(StringBuilder output, InputStream ancestor, InputStream target, InputStream other) {
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
- IStreamMerger merger= new TextStreamMerger();
- IStatus status= merger.merge(os, encoding, ancestor, encoding, target, encoding, other, encoding, (IProgressMonitor) null);
+ IStreamMerger merger = new TextStreamMerger();
+ IStatus status = merger.merge(os, encoding, ancestor, encoding, target, encoding, other, encoding,
+ (IProgressMonitor) null);
output.append(new String(os.toByteArray(), StandardCharsets.UTF_8));
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StructureCreatorTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StructureCreatorTest.java
index 09b049059..5d8e70bd3 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StructureCreatorTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StructureCreatorTest.java
@@ -13,36 +13,24 @@
*******************************************************************************/
package org.eclipse.compare.tests;
+import static org.junit.Assert.assertNull;
+
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import junit.framework.TestCase;
-
import org.eclipse.compare.ICompareFilter;
import org.eclipse.compare.ISharedDocumentAdapter;
-import org.eclipse.compare.structuremergeviewer.DocumentRangeNode;
-import org.eclipse.compare.structuremergeviewer.IStructureComparator;
-import org.eclipse.compare.structuremergeviewer.StructureCreator;
+import org.eclipse.compare.structuremergeviewer.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.*;
import org.junit.Assert;
+import org.junit.Test;
-public class StructureCreatorTest extends TestCase {
-
- public StructureCreatorTest() {
- super();
- }
-
- public StructureCreatorTest(String name) {
- super(name);
- }
+public class StructureCreatorTest {
+@Test
public void testIgnoreWhitespace() {
IDocument[] docs = new IDocument[15];
docs[0] = new Document();
@@ -81,11 +69,13 @@ public class StructureCreatorTest extends TestCase {
filters[0] = null;
filters[1] = new ICompareFilter[] { new ICompareFilter() {
+ @Override
public void setInput(Object input, Object ancestor, Object left,
Object right) {
// EMPTY
}
+ @Override
public IRegion[] getFilteredRegions(HashMap lineComparison) {
String line = lineComparison.get(ICompareFilter.THIS_LINE)
.toString();
@@ -95,10 +85,12 @@ public class StructureCreatorTest extends TestCase {
return null;
}
+ @Override
public boolean isEnabledInitially() {
return false;
}
+ @Override
public boolean canCacheFilteredRegions() {
return true; // cache-able
}
@@ -106,11 +98,13 @@ public class StructureCreatorTest extends TestCase {
filters[2] = new ICompareFilter[] { new ICompareFilter() {
+ @Override
public void setInput(Object input, Object ancestor, Object left,
Object right) {
// EMPTY
}
+ @Override
public IRegion[] getFilteredRegions(HashMap lineComparison) {
String line = lineComparison.get(ICompareFilter.THIS_LINE)
.toString();
@@ -120,10 +114,12 @@ public class StructureCreatorTest extends TestCase {
return null;
}
+ @Override
public boolean isEnabledInitially() {
return false;
}
+ @Override
public boolean canCacheFilteredRegions() {
return false; // not cache-able
}
@@ -133,10 +129,12 @@ public class StructureCreatorTest extends TestCase {
private Pattern whitespace = Pattern.compile("\\s+");
private Matcher matcher = null;
+ @Override
public String getName() {
return "NAME";
}
+ @Override
public String getContents(Object node, boolean ignoreWhitespace) {
DocumentRangeNode drn = (DocumentRangeNode) node;
String retval = null;
@@ -156,6 +154,7 @@ public class StructureCreatorTest extends TestCase {
return retval;
}
+ @Override
protected IStructureComparator createStructureComparator(
Object element, IDocument document,
ISharedDocumentAdapter sharedDocumentAdapter,
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java
index 957dc4ed6..815a0c235 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java
@@ -75,12 +75,15 @@ public class TextMergeViewerTest {
}
public static class TestElement implements ITypedElement {
+ @Override
public Image getImage() {
return null;
}
+ @Override
public String getName() {
return "test";
}
+ @Override
public String getType() {
return UNKNOWN_TYPE;
}
@@ -91,9 +94,11 @@ public class TextMergeViewerTest {
* The purpose of the parent is to be able to copy a child into the destination element.
*/
public static class ParentTestElement extends TestElement implements IEditableContent {
+ @Override
public boolean isEditable() {
return false;
}
+ @Override
public ITypedElement replace(ITypedElement child, ITypedElement other) {
if (child == null) { // add child
// clone the other and return it as the new child
@@ -121,6 +126,7 @@ public class TextMergeViewerTest {
}
return child;
}
+ @Override
public void setContent(byte[] newContent) {
// Node is not directly editable
}
@@ -131,25 +137,32 @@ public class TextMergeViewerTest {
public EditableTestElement(byte[] contents) {
this.contents = contents;
}
+ @Override
public String getType() {
return TEXT_TYPE;
}
+ @Override
public InputStream getContents() {
return new ByteArrayInputStream(contents);
}
+ @Override
protected Object clone() {
return new EditableTestElement(contents);
}
+ @Override
public boolean isEditable() {
return true;
}
+ @Override
public ITypedElement replace(ITypedElement dest, ITypedElement src) {
// Nothing to do since this node has no children
return null;
}
+ @Override
public void setContent(byte[] newContent) {
contents = newContent;
}
+ @Override
public boolean equals(Object obj) {
if (obj instanceof EditableTestElement) {
EditableTestElement other = (EditableTestElement) obj;
@@ -171,6 +184,7 @@ public class TextMergeViewerTest {
super(parent, cc);
}
+ @Override
public void copy(boolean leftToRight) {
super.copy(leftToRight);
}
@@ -199,6 +213,7 @@ public class TextMergeViewerTest {
final CompareConfiguration cc) throws Exception {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
Dialog dialog = new Dialog(shell) {
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
viewer = new TestMergeViewer(composite, cc);
@@ -375,12 +390,14 @@ public class TextMergeViewerTest {
Map<String, ICompareFilter> filters = new HashMap<>();
filters.put("filter.id", new ICompareFilter() {
+ @Override
public void setInput(Object input, Object ancestor,
Object left, Object right) {
assertTrue(leftElement == left);
assertTrue(rightElement == right);
}
+ @Override
public IRegion[] getFilteredRegions(
HashMap lineComparison) {
Object thisLine = lineComparison.get(THIS_LINE);
@@ -409,10 +426,12 @@ public class TextMergeViewerTest {
return new IRegion[] { new Region(0, 2) };
}
+ @Override
public boolean isEnabledInitially() {
return false;
}
+ @Override
public boolean canCacheFilteredRegions() {
return true;
}
@@ -436,14 +455,17 @@ public class TextMergeViewerTest {
public void testDocumentAsTypedElement() throws Exception {
class DocumentAsTypedElement extends Document implements ITypedElement {
+ @Override
public String getName() {
return "file";
}
+ @Override
public Image getImage() {
return null;
}
+ @Override
public String getType() {
return ITypedElement.UNKNOWN_TYPE;
}
@@ -463,6 +485,7 @@ public class TextMergeViewerTest {
private void runInDialogWithPartioner(Object input, Runnable runnable, final CompareConfiguration cc) throws Exception {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
Dialog dialog = new Dialog(shell) {
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
viewer = new TestMergeViewerWithPartitioner(composite, cc);
@@ -484,34 +507,42 @@ public class TextMergeViewerTest {
//This viewer is used to provide a dummy partitioner
public static class TestMergeViewerWithPartitioner extends TestMergeViewer {
public class DummyPartitioner implements IDocumentPartitioner {
+ @Override
public void connect(IDocument document) {
//Nothing to do
}
+ @Override
public void disconnect() {
//Nothing to do
}
+ @Override
public void documentAboutToBeChanged(DocumentEvent event) {
//Nothing to do
}
+ @Override
public boolean documentChanged(DocumentEvent event) {
return false;
}
+ @Override
public String[] getLegalContentTypes() {
return null;
}
+ @Override
public String getContentType(int offset) {
return null;
}
+ @Override
public ITypedRegion[] computePartitioning(int offset, int length) {
return null;
}
+ @Override
public ITypedRegion getPartition(int offset) {
return null;
}
@@ -525,9 +556,11 @@ public class TextMergeViewerTest {
super(parent, cc);
}
+ @Override
public void copy(boolean leftToRight) {
super.copy(leftToRight);
}
+ @Override
protected IDocumentPartitioner getDocumentPartitioner() {
return new DummyPartitioner();
}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/WorkspaceTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/WorkspaceTest.java
index 8b5f16e11..febf0aa3a 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/WorkspaceTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/WorkspaceTest.java
@@ -87,7 +87,7 @@ public class WorkspaceTest extends ResourceTest {
/**
* Creates filesystem 'resources' with the given names and fills them with random text.
* @param container An object that can hold the newly created resources.
- * @param hierarchy A list of files & folder names to use as resources
+ * @param hierarchy A list of files &amp; folder names to use as resources
* @param includeContainer A flag that controls whether the container is included in the list of resources.
* @return IResource[] An array of resources filled with variable amounts of random text
* @throws CoreException
diff --git a/tests/org.eclipse.core.tests.net/.classpath b/tests/org.eclipse.core.tests.net/.classpath
index eca7bdba8..a42a828e0 100644
--- a/tests/org.eclipse.core.tests.net/.classpath
+++ b/tests/org.eclipse.core.tests.net/.classpath
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/tests/org.eclipse.core.tests.net/.cvsignore b/tests/org.eclipse.core.tests.net/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/tests/org.eclipse.core.tests.net/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/tests/org.eclipse.core.tests.net/.project b/tests/org.eclipse.core.tests.net/.project
index 1b93d51e2..bb53ef766 100644
--- a/tests/org.eclipse.core.tests.net/.project
+++ b/tests/org.eclipse.core.tests.net/.project
@@ -20,15 +20,9 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/tests/org.eclipse.core.tests.net/.settings/org.eclipse.core.runtime.prefs b/tests/org.eclipse.core.tests.net/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/tests/org.eclipse.core.tests.net/.settings/org.eclipse.core.runtime.prefs
+++ b/tests/org.eclipse.core.tests.net/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/tests/org.eclipse.core.tests.net/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.core.tests.net/.settings/org.eclipse.jdt.core.prefs
index 7488e48df..e0f086235 100644
--- a/tests/org.eclipse.core.tests.net/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/org.eclipse.core.tests.net/.settings/org.eclipse.jdt.core.prefs
@@ -9,9 +9,9 @@ org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -24,6 +24,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
@@ -48,6 +49,7 @@ org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
@@ -69,6 +71,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/tests/org.eclipse.core.tests.net/META-INF/MANIFEST.MF b/tests/org.eclipse.core.tests.net/META-INF/MANIFEST.MF
index 5e8222883..86da25701 100644
--- a/tests/org.eclipse.core.tests.net/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.core.tests.net/META-INF/MANIFEST.MF
@@ -2,14 +2,13 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Net Tests Plug-in
Bundle-SymbolicName: org.eclipse.core.tests.net
-Bundle-Version: 1.4.400.qualifier
-Bundle-Activator: org.eclipse.core.tests.net.Activator
+Bundle-Version: 1.5.0.qualifier
Bundle-Vendor: Eclipse.org
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
org.eclipse.core.net;bundle-version="[1.0.0,2.0.0)",
org.junit
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Eclipse-BundleShape: dir
Export-Package: org.eclipse.core.tests.net
Automatic-Module-Name: org.eclipse.core.tests.net
diff --git a/tests/org.eclipse.core.tests.net/pom.xml b/tests/org.eclipse.core.tests.net/pom.xml
index 050926337..3d2f9a2e9 100644
--- a/tests/org.eclipse.core.tests.net/pom.xml
+++ b/tests/org.eclipse.core.tests.net/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team.tests</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.tests.net</artifactId>
- <version>1.4.400-SNAPSHOT</version>
+ <version>1.5.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/Activator.java b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/Activator.java
index 34028c072..dd3476149 100644
--- a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/Activator.java
+++ b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/Activator.java
@@ -14,50 +14,18 @@
package org.eclipse.core.tests.net;
import org.eclipse.core.net.proxy.IProxyService;
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
+import org.osgi.framework.*;
/**
* The activator class controls the plug-in life cycle
*/
-public class Activator extends Plugin {
+public class Activator {
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.net.tests";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- public IProxyService getProxyService() {
- ServiceReference<IProxyService> serviceReference = getBundle().getBundleContext().getServiceReference(IProxyService.class);
+ public static IProxyService getProxyService() {
+ Bundle bundle = FrameworkUtil.getBundle(Activator.class);
+ ServiceReference<IProxyService> serviceReference = bundle.getBundleContext().getServiceReference(IProxyService.class);
if (serviceReference != null)
- return getBundle().getBundleContext().getService(serviceReference);
+ return bundle.getBundleContext().getService(serviceReference);
return null;
}
diff --git a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/AllNetTests.java b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/AllNetTests.java
index 65a5f3e82..ec48f311b 100644
--- a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/AllNetTests.java
+++ b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/AllNetTests.java
@@ -16,10 +16,8 @@ package org.eclipse.core.tests.net;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
-import junit.framework.*;
-
@RunWith(Suite.class)
@Suite.SuiteClasses({ NetTest.class, PreferenceModifyListenerTest.class })
-public class AllNetTests extends TestCase {
+public class AllNetTests {
}
diff --git a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java
index 734b4ab4c..3abeba254 100644
--- a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java
+++ b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java
@@ -61,7 +61,7 @@ public class NetTest {
}
private IProxyService getProxyManager() {
- return Activator.getDefault().getProxyService();
+ return Activator.getProxyService();
}
private void assertProxyDataEqual(IProxyData expected) {
diff --git a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/SystemProxyTest.java b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/SystemProxyTest.java
index 918fee7b0..3376dd264 100644
--- a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/SystemProxyTest.java
+++ b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/SystemProxyTest.java
@@ -13,49 +13,38 @@
*******************************************************************************/
package org.eclipse.core.tests.net;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.internal.net.ProxyData;
import org.eclipse.core.internal.net.ProxySelector;
import org.eclipse.core.net.proxy.IProxyData;
import org.eclipse.core.net.proxy.IProxyService;
+import org.junit.*;
-public class SystemProxyTest extends TestCase {
+public class SystemProxyTest {
private boolean isProxiesDefault;
private boolean isSystemProxiesDefault;
private Map<String, IProxyData> proxyDataMap = new HashMap<>();
- public SystemProxyTest() {
- super();
- }
-
- public SystemProxyTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return new TestSuite(SystemProxyTest.class);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() throws Exception {
isSystemProxiesDefault = isSystemProxiesEnabled();
setSystemProxiesEnabled(true);
isProxiesDefault = isProxiesEnabled();
setProxiesEnabled(true);
}
- protected void tearDown() throws Exception {
- super.tearDown();
+ @After
+ public void tearDown() throws Exception {
setProxiesEnabled(isProxiesDefault);
setSystemProxiesEnabled(isSystemProxiesDefault);
IProxyData[] data = getProxyManager().getProxyData();
@@ -66,7 +55,7 @@ public class SystemProxyTest extends TestCase {
}
private IProxyService getProxyManager() {
- return Activator.getDefault().getProxyService();
+ return Activator.getProxyService();
}
private boolean isProxiesEnabled() {
@@ -79,8 +68,7 @@ public class SystemProxyTest extends TestCase {
private void setProxiesEnabled(boolean enabled) {
this.getProxyManager().setProxiesEnabled(enabled);
- if (enabled && this.getProxyManager().isSystemProxiesEnabled()
- && !this.getProxyManager().hasSystemProxies()) {
+ if (enabled && this.getProxyManager().isSystemProxiesEnabled() && !this.getProxyManager().hasSystemProxies()) {
assertEquals(false, this.getProxyManager().isProxiesEnabled());
} else {
assertEquals(enabled, this.getProxyManager().isProxiesEnabled());
@@ -100,8 +88,7 @@ public class SystemProxyTest extends TestCase {
assertEquals(expectedData.getPort(), data.getPort());
assertEquals(expectedData.getUserId(), data.getUserId());
assertEquals(expectedData.getPassword(), data.getPassword());
- assertEquals(expectedData.isRequiresAuthentication(), data
- .isRequiresAuthentication());
+ assertEquals(expectedData.isRequiresAuthentication(), data.isRequiresAuthentication());
assertEquals(expectedData.getSource(), data.getSource());
}
@@ -139,36 +126,40 @@ public class SystemProxyTest extends TestCase {
}
/**
- * This test needs system env set. See {@link #initializeTestProxyData()}
- * for values.
+ * This test needs system env set. See {@link #initializeTestProxyData()} for
+ * values.
*/
+ @Test
public void testGetProxyDataForHost_LinuxEnvSettings() {
initializeTestProxyData("LINUX_ENV");
checkGetProxyDataForHost();
}
/**
- * This test needs system env set. See {@link #initializeTestProxyData()}
- * for values.
+ * This test needs system env set. See {@link #initializeTestProxyData()} for
+ * values.
*/
+ @Test
public void testProxySelector_LinuxEnvSettings() {
initializeTestProxyData("LINUX_ENV");
checkProxySelector();
}
/**
- * This test needs Gnome settings set. See
- * {@link #initializeTestProxyData()} for values.
+ * This test needs Gnome settings set. See {@link #initializeTestProxyData()}
+ * for values.
*/
+ @Test
public void testGetProxyDataForHost_LinuxGnomeSettings() {
initializeTestProxyData("LINUX_GNOME");
checkGetProxyDataForHost();
}
/**
- * This test needs Gnome settings set. See
- * {@link #initializeTestProxyData()} for values.
+ * This test needs Gnome settings set. See {@link #initializeTestProxyData()}
+ * for values.
*/
+ @Test
public void testProxySelector_LinuxGnomeSettings() {
initializeTestProxyData("LINUX_GNOME");
checkProxySelector();
@@ -178,6 +169,7 @@ public class SystemProxyTest extends TestCase {
* This test needs Windows IE settings manually set. See
* {@link #initializeTestProxyData()} for values.
*/
+ @Test
public void testGetProxyDataForHost_WindowsIEManualSettings() {
initializeTestProxyData("WINDOWS_IE");
checkGetProxyDataForHost();
@@ -187,6 +179,7 @@ public class SystemProxyTest extends TestCase {
* This test needs Windows IE settings manually set. See
* {@link #initializeTestProxyData()} for values.
*/
+ @Test
public void testProxySelector_WindowsIEManualSettings() {
initializeTestProxyData("WINDOWS_IE");
checkProxySelector();
@@ -195,47 +188,38 @@ public class SystemProxyTest extends TestCase {
/**
* This test needs Windows IE settings manually set. See
* {@link #initializeTestProxyData()} for values. Additionally set
- * <code>"eclipse.*;nonexisting.com;*.eclipse.org;www.*.com;*.test.*"</code>
- * as proxy bypass in the IE settings.
+ * <code>"eclipse.*;nonexisting.com;*.eclipse.org;www.*.com;*.test.*"</code> as
+ * proxy bypass in the IE settings.
*
* @throws URISyntaxException
*/
- public void testNonProxiedHosts_WindowsIEManualSettings()
- throws URISyntaxException {
- IProxyData[] proxiesData = getProxyManager().select(
- new URI("http://eclipse"));
+ @Test
+ public void testNonProxiedHosts_WindowsIEManualSettings() throws URISyntaxException {
+ IProxyData[] proxiesData = getProxyManager().select(new URI("http://eclipse"));
assertEquals(1, proxiesData.length);
- proxiesData = getProxyManager().select(
- new URI("http://eclipse.org/bugs"));
+ proxiesData = getProxyManager().select(new URI("http://eclipse.org/bugs"));
assertEquals(0, proxiesData.length);
- proxiesData = getProxyManager().select(
- new URI("http://nonexisting.com"));
+ proxiesData = getProxyManager().select(new URI("http://nonexisting.com"));
assertEquals(0, proxiesData.length);
- proxiesData = getProxyManager().select(
- new URI("http://www.eclipse.org"));
+ proxiesData = getProxyManager().select(new URI("http://www.eclipse.org"));
assertEquals(0, proxiesData.length);
- proxiesData = getProxyManager().select(
- new URI("http://www.myDomain.com"));
+ proxiesData = getProxyManager().select(new URI("http://www.myDomain.com"));
assertEquals(0, proxiesData.length);
- proxiesData = getProxyManager().select(
- new URI("http://www.test.edu"));
+ proxiesData = getProxyManager().select(new URI("http://www.test.edu"));
assertEquals(0, proxiesData.length);
}
private void initializeTestProxyData(String proxyDataSource) {
- proxyDataMap.put(IProxyData.HTTP_PROXY_TYPE, new ProxyData(
- IProxyData.HTTP_PROXY_TYPE, "127.0.0.1", 8081, false,
- proxyDataSource));
- proxyDataMap.put(IProxyData.HTTPS_PROXY_TYPE, new ProxyData(
- IProxyData.HTTPS_PROXY_TYPE, "127.0.0.2", 8082, false,
- proxyDataSource));
- proxyDataMap.put(IProxyData.SOCKS_PROXY_TYPE, new ProxyData(
- IProxyData.SOCKS_PROXY_TYPE, "127.0.0.3", 8083, false,
- proxyDataSource));
+ proxyDataMap.put(IProxyData.HTTP_PROXY_TYPE,
+ new ProxyData(IProxyData.HTTP_PROXY_TYPE, "127.0.0.1", 8081, false, proxyDataSource));
+ proxyDataMap.put(IProxyData.HTTPS_PROXY_TYPE,
+ new ProxyData(IProxyData.HTTPS_PROXY_TYPE, "127.0.0.2", 8082, false, proxyDataSource));
+ proxyDataMap.put(IProxyData.SOCKS_PROXY_TYPE,
+ new ProxyData(IProxyData.SOCKS_PROXY_TYPE, "127.0.0.3", 8083, false, proxyDataSource));
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.jsch.tests/.cvsignore b/tests/org.eclipse.jsch.tests/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/tests/org.eclipse.jsch.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/tests/org.eclipse.jsch.tests/.settings/org.eclipse.core.runtime.prefs b/tests/org.eclipse.jsch.tests/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/tests/org.eclipse.jsch.tests/.settings/org.eclipse.core.runtime.prefs
+++ b/tests/org.eclipse.jsch.tests/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/tests/org.eclipse.jsch.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.jsch.tests/META-INF/MANIFEST.MF
index ec1e9a324..c325e7c5c 100644
--- a/tests/org.eclipse.jsch.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.jsch.tests/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: JSch Tests Plug-in
Bundle-SymbolicName: org.eclipse.jsch.tests
-Bundle-Version: 1.1.300.qualifier
+Bundle-Version: 1.1.600.qualifier
Eclipse-BundleShape: dir
Bundle-Activator: org.eclipse.jsch.tests.Activator
Bundle-Vendor: Eclipse.org
Require-Bundle: org.eclipse.core.runtime
-Eclipse-LazyStart: true
+Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: org.eclipse.jsch.tests
diff --git a/tests/org.eclipse.jsch.tests/pom.xml b/tests/org.eclipse.jsch.tests/pom.xml
index c76b97154..1408762fb 100644
--- a/tests/org.eclipse.jsch.tests/pom.xml
+++ b/tests/org.eclipse.jsch.tests/pom.xml
@@ -14,10 +14,10 @@
<parent>
<artifactId>eclipse.platform.team.tests</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.jsch</groupId>
<artifactId>org.eclipse.jsch.tests</artifactId>
- <version>1.1.300-SNAPSHOT</version>
+ <version>1.1.600-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/tests/org.eclipse.team.tests.core/.classpath b/tests/org.eclipse.team.tests.core/.classpath
index 01836c484..a42a828e0 100644
--- a/tests/org.eclipse.team.tests.core/.classpath
+++ b/tests/org.eclipse.team.tests.core/.classpath
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/tests/org.eclipse.team.tests.core/.cvsignore b/tests/org.eclipse.team.tests.core/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/tests/org.eclipse.team.tests.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/tests/org.eclipse.team.tests.core/.settings/org.eclipse.core.runtime.prefs b/tests/org.eclipse.team.tests.core/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/tests/org.eclipse.team.tests.core/.settings/org.eclipse.core.runtime.prefs
+++ b/tests/org.eclipse.team.tests.core/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/tests/org.eclipse.team.tests.core/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.team.tests.core/.settings/org.eclipse.jdt.core.prefs
index 43cfc7e19..26b1b8cb5 100644
--- a/tests/org.eclipse.team.tests.core/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/org.eclipse.team.tests.core/.settings/org.eclipse.jdt.core.prefs
@@ -9,9 +9,9 @@ org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -24,6 +24,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -44,6 +45,7 @@ org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
@@ -65,6 +67,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF b/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF
index cac91353b..55568ad8d 100644
--- a/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.tests.core; singleton:=true
-Bundle-Version: 3.8.600.qualifier
+Bundle-Version: 3.9.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.team.tests.core,
@@ -19,9 +19,7 @@ Require-Bundle: org.eclipse.ui.ide;resolution:=optional,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.team.core,
- org.eclipse.team.cvs.core,
org.eclipse.team.ui,
- org.eclipse.team.cvs.ui,
org.eclipse.compare,
org.eclipse.ui,
org.junit,
@@ -31,5 +29,5 @@ Require-Bundle: org.eclipse.ui.ide;resolution:=optional,
org.eclipse.compare.tests
Bundle-ActivationPolicy: lazy
Eclipse-BundleShape: dir
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.team.tests.core
diff --git a/tests/org.eclipse.team.tests.core/pom.xml b/tests/org.eclipse.team.tests.core/pom.xml
index c17238c39..744cf00bd 100644
--- a/tests/org.eclipse.team.tests.core/pom.xml
+++ b/tests/org.eclipse.team.tests.core/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team.tests</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.tests.core</artifactId>
- <version>3.8.600-SNAPSHOT</version>
+ <version>3.9.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderBic.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderBic.java
index d1efd473f..aecb6d78f 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderBic.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderBic.java
@@ -25,19 +25,24 @@ public class RepositoryProviderBic extends RepositoryProvider {
private IMoveDeleteHook mdh;
private IFileModificationValidator mv;
+ @Override
public void configureProject() throws CoreException {
}
+ @Override
public String getID() {
return NATURE_ID;
}
+ @Override
public void deconfigure() throws CoreException {
}
+ @Override
public IFileModificationValidator getFileModificationValidator() {
return mv;
}
+ @Override
public IMoveDeleteHook getMoveDeleteHook() {
return mdh;
}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderNaish.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderNaish.java
index baf35a567..03c4f35ad 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderNaish.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderNaish.java
@@ -23,12 +23,15 @@ public class RepositoryProviderNaish extends RepositoryProvider {
final public static String NATURE_ID = "org.eclipse.team.tests.core.naish-provider";
private IMoveDeleteHook mdh;
private IFileModificationValidator mv;
+ @Override
public void configureProject() throws CoreException {
}
+ @Override
public String getID() {
return NATURE_ID;
}
+ @Override
public void deconfigure() throws CoreException {
}
@@ -39,10 +42,12 @@ public class RepositoryProviderNaish extends RepositoryProvider {
public void setMoveDeleteHook(IMoveDeleteHook mdh) {
this.mdh = mdh;
}
+ @Override
public IFileModificationValidator getFileModificationValidator() {
return mv;
}
+ @Override
public IMoveDeleteHook getMoveDeleteHook() {
return mdh;
}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderOtherSport.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderOtherSport.java
index d0b0b1dd5..025373fca 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderOtherSport.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderOtherSport.java
@@ -20,13 +20,16 @@ public class RepositoryProviderOtherSport extends RepositoryProvider {
final public static String NATURE_ID = "org.eclipse.team.tests.core.other";
+ @Override
public void configureProject() throws CoreException {
}
+ @Override
public String getID() {
return NATURE_ID;
}
+ @Override
public void deconfigure() throws CoreException {
}
}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTests.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTests.java
index 8ef4d6e90..1b9b39a4d 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTests.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTests.java
@@ -142,9 +142,11 @@ public class RepositoryProviderTests extends TeamTest {
final boolean[] called = new boolean[] {false};
bicProvider.setModificationValidator(new FileModificationValidator() {
// can't test validate edit here because it is only called from editors
+ @Override
public IStatus validateEdit(IFile[] files, FileModificationValidationContext context) {
return null;
}
+ @Override
public IStatus validateSave(IFile file) {
called[0] = true;
return getTeamTestStatus(IStatus.OK);
@@ -159,9 +161,11 @@ public class RepositoryProviderTests extends TeamTest {
called[0] = false;
bicProvider.setModificationValidator(new FileModificationValidator() {
// can't test validate edit here because it is only called from editors
+ @Override
public IStatus validateEdit(IFile[] files, FileModificationValidationContext context) {
return null;
}
+ @Override
public IStatus validateSave(IFile file) {
called[0] = true;
return getTeamTestStatus(IStatus.ERROR);
@@ -190,26 +194,32 @@ public class RepositoryProviderTests extends TeamTest {
// only testing that dispatching works, resources plugin is testing the rest of the API
final boolean[] called = new boolean[] {false, false, false, false, false, false};
IMoveDeleteHook hook = new IMoveDeleteHook() {
+ @Override
public boolean deleteFile(IResourceTree tree, IFile file, int updateFlags, IProgressMonitor monitor) {
called[0] = true;
return false;
}
+ @Override
public boolean deleteFolder(IResourceTree tree, IFolder folder, int updateFlags, IProgressMonitor monitor) {
called[1] = true;
return false;
}
+ @Override
public boolean deleteProject(IResourceTree tree, IProject project, int updateFlags, IProgressMonitor monitor) {
called[2] = true;
return false;
}
+ @Override
public boolean moveFile(IResourceTree tree, IFile source, IFile destination, int updateFlags, IProgressMonitor monitor) {
called[3] = true;
return false;
}
+ @Override
public boolean moveFolder(IResourceTree tree, IFolder source, IFolder destination, int updateFlags, IProgressMonitor monitor) {
called[4] = true;
return false;
}
+ @Override
public boolean moveProject(IResourceTree tree, IProject source, IProjectDescription description, int updateFlags, IProgressMonitor monitor) {
called[5] = true;
return false;
@@ -251,25 +261,31 @@ public class RepositoryProviderTests extends TeamTest {
// only testing that dispatching works, resources plugin is testing the rest of the API
final boolean[] calledProjectA = new boolean[] {false, false};
bicProvider.setMoveDeleteHook(new IMoveDeleteHook() {
+ @Override
public boolean deleteFile(IResourceTree tree, IFile file, int updateFlags, IProgressMonitor monitor) {
return false;
}
+ @Override
public boolean deleteFolder(IResourceTree tree, IFolder folder, int updateFlags, IProgressMonitor monitor) {
return false;
}
+ @Override
public boolean deleteProject(IResourceTree tree, IProject project, int updateFlags, IProgressMonitor monitor) {
return false;
}
+ @Override
public boolean moveFile(IResourceTree tree, IFile source, IFile destination, int updateFlags, IProgressMonitor monitor) {
Assert.assertTrue(bicProvider.getProject().equals(source.getProject()));
calledProjectA[0] = true;
return false;
}
+ @Override
public boolean moveFolder(IResourceTree tree, IFolder source, IFolder destination, int updateFlags, IProgressMonitor monitor) {
Assert.assertTrue(bicProvider.getProject().equals(source.getProject()));
calledProjectA[1] = true;
return false;
}
+ @Override
public boolean moveProject(IResourceTree tree, IProject source, IProjectDescription description, int updateFlags, IProgressMonitor monitor) {
return false;
}
@@ -277,25 +293,31 @@ public class RepositoryProviderTests extends TeamTest {
final boolean[] calledProjectB = new boolean[] {false, false};
naishProvider.setMoveDeleteHook(new IMoveDeleteHook() {
+ @Override
public boolean deleteFile(IResourceTree tree, IFile file, int updateFlags, IProgressMonitor monitor) {
return false;
}
+ @Override
public boolean deleteFolder(IResourceTree tree, IFolder folder, int updateFlags, IProgressMonitor monitor) {
return false;
}
+ @Override
public boolean deleteProject(IResourceTree tree, IProject project, int updateFlags, IProgressMonitor monitor) {
return false;
}
+ @Override
public boolean moveFile(IResourceTree tree, IFile source, IFile destination, int updateFlags, IProgressMonitor monitor) {
Assert.assertTrue(bicProvider.getProject().equals(destination.getProject()));
calledProjectB[0] = true;
return false;
}
+ @Override
public boolean moveFolder(IResourceTree tree, IFolder source, IFolder destination, int updateFlags, IProgressMonitor monitor) {
Assert.assertTrue(bicProvider.getProject().equals(destination.getProject()));
calledProjectB[1] = true;
return false;
}
+ @Override
public boolean moveProject(IResourceTree tree, IProject source, IProjectDescription description, int updateFlags, IProgressMonitor monitor) {
return false;
}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTypeBic.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTypeBic.java
index 27475f496..d00850ed5 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTypeBic.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTypeBic.java
@@ -22,14 +22,17 @@ import org.eclipse.team.core.*;
public class RepositoryProviderTypeBic extends RepositoryProviderType {
File createdFile;
+ @Override
public ProjectSetCapability getProjectSetCapability() {
return new ProjectSetCapability() {
+ @Override
public IProject[] addToWorkspace(String[] referenceStrings,
ProjectSetSerializationContext context,
IProgressMonitor monitor) throws TeamException {
return new IProject[0];
}
+ @Override
public void projectSetCreated(File file,
ProjectSetSerializationContext context,
IProgressMonitor monitor) {
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TestStorageMerger.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TestStorageMerger.java
index 825985032..fa4361e3d 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TestStorageMerger.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TestStorageMerger.java
@@ -23,10 +23,12 @@ public class TestStorageMerger implements IStorageMerger {
public static final String MERGE_FAILURE = "merge failed";
+ @Override
public boolean canMergeWithoutAncestor() {
return false;
}
+ @Override
public IStatus merge(OutputStream output, String outputEncoding,
IStorage ancestor, IStorage target, IStorage other,
IProgressMonitor monitor) throws CoreException {
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java
index 6f4b6fd6e..bedb03377 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java
@@ -36,6 +36,7 @@ public class ScopeBuildingTests extends TeamTest {
protected TestResourceMappingOperation(ResourceMapping[] selectedMappings, final ResourceMapping[] additionalMappings) {
super(null, new SynchronizationScopeManager("", selectedMappings, ResourceMappingContext.LOCAL_CONTEXT, false) {
+ @Override
public void initialize(
IProgressMonitor monitor) throws CoreException {
super.initialize(monitor);
@@ -49,12 +50,14 @@ public class ScopeBuildingTests extends TeamTest {
}
});
}
+ @Override
protected void endOperation(IProgressMonitor monitor) throws InvocationTargetException {
ISynchronizationScopeManager manager= getScopeManager();
manager.dispose();
super.endOperation(monitor);
}
+ @Override
protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
// Do nothing since we're just testing the scope build
}
@@ -90,22 +93,27 @@ public class ScopeBuildingTests extends TeamTest {
private ResourceMapping getMapping(final IProject project, final IResource[] resources, final int depth) {
return new ResourceMapping() {
+ @Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context,
IProgressMonitor monitor) throws CoreException {
return new ResourceTraversal[] { new ResourceTraversal(resources, depth, IResource.NONE)};
}
+ @Override
public IProject[] getProjects() {
return new IProject[] { project };
}
+ @Override
public Object getModelObject() {
return new Object();
}
+ @Override
public String getModelProviderId() {
return TEST_MODEL_PROVIDER_ID;
}
+ @Override
public boolean contains(ResourceMapping mapping) {
return false;
}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTestSubscriber.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTestSubscriber.java
index f4437faa8..1d1cced67 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTestSubscriber.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTestSubscriber.java
@@ -24,18 +24,23 @@ import org.eclipse.team.core.variants.IResourceVariantComparator;
public class ScopeTestSubscriber extends Subscriber {
+ @Override
public String getName() {
return "Scope Tests";
}
+ @Override
public IResourceVariantComparator getResourceComparator() {
return new IResourceVariantComparator() {
+ @Override
public boolean isThreeWay() {
return false;
}
+ @Override
public boolean compare(IResourceVariant base, IResourceVariant remote) {
return false;
}
+ @Override
public boolean compare(IResource local, IResourceVariant remote) {
return false;
}
@@ -43,14 +48,17 @@ public class ScopeTestSubscriber extends Subscriber {
};
}
+ @Override
public SyncInfo getSyncInfo(IResource resource) throws TeamException {
return null;
}
+ @Override
public boolean isSupervised(IResource resource) throws TeamException {
return false;
}
+ @Override
public IResource[] members(IResource resource) throws TeamException {
if (resource instanceof IContainer) {
IContainer c = (IContainer) resource;
@@ -63,11 +71,13 @@ public class ScopeTestSubscriber extends Subscriber {
return new IResource[0];
}
+ @Override
public void refresh(IResource[] resources, int depth,
IProgressMonitor monitor) throws TeamException {
// Nothing to do
}
+ @Override
public IResource[] roots() {
return ResourcesPlugin.getWorkspace().getRoot().getProjects();
}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTests.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTests.java
index 7db0fd74a..d8dcdb42d 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTests.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeTests.java
@@ -42,6 +42,7 @@ public class ScopeTests extends TeamTest {
super(name);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
project1 = createProject("p1", new String[]{"file.txt"});
@@ -52,6 +53,7 @@ public class ScopeTests extends TeamTest {
manager.addWorkingSet(workingSet);
}
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
this.manager.dispose();
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/DoNotRemoveTest.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/DoNotRemoveTest.java
index 6e115af3f..73fa10c98 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/DoNotRemoveTest.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/DoNotRemoveTest.java
@@ -38,8 +38,7 @@ public class DoNotRemoveTest extends TeamTest {
*/
public void test_Utils_updateLabels() {
try {
- Method method = Utils.class.getMethod("updateLabels", new Class[] {
- SyncInfo.class, CompareConfiguration.class });
+ Method method = Utils.class.getMethod("updateLabels", SyncInfo.class, CompareConfiguration.class);
assertEquals(Modifier.STATIC | Modifier.PUBLIC,
method.getModifiers());
assertEquals(Void.TYPE, method.getReturnType());
@@ -56,9 +55,7 @@ public class DoNotRemoveTest extends TeamTest {
*/
public void testBug312217() {
try {
- Method method = CompareRevisionAction.class.getMethod(
- "findReusableCompareEditor",
- new Class[] { IWorkbenchPage.class });
+ Method method = CompareRevisionAction.class.getMethod("findReusableCompareEditor", IWorkbenchPage.class);
assertEquals(Modifier.STATIC | Modifier.PUBLIC,
method.getModifiers());
assertEquals(IEditorPart.class, method.getReturnType());
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java
index c2ebc1646..83a38200e 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java
@@ -37,22 +37,28 @@ public class PessimisticRepositoryProvider extends RepositoryProvider implements
soleInstance = this;
}
+ @Override
public void configureProject() {
}
+ @Override
public String getID() {
return NATURE_ID;
}
+ @Override
public void deconfigure() {
}
+ @Override
public boolean canHandleLinkedResourceURI() {
return true;
}
+ @Override
public IFileModificationValidator getFileModificationValidator() {
return soleInstance;
}
+ @Override
public IStatus validateEdit(final IFile[] files, Object context) {
if (markWritableOnEdit) {
try {
@@ -75,6 +81,7 @@ public class PessimisticRepositoryProvider extends RepositoryProvider implements
return Status.OK_STATUS;
}
+ @Override
public IStatus validateSave(IFile file) {
if (markWritableOnSave) {
try {
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java
index 265450dde..1ba334c9d 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java
@@ -68,6 +68,7 @@ public class SaveableCompareEditorInputTest extends TeamTest {
private TestLogListener logListener = new TestLogListener();
private IProject project;
+ @Override
protected void setUp() throws Exception {
super.setUp();
@@ -84,6 +85,7 @@ public class SaveableCompareEditorInputTest extends TeamTest {
RuntimeLog.addLogListener(logListener);
}
+ @Override
protected void tearDown() throws Exception {
// remove log listener
RuntimeLog.removeLogListener(logListener);
@@ -103,20 +105,24 @@ public class SaveableCompareEditorInputTest extends TeamTest {
this.file = file;
}
+ @Override
public String getName() {
return file.getName();
}
+ @Override
public Image getImage() {
return null;
}
+ @Override
public String getType() {
return TEXT_TYPE;
}
}
private class TestLogListener implements ILogListener {
+ @Override
public void logging(IStatus status, String plugin) {
if (status.getSeverity() == IStatus.ERROR)
fail(status.toString());
@@ -137,6 +143,7 @@ public class SaveableCompareEditorInputTest extends TeamTest {
return null;
}
+ @Override
protected IResource[] getResources(ICompareInput input) {
List resources = new ArrayList();
@@ -154,19 +161,23 @@ public class SaveableCompareEditorInputTest extends TeamTest {
super(Differencer.CHANGE, null, left, right);
}
+ @Override
public void fireChange() {
super.fireChange();
}
+ @Override
protected CompareInputChangeNotifier getChangeNotifier() {
return notifier;
}
+ @Override
public boolean needsUpdate() {
// The remote never changes
return false;
}
+ @Override
public void update() {
fireChange();
}
@@ -178,6 +189,7 @@ public class SaveableCompareEditorInputTest extends TeamTest {
protected ITypedElement right;
private ICompareInput input;
+ @Override
public Object getCompareResult() {
return input;
}
@@ -190,6 +202,7 @@ public class SaveableCompareEditorInputTest extends TeamTest {
this.right = right;
}
+ @Override
protected ICompareInput prepareCompareInput(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
input = createCompareInput();
@@ -202,6 +215,7 @@ public class SaveableCompareEditorInputTest extends TeamTest {
return new TestDiffNode(left, right);
}
+ @Override
protected void fireInputChange() {
((TestDiffNode) getCompareResult()).fireChange();
}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java
index b37d930a9..aa74bb8e5 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java
@@ -47,14 +47,17 @@ public class ResourceContentTests extends TeamTest {
this.configuration = configuration;
}
+ @Override
public ISynchronizePageConfiguration getConfiguration() {
return configuration;
}
+ @Override
public ISynchronizationContext getContext() {
return context;
}
+ @Override
public ISynchronizationScope getScope() {
return scope;
}
@@ -74,11 +77,13 @@ public class ResourceContentTests extends TeamTest {
super(name);
}
+ @Override
protected void setUp() throws Exception {
initializeProvider(null, null, null);
super.setUp();
}
+ @Override
protected void tearDown() throws Exception {
cleanupProvider();
super.tearDown();
diff --git a/tests/org.eclipse.team.tests.cvs.core/.classpath b/tests/org.eclipse.team.tests.cvs.core/.classpath
index eca7bdba8..a42a828e0 100644
--- a/tests/org.eclipse.team.tests.cvs.core/.classpath
+++ b/tests/org.eclipse.team.tests.cvs.core/.classpath
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/tests/org.eclipse.team.tests.cvs.core/.cvsignore b/tests/org.eclipse.team.tests.cvs.core/.cvsignore
deleted file mode 100644
index 77c5177b2..000000000
--- a/tests/org.eclipse.team.tests.cvs.core/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-selfhost*
-cvsSniff*.zip
diff --git a/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.core.runtime.prefs b/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.core.runtime.prefs
index c522e1f4a..5a0ad22d2 100644
--- a/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.core.runtime.prefs
+++ b/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.core.runtime.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs
index 7155a0d00..d7b496395 100644
--- a/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,133 +1,135 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.APILeak=warning
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
-org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
-org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
-org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF b/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF
index 37d2a841f..9a5ce4a6b 100644
--- a/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.tests.cvs.core; singleton:=true
-Bundle-Version: 3.4.700.qualifier
+Bundle-Version: 3.5.0.qualifier
Bundle-Activator: org.eclipse.team.tests.ccvs.core.TeamCVSTestPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -41,6 +41,6 @@ Require-Bundle: org.eclipse.ui.ide;resolution:=optional,
Bundle-ActivationPolicy: lazy
Eclipse-AutoStart: true
Plugin-Class: org.eclipse.team.tests.ccvs.core.TeamCVSTestPlugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-11
Eclipse-BundleShape: dir
Automatic-Module-Name: org.eclipse.team.tests.cvs.core
diff --git a/tests/org.eclipse.team.tests.cvs.core/benchmark/cvsui_benchmark.bat b/tests/org.eclipse.team.tests.cvs.core/benchmark/cvsui_benchmark.bat
index 3bc2ef092..81dd30bdf 100644
--- a/tests/org.eclipse.team.tests.cvs.core/benchmark/cvsui_benchmark.bat
+++ b/tests/org.eclipse.team.tests.cvs.core/benchmark/cvsui_benchmark.bat
@@ -1,55 +1,55 @@
-@rem ***************************************************************************
-@rem Copyright (c) 2002, 2011 IBM Corporation and others.
+@rem ***************************************************************************
+@rem Copyright (c) 2002, 2011 IBM Corporation and others.
m
-m This program and the accompanying materials
-@rem are made available under the terms of the Eclipse Public License 2.0
-@rem which accompanies this distribution, and is available at
+m This program and the accompanying materials
+@rem are made available under the terms of the Eclipse Public License 2.0
+@rem which accompanies this distribution, and is available at
m https://www.eclipse.org/legal/epl-2.0/
m
-m SPDX-License-Identifier: EPL-2.0
-@rem
-@rem Contributors:
-@rem IBM Corporation - initial API and implementation
-@rem ***************************************************************************
-@echo off
-rem Team UI benchmark script
-rem Expects the following plugins to be installed:
-rem org.eclipse.core.tests.harness
-rem org.eclipse.team.core
-rem org.eclipse.team.cvs.core
-rem org.eclipse.team.cvs.ui
-rem org.eclipse.team.tests.cvs
-rem org.eclipse.team.tests.cvs.core
-rem org.eclipse.team.ui
-rem org.junit
-
-set ROOT=D:\PerformanceTesting
-
-set ECLIPSE=%ROOT%\eclipse
-set REPOSITORY_PROPERTIES=%ROOT%\repository.properties
-
-rem set TEST=cvsui.benchmark.all
-rem set REPEAT=25
-rem set IGNOREFIRST=-ignorefirst
-
-set TEST=cvsui.benchmark.command
-set REPEAT=25
-set IGNOREFIRST=-ignorefirst
-
-set LOG=%ROOT%\%TEST%.xml
-set WORKSPACE=%ECLIPSE%\workspace
-set JRE=%ROOT%\jre
-set JAVA=%JRE%\bin\java.exe
-set HARNESS=org.eclipse.team.tests.cvs.core.harness
-
-set VMARGS=-Declipse.cvs.properties=%REPOSITORY_PROPERTIES%
-set PROGARGS=-dev bin -noupdate -application %HARNESS% -test %TEST% -log %LOG% -purge -repeat %REPEAT% %IGNOREFIRST%
-
-pushd %ECLIPSE%
-echo Purging the workspace: %WORKSPACE%
-del /S /F /Q %WORKSPACE% >NUL:
-@echo on
-@echo Running Team UI benchmark test
-%JAVA% -cp startup.jar %VMARGS% org.eclipse.core.launcher.Main %PROGARGS%
-@echo off
+m SPDX-License-Identifier: EPL-2.0
+@rem
+@rem Contributors:
+@rem IBM Corporation - initial API and implementation
+@rem ***************************************************************************
+@echo off
+rem Team UI benchmark script
+rem Expects the following plugins to be installed:
+rem org.eclipse.core.tests.harness
+rem org.eclipse.team.core
+rem org.eclipse.team.cvs.core
+rem org.eclipse.team.cvs.ui
+rem org.eclipse.team.tests.cvs
+rem org.eclipse.team.tests.cvs.core
+rem org.eclipse.team.ui
+rem org.junit
+
+set ROOT=D:\PerformanceTesting
+
+set ECLIPSE=%ROOT%\eclipse
+set REPOSITORY_PROPERTIES=%ROOT%\repository.properties
+
+rem set TEST=cvsui.benchmark.all
+rem set REPEAT=25
+rem set IGNOREFIRST=-ignorefirst
+
+set TEST=cvsui.benchmark.command
+set REPEAT=25
+set IGNOREFIRST=-ignorefirst
+
+set LOG=%ROOT%\%TEST%.xml
+set WORKSPACE=%ECLIPSE%\workspace
+set JRE=%ROOT%\jre
+set JAVA=%JRE%\bin\java.exe
+set HARNESS=org.eclipse.team.tests.cvs.core.harness
+
+set VMARGS=-Declipse.cvs.properties=%REPOSITORY_PROPERTIES%
+set PROGARGS=-dev bin -noupdate -application %HARNESS% -test %TEST% -log %LOG% -purge -repeat %REPEAT% %IGNOREFIRST%
+
+pushd %ECLIPSE%
+echo Purging the workspace: %WORKSPACE%
+del /S /F /Q %WORKSPACE% >NUL:
+@echo on
+@echo Running Team UI benchmark test
+%JAVA% -cp startup.jar %VMARGS% org.eclipse.core.launcher.Main %PROGARGS%
+@echo off
popd \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/pom.xml b/tests/org.eclipse.team.tests.cvs.core/pom.xml
index a4ddd2801..397b6befd 100644
--- a/tests/org.eclipse.team.tests.cvs.core/pom.xml
+++ b/tests/org.eclipse.team.tests.cvs.core/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.team.tests</artifactId>
<groupId>eclipse.platform.team</groupId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.tests.cvs.core</artifactId>
- <version>3.4.700-SNAPSHOT</version>
+ <version>3.5.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
index bc3180255..1f76a79d0 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
@@ -13,17 +13,30 @@
*******************************************************************************/
package org.eclipse.team.tests.ccvs.core;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.internal.ccvs.core.CVSStatus;
+import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.connection.CVSCommunicationException;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.util.KnownRepositories;
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
public class CVSTestSetup extends TestSetup {
public static final String REPOSITORY_LOCATION;
public static final boolean INITIALIZE_REPO;
@@ -62,18 +75,14 @@ public class CVSTestSetup extends TestSetup {
if (propertiesFile == null) return;
File file = new File(propertiesFile);
if (file.isDirectory()) file = new File(file, "repository.properties");
- try {
- BufferedReader reader = new BufferedReader(new FileReader(file));
- try {
- for (String line; (line = reader.readLine()) != null; ) {
- if (line.startsWith("#")) continue;
- int sep = line.indexOf("=");
- String property = line.substring(0, sep).trim();
- String value = line.substring(sep + 1).trim();
- System.setProperty("eclipse.cvs." + property, value);
- }
- } finally {
- reader.close();
+ try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
+ for (String line; (line = reader.readLine()) != null;) {
+ if (line.startsWith("#"))
+ continue;
+ int sep = line.indexOf("=");
+ String property = line.substring(0, sep).trim();
+ String value = line.substring(sep + 1).trim();
+ System.setProperty("eclipse.cvs." + property, value);
}
} catch (Exception e) {
System.err.println("Could not read repository properties file: " + file.getAbsolutePath());
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseCVSClient.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseCVSClient.java
index 576be08e4..4cfb3d8af 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseCVSClient.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseCVSClient.java
@@ -82,7 +82,7 @@ public class EclipseCVSClient implements ICVSClient {
GlobalOption[] cvsGlobalOptions = globals.toArray(new GlobalOption[globals.size()]);
// get local options
- List<CustomLocalOption> locals = new ArrayList<CustomLocalOption>();
+ List<CustomLocalOption> locals = new ArrayList<>();
for (int i = 0; i < localOptions.length; i++) {
String option = localOptions[i];
String argument = null;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index a6cdf88e1..f427cd319 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -162,7 +162,7 @@ public class EclipseTest extends ResourceTest {
return new CVSTestSetup(suite);
} else {
try {
- return new CVSTestSetup((Test) c.getConstructor(new Class[] { String.class }).newInstance(new Object[] {testName}));
+ return new CVSTestSetup((Test) c.getConstructor(new Class[] { String.class }).newInstance(testName));
} catch (Exception e) {
fail(e.getMessage());
// Above will throw so below is never actually reached
@@ -271,12 +271,9 @@ public class EclipseTest extends ResourceTest {
public static String getFileContents(IFile file) throws IOException, CoreException {
StringBuilder buf = new StringBuilder();
- Reader reader = new InputStreamReader(new BufferedInputStream(file.getContents()));
- try {
+ try (Reader reader = new InputStreamReader(new BufferedInputStream(file.getContents()))) {
int c;
while ((c = reader.read()) != -1) buf.append((char)c);
- } finally {
- reader.close();
}
return buf.toString();
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
index 5e018d788..2cc2d7bbf 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
@@ -144,8 +144,7 @@ public abstract class JUnitTestCase extends TestCase {
protected static void writeToFile(IFile file, String[] contents)
throws IOException, CoreException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
- PrintStream os = new PrintStream(bos);
- try {
+ try (PrintStream os = new PrintStream(bos)) {
for (String content : contents) {
os.println(content);
}
@@ -156,8 +155,6 @@ public abstract class JUnitTestCase extends TestCase {
mkdirs(file.getParent());
file.create(bis, false /*force*/, null);
}
- } finally {
- os.close();
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/TestConnection.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/TestConnection.java
index 862a45934..bcf457daa 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/TestConnection.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/TestConnection.java
@@ -29,7 +29,7 @@ import org.eclipse.team.internal.ccvs.core.connection.CVSAuthenticationException
* @author Administrator
*
* To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
public class TestConnection implements IServerConnection {
public static TestConnection currentConnection;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
index 1d72833ac..fe7aed3c4 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
@@ -369,22 +369,18 @@ public final class SameResultEnv extends JUnitTestCase {
assertEquals(mFile1.isReadOnly(), mFile2.isReadOnly());
// Compare the content of the files
- try {
- InputStream in1 = mFile1.getContents();
- InputStream in2 = mFile2.getContents();
- byte[] buffer1 = new byte[(int)mFile1.getSize()];
- byte[] buffer2 = new byte[(int)mFile2.getSize()];
+ byte[] buffer1 = new byte[(int) mFile1.getSize()];
+ byte[] buffer2 = new byte[(int) mFile2.getSize()];
+ try (InputStream in1 = mFile1.getContents(); InputStream in2 = mFile2.getContents()) {
// This is not the right way to do it, because the Stream
// may read less than the whole file
in1.read(buffer1);
in2.read(buffer2);
- in1.close();
- in2.close();
- assertEquals("Length differs for file " + mFile1.getName(), buffer1.length, buffer2.length);
- assertEquals("Contents differs for file " + mFile1.getName(), new String(buffer1),new String(buffer2));
} catch (IOException e) {
throw new CVSException("Error in TestCase");
}
+ assertEquals("Length differs for file " + mFile1.getName(), buffer1.length, buffer2.length);
+ assertEquals("Contents differs for file " + mFile1.getName(), new String(buffer1),new String(buffer2));
// We can not do the check, because the reference client does
// check out dirty files ?!?
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
index 80cfcf3c1..b3a0b3bd3 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
@@ -82,11 +82,8 @@ public class ModuleTest extends EclipseTest {
waitMsec(1000);
IProject cvsroot = checkoutProject(null, "CVSROOT", null);
- InputStream in = url.openStream();
- try {
+ try (InputStream in = url.openStream()) {
cvsroot.getFile("modules").setContents(in, false, false, DEFAULT_MONITOR);
- } finally {
- in.close();
}
commitProject(cvsroot);
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ResourceDeltaTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ResourceDeltaTest.java
index c4a03dcff..cc44611b9 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ResourceDeltaTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ResourceDeltaTest.java
@@ -156,15 +156,12 @@ public class ResourceDeltaTest extends EclipseTest {
// wait to ensure the timestamp differs from the one Core has
waitMsec(1500);
InputStream in = new BufferedInputStream(getRandomContents());
- OutputStream out = new BufferedOutputStream(new FileOutputStream(ioFile));
- try {
+ try (OutputStream out = new BufferedOutputStream(new FileOutputStream(ioFile))) {
int next = in.read();
while (next != -1) {
out.write(next);
next = in.read();
}
- } finally {
- out.close();
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java
index ddf327f22..89d81974e 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 IBM Corporation and others.
+ * Copyright (c) 2009, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -22,8 +22,6 @@ import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.URL;
-import junit.framework.Test;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -57,6 +55,8 @@ import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
+import junit.framework.Test;
+
public class CreatePatchTest extends EclipseTest {
public static final String PATCHDATA = "patchdata";
@@ -308,8 +308,7 @@ public class CreatePatchTest extends EclipseTest {
try {
return serverResp.readLine();
} catch (IOException e) {
- throw new CVSException(new Status(IStatus.ERROR, null,
- null, e));
+ throw new CVSException(new Status(IStatus.ERROR, CreatePatchTest.class, null, e));
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java
index 464826489..0f36e3861 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java
@@ -248,8 +248,7 @@ public class PatchWizardRadioButtonGroupTests extends TestCase {
.forName("org.eclipse.team.internal.ccvs.ui.wizards.GenerateDiffFileWizard$RadioButtonGroup");
Constructor<?>[] constructors = clazz.getDeclaredConstructors();
constructors[0].setAccessible(true);
- groupObject = constructors[0]
- .newInstance(new Object[] { wizard });
+ groupObject = constructors[0].newInstance(wizard);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
fail(e.getMessage());
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java
index 1012510c3..8e91640bc 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java
@@ -94,10 +94,8 @@ public class ProjectSetImporterTests extends EclipseTest {
IProject project2 = createProject("testImportProject",
new String[] { "file.txt", "folder1/", "folder1/a.txt" });
- PrintWriter out = null;
- try {
- out = new PrintWriter(new BufferedWriter(new FileWriter(PSF_FILE)),
- true);
+ try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(PSF_FILE)),
+ true)) {
out.println(psf_header_0);
out.println(psf_header_1);
@@ -123,9 +121,6 @@ public class ProjectSetImporterTests extends EclipseTest {
fail("1.", e.getCause());
} catch (IOException e) {
fail("2.", e);
- } finally {
- if (out != null)
- out.close();
}
}
@@ -136,11 +131,9 @@ public class ProjectSetImporterTests extends EclipseTest {
IProject project2 = createProject("testBug234149_aFewProviders",
new String[0]);
- // create psf with two providers
- PrintWriter out = null;
- try {
- out = new PrintWriter(new BufferedWriter(new FileWriter(PSF_FILE)),
- true);
+ try ( // create psf with two providers
+ PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(PSF_FILE)),
+ true)) {
// add first provider to psf
out.println(psf_header_0);
@@ -172,9 +165,6 @@ public class ProjectSetImporterTests extends EclipseTest {
fail("1.", e.getCause());
} catch (IOException e) {
fail("2.", e);
- } finally {
- if (out != null)
- out.close();
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkUtils.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkUtils.java
index e86cb12a6..0da269355 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkUtils.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkUtils.java
@@ -156,18 +156,19 @@ public class BenchmarkUtils {
fileSize = (int) Math.abs(gen.nextGaussian() * variance + meanSize);
} while (fileSize > meanSize + variance * 4); // avoid huge files
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- String fileName;
- if (gen.nextInt(100) < probBinary) {
- fileName = makeUniqueName(gen, "file", "class"); // binary
- writeRandomBytes(gen, os, fileSize);
- } else {
- fileName = makeUniqueName(gen, "file", "txt"); // text
- writeRandomText(gen, os, fileSize);
+ IFile file;
+ try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
+ String fileName;
+ if (gen.nextInt(100) < probBinary) {
+ fileName = makeUniqueName(gen, "file", "class"); // binary
+ writeRandomBytes(gen, os, fileSize);
+ } else {
+ fileName = makeUniqueName(gen, "file", "txt"); // text
+ writeRandomText(gen, os, fileSize);
+ }
+ file = parent.getFile(new Path(fileName));
+ file.create(new ByteArrayInputStream(os.toByteArray()), true, new NullProgressMonitor());
}
- IFile file = parent.getFile(new Path(fileName));
- file.create(new ByteArrayInputStream(os.toByteArray()), true, new NullProgressMonitor());
- os.close();
return file;
}
@@ -221,10 +222,7 @@ public class BenchmarkUtils {
*/
public static void modifyFile(SequenceGenerator gen, IFile file)
throws IOException, CoreException {
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- InputStream is = file.getContents(true);
- try {
+ try (ByteArrayOutputStream os = new ByteArrayOutputStream(); InputStream is = file.getContents(true)) {
byte[] buffer = new byte[8192];
int rsize;
boolean changed = false;
@@ -240,11 +238,6 @@ public class BenchmarkUtils {
}
if (! changed) os.write('!'); // make sure we actually did change the file
file.setContents(new ByteArrayInputStream(os.toByteArray()), false /*force*/, true /*keepHistory*/, null);
- } finally {
- is.close();
- }
- } finally {
- os.close();
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java
index 239b09c32..79f82a94c 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java
@@ -93,8 +93,7 @@ public class Bug152581Test extends BenchmarkTest {
private IProject createProject(String filename) throws IOException, CoreException {
File file = BenchmarkTestSetup.getTestFile(filename + ".txt");
- InputStream content = getContents(file, "Could not read seed file " + filename + ".txt");
- try {
+ try (InputStream content = getContents(file, "Could not read seed file " + filename + ".txt")) {
BufferedReader reader = new BufferedReader(new InputStreamReader(content));
IProject project = getUniqueTestProject(filename);
populateProject(reader, project);
@@ -102,8 +101,6 @@ public class Bug152581Test extends BenchmarkTest {
// Perform an update to prune any empty directories
updateProject(project, null, false);
return project;
- } finally {
- content.close();
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/test.xml b/tests/org.eclipse.team.tests.cvs.core/test.xml
index fbd7c6dc6..2ead6abc5 100644
--- a/tests/org.eclipse.team.tests.cvs.core/test.xml
+++ b/tests/org.eclipse.team.tests.cvs.core/test.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2002, 2011 IBM Corporation and others.
+ Copyright (c) 2002, 2020 IBM Corporation and others.
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
@@ -12,6 +12,7 @@
Contributors:
IBM Corporation - initial API and implementation
+ Paul Pazderski - Bug 391014: remove CVS performance tests (required CVS server not available anymore)
-->
<project name="CVS Automated Tests" default="run" basedir=".">
@@ -27,9 +28,6 @@
<property name="org.eclipse.team.tests.cvs.core" value="org.eclipse.team.tests.cvs.core"/>
<property name="team-home" value="${eclipse-home}/plugins/${org.eclipse.team.tests.cvs.core}"/>
<property file="${team-home}/repository.properties"/>
-
- <!-- define the number of times each perfomance test shouldbe run to get an average performance -->
- <property name="performance-loop-count" value="5"/>
<!-- This target holds all initialization code that needs to be done for -->
<!-- all tests that are to be run. Initialization for individual tests -->
@@ -47,44 +45,23 @@
<delete dir="${location}" quiet="true"/>
<!-- Session Test ** CVS Provider ** -->
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <!--ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
<property name="vmargs" value="-Declipse.cvs.properties=${team-home}/repository.properties -Declipse.cvs.recordProtocolTraffic=true"/>
<property name="data-dir" value="${location}"/>
<property name="plugin-name" value="${plugin-name}"/>
<property name="classname" value="org.eclipse.team.tests.ccvs.core.AllCoreTests"/>
- </ant>
+ </ant-->
<!-- Session Test ** CVS Provider ** -->
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <!--ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
<property name="vmargs" value="-Declipse.cvs.properties=${team-home}/repository.properties -Declipse.cvs.recordProtocolTraffic=true"/>
<property name="data-dir" value="${location}"/>
<property name="plugin-name" value="${plugin-name}"/>
<property name="classname" value="org.eclipse.team.tests.ccvs.core.AllTests"/>
- </ant>
+ </ant-->
</target>
- <!-- This target defines the performance tests that need to be run. -->
- <target name="performance-suite">
- <property name="cvs-performance-folder"
- value="${eclipse-home}/cvs_performance_folder"/>
- <delete dir="${cvs-performance-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="vmargs" value="-Declipse.cvs.properties=${team-home}/repository.properties -Declipse.cvs.loopCount=20 -Declipse.cvs.recordProtocolTraffic=false"/>
- <property name="data-dir" value="${cvs-performance-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.team.tests.ccvs.ui.benchmark.SyncTests"/>
- </ant>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="vmargs" value="-Declipse.cvs.properties=${team-home}/repository.properties -Declipse.cvs.loopCount=20 -Declipse.cvs.recordProtocolTraffic=false"/>
- <property name="data-dir" value="${cvs-performance-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.team.tests.ccvs.ui.benchmark.WorkflowTests"/>
- </ant>
- </target>
-
<!-- This target holds code to cleanup the testing environment after the tests -->
<!-- have been run. You can use this to delete temporary files that are created. -->
<target name="cleanup">
@@ -99,14 +76,4 @@
</ant>
</target>
- <!-- This target runs the performance test suite. Any actions that need to happen -->
-
- <!-- after all the tests have been run should go here. -->
- <target name="performance" depends="init,performance-suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
</project>
diff --git a/tests/pom.xml b/tests/pom.xml
index 30e3fa2e5..0819930ad 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -14,7 +14,7 @@
<parent>
<groupId>eclipse.platform.team</groupId>
<artifactId>eclipse.platform.team</artifactId>
- <version>4.13.0-SNAPSHOT</version>
+ <version>4.24.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>eclipse.platform.team.tests</artifactId>
@@ -26,7 +26,6 @@
<module>org.eclipse.compare.tests</module>
<module>org.eclipse.core.tests.net</module>
<module>org.eclipse.jsch.tests</module>
- <module>org.eclipse.team.tests.cvs.core</module>
<module>org.eclipse.team.tests.core</module>
</modules>
</project>

Back to the top