Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 833226 Details for
Bug 1038689
Do not allocate collection for Configuration.rawConfigurations by default
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Possible patch
Don_t_allocate_raw_config_by_default_to_save_space_.patch (text/plain), 3.51 KB, created by
Heiko W. Rupp
on 2013-12-05 15:57:10 UTC
(
hide
)
Description:
Possible patch
Filename:
MIME Type:
Creator:
Heiko W. Rupp
Created:
2013-12-05 15:57:10 UTC
Size:
3.51 KB
patch
obsolete
>Index: modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Configuration.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>ISO-8859-1 >=================================================================== >--- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Configuration.java (revision ec67bac995a335960f2d5d4a39070bc5d408f08b) >+++ modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Configuration.java (revision ) >@@ -25,6 +25,7 @@ > import java.io.Serializable; > import java.util.ArrayList; > import java.util.Collection; >+import java.util.Collections; > import java.util.HashSet; > import java.util.Iterator; > import java.util.LinkedHashMap; >@@ -507,7 +508,7 @@ > > @OneToMany(mappedBy = "configuration", fetch = FetchType.EAGER) > @Cascade({ CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DELETE_ORPHAN }) >- private Set<RawConfiguration> rawConfigurations = new HashSet<RawConfiguration>(); >+ private Set<RawConfiguration> rawConfigurations ; > > @Column(name = "NOTES") > private String notes; >@@ -813,15 +814,24 @@ > } > > public Set<RawConfiguration> getRawConfigurations() { >+ if (rawConfigurations==null) { >+ return Collections.EMPTY_SET; >+ } > return rawConfigurations; > } > > public void addRawConfiguration(RawConfiguration rawConfiguration) { > rawConfiguration.setConfiguration(this); >+ if (rawConfigurations==null) { >+ rawConfigurations=new HashSet<RawConfiguration>(1); >+ } > rawConfigurations.add(rawConfiguration); > } > > public boolean removeRawConfiguration(RawConfiguration rawConfiguration) { >+ if (rawConfigurations==null) { >+ return false; >+ } > boolean removed = rawConfigurations.remove(rawConfiguration); > if (removed) { > rawConfiguration.setConfiguration(null); >@@ -907,6 +917,9 @@ > } > > private void createDeepCopyOfRawConfigs(Configuration copy, boolean keepId) { >+ if (rawConfigurations==null) >+ return; >+ > for (RawConfiguration rawConfig : rawConfigurations) { > copy.addRawConfiguration(rawConfig.deepCopy(keepId)); > } >@@ -937,13 +950,22 @@ > > Configuration that = (Configuration) obj; > >- return (this.properties.equals(that.properties)) && (this.rawConfigurations.equals(that.rawConfigurations)); >+ boolean rcEquals=true; >+ if (this.rawConfigurations!=null) { >+ rcEquals = this.rawConfigurations.equals(that.rawConfigurations); > } >+ return (this.properties.equals(that.properties)) && rcEquals; >+ } > > @Override > public int hashCode() { >- return properties.hashCode() * rawConfigurations.hashCode() * 19; >+ int hc = properties.hashCode(); // TODO this requires loading of all properties and is expensive >+ if (rawConfigurations!=null) { >+ int rchc = rawConfigurations.hashCode() ; >+ hc = hc * rchc + 19; > } >+ return hc ; >+ } > > @Override > public String toString() { >@@ -980,8 +1002,12 @@ > } > builder.append("], rawConfigurations["); > >+ if (rawConfigurations==null) { >+ builder.append("-none-"); >+ } else { > for (RawConfiguration rawConfig : rawConfigurations) { > builder.append("[").append(rawConfig.getPath()).append(", ").append(rawConfig.getSha256()).append("]"); >+ } > } > builder.append("]"); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1038689
: 833226