1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 23:55:26 +02:00
Commit graph

610 commits

Author SHA1 Message Date
Jeff Johnston
3982641456 Refactor the CDT Core CommandLauncherFactory extension
- clean up the extension to have a simple
  factory element with id, priority, and class
- have CommandLauncherManager use the priority
  of factories to find the best launcher
  (one returned by factory with highest
  priority or first one returned by factories
  of equal priority)
- fix the specification of the Docker Container
  Command launcher in org.eclipse.cdt.docker.launcher
  plug-in
- fix CModelMock to return an ICProjectDescription so
  serializer tests will work with CommandLaunchManager

Change-Id: I91c383c1f4da05b9c39fefceb0bea572fb4af34b
2017-08-01 19:23:06 -04:00
Jeff Johnston
a9fd3a7847 Fix Debug in Container
- on Windows (possibly Mac as well), we can't use the ip of
  the Container to contact the gdbserver as this address
  may be hidden from the host behind a VM
- instead use the localhost port that the tcp/2345 is mapped
  to which the Docker machine etc.. forwards back
- fix this in ContainerLaunchConfigurationDelegate

Change-Id: I9f85bf0d0d9dec183c504ba4fb7adc55d4a038bb
2017-07-20 18:29:24 -04:00
Jeff Johnston
93935c5318 Fix ContainerPropertyTab to properly enable Data Volume add button 2017-07-06 19:32:22 -04:00
Jeff Johnston
8930584b13 Fix problems in Build in Container support
- add check for null configuration in ContainerCommandLauncherFactory
  and return null
- remove extraneous changeEvent method in ContainerTab
2017-06-29 16:04:52 -04:00
Jeff
379e33af43 More Windows fixes for Container build
- change ICommandLauncherFactory to have two getCommandLauncher()
  methods that take an IProject and an ICConfigurationDescription
  rather than one method that takes an Object
- change CommandLauncherManager and ContainerCommandLauncherFactory
  classes to have the same two methods
- fix ContainerPropertyTab to add Elf and GNU Elf binary parsers
  when build in Container is chosen so that output executables
  are treated as Binaries by the CDT project
2017-06-28 17:42:35 -04:00
Jeff
49c2109ff6 Fix specs detection for Container Build feature
- sometimes specs detection will be for a non-active
  build configuration so the project cannot be used to
  determine eligibility for the command launcher
- change ICommandLauncherFactory to accept an object in its
  getCommandLauncher method which can either be an IProject or
  ICConfigurationDesription
- change ContainerCommandLauncherFactory to accept an Object
  instead of IProject in its getCommandLauncher() method
- cast the Object received either to be an IProject or
  ICConfigurationDescription to determine if the build should
  occur in a Container or not
- fix CommandLauncherManager.getCommandLauncher() to accept
  and pass on an Object to the list of ICommandLauncherFactory
  instances
- fix AbstractBuiltinSpecsDetector to pass in the current
  configuration description when getting the CommandLauncher
  since the current configuration may not be the active
  configuration
2017-06-27 16:10:01 -04:00
Jeff
0c1c44a47d Add Windows support for CDT Build in Container
- fix AutotoolsNewMakeGenerator.getWinOSType to not specify "." for
  working dir
- fix GCCBuiltinSpecsDetectorCygwin to not map paths to Cygwin if
  the current configuration is enabled for container build
- add logic to ContainerCommandLauncher to look for Windows
  file formats and change them to unix format and map
  any "." working dir to be /tmp
- fix ContainerLauncherConfigurationDelegate similarly
2017-06-22 18:10:11 -04:00
Jeff Johnston
35b02e5aed Fix ContainerPropertyTab to handle no images 2017-06-22 18:10:11 -04:00
Jeff Johnston
1841c84420 Add volume specification for ContainerPropertyTab
- add BaseDatabindingModel class
- add DataVolumeModel class to model a volume mount
- add ContainerPropertyVolumes model to model volume specification
  and selected volumes
- add new properties to ContainerCommandLauncher to represent
  volumes and selected volumes for a configuration
- add new ContainerDataVolumeDialog for specifying a volume
  mount by the end-user
- add code to ContainerPropertyTab to support specification of
  volumes to mount when building

- add a null detector for cfgDescription in
  LanguageSettingsSerializableProvider

Change-Id: I54db9afe608475514f60e9dd9e6c6b8bec1d3137
2017-06-22 18:10:11 -04:00
Jeff Johnston
5dce123041 Fix containerBuild branch to work with latest Linux Tools master
- fix ContainerPropertyTab changeEvent() method to match new
  format for IDockerManagerListener
- ditto for ContainerTab
- add "seccomp:unconfined" option when launching the gdbserver
  for debugging to avoid issue with using ptrace in Container

Change-Id: I2b07b64ba3f9e26b27e5100e357556d99c5272dc
2017-06-22 18:10:11 -04:00
Jeff Johnston
eb561ddbf8 Multiple fixes for indexing support
- fix ContainerPropertyTab.performApply to be ready for a null
  enablement property which occurs when Apply is hit on another
  tab page
- fix LanguageSettingsWorkspaceProvider.getSettingEntries method
  to use the CommandLauncherManager so entries will be transformed
  to use cached headers

Change-Id: Ib2bb283d768905716e7fb37fd598aeace7832b2d
2017-06-22 18:10:11 -04:00
Jeff Johnston
b04c4b68ef Make modifications for CDT Container in Build indexing support
- change ContainerPropertyTab to have a performApply and
  performOK method so that gcc specs detection is performed
  in either case
    - in performOK, only clear the current specs since the
      change of the project description will cause the regeneration
      to occur
    - in performApply, clear specs and send a null event to handle
    - calculate whether specs calculation is actually needed based on
      changes to the original configuration
- in ContainerCommandLauncherFactory move cached headers under
  a HEADERS directory in the plug-in area
  - create a sub-directory for the connection and a sub-directory
    for the image based on cleansed names
  - store the real names of the connection and image to use
    later in the DockerHeaderPreferencePage
- modify LanguageSettingsEntriesTab to force the horizontal
  scroll bar to appear (this is a bug in SWT SashForm support
  and the fix here isn't quite correct, but is better)
- add new DockerHeaderPreferencePage that allows user to
  remove cached headers from images
- change C/C++ Docker preferences to be titled: Docker Container

Change-Id: Ic577f0fdbb89f68aa88146e6c0f5aa95d75694bd
2017-06-22 18:10:10 -04:00
Jeff Johnston
00a7db1c4d Add indexing support for CDT Build in Container
- in LanguageSettingsSerializableSettings class, call the
  CommandLauncherFactoryManager getLanguageSettingEntries method
  to get the massaged language setting entries based on the
  current list
- in LanguageSettingsProviderSerializer, try and get the
  pooled entries using the cfg description so that it will
  have the project and can use the CommandLauncherFactoryManager
  to get entries from image
- add getLanguageSettingEntries method to CommandLauncherFactoryManager
  to convert include paths to locally cached paths copied from
  image
- add verifyLanguageSettingEntries method to ICommandLauncherFactory
- fix copy header logic in ContainerCommandLauncherFactory
- add verifyLanguageSettingEntries method to
  ContainerCommandLauncherFactory that looks to see if the
  project is currently enabled for container build and any
  include path entries are ones that have been copied over as
  part of a CopyVolumesFromImage job in which case they are
  replaced in the entries list
- fix the ContainerPropertyTab performOK method to always
  refresh the builtin specs for the time-being so switching
  can be done between container and regular build

Change-Id: I004e916253cbaae9c6dfed1ef4f5844678fe0dd9
2017-06-22 18:10:10 -04:00
Jeff Johnston
e70713966f Add support to copy header files from Container to Host
- add logic in ContainerPropertyTab to kick off gcc specs discovery
  when the OK button is pressed
- also fix bug in ContainerPropertyTab whereby the image name
  was being reset to blank when a change occurred in connection combo
- add setLanguageSettngEntries method to CommandLauncherFactoryManager
- add registerLanguangeSettingEntries method to ICommandLauncherFactory
  and ContainerCommandLauncherFactory

Change-Id: I22f60a5ff42f9312cba42ca4d3b6f78225783378
2017-06-22 18:10:10 -04:00
Jeff Johnston
ed2768aa50 Fix array out of bounds exception in ContainerPropertyTab
- in Connection combo modify listener, just return if the
  Connection combo doesn't have a selection and set
  connection to null and connection name to empty string

Change-Id: Ib6274eb27b9a3128a538da4df520b7b83ce1e575
2017-06-22 18:10:09 -04:00
Jeff Johnston
832347339c Fix Standard Make projects to work
- fix erroneous check in Configuration to use the optionalProps
  variable instead of props
- in ContainerCommandLauncher add the project directory as an
  additional directory so all sources and make macros are
  available to the Container

Change-Id: I13099d246456aa350bebbbae32cc152b3b4598bc
2017-06-22 18:10:09 -04:00
Jeff Johnston
db3ee42b31 Bug 513589 - Add support to build CDT projects in a Docker Container
- add IOptionalBuildObjectPropertiesContainer interface to use for
  objects that supply optional build properties
- add new IOptionalBuildProperties interface that defines
  optional build properties donated by external plug-ins
- add new
- change IConfiguration to an IOptionalBuildObjectPropertiesContainer
- change IManagedProject to be an
  IOptionalBuildObjectPropertiesContainer
- fix ProcessClosure to ensure that readers are not null before
  accessing them
- fix Container launch delegate to look at project optional
  build properties for active configuration to fetch connection
  and image info and use said info to find a matching
  launch or create a new one
- have Container launch delegate use the image name as part of
  the launch config name
- have Container launch short-cut also use the project's
  optional build properties for the active config to get
  connection and image information before any defaulting
- change AutotoolsNewMarkerGenerator to store the command
  launcher as an ICommandLauncher
- add new CommandLauncherFactory extension to cdt.core that
  allows plug-ins to specify a CommandLauncherFactory that
  will return an ICommandLauncher based on the project
- add macros for new extension to CCorePlugin
- add new CommandLauncherFactoryManager class that loads
  CommandLauncherFactory extensions and is used to give
  an ICommandLauncher wrapper that will go through the list
  of CommandLauncherFactory extensions until one returns
  non-null ICommandLauncher
- add code to RemoteCommandLauncher so it will use the
  CommandLauncherFactoryManager to get the local launcher
- also change RemoteCommandLauncher to check at execution
  time whether the command is local and in that case use
  the local command launcher
- add new ICommandLauncherFactory interface
- add new ContainerCommandLauncher to launch
- add new ContainerCommandLauncherFactory class for returning
  a ContainerCommandLauncher instance to launch commands
  in a Docker Container
- change MakeBuilder to use CommandLauncherFactoryManager to get
  its ICommandLauncher
- change CommandBuilder to use CommandLauncherFactoryManager too
- ditto for Builder and AbstractBuiltinSpecsDetector and
  ExternalToolInvoker
- change Configuration to load/store optional build properties
  as well as return the properties to get/set
- ditto for MultiConfiguration
- change ManagedProject to implement IOptionalBuildOptionProperties
  interface
- ditto for ProjectType
- create new OptionalBuildProperties class to store optional
  build properties for a configuration
- bump cdt.managedbuilder.core to 8.5.0
- bump cdt.docker.launcher to 1.1.0
- use CommandLauncherFactory extension to define
  ContainerCommandLauncherFactory
- add optional ContainerPropertyTab which allows the end-user to
  optionally choose to build a C/C++ project in a Container
  and specify the connection/image to use

Change-Id: Id4d202d5eeb0dd52e528a45bf44d3e386f67376d
2017-06-22 18:10:09 -04:00
Jonah Graham
ad97076c4d Bug 517722: Mark as deprecated code related to Launch Group
Change-Id: I8d4b1dd3280011086a8e5b9652ecb7cdede81d52
2017-06-05 12:46:05 +01:00
Jonah Graham
fa142ee04b Bug 517722: Mark CDT specific Launch Group as Deprecated in the UI
Change-Id: Ib945742c6cec83ca9bd9fcb6bc42e32815d74f28
2017-06-05 11:04:48 +01:00
Jonah Graham
efa1662b6c Bug 508948: Use environment from Launch configuration when running
Change-Id: I9f37eded44ece4ae25094cf70fa7f90a706e3e69
2017-05-29 08:49:12 -04:00
Jeff Johnston
88c6da2e40 Add seccomp:unconfined option when debugging using a Container
- current Docker daemons don't allow ptrace in the default
  seccomp profile so specify "seccomp:unconfined" when
  kicking off the gdbserver

Change-Id: I742a99221c897a553a46bc768e713d74b1fda22e
2017-05-11 21:35:56 -04:00
Marc-Andre Laperle
a06ad70d0a Bring back some pom.xml from features
Those features have the exact same id and groupid than a plugin
which throws off SonarQube with:
"Two modules have the same id: 'org.eclipse.cdt:org.eclipse.cdt.util'.
Each module must have a unique id."

In the pom.xml, we can specify a different groupid which resolves the
problem. Alternatively, the feature id could have been changed but that
would break upgrades.

Change-Id: Ib2912ad854a3af431b96f89a6ead1bcb6d06ba60
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2017-04-18 22:49:39 -04:00
Sergey Prigogin
212bbd011f Fixed broken compilation.
Change-Id: I0e4355fd8f1547d1e93400215759a5d897924031
2017-03-08 02:01:43 -04:00
Marc-Andre Laperle
0046099052 releng: Make use of Tycho POM-less functionality
This removes a lot of pom.xml from the source tree. This is using the
"POM-less" Tycho functionality.
See
https://wiki.eclipse.org/Tycho/Release_Notes/0.24#POM-less_Tycho_builds

One advantage of this is that you do not need to update the version in
the pom.xml when you change it in the MANIFEST.MF because the pom.xml is
automatically generated. This also reduces a lot of the duplicated
information and pom.xml repetition.

- Maven 3.3 and up is required.
- Only eclipse-plugins and eclipse-features can be pom-less.
Repositories, target and others still have pom.xml.
- New parent poms are added because a parent is necessary directly one
level above the plug-in/feature that will have its pom generated
- Some test plug-ins had to be renamed .test -> .tests because it's
required so that it detects that it's a test plug-in
- Some suites were renamed so that they all use the same consistent name
"AutomatedIntegrationSuite"
- Profiles were added for the more common test configurations. They are
activated by the presence of simple .properties files that only serve to
activate the correct profile. The profiles:
  - One for UI tests (UI present and start in UI thread)
  - One for SWTBot tests (UI present and do not start in UI thread)
Other test plug-ins that are too different are kept intact and still
have
a pom.xml
- Fragments are kept intact since they all have different target
platform configurations

Change-Id: I9d73380eb766f547830c552daf08053a30b1845c
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2017-02-13 23:19:56 -04:00
Marc Dumais
7f6e7f8c9b Bug 510615 - Launch dialog, handle spaces in gdb path
The path to GDB is set in the launch dialog, under the Debugger tab. If
the path to GDB contains one or more spaces, and is not within double
quotes, GDB will not be found and the launch will fail. 

This patch improves the use cases around the "Browse" button, to select
GDB's path. 

1) if the user clicks on the "Browse" button, the browse dialog will
open in the correct place, no matter the presence of space(s).
2) When GDB's path is selected with the "Browse" button, it's then set
in the "GDB debugger" field. This patch looks at the selected path and
adds surrounding double quotes if there is any space within, and strips
any double quotes if there are no spaces. 


Change-Id: I202f574772965af3a491d449b9e9a97e8c61e2b0
2017-02-07 09:48:23 -05:00
Marc Khouzam
704dc4a53f Add missing strings for Run launch delegate.
Commit 6fc6c3c671 mistakenly removed the
two strings that were being used for the Run launch delegate.  We
haven't noticed because we only have one Run launch delegate and
therefore its name does not end up being shown in most cases.

However, by going to Preferences->Run/Debug->Perspectives and then
expanding the C/C++ Application launch configuration type, the Run
delegate is shown with a missing string.

Change-Id: I2435097b0a13efd21ef3da01e2d4969d231a6f97
2017-01-26 11:23:56 -05:00
Marc Khouzam
8d0a0717e2 Auto-generate source features using tycho.
This commit removes explicit source features and has tycho create them
automatically, along with all other source features that were not
previously defined.  The logic to auto-generate is in the root pom.xml

For all pre-existing source feature, the name presented to the user has
been changed to use the default name used by Tycho, which is "Developer
Resources".  This will provide a more standard user-experience with
respect to other source features built by Tycho.

Existing SDK features are kept for backwards compatibility.

All the names of the auto-generated source features that replace an
existing source feature have stayed the same except for the
'testsrunner' feature; for that one name change, a p2.inf file is added
to allow upgrading from the old named feature to the new named feature.

Change-Id: Ie632e798c93898fd828f88df4983fc43e2749d22
2017-01-25 16:14:03 -04:00
Jonah Graham
11de6abfaf Bug 510394: set environment when doing project-less run
Change-Id: I7b82f99f88b9e4c5d2367dfdf98cb3952e6a89eb
2017-01-12 19:51:40 +00:00
Marc Khouzam
8cf5ed53f2 Update version to 9.3.0
Change-Id: Ic953ccc5d38ff3661ca44de21ed8c4b7dad5b246
2016-11-15 20:32:51 -05:00
Marc Khouzam
334777eb6e Update version to 9.2.0
Change-Id: I36ad4218b20b8ea70584c89f5be45c757bf4c714
2016-11-14 23:50:05 -05:00
Doug Schaefer
03051c91ab Implement Qt build tab for the launch config dialog.
Make sure Core Build handles the properties set by these tabs
correctly. A bunch of string externalization too.

Change-Id: I54a61b4d2520a0952c43608169747e792826062e
2016-11-11 16:24:40 -05:00
Philip Langer
ab7afbf0aa Bug 506843: Reset buildFailed flag on buildForLaunch
Since delegate instances are cached and reused for subsequent launches,
we have to reset the buildFailed flag on subsequent builds (i.e., calls
of buildForLaunch). Otherwise, this flag will remain to be set to true
after a failed/cancelled build for the entire lifetime of this delegate,
even if a project has been re-launched and the build succeeded. If the
flag remains to be true, the dialog keeps popping up asking the user
whether to succeed with the launch with errors in the project, even if
the build succeeded and there are no errors any more.

Change-Id: I51aece90154f817542ed7548ec4c36591b19eaec
Signed-off-by: Philip Langer <planger@eclipsesource.com>
2016-11-02 11:04:47 -04:00
Doug Schaefer
e371ba0919 Updates for Core Build.
Change-Id: I8720d5b57e335adde538838790c3ecdd465a7ed7
2016-10-12 19:19:19 -04:00
Doug Schaefer
b26917be90 Introduce Core Build launches and Launch Bar integration.
Unify launching for projects that use the new Core Build system.
Starts with CMake projects. We'll do Qt projects next.

Change-Id: I14af8e99decd54cc6548095b3ad3e054c550aea2
2016-09-12 11:14:17 -04:00
Marc Khouzam
999c2e97cc Bug 303808: Add dedicated debugger console view
Splitting out the GDB console into its own Debugger Console view.

The goal of this patch is to allow the user to easily keep the full GDB
console in focus, without having to pin it, as the pin requirement was
not very user-friendly.  Furthermore, the user can also use the GDB
console while looking at the output of the program being debugged,
which couldn't not be done without a dedicated gdb console view.

This patch also resolves two issues we had with re-using the platform
console view, which were:
- pin didn't work
- clone didn't work
With this new Debugger console view, there is no pin and no clone.

Change-Id: Ia19132704a2f6618f35ffe47ebb4b8f0028dc9ab
2016-09-07 15:26:43 -04:00
Marc Khouzam
cd559dafaf Update version to 9.1.0
This commit used the script releng/scripts/ChangeFeaturesVersion.sh

Change-Id: I8274a6e8dd5c0f1e450f07952e138b265a441a62
2016-08-17 10:11:57 -04:00
Jeff Johnston
1560afe3fa Bug 497779 - Add labels to applications run as Docker containers
- fix labels to comply with Docker standards (lower-case and
  prefixed by reverse DNS notation)

Change-Id: I7464f74e902f2198833e048a0d5dc6dd3c42de39
2016-07-14 17:02:06 -04:00
Jeff Johnston
bfcf98caff Bug 497779 - Add labels to applications run as Docker containers
- add CDTLaunch label (no value) and CDTProject label (with project)
  for containers created by the CDT Run in Container launch

Change-Id: Ic9a1ccb3c998083eccb6b16098c4a443c7d040bc
2016-07-13 13:10:29 -04:00
Marc Khouzam
f38cbb85c3 Remove old .cvsignore files
Change-Id: Ia66de47055a15d94c0aa45d1198f0a9e78d82ad0
2016-06-30 09:58:00 -04:00
Nils Carlson
ff412311a7 Bug 495836 - Eclipse CDT needs privileged mode for docker containers
This adds a checkbox to the container tab of the container
launcher to enable privileged mode. It requires a corresponding
change to the linuxtools repo.

Change-Id: I3f5fc15490e58304d3f43669fd6b16373a30ef7c
Signed-off-by: Nils Carlson <nils.carlson@ludd.ltu.se>
2016-06-22 18:45:40 -04:00
Marc Khouzam
9e1e981b4d Move the rest of the CDT plugins to java 8
This change was generated using the script:
releng/scripts/ChangeJavaVersion.sh

Change-Id: I2ad96dc682a5acb8529c3edec40de279c331b5a4
2016-06-22 14:51:43 -04:00
Doug Schaefer
5d2cbaaa1c Cherry picking changes from the CDT 9 branch for Qt and Arduino.
Change-Id: I85eca2b8bb0447d4dd703030c41d90c1f9bcdf89
2016-06-13 21:23:10 -04:00
Alex Blewitt
c73978c03a Bug 492210 - Remove ChangeLog files from project
ChangeLog is an archaic format for identifying what has changed in a
project. Fortunately more powerful version control systems are capable
of generating this information and displaying information such as this
paragraph in order to determine what has changed in a project and when.

Change-Id: Ia71a05fa51869c1adb193d94f71c28b3b36beb37
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-25 22:53:31 +01:00
Alex Blewitt
12904409a3 Bug 492304 - Fix NLS warnings
Eclipse warns if a String literal does not have a `//$NON-NLS-<n>$`
entry at the end of the line. However, for historic or formatting
reasons, many such occurrences in the CDT source have an intermediate
whitespace, such as `// $NON-NLS-<n>$`

Fix these so that the whitespace is removed between the // and $
characters.

Change-Id: Idc12398fe6e9d619af1d0b1b73fb8b6180da223c
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-25 22:53:30 +01:00
Alex Blewitt
6bdca5f4a2 Bug 492230 - Replace buffer.append(a+b) calls
When using a `StringBuilder` or `StringBuffer` to create a string message,
using implicit string concatenation inside an `.append()` call will
create a nested StringBuilder for the purposes of creating the arguments,
which will subsequently be converted to a String and then passed to
the outer StringBuilder.

Skip the creation of the intermediate object and String by simply
replacing such calls with `buffer.append(a).append(b)`.

Where values are compile time String constants, leave as is so
that the javac compiler can perform compile-time String concatenation.
Ensure that NEWLINE isn't appended in such a way since it is not
a compile time constant `System.getProperty("line.separator")`

Change-Id: I4126aefb2272f06b08332e004d7ea76b6f02cdba
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-25 11:38:47 -05:00
Alex Blewitt
2356a29c70 Bug 492200 - Replace StringBuffer with StringBuilder
There are many opportunities for replacing `StringBuffer` with
`StringBuilder` provided that the type isn't visible from the
public API and is used only in internal methods. Replace these
where appropriate.

Change-Id: Ic2f50c5b6f3c3a4eae301bb3b40fb6faed235f79
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-21 22:17:03 -05:00
Sergey Prigogin
9f79b897c1 Bug 492200 - Replace StringBuffer with StringBuilder where appropriate
Change-Id: Ib52b839a211e2068e56da4b62a5b9640fef55d40
2016-04-21 16:15:31 -07:00
Jeff Johnston
8a2fd3307b Fix Connection drop-down in Run Image Launch configuration
- drop-down doesn't cause Apply button to activate when
  changing Connections from previous connection
- fix setting of default connectionName to avoid NPE
- move setting of connectionURI when user changes drop-down
- add check in isvalid() to verify image exists in connection
- reload images when changing connection and ignore parent images

Change-Id: I9dbc8828a6e6321e9cd1392d4e8c4dbdf2a954db
2016-04-21 14:56:30 -04:00
Alex Blewitt
2114f6b108 Bug 491984 - Replace .equals("") with .isEmpty()
In many cases a String's empty status is tested with `.equals("")`.
However, Java 1.6 added `.isEmpty()` which can be more efficient since
it compares the internal length parameter only for testing. Replace
code using the `.isEmpty()` variant instead.

Some tests for `"".equals(expr)` can be replaced with `expr.isEmpty()`
where it is already known that the `expr` is not null; however,
these have to be reviewed on a case-by-case basis.

Change-Id: I3c6af4d8b7638e757435914ac76cb3a67899a5fd
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-19 13:35:54 -04:00
Alex Blewitt
809598db9d Bug 491945 - Remove new String()
Occurrences of `new String()` have been replaced with the equivalent `""` and
additional NON-NLS tags have been inserted in where appropriate.

Change-Id: I54cf71dcd0d5a92a675a71166d66949533de502b
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-18 23:15:05 +01:00