Commit Graph
58 Commits
Author SHA1 Message Date
Basil Crow 27646d11e4 [JENKINS-67372] Restore support for symbolic links in the Jenkins home directory (#6059) 2021-12-18 11:17:05 -08:00
Basil Crow 485c9b0966 Fix XXE_SAXPARSER SpotBugs violations (#6052) 2021-12-14 10:49:51 -08:00
Basil Crow 165d559469 Fix RV_RETURN_VALUE_IGNORED_BAD_PRACTICE SpotBugs violations (#6025) 2021-12-11 12:51:46 -08:00
Basil Crow 623b7340d5 Enable Javadoc-related Checkstyle checks (#5968) 2021-12-03 18:56:50 -08:00
Alex 8c94225d5d Address dead URLs (#5874) 2021-11-04 20:15:50 +00:00
Basil Crow 632033d6ad Sort imports (#5732) 2021-09-18 09:39:42 +01:00
Basil Crow 62e87adf2a Add missing @since (#5661) 2021-08-11 10:45:39 +01:00
Basil Crow bc48b4de78 Allow consumers of XmlFile to disable fsync(2) (#5599)
* Allowing consumers of XmlFile to disable fsync(2).

* Stop using Unix-specific terminology

* Jesse feels that this would be more natural as a constructor parameter

* Place Javadoc on constructor to make warning visible to callers
2021-07-24 16:13:28 +08:00
Basil Crow 881365d30b Enable RedundantModifier Checkstyle check 2021-03-08 07:56:42 -08:00
Basil Crow 63441802d8 Fix unresolvable references in Javadocs 2019-10-19 14:02:59 -07:00
Oleg Nenashev ba08ebc97a Refactoring: Cleanup <tt> tags from the Jenkins core Javadoc 2018-09-21 17:47:11 -07:00
mike cirioli 17f74fc713 Merge branch 'master' into OSS-2590 2018-01-24 09:27:57 -05:00
mike cirioli 570b52dbcc [JENKINS-48463] refactored XStream2 to default to KXml2Driver by default.
Changed all explicit references of the hierarchical driver to use a static
convinience method XStream2.getDefaultDriver() to ensure all XML operations
are using the same driver.
2018-01-24 09:25:32 -05:00
mike cirioli 9a4a913e38 [JENKINS-48463] - update jenkins core to use xml v1.1
- switched to KxmlDriver (needed for xml 1.1 support)
  - updated to create xml v1.1 headers
  - updated test to use KXml2Driver explicitly
  - updated unit tests to support xml v1.1
2018-01-24 09:24:56 -05:00
Daniel Beck 08a2b1e441 Update 'since FIXME' and 'since TODO' Javadoc tags 2018-01-08 20:52:30 +01:00
Jesse Glick ddb9ad68b4 Making nullOut behavior opt-in, so limiting to AbstractItem and View (and in particular not Jenkins). 2017-12-14 13:16:42 -05:00
Jesse Glick c79683bdd8 Rethrow any kind of RuntimeException, such as errors from RobustReflectionConverter. 2017-11-29 14:48:24 -05:00
Jesse Glick a032c59e06 [JENKINS-45892] Enhanced diagnostics (#2997)
* [JENKINS-45892] Enhanced diagnostics.

* Refined fix which should avoid a needless warning when called from MultiBranchProject.onLoad.
2017-09-02 18:42:04 -07:00
Jesse Glick 14028ec75b [JENKINS-45892] Merged #2957: prevent model objects from being serialized except at top level. 2017-08-08 08:48:37 -04:00
Jesse Glick 2d2101215d Simplifying writeReplace methods by factoring common logic into XmlFile.replaceIfNotAtTopLevel. 2017-08-02 16:28:41 -04:00
Stephen Connolly 3871d7778e [JENKINS-43531] Plugins may not be expecting InvalidPathException
- Plugins should really be expecting it, but as historically they have not, may as well convert to IOE for them
2017-04-19 14:04:33 +01:00
Jesse Glick 23cb13aad0 Clean up usages of IOUtils.closeQuietly and related calls (#2830)
* Clean up usages of IOUtils.closeQuietly and related calls predating Java 7.

* Review comments from @oleg-nenashev.

* Noticed another place where try-with-resources would protect against a potential leak.
2017-04-08 00:41:27 +02:00
Stephen Connolly f0cd7ae8ff [JENKINS-42934] Avoid using new FileInputStream / new FileOutputStream 2017-03-20 12:50:46 +00:00
Oleg Nenashev fe2b697e14 [JENKINS-39363,CID-1205051] - Prevent resource leak in hudson.XmlFile#readRaw() in the case of encoding issues. (#2518)
[JENKINS-39363,CID-1205051] - Prevent resource leak in hudson.XmlFile#readRaw() in the case of encoding issues.
2016-10-29 15:28:39 +04:00
Akbashev Alexander 8888296e68 Update XStream drive to improve performance in xml serilization/deserialization (#2561)
* Update XStream drive to improve performance in xml serilization/deserialization

According XStream FAQ (http://x-stream.github.io/faq.html#Scalability):

XStream is a generalizing library, it inspects and handles your types on
the fly. Therefore it will normally be slower than a piece of optimized
Java code generated out of a schema. However, it is possible to increase
the performance anyway:

* Write custom converters for those of your types that occur very often in
your XML.
* Keep a configured XStream instance for multiple usage. Creation and
initialization is quite expensive compared to the overhead of XStream
when calling marshall or unmarshal.
* Use Xpp3 or StAX parsers.

So, I decided to move from old Xpp to new Xpp3.

* Change other occurance of XppDriver to Xpp3Driver as well
2016-10-10 08:12:02 +02:00
Nicolas De Loof 7b39424495 rely on try-with-resources 2016-10-03 15:12:48 +02:00
Jesse Glick a58e198f8a [FIXED JENKINS-20951] XmlFile.read/unmarshal needs to catch general XStreamException so as to include CannotResolveClassException, thrown when a TopLevelItem provided by a plugin is unloadable. 2013-12-10 18:50:33 -05:00
Jesse Glick 15ac490af1 Now that we use Java 6, can finally deprecate IOException2. 2013-11-15 08:19:59 -05:00
Jesse Glick 3ce2e7f023 More information on format upgrades in Javadoc. 2013-02-27 10:51:49 -05:00
Kohsuke Kawaguchi b061d3cf87 exposing XStream 2012-06-20 09:50:08 -07:00
Kohsuke Kawaguchi d2c9d7346f [FIXED JENKINS-4525] XML encoding sniffing can fail with old JAXP.
Modified to assume UTF-8 if we fail to find it.
2011-10-10 06:31:49 +09:00
Christoph Kutzinski 2e0ed4650b minor optimization 2011-07-26 22:03:26 +02:00
Jerome Lacoste b58044ada6 Unused import 2011-07-23 07:11:06 -07:00
Kohsuke Kawaguchi 599888fec1 [FIXED JENKINS-4525]
I'd like to believe that the original reason was because earlier
versions of XStream that we used early on didn't support the methods
that take InputStream as a parameter.
2011-06-28 22:14:03 -07:00
Kohsuke Kawaguchi 39a9b8fe3c [FIXED JENKINS-8042] Fixed a file handle leak 2011-06-28 19:25:18 -07:00
Kohsuke Kawaguchi 071dd5917f really clean up all the atomic*.xmp 2010-11-22 10:37:31 -08:00
jglick 5b7c857cfd [HUDSON-4941] Log which file had an XML parse error to assist in diagnosis & fix.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@24022 71c3de6d-444a-0410-be80-ed276b4c234a
2009-11-24 16:36:07 +00:00
kohsuke 720be7d7a1 Merged revisions 23183,23185,23245,23256,23266,23279-23284,23286 via svnmerge from
https://www.dev.java.net/svn/hudson/branches/multiple-update-sources

........
  r23183 | abayer | 2009-10-25 11:53:17 -0700 (Sun, 25 Oct 2009) | 1 line
  
  First chunk of work towards supporting multiple update centers - infrastructure in place for it, and default update center treated as only one of multiple - have to use slightly modified update-center.json though
........
  r23185 | abayer | 2009-10-25 12:25:49 -0700 (Sun, 25 Oct 2009) | 1 line
  
  a number of tweaks - among other things, now works properly with additional update centers defined in hudson.model.UpdateCenter.xml - try using http://andrewbayer.com/images/hello-world/helloWorld-update-center.json as second update center
........
  r23245 | abayer | 2009-10-27 13:45:25 -0700 (Tue, 27 Oct 2009) | 1 line
  
  Modified to support existing default update-center.json
........
  r23256 | kohsuke | 2009-10-27 18:30:15 -0700 (Tue, 27 Oct 2009) | 7 lines
  
  - moved data binding of update-center.json to UpdateSource.
  - moved some of the UpdateSource property into JSON, to improve the user experience when adding an update source.
    the user should just type in one URL, and everything else should happen automatically.
  - it doesn't make sense for UpdateSource to rely on UpdateCenterConfiguration, since behaviors cannot be
    modified per UpdateSource basis. Instead, leaving it in UpdateCenter allows us to maintain backward compatible
    behaviors with the existing custom UpdateCenterConfiguration implementation.
........
  r23266 | kohsuke | 2009-10-27 19:29:24 -0700 (Tue, 27 Oct 2009) | 1 line
  
  serve id inside JSON.
........
  r23279 | kohsuke | 2009-10-28 10:44:00 -0700 (Wed, 28 Oct 2009) | 1 line
  
  Do not special-case "default" ID. Receive hudson.war updates from wherever that provides one.
........
  r23280 | kohsuke | 2009-10-28 10:50:57 -0700 (Wed, 28 Oct 2009) | 1 line
  
  formatting change.
........
  r23281 | kohsuke | 2009-10-28 11:30:40 -0700 (Wed, 28 Oct 2009) | 1 line
  
  typo
........
  r23282 | kohsuke | 2009-10-28 11:45:06 -0700 (Wed, 28 Oct 2009) | 2 lines
  
  - added the UI to remove sites.
  - persistence of UpdateSource happens more automatically now.
........
  r23283 | kohsuke | 2009-10-28 11:50:04 -0700 (Wed, 28 Oct 2009) | 1 line
  
  UpdateSource -> UpdateSite to align terminology with Eclipse.
........
  r23284 | kohsuke | 2009-10-28 11:55:03 -0700 (Wed, 28 Oct 2009) | 5 lines
  
  Actually, for now, just having a programmatic modification to UpdateSite would satisfy the primary use case.
  
  And I'd like to upgrade YUI to a more recent version so that we can use its DataTable for UI. Plus the single update center model encourages the community to bring the code into the Hudson project, which is something we'd like to keep.
  
  So all in all, I'm postponing the UI work.
........
  r23286 | kohsuke | 2009-10-28 13:07:19 -0700 (Wed, 28 Oct 2009) | 1 line
  
  Renaming and bug fixes.
........


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23326 71c3de6d-444a-0410-be80-ed276b4c234a
2009-10-29 21:27:46 +00:00
kohsuke d3b5cde166 improved the error handling
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21858 71c3de6d-444a-0410-be80-ed276b4c234a
2009-09-18 18:09:11 +00:00
mindless 9fed9823f5 Add @Override annotations, remove unused imports,
add some copyright headers, some tab->ws


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21654 71c3de6d-444a-0410-be80-ed276b4c234a
2009-09-14 18:08:34 +00:00
kohsuke 1a1d0d74d5 license header clean up
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15081 71c3de6d-444a-0410-be80-ed276b4c234a
2009-02-06 20:05:24 +00:00
kohsuke 1a5d0d13ef one more convenience method.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10077 71c3de6d-444a-0410-be80-ed276b4c234a
2008-06-13 17:37:47 +00:00
kohsuke 8e5fe562be getRootDir() isn't avaiable when it's called from the constructor (see #740), so instead make sure XmlFile creates directories.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4327 71c3de6d-444a-0410-be80-ed276b4c234a
2007-08-18 14:16:19 +00:00
kohsuke 2f99ea2605 added a method to read it into a string.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3908 71c3de6d-444a-0410-be80-ed276b4c234a
2007-07-29 17:45:22 +00:00
kohsuke 26fa803ddb added one more convenience method.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3904 71c3de6d-444a-0410-be80-ed276b4c234a
2007-07-29 17:22:32 +00:00
kohsuke 82fe674184 added a method to read XML in the proper encoding.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3902 71c3de6d-444a-0410-be80-ed276b4c234a
2007-07-29 17:20:15 +00:00
kohsuke e334c7b300 2-arg constructor not supported on Tiger.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3901 71c3de6d-444a-0410-be80-ed276b4c234a
2007-07-29 17:20:14 +00:00
kohsuke 471ddaddac formatting changes.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3900 71c3de6d-444a-0410-be80-ed276b4c234a
2007-07-29 17:20:13 +00:00
kohsuke d13fe3cea2 added a method to sniff XML encoding.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3899 71c3de6d-444a-0410-be80-ed276b4c234a
2007-07-29 17:17:26 +00:00
kohsuke 6c7d0ce837 added loggign.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2151 71c3de6d-444a-0410-be80-ed276b4c234a
2007-02-11 00:28:46 +00:00