- Timestamp:
- 2016-02-20T01:34:07+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java
r9575 r9841 240 240 241 241 public void setUploadStrategySpecification(UploadStrategySpecification strategy) { 242 if (strategy == null) return; 242 if (strategy == null) 243 return; 243 244 rbStrategy.get(strategy.getStrategy()).setSelected(true); 244 245 tfChunkSize.setEnabled(strategy.getStrategy() == UploadStrategy.CHUNKED_DATASET_STRATEGY); … … 256 257 int chunkSize = getChunkSize(); 257 258 UploadStrategySpecification spec = new UploadStrategySpecification(); 258 switch(strategy) { 259 case INDIVIDUAL_OBJECTS_STRATEGY: 260 case SINGLE_REQUEST_STRATEGY: 261 spec.setStrategy(strategy); 262 break; 263 case CHUNKED_DATASET_STRATEGY: 264 spec.setStrategy(strategy).setChunkSize(chunkSize); 265 break; 259 if (strategy != null) { 260 switch(strategy) { 261 case INDIVIDUAL_OBJECTS_STRATEGY: 262 case SINGLE_REQUEST_STRATEGY: 263 spec.setStrategy(strategy); 264 break; 265 case CHUNKED_DATASET_STRATEGY: 266 spec.setStrategy(strategy).setChunkSize(chunkSize); 267 break; 268 } 266 269 } 267 270 if (pnlMultiChangesetPolicyPanel.isVisible()) { -
trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySpecification.java
r9371 r9841 35 35 36 36 /** 37 * Clones another upload strategy. If other is null,assumes default 38 * values. 37 * Clones another upload strategy. If other is null, assumes default values. 39 38 * 40 39 * @param other the other upload strategy 41 40 */ 42 41 public UploadStrategySpecification(UploadStrategySpecification other) { 43 if (other == null) return; 44 this.strategy = other.strategy; 45 this.chunkSize = other.chunkSize; 46 this.policy = other.policy; 47 this.closeChangesetAfterUpload = other.closeChangesetAfterUpload; 42 if (other != null) { 43 this.strategy = other.strategy; 44 this.chunkSize = other.chunkSize; 45 this.policy = other.policy; 46 this.closeChangesetAfterUpload = other.closeChangesetAfterUpload; 47 } 48 48 } 49 49 … … 93 93 94 94 public int getNumRequests(int numObjects) { 95 if (numObjects <= 0) return 0; 95 if (numObjects <= 0) 96 return 0; 96 97 switch(strategy) { 97 98 case INDIVIDUAL_OBJECTS_STRATEGY: return numObjects; … … 114 115 @Override 115 116 public boolean equals(Object obj) { 116 if (this == obj) return true; 117 if (obj == null || getClass() != obj.getClass()) return false; 117 if (this == obj) 118 return true; 119 if (obj == null || getClass() != obj.getClass()) 120 return false; 118 121 UploadStrategySpecification that = (UploadStrategySpecification) obj; 119 122 return chunkSize == that.chunkSize &&
Note:
See TracChangeset
for help on using the changeset viewer.