auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public @NonNull Image getIcon() { String traceType = getTraceType(); if (traceType == null || TmfTraceType.getTraceType(traceType) == null) { Image icon = TmfProjectModelIcons.WORKSPACE_LABEL_PROVIDER.getImage(getResource()); return (icon == null ? TmfProjectModelIcons.DEFAULT_TRACE_ICON : icon); } IConfigurationElement traceUIAttributes = TmfTraceTypeUIUtils.getTraceUIAttributes(traceType, (this instanceof TmfTraceElement) ? TraceElementType.TRACE : TraceElementType.EXPERIMENT); if (traceUIAttributes != null) { String iconAttr = traceUIAttributes.getAttribute(TmfTraceTypeUIUtils.ICON_ATTR); if (iconAttr != null) { String name = traceUIAttributes.getContributor().getName(); if (name != null) { Bundle bundle = Platform.getBundle(name); if (bundle != null) { Image image = TmfProjectModelIcons.loadIcon(bundle, iconAttr); if (image != null) { return image; } } } } <START> } <END> if (this instanceof TmfTraceElement) { return TmfProjectModelIcons.DEFAULT_TRACE_ICON; } return TmfProjectModelIcons.DEFAULT_EXPERIMENT_ICON; }</code><technical_language>return null subclass return default image if super.getIcon() returns null, if better</technical_language>

Target:
public Image getIcon() { String traceType = getTraceType(); if (traceType == null || TmfTraceType.getTraceType(traceType) == null) { Image icon = TmfProjectModelIcons.WORKSPACE_LABEL_PROVIDER.getImage(getResource()); return (icon == null ? TmfProjectModelIcons.DEFAULT_TRACE_ICON : icon); } IConfigurationElement traceUIAttributes = TmfTraceTypeUIUtils.getTraceUIAttributes(traceType, (this instanceof TmfTraceElement) ? TraceElementType.TRACE : TraceElementType.EXPERIMENT); if (traceUIAttributes != null) { String iconAttr = traceUIAttributes.getAttribute(TmfTraceTypeUIUtils.ICON_ATTR); if (iconAttr != null) { String name = traceUIAttributes.getContributor().getName(); if (name != null) { Bundle bundle = Platform.getBundle(name); if (bundle != null) { Image image = TmfProjectModelIcons.loadIcon(bundle, iconAttr); if (image != null) { return image; } } } } } return null; }
Source:
<code>public String createRecordName(String objectType) { StringBuilder sb = new StringBuilder(); Formatter formatter = new Formatter(sb, Locale.US); <START> formatter.format("SyncManagerTest_%s_%08d", objectType, (int) (Math.random()*10000000)); <END> String name = sb.toString(); return name; }</code><technical_language>System.currentTimeMillis() get current millisecond timestamp, append instead. Formatter a bit heavy for this :-)</technical_language>

Target:
protected String createRecordName(String objectType) { return String.format(Locale.US, "ManagerTest_%s_%08d", objectType, System.currentTimeMillis()); }
Source:
<code>public <T> JsonAdapter<T> adapter(Type type, Class<? extends Annotation>... annotationTypes) { if (annotationTypes.length == 1) { return adapter(type, Collections.singleton(Types.createJsonQualifierImplementation(annotationTypes[0]))); } Set<Annotation> annotations = new LinkedHashSet<>(annotationTypes.length); for (Class<? extends Annotation> annotationType : annotationTypes) { annotations.add(Types.createJsonQualifierImplementation(annotationType)); } <START> return adapter(type, annotations); <END> }</code><technical_language>Collections.unmodifiableSet</technical_language>

Target:
public <T> JsonAdapter<T> adapter(Type type, Class<? extends Annotation>... annotationTypes) { if (annotationTypes.length == 1) { return adapter(type, annotationTypes[0]); } Set<Annotation> annotations = new LinkedHashSet<>(annotationTypes.length); for (Class<? extends Annotation> annotationType : annotationTypes) { annotations.add(Types.createJsonQualifierImplementation(annotationType)); } return adapter(type, Collections.unmodifiableSet(annotations)); }
Source:
<code>public void nullAADCredential() { assertThrows(NullPointerException.class, () -> { final TextAnalyticsClientBuilder builder = new TextAnalyticsClientBuilder(); <START> builder.endpoint(getEndpoint()).credential(null).buildClient(); <END> }); }</code><technical_language>Generally, try limit scope of assertion. do threw in credential(null) buildclient()? This for other tests do same. java // arrange final TextAnalyticsClientBuilder builder = new TextAnalyticsClientBuilder(); // Act & Assert assertThrows(NullPointerException.class, () -> builder.credential(null));</technical_language>

Target:
public void nullAADCredential() { assertThrows(NullPointerException.class, () -> { final TextAnalyticsClientBuilder builder = new TextAnalyticsClientBuilder(); builder.endpoint(getEndpoint()).credential(null); }); }
Source:
<code>protected String velocifyFile(String name) { Exception eo; try { StringWriter w = new StringWriter(); Velocity.mergeTemplate(name, velocityContext, w); return w.toString(); } <START> catch(ResourceNotFoundException e) { <END> try { StringWriter w = new StringWriter(); String pkg = "com/google/gerrit/server/mail/"; Velocity.mergeTemplate(pkg + name, velocityContext, w); return w.toString(); } catch(Exception e2) { eo = e; } } catch(Exception e) { eo = e; } return "Velocity exception in template " + name + ".\n" + eo.toString(); }</code><technical_language>Style-nit: cuddle catch closing brace prior line</technical_language>

Target:
protected String velocifyFile(String name) throws EmailException { try { StringWriter w = new StringWriter(); Velocity.mergeTemplate(name, velocityContext, w); return w.toString(); } catch(ResourceNotFoundException e) { try { StringWriter w = new StringWriter(); String pkg = "com/google/gerrit/server/mail/"; Velocity.mergeTemplate(pkg + name, velocityContext, w); return w.toString(); } catch(Exception e2) { throw new EmailException("Velocity WAR template" + name + ".\n", e2); } } catch(Exception e) { throw new EmailException("Velocity template " + name + ".\n", e); } }
Source:
<code>public Log(String dataDir, long totalCapacityInBytes, long segmentCapacityInBytes, StoreMetrics metrics) throws IOException { if (totalCapacityInBytes <= 0 || segmentCapacityInBytes <= 0) { throw new IllegalArgumentException( "One of totalCapacityInBytes [" + totalCapacityInBytes + "] or " + "segmentCapacityInBytes [" + segmentCapacityInBytes + "] is <=0"); } <START> long segmentCapacity = Math.min(totalCapacityInBytes, segmentCapacityInBytes); <END> if (totalCapacityInBytes % segmentCapacity != 0) { throw new IllegalArgumentException( "Capacity of log [" + totalCapacityInBytes + "] should be a perfect multiple of segment capacity [" + segmentCapacityInBytes + "]"); } this.dataDir = dataDir; this.capacityInBytes = totalCapacityInBytes; this.metrics = metrics; remainingUnallocatedCapacity = new AtomicLong(totalCapacityInBytes); long numSegments = (totalCapacityInBytes - 1) / segmentCapacityInBytes + 1; loadSegments(segmentCapacity, numSegments); }</code><technical_language>is this necessary? segmentCapacity <= totalCapacity</technical_language>

Target:
Log(String dataDir, long totalCapacityInBytes, long segmentCapacityInBytes, StoreMetrics metrics) throws IOException { this.dataDir = dataDir; this.capacityInBytes = totalCapacityInBytes; this.metrics = metrics; File dir = new File(dataDir); File[] segmentFiles = dir.listFiles(LogSegmentNameHelper.LOG_FILE_FILTER); if (segmentFiles == null) { throw new IOException("Could not read from directory: " + dataDir); } else if (segmentFiles.length == 0) { checkArgsAndAllocateFirstSegment(totalCapacityInBytes, segmentCapacityInBytes); } else { loadSegments(segmentFiles, totalCapacityInBytes); } activeSegment = segmentsByName.lastEntry().getValue(); }
Source:
<code>public void setAttributeEnumMap(List<String> entries) { List<String> displayedAttributes = new ArrayList<>(); Map<String, Set<String>> attributeValueEnums = new HashMap<>(); for (String entry : entries) { if (entry.isEmpty()) { continue; } String[] kvPair = entry.split("=", 2); <START> String attrName = kvPair[0]; <END> displayedAttributes.add(attrName); if (kvPair.length == 2) { Set<String> valueSet = attributeValueEnums.containsKey(attrName) ? attributeValueEnums.get(attrName) : new LinkedHashSet<>(); for (String value : kvPair[1].split(",")) { String trimmedValue = value.trim(); if (trimmedValue.length() > 0) { valueSet.add(value.trim()); } } if (!valueSet.isEmpty()) { attributeValueEnums.put(attrName, valueSet); } } } setEditorAttributes(displayedAttributes); setAttributeEnumMap(attributeValueEnums); }</code><technical_language>I get exceptions if check values length of kvPair accessing them</technical_language>

Target:
public void setAttributeEnumMap(List<String> entries) { Map<String, Set<String>> mergedEntryMap = new LinkedHashMap<>(); for (String entry : entries) { if (StringUtils.isBlank(entry)) { continue; } String[] kvPair = entry.split("=", 2); String attribute = kvPair[0].trim(); if (!attribute.isEmpty()) { Set<String> values; if (mergedEntryMap.containsKey(attribute)) { values = mergedEntryMap.get(attribute); } else { values = new LinkedHashSet<>(); mergedEntryMap.put(attribute, values); } if (kvPair.length == 2) { values.addAll(Splitter.on(',').trimResults().omitEmptyStrings().splitToList(kvPair[1])); } } } Set<String> attributeSet = new LinkedHashSet<>(mergedEntryMap.keySet()); setEditorAttributes(attributeSet); mergedEntryMap.entrySet().removeIf(entry -> entry.getValue().isEmpty()); setAttributeEnumMap(mergedEntryMap); }
Source:
<code>public void update(ServiceProvider serviceProvider) { <START> long count = datastore.entityCount(ServiceProviderEntity.class, Filter.where("name").is(serviceProvider.name)); <END> if (count != 0) { throw new ServiceProviderException("Duplicate Service Provider Names are not allowed."); } datastore.save(adapt(serviceProvider)); }</code><technical_language>hmm, do test rest service for update? if try update a provider (without change name)</technical_language>

Target:
public void update(ServiceProvider serviceProvider) { long count = datastore.entityCount(ServiceProviderEntity.class, Filter.where("name").is(serviceProvider.name).and("_id").isNot(serviceProvider.id.value)); if (count != 0) { throw new ServiceProviderException("Duplicate Service Provider Names are not allowed."); } datastore.save(adapt(serviceProvider)); }
Source:
<code>public Observable<String> observePreferences() { return Observable.create(new ObservableOnSubscribe<String>() { <START> Collection<OnChangeListener> listenerReferences = <END> Collections.synchronizedList(new ArrayList<OnChangeListener>()); @Override public void subscribe(final @io.reactivex.annotations.NonNull ObservableEmitter<String> e) { final OnChangeListener onChangeListener = new OnChangeListener(e); preferences.registerOnSharedPreferenceChangeListener(onChangeListener); listenerReferences.add(onChangeListener); e.setCancellable(new Cancellable() { @Override public void cancel() { preferences.unregisterOnSharedPreferenceChangeListener(onChangeListener); listenerReferences.remove(onChangeListener); } }); } }); }</code><technical_language>final</technical_language>

Target:
public Observable<String> observePreferences() { return Observable.create(new ObservableOnSubscribe<String>() { final Collection<OnChangeListener> listenerReferences = Collections.synchronizedList(new ArrayList<OnChangeListener>()); @Override public void subscribe(final @io.reactivex.annotations.NonNull ObservableEmitter<String> e) { final OnChangeListener onChangeListener = new OnChangeListener(e); preferences.registerOnSharedPreferenceChangeListener(onChangeListener); listenerReferences.add(onChangeListener); e.setCancellable(new Cancellable() { @Override public void cancel() { preferences.unregisterOnSharedPreferenceChangeListener(onChangeListener); listenerReferences.remove(onChangeListener); } }); } }); }
Source:
<code>protected EmbeddedCacheManager createCacheManager() throws Exception { MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext()); cacheManager = TestCacheManagerFactory.createCacheManager(hotRodCacheConfiguration()); cache = cacheManager.getCache(); hotRodServer = TestHelper.startHotRodServer(cacheManager); Properties hotrodClientConf = new Properties(); hotrodClientConf.put("infinispan.client.hotrod.server_list", "localhost:" + hotRodServer.getPort()); hotrodClientConf.put("infinispan.client.hotrod.marshaller", ProtoStreamMarshaller.class.getName()); <START> remoteCacheManager = new RemoteCacheManager(hotrodClientConf); END> remoteCache = remoteCacheManager.getCache(); return cacheManager; }</code><technical_language>constructors disappearing in 6.0..</technical_language>

Target:
protected EmbeddedCacheManager createCacheManager() throws Exception { MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext()); cacheManager = TestCacheManagerFactory.createCacheManager(hotRodCacheConfiguration()); cache = cacheManager.getCache(); hotRodServer = TestHelper.startHotRodServer(cacheManager); ConfigurationBuilder clientBuilder = new ConfigurationBuilder(); clientBuilder.addServer().host("127.0.0.1").port(hotRodServer.getPort()); clientBuilder.marshaller(new ProtoStreamMarshaller()); remoteCacheManager = new RemoteCacheManager(clientBuilder.build()); remoteCache = remoteCacheManager.getCache(); return cacheManager; }
Source:
<code>private void checkDestFormatCompatibility() { for (Object item : getItems()) { VM vm = (VM) item; if (vm.getDiskMap() != null) { for (Map.Entry<Guid, Disk> pair : vm.getDiskMap().entrySet()) { DiskImage disk = (DiskImage) pair.getValue(); if (disk.getvolume_type() == VolumeType.Sparse && disk.getvolume_format() == VolumeFormat.RAW && getDiskImportData(disk.getId()) != null && (getDiskImportData(disk.getId()).getSelectedStorageDomain() .getstorage_type().isBlockDomain())) { <START> getProblematicItems().add(vm); <END> break; } } } } if (getProblematicItems().size() > 0) { getCollapseSnapshots().setEntity(true); getCollapseSnapshots().setIsChangable(false); setMessage(ConstantsManager.getInstance() .getConstants() .useSeparateImportOperationForMarkedVMsMsg()); OnPropertyChanged(new PropertyChangedEventArgs(ON_DISK_LOAD)); } }</code><technical_language>getProblematicItems anything. Method name getDisksToConvert</technical_language>

Target:
private void checkDestFormatCompatibility() { for (Object item : getItems()) { VM vm = (VM) item; if (vm.getDiskMap() != null) { for (Map.Entry<Guid, Disk> pair : vm.getDiskMap().entrySet()) { DiskImage disk = (DiskImage) pair.getValue(); if (disk.getvolume_type() == VolumeType.Sparse && disk.getvolume_format() == VolumeFormat.RAW && getDiskImportData(disk.getId()) != null && (getDiskImportData(disk.getId()).getSelectedStorageDomain() .getstorage_type().isBlockDomain())) { getDisksToConvert().add(vm); break; } } } } if (getDisksToConvert().size() > 0) { getCollapseSnapshots().setEntity(true); getCollapseSnapshots().setIsChangable(false); setMessage(ConstantsManager.getInstance() .getConstants() .useSeparateImportOperationForMarkedVMsMsg()); OnPropertyChanged(new PropertyChangedEventArgs(ON_DISK_LOAD)); } }
Source:
<code>public String getName() { <START> if (StringUtils.isBlank(name)) { <END> return StringUtils.isBlank(apiUrl) || GITHUB_URL.equals(apiUrl) ? GITHUB_NAME : SCMName.fromUrl(apiUrl, COMMON_PREFIX_HOSTNAMES); } return name; }</code><technical_language>getDisplayName() is standard pattern for jenkins shown in UI</technical_language>

Target:
public String getName() { return name; }
Source:
<code>private TaskResult processAttempt(StoredSessionAttempt attempt, Config lastStateParams, OptionRerunOn rerunOn, boolean ignoreFailure) { if (attempt.getStateFlags().isDone()) { boolean requireKicked = lastStateParams.get("require_kicked", boolean.class, false); if (!requireKicked && ( <START> rerunOn == OptionRerunOn.ALL || <END> rerunOn == OptionRerunOn.FAILED && !attempt.getStateFlags().isSuccess())) { throw nextPolling(lastStateParams.deepCopy().set("rerun_on_retry_attempt_name", UUID.randomUUID().toString())); } if (!ignoreFailure && !attempt.getStateFlags().isSuccess()) { throw new TaskExecutionException(String.format(ENGLISH, "Dependent workflow failed. Session id: %d, attempt id: %d", attempt.getSessionId(), attempt.getId())); } return TaskResult.empty(cf); } else { throw nextPolling(request.getLastStateParams().deepCopy()); } }</code><technical_language>OptionRerunOn.ALL is set, workflow executed executed require operator not, right? If so, rerunOn == OptionRerunOn.ALL depend requireKicked</technical_language>

Target:
private TaskResult processAttempt(StoredSessionAttempt attempt, Config lastStateParams, OptionRerunOn rerunOn, boolean ignoreFailure) { if (attempt.getStateFlags().isDone()) { boolean requireKicked = lastStateParams.get("require_kicked", boolean.class, false); if (!requireKicked && ( rerunOn == OptionRerunOn.ALL || rerunOn == OptionRerunOn.FAILED && !attempt.getStateFlags().isSuccess())) { throw nextPolling(lastStateParams.deepCopy().set("rerun_on_retry_attempt_name", UUID.randomUUID().toString())); } if (!ignoreFailure && !attempt.getStateFlags().isSuccess()) { throw new TaskExecutionException(String.format(ENGLISH, "Dependent workflow failed. Session id: %d, attempt id: %d", attempt.getSessionId(), attempt.getId())); } return TaskResult.empty(cf); } else { throw nextPolling(lastStateParams.deepCopy()); } }
Source:
<code>public void enableVersioning(EnableVersioningArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkArgs(args); Map<String, String> queryParamMap = new HashMap<>(); queryParamMap.put("versioning", ""); <START> VersioningConfiguration config = new VersioningConfiguration("Enabled"); <END> Response response = executePut(args.bucket(), null, null, queryParamMap, config, 0); response.body().close(); }</code><technical_language>pass a boolean a string</technical_language>

Target:
public void enableVersioning(EnableVersioningArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkArgs(args); Map<String, String> queryParamMap = new HashMap<>(); queryParamMap.put("versioning", ""); VersioningConfiguration config = new VersioningConfiguration(true); Response response = executePut(args.bucket(), null, null, queryParamMap, config, 0); response.body().close(); }
Source:
<code>protected static DefaultHardwareDevice anDevice(String name, DeviceTargetPlatform platform) throws AndroidDeviceException { DefaultHardwareDevice device = mock(DefaultHardwareDevice.class); when(device.getModel()).thenReturn(name); when(device.getTargetPlatform()).thenReturn(platform); <START> when(device.getModel()).thenReturn("Nexus 5"); <END> when(device.isDeviceReady()).thenReturn(true); when(device.screenSizeMatches("320x480")).thenReturn(true); return device; }</code><technical_language>default for this empty string? If yes, change this return empty string instead explicitly set "Nexus 5" for tests need that</technical_language>

Target:
protected static DefaultHardwareDevice anDevice(String name, DeviceTargetPlatform platform) throws AndroidDeviceException { DefaultHardwareDevice device = mock(DefaultHardwareDevice.class); when(device.getModel()).thenReturn(name); when(device.getTargetPlatform()).thenReturn(platform); when(device.isDeviceReady()).thenReturn(true); when(device.screenSizeMatches("320x480")).thenReturn(true); return device; }
Source:
<code>public void whenUpdateExistingEventTypeItUpdates() throws NakadiException, DuplicatedEventTypeNameException, IOException, NoSuchEventTypeException { EventType eventType = buildEventType(); repository.saveEventType(eventType); <START> eventType.setCategory(EventCategory.UNDEFINED); <END> repository.update(eventType); SqlRowSet rs = template.queryForRowSet("SELECT et_name, et_event_type_object FROM zn_data.event_type"); rs.next(); assertThat("Name is persisted", rs.getString(1), equalTo("event-name")); ObjectMapper mapper = (new JsonConfig()).jacksonObjectMapper(); EventType persisted = mapper.readValue(rs.getString(2), EventType.class); assertThat(persisted.getCategory(), equalTo(eventType.getCategory())); assertThat(persisted.getName(), equalTo(eventType.getName())); assertThat(persisted.getSchema().getType(), equalTo(eventType.getSchema().getType())); assertThat(persisted.getSchema().getSchema(), equalTo(eventType.getSchema().getSchema())); }</code><technical_language>This test written in safest possible. This change broken it. idea is updates persisted. set a original here</technical_language>

Target:
public void whenUpdateExistingEventTypeItUpdates() throws NakadiException, DuplicatedEventTypeNameException, IOException, NoSuchEventTypeException { EventType eventType = buildEventType(); repository.saveEventType(eventType); eventType.setCategory(EventCategory.BUSINESS); eventType.setOwningApplication("new-application"); repository.update(eventType); SqlRowSet rs = template.queryForRowSet("SELECT et_name, et_event_type_object FROM zn_data.event_type"); rs.next(); assertThat("Name is persisted", rs.getString(1), equalTo("event-name")); ObjectMapper mapper = (new JsonConfig()).jacksonObjectMapper(); EventType persisted = mapper.readValue(rs.getString(2), EventType.class); assertThat(persisted.getCategory(), equalTo(eventType.getCategory())); assertThat(persisted.getOwningApplication(), equalTo(eventType.getOwningApplication())); assertThat(persisted.getOrderingKeyFields(), equalTo(eventType.getOrderingKeyFields())); assertThat(persisted.getName(), equalTo(eventType.getName())); assertThat(persisted.getSchema().getType(), equalTo(eventType.getSchema().getType())); assertThat(persisted.getSchema().getSchema(), equalTo(eventType.getSchema().getSchema())); }
Source:
<code>public Map<TaskId, Integer> getTaskOffsetSums() { final Map<TaskId, Integer> taskOffsetSums = new HashMap<>(); for (final TaskId id : tasksOnLocalStorage()) { <START> if (isActive(id)) { <END> taskOffsetSums.put(id, ACTIVE_TASK_SENTINEL_OFFSET); } else { taskOffsetSums.put(id, 0); } } return taskOffsetSums; }</code><technical_language>No, good now</technical_language>

Target:
public Map<TaskId, Long> getTaskOffsetSums() { final Map<TaskId, Long> taskOffsetSums = new HashMap<>(); for (final TaskId id : tasksOnLocalStorage()) { if (isRunning(id)) { taskOffsetSums.put(id, Task.LATEST_OFFSET); } else { taskOffsetSums.put(id, 0L); } } return taskOffsetSums; }
Source:
<code>public void performSimpleOperationsDropSNIProxy() throws IOException, InterruptedException { final Region<String, Integer> region = getRegion(); region.put("Roy Hobbs", 9); assertThat(region.get("Roy Hobbs")).isEqualTo(9); docker.containers() .container("haproxy") .stop(); assertThatThrownBy(() -> region.get("Roy Hobbs")) .isInstanceOf(NoAvailableLocatorsException.class) .hasMessageContaining("Unable to connect to any locators in the list"); docker.containers() .container("haproxy") <START> .start(); <END> assertThat(region.get("Roy Hobbs")).isEqualTo(9); region.put("Bennie Rodriquez", 30); assertThat(region.get("Bennie Rodriquez")).isEqualTo(30); region.put("Jake Taylor", 7); region.put("Crash Davis", 8); region.put("Ricky Vaughn", 99); region.put("Ebbie Calvin LaLoosh", 37); }</code><technical_language>elected this (socket factory)</technical_language>

Target:
public void performSimpleOperationsDropSNIProxy() throws IOException, InterruptedException { final Region<String, Integer> region = getRegion(); region.put("Roy Hobbs", 9); assertThat(region.get("Roy Hobbs")).isEqualTo(9); stopProxy(); assertThatThrownBy(() -> region.get("Roy Hobbs")) .isInstanceOf(NoAvailableLocatorsException.class) .hasMessageContaining("Unable to connect to any locators in the list"); restartProxy(); await().untilAsserted(() -> assertThat(region.get("Roy Hobbs")).isEqualTo(9)); region.put("Bennie Rodriquez", 30); assertThat(region.get("Bennie Rodriquez")).isEqualTo(30); region.put("Jake Taylor", 7); region.put("Crash Davis", 8); region.put("Ricky Vaughn", 99); region.put("Ebbie Calvin LaLoosh", 37); }
Source:
<code>public String addIdentifiersFromFile(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam(required=true, value="source") IdentifierSource source, @RequestParam(required=true, value="inputFile") MultipartFile inputFile) throws Exception { IdentifierPool pool = (IdentifierPool)source; List<String> ids = new ArrayList<String>(); <START> if(inputFile!=null){ <END> try { String jsonIdentifiers = IOUtils.toString(inputFile.getInputStream()); if(StringUtils.isNotBlank(jsonIdentifiers)){ try{ ObjectMapper mapper = new ObjectMapper(); RemoteIdentifiersMessage remoteIdentifiersMessage = mapper.readValue(jsonIdentifiers, RemoteIdentifiersMessage.class); if(remoteIdentifiersMessage!=null){ ids= remoteIdentifiersMessage.getIdentifiers(); } }catch (IOException ex){ log.error("Unexpected response: " + jsonIdentifiers, ex); throw new Exception(ex); } } }catch (Exception e){ log.error("failed to read uploaded file", e); throw new Exception(e); } } iss.addIdentifiersToPool(pool, ids); request.getSession().setAttribute(WebConstants.OPENMRS_MSG_ATTR, "Success: Identifiers successfully uploaded."); return "redirect:/module/idgen/viewIdentifierSource.form?source="+source.getId(); }</code><technical_language>ObjectMapper a readValue(File, Class) method -- instead, avoid needing IOUtils</technical_language>

Target:
public String addIdentifiersFromFile(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam(required=true, value="source") IdentifierSource source, @RequestParam(required=true, value="inputFile") MultipartFile inputFile) throws Exception { IdentifierPool pool = (IdentifierPool)source; List<String> ids = new ArrayList<String>(); InputStream streamReader = null; if(inputFile != null){ try { streamReader = inputFile.getInputStream(); if(streamReader != null){ try{ ObjectMapper mapper = new ObjectMapper(); RemoteIdentifiersMessage remoteIdentifiersMessage = mapper.readValue(streamReader, RemoteIdentifiersMessage.class); if(remoteIdentifiersMessage != null){ ids = remoteIdentifiersMessage.getIdentifiers(); iss.addIdentifiersToPool(pool, ids); request.getSession().setAttribute(WebConstants.OPENMRS_MSG_ATTR, "Success: Identifiers successfully uploaded."); } }catch (IOException ex){ log.error("Unexpected response: " , ex); throw new Exception(ex); } } }catch (Exception e){ log.error("failed to read uploaded file", e); throw new Exception(e); }finally { if(streamReader != null){ streamReader.close(); } } } return "redirect:/module/idgen/viewIdentifierSource.form?source=" + source.getId(); }
Source:
<code>public void setStatus(VDSStatus status, VDS vds) { synchronized (this) { if (isNetworkExceptionDuringMaintenance(status)) { return; } if (vds == null) { vds = vdsDao.get(getVdsId()); } if (vds.getStatus() != status) { if (status == VDSStatus.PreparingForMaintenance) { calculateNextMaintenanceAttemptTime(); } vds.setPreviousStatus(vds.getStatus()); if (this.cachedVds != null) { this.cachedVds.setPreviousStatus(vds.getStatus()); } } vds.setStatus(status); if (this.cachedVds != null) { this.cachedVds.setStatus(status); } if (status != VDSStatus.Up) { <START> invalidateVdsCacheData(); <END> } switch (status) { case NonOperational: if (this.cachedVds != null) { this.cachedVds.setNonOperationalReason(vds.getNonOperationalReason()); } if (vds.getVmCount() > 0) { break; } case NonResponsive: case Down: case Maintenance: vds.setCpuSys(Double.valueOf(0)); vds.setCpuUser(Double.valueOf(0)); vds.setCpuIdle(Double.valueOf(0)); vds.setCpuLoad(Double.valueOf(0)); vds.setUsageCpuPercent(0); vds.setUsageMemPercent(0); vds.setUsageNetworkPercent(0); if (this.cachedVds != null) { this.cachedVds.setCpuSys(Double.valueOf(0)); this.cachedVds.setCpuUser(Double.valueOf(0)); this.cachedVds.setCpuIdle(Double.valueOf(0)); this.cachedVds.setCpuLoad(Double.valueOf(0)); this.cachedVds.setUsageCpuPercent(0); this.cachedVds.setUsageMemPercent(0); this.cachedVds.setUsageNetworkPercent(0); } break; case Up: vds.setInFenceFlow(false); break; default: break; } } }</code><technical_language>Cached</technical_language>

Target:
public void setStatus(VDSStatus status, VDS vds) { synchronized (this) { if (isNetworkExceptionDuringMaintenance(status)) { return; } if (vds == null) { vds = vdsDao.get(getVdsId()); } if (vds.getStatus() != status) { if (status == VDSStatus.PreparingForMaintenance) { calculateNextMaintenanceAttemptTime(); } vds.setPreviousStatus(vds.getStatus()); if (this.cachedVds != null) { this.cachedVds.setPreviousStatus(vds.getStatus()); } } vds.setStatus(status); if (this.cachedVds != null) { this.cachedVds.setStatus(status); } if (status != VDSStatus.Up) { invalidateVdsCachedData(); } switch (status) { case NonOperational: if (this.cachedVds != null) { this.cachedVds.setNonOperationalReason(vds.getNonOperationalReason()); } if (vds.getVmCount() > 0) { break; } case NonResponsive: case Down: case Maintenance: vds.setCpuSys(Double.valueOf(0)); vds.setCpuUser(Double.valueOf(0)); vds.setCpuIdle(Double.valueOf(0)); vds.setCpuLoad(Double.valueOf(0)); vds.setUsageCpuPercent(0); vds.setUsageMemPercent(0); vds.setUsageNetworkPercent(0); if (this.cachedVds != null) { this.cachedVds.setCpuSys(Double.valueOf(0)); this.cachedVds.setCpuUser(Double.valueOf(0)); this.cachedVds.setCpuIdle(Double.valueOf(0)); this.cachedVds.setCpuLoad(Double.valueOf(0)); this.cachedVds.setUsageCpuPercent(0); this.cachedVds.setUsageMemPercent(0); this.cachedVds.setUsageNetworkPercent(0); } break; case Up: vds.setInFenceFlow(false); break; default: break; } } }
Source:
<code>private void prepareResponse(final KuraResponsePayload respPayload, final List<? extends ChannelRecord> channelRecords) { requireNonNull(respPayload, message.respPayloadNonNull()); <START> requireNonNull(channelRecords, message.assetRecordsNonNull()); <END> for (final ChannelRecord channelRecord : channelRecords) { final TypedValue<?> assetValue = channelRecord.getValue(); final String value = (assetValue != null) ? String.valueOf(assetValue.getValue()) : "ERROR"; String errorText; final ChannelStatus channelStatus = channelRecord.getChannelStatus(); final ChannelFlag channelFlag = channelStatus.getChannelFlag(); final String prefix = channelRecord.getChannelName() + "#"; respPayload.addMetric(prefix + message.flag(), channelFlag.toString()); respPayload.addMetric(prefix + message.timestamp(), channelRecord.getTimestamp()); respPayload.addMetric(prefix + message.value(), value); if (channelFlag == ChannelFlag.FAILURE) { final String exceptionMessage = channelStatus.getExceptionMessage(); errorText = (exceptionMessage != null) ? exceptionMessage : ""; respPayload.addMetric(prefix + message.errorMessage(), errorText); } } }</code><technical_language>change localization method assetRecordsNonNull channelRecordsNonNull</technical_language>

Target:
private void prepareResponse(final KuraResponsePayload respPayload, final List<? extends ChannelRecord> channelRecords) { requireNonNull(respPayload, message.respPayloadNonNull()); requireNonNull(channelRecords, message.channelRecordsNonNull()); for (final ChannelRecord channelRecord : channelRecords) { final TypedValue<?> assetValue = channelRecord.getValue(); final String value = (assetValue != null) ? String.valueOf(assetValue.getValue()) : "ERROR"; String errorText; final ChannelStatus channelStatus = channelRecord.getChannelStatus(); final ChannelFlag channelFlag = channelStatus.getChannelFlag(); final String prefix = channelRecord.getChannelName() + "#"; respPayload.addMetric(prefix + message.flag(), channelFlag.toString()); respPayload.addMetric(prefix + message.timestamp(), channelRecord.getTimestamp()); respPayload.addMetric(prefix + message.value(), value); if (channelFlag == ChannelFlag.FAILURE) { final String exceptionMessage = channelStatus.getExceptionMessage(); errorText = (exceptionMessage != null) ? exceptionMessage : ""; respPayload.addMetric(prefix + message.errorMessage(), errorText); } } }
Source:
<code>private void updateCommand(@NotNull final String wsId, @NotNull final CommandDto commandUpdate, final String commandName, @NotNull AsyncCallback<WorkspaceDto> callback) { String url = null; try { url = baseHttpUrl + '/' + wsId + "/command/" + URLEncoder.encode(commandName, "UTF-8"); <START> } catch (UnsupportedEncodingException ignored) { <END> } asyncRequestFactory.createRequest(PUT, url, commandUpdate, false) .header(ACCEPT, APPLICATION_JSON) .header(CONTENT_TYPE, APPLICATION_JSON) .loader(loaderFactory.newLoader("Updating command...")) .send(newCallback(callback, dtoUnmarshallerFactory.newUnmarshaller(WorkspaceDto.class))); }</code><technical_language>silent catch is good url is null create exceptions</technical_language>

Target:
private void updateCommand(@NotNull final String wsId, @NotNull final CommandDto commandUpdate, final String commandName, @NotNull AsyncCallback<WorkspaceDto> callback) { final String url = baseHttpUrl + '/' + wsId + "/command/" + URL.encodePathSegment(commandName); asyncRequestFactory.createRequest(PUT, url, commandUpdate, false) .header(ACCEPT, APPLICATION_JSON) .header(CONTENT_TYPE, APPLICATION_JSON) .loader(loaderFactory.newLoader("Updating command...")) .send(newCallback(callback, dtoUnmarshallerFactory.newUnmarshaller(WorkspaceDto.class))); }
Source:
<code>public void setCurrentLogForLedgerAndAddToRotate(long ledgerId, BufferedLogChannel logChannel) throws IOException { acquireLock(ledgerId); try { BufferedLogChannel hasToRotateLogChannel = getCurrentLogForLedger(ledgerId); logChannel.setLedgerIdAssigned(ledgerId); ledgerIdEntryLogMap.get(ledgerId).setEntryLog(logChannel); replicaOfCurrentLogChannels.put(logChannel.getLogId(), logChannel); if (hasToRotateLogChannel != null) { replicaOfCurrentLogChannels.remove(hasToRotateLogChannel.getLogId()); rotatedLogChannels.add(hasToRotateLogChannel); } } catch (Exception e) { log.error("Received unexpected exception while fetching entry from map", e); throw new IOException("Received unexpected exception while fetching entry from map", e); } finally { <START> releaseLock(ledgerId); <END> } }</code><technical_language>releaseLock() anticipates cases lock in cache. leads a question how/when is get lock lock get unlock? i.e. if removed cache? that? IMO more clean version error scenarios be: java public Lock getLock(Long ledgerId) throws IOException { try { return ledgerIdEntryLogMap.get(ledgerId).getLedgerLock(); } catch (Exception e) { log.error("Received unexpected exception while fetching lock acquire", e); throw new IOException("Received unexpected exception while fetching lock acquire", e); } } .... final Lock lock = getLock(ledgerId); lock.lock(); try { // do stuff } finally { lock.unlock(); }</technical_language>

Target:
public void setCurrentLogForLedgerAndAddToRotate(long ledgerId, BufferedLogChannel logChannel) throws IOException { Lock lock = getLock(ledgerId); lock.lock(); try { BufferedLogChannel hasToRotateLogChannel = getCurrentLogForLedger(ledgerId); logChannel.setLedgerIdAssigned(ledgerId); BufferedLogChannelWithDirInfo logChannelWithDirInfo = new BufferedLogChannelWithDirInfo(logChannel); ledgerIdEntryLogMap.get(ledgerId).setEntryLogWithDirInfo(logChannelWithDirInfo); replicaOfCurrentLogChannels.put(logChannel.getLogId(), logChannelWithDirInfo); if (hasToRotateLogChannel != null) { replicaOfCurrentLogChannels.remove(hasToRotateLogChannel.getLogId()); rotatedLogChannels.add(hasToRotateLogChannel); } } catch (Exception e) { log.error("Received unexpected exception while fetching entry from map for ledger: " + ledgerId, e); throw new IOException("Received unexpected exception while fetching entry from map", e); } finally { lock.unlock(); } }
Source:
<code>protected Class findClass(String name) throws ClassNotFoundException { byte[] classfile; try { if (source != null) { if (translator != null) translator.onLoad(source, name); try { classfile = source.get(name).toBytecode(); } catch (NotFoundException e) { return null; } } else { String jarname = "/" + name.replace('.', '/') + ".class"; InputStream in = this.getClass().getResourceAsStream(jarname); if (in == null) return null; classfile = ClassPoolTail.readStream(in); } } catch (Exception e) { throw new ClassNotFoundException( "caught an exception while obtaining a class file for " + name, e); } int i = name.lastIndexOf('.'); if (i != -1) { String pname = name.substring(0, i); <START> if (getDefinedPackage(pname) == null) <END> try { definePackage( pname, null, null, null, null, null, null, null); } catch (IllegalArgumentException e) { } } if (domain == null) return defineClass(name, classfile, 0, classfile.length); else return defineClass(name, classfile, 0, classfile.length, domain); }</code><technical_language>getDefinedPackage is a new method Java 9. move 9 now</technical_language>

Target:
protected Class<?> findClass(String name) throws ClassNotFoundException { byte[] classfile; try { if (source != null) { if (translator != null) translator.onLoad(source, name); try { classfile = source.get(name).toBytecode(); } catch (NotFoundException e) { return null; } } else { String jarname = "/" + name.replace('.', '/') + ".class"; InputStream in = this.getClass().getResourceAsStream(jarname); if (in == null) return null; classfile = ClassPoolTail.readStream(in); } } catch (Exception e) { throw new ClassNotFoundException( "caught an exception while obtaining a class file for " + name, e); } int i = name.lastIndexOf('.'); if (i != -1) { String pname = name.substring(0, i); if (getDefinedPackage(pname) == null) try { definePackage( pname, null, null, null, null, null, null, null); } catch (IllegalArgumentException e) { } } if (domain == null) return defineClass(name, classfile, 0, classfile.length); return defineClass(name, classfile, 0, classfile.length, domain); }
Source:
<code>protected void packColumns() { if (fPackDone) { return; } fTable.setRedraw(false); try { TableColumn tableColumns[] = fTable.getColumns(); for (int i = <START> 1; i <END> < tableColumns.length; i++) { final TableColumn column = tableColumns[i]; packSingleColumn(i, column); column.setData(Key.WIDTH, column.getWidth()); } } finally { fTable.setRedraw(true); } fPackDone = true; }</code><technical_language>do want pack margin column, want set Key.WIDTH it</technical_language>

Target:
protected void packColumns() { if (fPackDone) { return; } fTable.setRedraw(false); try { TableColumn tableColumns[] = fTable.getColumns(); for (int i = 0; i < tableColumns.length; i++) { final TableColumn column = tableColumns[i]; packSingleColumn(i, column); } } finally { fTable.setRedraw(true); } fPackDone = true; }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow != null) { IWorkbenchPart activePart = activeWorkbenchWindow.getActivePage().getActivePart(); if (activePart instanceof PapyrusMultiDiagramEditor) { PapyrusMultiDiagramEditor papyrusEditor = (PapyrusMultiDiagramEditor) activePart; try { IPage nextPage = null; if (isPrevious) { nextPage = papyrusEditor.getISashWindowsContainer().getPreviousPage(); } else { nextPage = papyrusEditor.getISashWindowsContainer().getNextPage(); } papyrusEditor.getISashWindowsContainer().selectPage(nextPage); } catch (Exception e) { <START> e.printStackTrace(); <END> } } } return null; }</code><technical_language>This stderr. logged or, if appropriate, presented user (via StatusManager)</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow != null) { IWorkbenchPart activePart = activeWorkbenchWindow.getActivePage().getActivePart(); if (activePart instanceof PapyrusMultiDiagramEditor) { PapyrusMultiDiagramEditor papyrusEditor = (PapyrusMultiDiagramEditor) activePart; try { IPage nextPage = null; if (isPrevious) { nextPage = papyrusEditor.getISashWindowsContainer().getPreviousPage(); } else { nextPage = papyrusEditor.getISashWindowsContainer().getNextPage(); } papyrusEditor.getISashWindowsContainer().selectPage(nextPage); } catch (Exception e) { Activator.log.error(e); } } } return null; }
Source:
<code>public static boolean checkAppSuccessFromYarnRM(Job job) throws Exception { <START> log.info("Could not retrieve job status from JobHistory server, trying YARN ResourceManager instead."); <END> final HttpClient httpClient = new HttpClient(); final AtomicBoolean succeeded = new AtomicBoolean(false); try { httpClient.start(); RetryUtils.retry( () -> { checkAppSuccessFromYarnRMOnce(httpClient, job, succeeded); return null; }, ex -> { return !succeeded.get(); }, 5 ); return succeeded.get(); } catch (Exception e) { log.error(e, "Got exception while trying to contact YARN RM."); return false; } finally { httpClient.stop(); } }</code><technical_language>nit: this belongs called this method .. assumption of JobHistory failure here</technical_language>

Target:
public static boolean checkAppSuccessFromYarnRM(Job job) { final HttpClient httpClient = new HttpClient(); final AtomicBoolean succeeded = new AtomicBoolean(false); try { httpClient.start(); RetryUtils.retry( () -> { checkAppSuccessFromYarnRMOnce(httpClient, job, succeeded); return null; }, ex -> { return !succeeded.get(); }, 5 ); return succeeded.get(); } catch (Exception e) { log.error(e, "Got exception while trying to contact YARN RM."); return false; } finally { try { httpClient.stop(); } catch (Exception e) { log.error(e, "Got exception with httpClient.stop() while trying to contact YARN RM."); } } }
Source:
<code>@Test public void requestThrowingBeforeExecuteFailsExecute() throws IOException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new ToStringConverterFactory()) .build(); Service service = retrofit.create(Service.class); server.enqueue(new MockResponse()); final AtomicInteger writeCount = new AtomicInteger(); Object a = new Object() { @Override public String toString() { writeCount.incrementAndGet(); throw new RuntimeException("Broken!"); } }; Call<String> call = service.postRequestBody(a); try { <START> call.request(); <END> } catch (RuntimeException e) { assertThat(e).hasMessage("Broken!"); } assertThat(writeCount.get()).isEqualTo(1); try { call.execute(); } catch (RuntimeException e) { assertThat(e).hasMessage("Broken!"); } assertThat(writeCount.get()).isEqualTo(1); }</code><technical_language>fail()</technical_language>

Target:
@Test public void requestThrowingBeforeExecuteFailsExecute() throws IOException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new ToStringConverterFactory()) .build(); Service service = retrofit.create(Service.class); server.enqueue(new MockResponse()); final AtomicInteger writeCount = new AtomicInteger(); Object a = new Object() { @Override public String toString() { writeCount.incrementAndGet(); throw new RuntimeException("Broken!"); } }; Call<String> call = service.postRequestBody(a); try { call.request(); fail(); } catch (RuntimeException e) { assertThat(e).hasMessage("Broken!"); } assertThat(writeCount.get()).isEqualTo(1); try { call.execute(); fail(); } catch (RuntimeException e) { assertThat(e).hasMessage("Broken!"); } assertThat(writeCount.get()).isEqualTo(1); }
Source:
<code>private void initBoolean(boolean booleanValue) { <START> typeBitfield |= 0x00000010; <END> this.booleanValue = booleanValue; }</code><technical_language>constants for ugly hex values, is there</technical_language>

Target:
private void initBoolean(boolean booleanValue) { setBitfieldType(BOOLEAN_MASK); this.booleanValue = booleanValue; }
Source:
<code>private void restoreCollectionPreferences() { try { mShowNextReviewTime = getCol().getConf().getBoolean("estTimes"); mShowRemainingCardCount = getCol().getConf().getBoolean("dueCounts"); JSONObject revOptions = new JSONObject(); if (!getCol().getDecks().isDyn(getCol().getDecks().selected())) { <START> grevOptions = getCol().getDecks().confForDid(getCol().getDecks().selected()).getJSONObject("rev"); <END> } mOptUseGeneralTimerSettings = revOptions.optBoolean("useGeneralTimeoutSettings", true); mOptUseTimer = revOptions.optBoolean("timeoutAnswer", false); mOptWaitAnswerSecond = revOptions.optInt("timeoutAnswerSeconds", 20); mOptWaitQuestionSecond = revOptions.optInt("timeoutQuestionSeconds", 60); } catch (JSONException e) { Timber.e(e, "Unable to restoreCollectionPreferences"); throw new RuntimeException(e); } catch (NullPointerException npe) { Intent deckPicker = new Intent(this, DeckPicker.class); deckPicker.putExtra("collectionLoadError", true); deckPicker.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivityWithAnimation(deckPicker, ActivityTransitionAnimation.LEFT); } }</code><technical_language>fine, I 'grevOptions' a typo meant following? suggestion revOptions = getCol().getDecks().confForDid(getCol().getDecks().selected()).getJSONObject("rev");</technical_language>

Target:
private void restoreCollectionPreferences() { try { mShowNextReviewTime = getCol().getConf().getBoolean("estTimes"); mShowRemainingCardCount = getCol().getConf().getBoolean("dueCounts"); JSONObject revOptions = new JSONObject(); long selectedDid = getCol().getDecks().selected(); if (!getCol().getDecks().isDyn(selectedDid)) { revOptions = getCol().getDecks().confForDid(selectedDid).getJSONObject("rev"); } mOptUseGeneralTimerSettings = revOptions.optBoolean("useGeneralTimeoutSettings", true); mOptUseTimer = revOptions.optBoolean("timeoutAnswer", false); mOptWaitAnswerSecond = revOptions.optInt("timeoutAnswerSeconds", 20); mOptWaitQuestionSecond = revOptions.optInt("timeoutQuestionSeconds", 60); } catch (JSONException e) { Timber.e(e, "Unable to restoreCollectionPreferences"); throw new RuntimeException(e); } catch (NullPointerException npe) { Intent deckPicker = new Intent(this, DeckPicker.class); deckPicker.putExtra("collectionLoadError", true); deckPicker.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivityWithAnimation(deckPicker, ActivityTransitionAnimation.LEFT); } }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { if (disk != null) { if (disk.getVmEntityType() == VmEntityType.VM) { <START> return Collections.singletonList(new PermissionSubject(getParameters().getStorageDomainId(), <END> VdcObjectType.Storage, ActionGroup.CONFIGURE_VM_STORAGE)); } if (disk.getVmEntityType() == VmEntityType.TEMPLATE) { return Collections.singletonList(new PermissionSubject(disk.getvm_guid(), VdcObjectType.VmTemplate, ActionGroup.DELETE_TEMPLATE)); } } return null; }</code><technical_language>permission vm storage</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { if (disk != null) { if (disk.getVmEntityType() == VmEntityType.VM) { return Collections.singletonList(new PermissionSubject(disk.getvm_guid(), VdcObjectType.VM, ActionGroup.CONFIGURE_VM_STORAGE)); } if (disk.getVmEntityType() == VmEntityType.TEMPLATE) { return Collections.singletonList(new PermissionSubject(disk.getvm_guid(), VdcObjectType.VmTemplate, ActionGroup.DELETE_TEMPLATE)); } } return null; }
Source:
<code><START> public void map(Double minX, Double maxX, Double minY, Double maxY) { <END> if (mapper == null) { mapper = new Mapper(0, 180, 0, 180); } if (minX != mapper.getMinX() || maxX != mapper.getMaxX() || minY != mapper.getMinY() || maxY != mapper.getMaxY()) { mapper = new Mapper(minX, maxX, minY, maxY); broadcastState(); } }</code><technical_language>for clarity reanmed variables minInput maxInput, minOutput, maxOutput clear. X Y confusing</technical_language>

Target:
public void map(Double minX, Double maxX, Double minY, Double maxY) { Mapper m = new Mapper(minX, maxX, minY, maxY); this.mapper = m; }
Source:
<code>private Set<String> getCurrentFileList() throws NoSuchChangeException, OrmException, NoSuchEntityException { <START> Set<String> result = new HashSet<String>(); <END> getFileListBy(psIdNew, result); getFileListBy(psIdBase, result); return result; }</code><technical_language>nit: s/result/fileList/</technical_language>

Target:
private Set<String> getCurrentFileList() throws NoSuchChangeException, OrmException, NoSuchEntityException { Set<String> fileList = getFileListBy(psIdNew); fileList.addAll(getFileListBy(psIdBase)); return fileList; }