auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void onUnityAdsReady(String placementId) { <END> Iterator<WeakReference<UnityAdapterDelegate>> iterator = mUnityAdapterDelegatesSet.iterator(); while (iterator.hasNext()) { UnityAdapterDelegate delegate = iterator.next().get(); if (delegate != null && delegate.getPlacementId().equals(placementId)) { delegate.onUnityAdsReady(placementId); iterator.remove(); } } }</code><technical_language>I guess Banner Ad is requested, this method(onUnityAdsReady) throw a null pointer exception? getPlacementId() is null</technical_language>

Target:
public void onUnityAdsReady(String placementId) { Iterator<WeakReference<UnityAdapterDelegate>> iterator = mUnityAdapterDelegatesSet.iterator(); while (iterator.hasNext()) { UnityAdapterDelegate delegate = iterator.next().get(); if(delegate.getPlacementId()!= null){ if (delegate.getPlacementId().equals(placementId)) { delegate.onUnityAdsReady(placementId); iterator.remove(); } } } }
Source:
<code>public <T extends Projectile> Optional<T> launchProjectile(final EntityType<T> projectileType) { <START> return ProjectileLauncher.launch(checkNotNull(projectileType, "projectileType"), this, null); <END> }</code><technical_language>Objects#requireNotNull (We're cut Guava usage if eliminate it)</technical_language>

Target:
public <T extends Projectile> Optional<T> launchProjectile(final EntityType<T> projectileType) { return ProjectileLauncher.launch(requireNonNull(projectileType, "projectileType"), this, null); }
Source:
<code>public boolean valueEquals(String desiredValue, Object value) { if (value instanceof String) { if (desiredValue.equals(value)) return true; } else if (value instanceof Double) { try { if (Double.valueOf(desiredValue).equals(value)) return true; } catch (Exception e) { } } else if (value instanceof Integer) { try { if (Integer.valueOf(desiredValue).equals(value)) return true; } catch (Exception e) { } } else if (value instanceof Boolean) { try { if (Boolean.valueOf(desiredValue).equals(value)) return true; } catch (Exception e) { } } else if (value instanceof List) { List list = (List)value; for (Object val : list) { if (valueEquals(desiredValue, val)) return true; } } else if (value instanceof JsonNode) { try { <START> JsonSerialization.readValue(desiredValue, JsonNode.class).equals(value); <END> } catch (Exception e) { } } return false; }</code><technical_language>missing here? Like: "if (JsonSerialization.readValue(desiredValue, JsonNode.class).equals(value)) return true" in other types? is currently, fall bottom in case "value" is JsonNode method return false always</technical_language>

Target:
public boolean valueEquals(String desiredValue, Object value) { if (value instanceof String) { if (desiredValue.equals(value)) return true; } else if (value instanceof Double) { try { if (Double.valueOf(desiredValue).equals(value)) return true; } catch (Exception e) { } } else if (value instanceof Integer) { try { if (Integer.valueOf(desiredValue).equals(value)) return true; } catch (Exception e) { } } else if (value instanceof Boolean) { try { if (Boolean.valueOf(desiredValue).equals(value)) return true; } catch (Exception e) { } } else if (value instanceof List) { List list = (List)value; for (Object val : list) { if (valueEquals(desiredValue, val)) return true; } } else if (value instanceof JsonNode) { try { if (JsonSerialization.readValue(desiredValue, JsonNode.class).equals(value)) return true; } catch (Exception ignore) { } } return false; }
Source:
<code><START> public Device searchActiveDevice(@Identification final String deviceIdentification) <END> throws UnregisteredDeviceException, InactiveDeviceException, UnknownEntityException { final Device device = this.searchDevice(deviceIdentification); final Ssld ssld = this.ssldRepository.findOne(device.getId()); if (ssld != null) { if (!device.isActivated() || !ssld.isPublicKeyPresent()) { throw new UnregisteredDeviceException(deviceIdentification); } } if (!device.isActivated()) { throw new InactiveDeviceException(deviceIdentification); } return device; }</code><technical_language>![MAJOR](<LINK_1> Refactor this method throw checked exception instead of: com.alliander.osgp.domain.core.exceptions.UnregisteredDeviceException, com.alliander.osgp.domain.core.exceptions.InactiveDeviceException, com.alliander.osgp.domain.core.exceptions.UnknownEntityException [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public Device searchActiveDevice(@Identification final String deviceIdentification) throws UnregisteredDeviceException, InactiveDeviceException, UnknownEntityException { final Device device = this.searchDevice(deviceIdentification); final Ssld ssld = this.ssldRepository.findOne(device.getId()); if (!device.isActivated()) { throw new InactiveDeviceException(deviceIdentification); } if (ssld != null && !ssld.isPublicKeyPresent()) { throw new UnregisteredDeviceException(deviceIdentification); } return device; }
Source:
<code>public static String generateJsonDiskDescription(Disk disk) throws IOException { String diskAlias = disk.getDiskAlias(); String diskDescription = StringUtils.defaultString(disk.getDiskDescription()); <START> boolean encodeDiskAlias, encodeDiskDescription; <END> if (encodeDiskAlias = !IS_ASCII_PATTERN.matcher(diskAlias).matches()) { diskAlias = encodeDiskProperty(diskAlias); } if (encodeDiskDescription = !IS_ASCII_PATTERN.matcher(diskDescription).matches()) { diskDescription = encodeDiskProperty(diskDescription); } int diskDescriptionMetadataPotentialLength = METADATA_DESCRIPTION_VALUE_MAX_LENGTH - DESCRIPTION_METADATA_OVERHEAD_LENGTH; if (diskAlias.length() <= diskDescriptionMetadataPotentialLength) { diskDescriptionMetadataPotentialLength -= diskAlias.length(); if (diskDescription.length() > diskDescriptionMetadataPotentialLength) { diskDescription = truncateDiskProperty(disk.getDiskDescription(), diskDescriptionMetadataPotentialLength, encodeDiskDescription); log.warn("Can't store full disk description since it's too long. " + "Truncating and storing {}={}.", disk.getId(), DISK_DESCRIPTION, diskDescription); } } else { diskAlias = truncateDiskProperty(disk.getDiskAlias(), diskDescriptionMetadataPotentialLength, encodeDiskAlias); diskDescription = StringUtils.EMPTY; log.warn("Can't store full disk alias since it's too long. " + "Truncating and storing {}={}.", disk.getId(), DISK_ALIAS, diskAlias); log.warn("Can't store disk description since the alias is too long. " + "The description will be stored as an empty string.", disk.getId()); } Map<String, Object> description = new TreeMap<>(); description.put(DISK_ALIAS, diskAlias); description.put(DISK_DESCRIPTION, diskDescription); if (encodeDiskAlias || encodeDiskDescription) { int encoding = 0; if (encodeDiskAlias) { encoding = DISK_ALIAS_ENCODED; if (encodeDiskDescription) { encoding = DISK_ALIAS_AND_DESCRIPTION_ENCODED; } } else if (encodeDiskDescription) { encoding = DISK_DESCRIPTION_ENCODED; } description.put(DISK_ENCODING, encoding); } return JsonHelper.mapToJson(description, false); }</code><technical_language>please</technical_language>

Target:
public String generateJsonDiskDescription(Disk disk) throws IOException { Map<String, Object> description = new TreeMap<>(); description.put(DISK_ALIAS, disk.getDiskAlias()); description.put(DISK_DESCRIPTION, StringUtils.defaultString(disk.getDiskDescription())); return JsonHelper.mapToJson(generateJsonDiskDescription(description, DESCRIPTION_FIELDS_PRIORITY), false); }
Source:
<code>private void resetOptionSettings(IHoldsOptions holder) { IOption[] opts = holder.getOptions(); for (IOption opt : opts) { <START> Object val = opt.getDefaultValue(); <END> if (val == null) val = opt.getValue(); try { switch(opt.getValueType()){ case IOption.BOOLEAN: if (val == null) val = new Boolean(false); ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (Boolean)opt.getDefaultValue()); break; case IOption.ENUMERATED: case IOption.TREE: case IOption.STRING: if (val == null) val = ""; ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String)opt.getDefaultValue()); break; case IOption.STRING_LIST: case IOption.INCLUDE_PATH: case IOption.PREPROCESSOR_SYMBOLS: case IOption.LIBRARIES: case IOption.OBJECTS: case IOption.INCLUDE_FILES: case IOption.LIBRARY_PATHS: case IOption.LIBRARY_FILES: case IOption.MACRO_FILES: case IOption.UNDEF_INCLUDE_PATH: case IOption.UNDEF_PREPROCESSOR_SYMBOLS: case IOption.UNDEF_INCLUDE_FILES: case IOption.UNDEF_LIBRARY_PATHS: case IOption.UNDEF_LIBRARY_FILES: case IOption.UNDEF_MACRO_FILES: if (val == null) val = new String[0]; ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String[])opt.getDefaultValue()); break; } } catch (BuildException e) { continue; } } }</code><technical_language>Bunch of code assigns this variable is used, is point</technical_language>

Target:
private void resetOptionSettings(IHoldsOptions holder) { IOption[] opts = holder.getOptions(); for (IOption opt : opts) { Object val = opt.getDefaultValue(); if (val != null) { if (val instanceof Boolean) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (Boolean)val); } else if (val instanceof String[]) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String[])val); } else { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String)val); } } } }
Source:
<code>public List<AnnotationDefinition> getAllAnnotations() { if(!dependsOnOtherProjects() || getCDIProjects(true).contains(this)) { return getDefinitions().getAllAnnotations(); } <START> List<CDICoreNature> ls = CDICoreNature.toList(getCDIProjects(true)); <END> List<AnnotationDefinition> result = new ArrayList<AnnotationDefinition>(); Set<IType> types = new HashSet<IType>(); for (CDICoreNature p: ls) { List<AnnotationDefinition> ds2 = p.getDefinitions().getAllAnnotations(); for (AnnotationDefinition d: ds2) { IType t = d.getType(); if(t != null && !types.contains(t)) { types.add(t); result.add(d); } } } List<AnnotationDefinition> ds = getDefinitions().getAllAnnotations(); for (AnnotationDefinition d: ds) { IType t = d.getType(); if(t != null && !types.contains(t)) { types.add(t); result.add(d); } } return result; }</code><technical_language>Calling getCDIProjects(true) in a row (after L258) a good idea. store result in a local variable avoiding unnecessary processing</technical_language>

Target:
public List<AnnotationDefinition> getAllAnnotations() { return getDefinitions().getAllAnnotationsWithDependencies(); }
Source:
<code>@Test public void shrinkingMoreThanOnePropertyParameter() { assertThat( testResult(ShrinkingMoreThanOnePropertyParameter.class), hasSingleFailureContaining( <START> String.format("Shrunken args: [%s, %s]", new Foo(0), new Foo(1)))); <END> }</code><technical_language>In pathological case, some issues. Consider a function is defined for 0 (that's author put constraint), a generator returns 0 a shrink. In failure case, shrinks useless</technical_language>

Target:
@Test public void shrinkingMoreThanOnePropertyParameter() { assertThat( testResult(ShrinkingMoreThanOnePropertyParameter.class), hasSingleFailureContaining( String.format("Shrunken args: [%s, %s]", new Foo(1), new Foo(1)))); }
Source:
<code>public VeluxProductReference(BCproductState productState) { this.name = new ProductName(productState.getName()); this.typeId = ProductTypeId.get(productState.getTypeId()); if (this.typeId == null) { <START> logger.error( <END> "PLEASE REPORT THIS TO MAINTAINER: VeluxProductReference({}) has found an unregistered ProductTypeId.", productState.getTypeId()); } }</code><technical_language>This a WARN, ERROR. Also, drop CAPS text</technical_language>

Target:
public VeluxProductReference(BCproductState productState) { this.name = new ProductName(productState.getName()); this.typeId = ProductTypeId.get(productState.getTypeId()); if (this.typeId == null) { logger.warn( "Please report this to maintainer: VeluxProductReference({}) has found an unregistered ProductTypeId.", productState.getTypeId()); } }
Source:
<code>public void getAccountProperties() { formTrainingAsyncClient.getAccountProperties().subscribe(accountProperties -> { <START> System.out.printf("Account properties limit: %s%n", accountProperties.getLimit()); <END> System.out.printf("Account properties count: %d%n", accountProperties.getCount()); }); END: com.azure.ai.formrecognizer.FormTrainingAsyncClient.getAccountProperties }</code><technical_language>"Max number of models trained for this account"</technical_language>

Target:
public void getAccountProperties() { formTrainingAsyncClient.getAccountProperties().subscribe(accountProperties -> { System.out.printf("Max number of models that can be trained for this account: %s%n", accountProperties.getLimit()); System.out.printf("Current count of trained custom models: %d%n", accountProperties.getCount()); }); END: com.azure.ai.formrecognizer.FormTrainingAsyncClient.getAccountProperties }
Source:
<code>public void setPosition(double position) { <START> double newPosition = positionRange != null ? positionRange.limitValue(position) : position; <END> motionController.setSetpoint(newPosition); }</code><technical_language>need newPosition... put operator setSetpoint</technical_language>

Target:
public void setPosition(double position) { motionController.setSetpoint(positionRange != null ? positionRange.limitValue(position) : position); }
Source:
<code>static HasNameCell wrap(final String name) { return new HasNameCell() { @Override public Name getName() { return new Name(name); } @Override public void setName(final Name name) { <START> throw new UnsupportedOperationException(); <END> } @Override public Group render(final GridBodyCellRenderContext context) { final BaseGridCellValue<String> hasNameCellValue = new BaseGridCellValue<>(this.getName().getValue()); return RendererUtils.getCenteredCellText(context, new BaseGridCell<>(hasNameCellValue)); } }; }</code><technical_language>please add message exception. Personally for is unclear is supported</technical_language>

Target:
static HasNameCell wrap(final String name) { return new HasNameCell() { @Override public Name getName() { return new Name(name); } @Override public void setName(final Name name) { throw new UnsupportedOperationException(SET_NAME_UNSUPPORTED_MESSAGE); } @Override public Group render(final GridBodyCellRenderContext context) { final BaseGridCellValue<String> hasNameCellValue = new BaseGridCellValue<>(this.getName().getValue()); return RendererUtils.getCenteredCellText(context, new BaseGridCell<>(hasNameCellValue)); } }; }
Source:
<code>public DvrpPassengerEventsReader(EventsManager events) { delegate = new EventsReaderXMLv1(events); this.setValidating(false); delegate.addCustomEventMapper(PassengerRequestRejectedEvent.EVENT_TYPE, getPassengerRequestRejectedEventMapper()); <START> delegate.addCustomEventMapper(PassengerRequestScheduledEvent.EVENT_TYPE, getPassengerRequestScheduledEventMapper()); <END> delegate.addCustomEventMapper(PassengerRequestSubmittedEvent.EVENT_TYPE, getPassengerRequestSubmittedEventMapper()); }</code><technical_language>method references cleaner (one level of abstraction less). is example: delegate.addCustomEventMapper(PassengerRequestScheduledEvent.EVENT_TYPE, this::passengerRequestScheduledEvent); modified method: private PassengerRequestScheduledEvent passengerRequestScheduledEvent(GenericEvent event) { Map<String, String> attributes = event.getAttributes(); double time = Double.parseDouble(attributes.get(PassengerRequestScheduledEvent.ATTRIBUTE_TIME)); String mode = attributes.get(PassengerRequestScheduledEvent.ATTRIBUTE_MODE); Id<Request> requestId = Id.create(attributes.get(PassengerRequestScheduledEvent.ATTRIBUTE_REQUEST), Request.class); Id<Person> personId = Id.createPersonId(attributes.get(PassengerRequestScheduledEvent.ATTRIBUTE_PERSON)); Id<DvrpVehicle> vehicleId = Id.create(attributes.get(PassengerRequestScheduledEvent.ATTRIBUTE_VEHICLE), DvrpVehicle.class); double pickupTime = Double.parseDouble(attributes.get(PassengerRequestScheduledEvent.ATTRIBUTE_PICKUP_TIME)); double dropoffTime = Double.parseDouble(attributes.get(PassengerRequestScheduledEvent.ATTRIBUTE_DROPOFF_TIME)); return new PassengerRequestScheduledEvent(time, mode, requestId, personId, vehicleId, pickupTime, dropoffTime); }</technical_language>

Target:
public DvrpPassengerEventsReader(EventsManager events) { delegate = new EventsReaderXMLv1(events); this.setValidating(false); delegate.addCustomEventMapper(PassengerRequestRejectedEvent.EVENT_TYPE, this::passengerRequestRejectedEvent); delegate.addCustomEventMapper(PassengerRequestScheduledEvent.EVENT_TYPE, this::passengerRequestScheduledEvent); delegate.addCustomEventMapper(PassengerRequestSubmittedEvent.EVENT_TYPE, this::passengerRequestSubmittedEvent); }
Source:
<code><START> ASTExpression getLengthExpression() { <END> return (ASTExpression) jjtGetChild(jjtGetNumChildren() - 1); }</code><technical_language>getLengthExpression, package private? public</technical_language>

Target:
public ASTExpression getLengthExpression() { return (ASTExpression) jjtGetChild(jjtGetNumChildren() - 1); }
Source:
<code>public void handleGetAssocationLnObjectsResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final AssociationLnListTypeDto resultData) { ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } final AssociationLnListType associationLnListValueDomain = this.mapperFactory.getMapperFacade().map(resultData, AssociationLnListType.class); <START> this.webServiceResponseMessageSender.send( <END> ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(associationLnListValueDomain) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }</code><technical_language>Extract building of ResponseMessage variable (in eclipse, select text, right-click > refactor > extract local variable / select code + shift+alt+L). This code a bit more readable, especially passing in other besides ResponseMessage</technical_language>

Target:
public void handleGetAssocationLnObjectsResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final AssociationLnListTypeDto resultData) { ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } final AssociationLnListType associationLnListValueDomain = this.mapperFactory.getMapperFacade().map(resultData, AssociationLnListType.class); ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(associationLnListValueDomain) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send( responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
<code>public final String getESResultJson(final String esQueryJson, final String url) { StringBuilder stringBuilder = new StringBuilder(); try { HttpClient httpClient = new DefaultHttpClient(); String encodedJson = URLEncoder.encode(esQueryJson, UTF_8); String esGetURL = url + encodedJson; HttpGet getRequest = new HttpGet(esGetURL); getRequest.setHeader(USER_AGENT, IDEA_PLUGIN); HttpResponse response = httpClient.execute(getRequest); if (response.getStatusLine().getStatusCode() != HTTP_OK_STATUS) { throw new RuntimeException(FAILED_HTTP_ERROR_CODE + <START> response.getStatusLine().getStatusCode()); <END> } BufferedReader bufferedReader = new BufferedReader( new InputStreamReader((response.getEntity().getContent()), UTF_8)); String output; while ((output = bufferedReader.readLine()) != null) { stringBuilder.append(output); } bufferedReader.close(); httpClient.getConnectionManager().shutdown(); } catch (IllegalStateException e) { e.printStackTrace(); return RefreshAction.EMPTY_ES_URL; } catch (MalformedURLException e) { e.printStackTrace(); return RefreshAction.EMPTY_ES_URL; } catch (IOException e) { e.printStackTrace(); return RefreshAction.EMPTY_ES_URL; } catch (IllegalArgumentException e) { e.printStackTrace(); return RefreshAction.EMPTY_ES_URL; } return stringBuilder.toString(); }</code><technical_language>Put response.getResponseBody error code both</technical_language>

Target:
public final String getESResultJson(final String esQueryJson, final String url) { StringBuilder stringBuilder = new StringBuilder(); try { HttpClient httpClient = new DefaultHttpClient(); String encodedJson = URLEncoder.encode(esQueryJson, UTF_8); String esGetURL = url + encodedJson; HttpGet getRequest = new HttpGet(esGetURL); getRequest.setHeader(USER_AGENT, IDEA_PLUGIN); HttpResponse response = httpClient.execute(getRequest); if (response.getStatusLine().getStatusCode() != HTTP_OK_STATUS) { throw new RuntimeException(FAILED_HTTP_ERROR + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase()); } BufferedReader bufferedReader = new BufferedReader( new InputStreamReader((response.getEntity().getContent()), UTF_8)); String output; while ((output = bufferedReader.readLine()) != null) { stringBuilder.append(output); } bufferedReader.close(); httpClient.getConnectionManager().shutdown(); } catch (IllegalStateException e) { e.printStackTrace(); return RefreshAction.EMPTY_ES_URL; } catch (MalformedURLException e) { e.printStackTrace(); return RefreshAction.EMPTY_ES_URL; } catch (IOException e) { e.printStackTrace(); return RefreshAction.EMPTY_ES_URL; } catch (IllegalArgumentException e) { e.printStackTrace(); return RefreshAction.EMPTY_ES_URL; } return stringBuilder.toString(); }
Source:
<code>private static JsonParserIterator<SupervisorStatus> getSupervisors( DruidLeaderClient indexingServiceClient, ObjectMapper jsonMapper, BytesAccumulatingResponseHandler responseHandler ) { Request request; try { request = indexingServiceClient.makeRequest( HttpMethod.GET, <START> StringUtils.format("/druid/indexer/v1/supervisor?fullStatus"), <END> false ); } catch (IOException e) { throw new RuntimeException(e); } ListenableFuture<InputStream> future = indexingServiceClient.goAsync( request, responseHandler ); final JavaType typeRef = jsonMapper.getTypeFactory().constructType(new TypeReference<SupervisorStatus>() { }); return new JsonParserIterator<>( typeRef, future, request.getUrl().toString(), null, request.getUrl().getHost(), jsonMapper, responseHandler ); }</code><technical_language>Is a benefit of StringUtils.format() if args formatted</technical_language>

Target:
private static JsonParserIterator<SupervisorStatus> getSupervisors( DruidLeaderClient indexingServiceClient, ObjectMapper jsonMapper, BytesAccumulatingResponseHandler responseHandler ) { Request request; try { request = indexingServiceClient.makeRequest( HttpMethod.GET, "/druid/indexer/v1/supervisor?system", false ); } catch (IOException e) { throw new RuntimeException(e); } ListenableFuture<InputStream> future = indexingServiceClient.goAsync( request, responseHandler ); final JavaType typeRef = jsonMapper.getTypeFactory().constructType(new TypeReference<SupervisorStatus>() { }); return new JsonParserIterator<>( typeRef, future, request.getUrl().toString(), null, request.getUrl().getHost(), jsonMapper, responseHandler ); }
Source:
<code>public @Nonnull Collection<V> values() { return mainMap.values() .stream() <START> .collect(ImmutableList.toImmutableList()); <END> }</code><technical_language>please replace return ImmutableList.copyOf(mainMap.values());</technical_language>

Target:
public @Nonnull Collection<V> values() { return ImmutableList.copyOf(mainMap.values()); }
Source:
<code>public void pass_the_null_tolerance_check() { final NullToleranceTest nullToleranceTest = NullToleranceTest.newBuilder() .setClass(Events.class) <START> .addDefaultValue(newArrayList()) <END> .addDefaultValue(stringValue.getClass()) .build(); final boolean passed = nullToleranceTest.check(); assertTrue(passed); }</code><technical_language>Instead provide default values for collections in NullToleranceTest itself</technical_language>

Target:
public void pass_the_null_tolerance_check() { final NullToleranceTest nullToleranceTest = NullToleranceTest.newBuilder() .setClass(Events.class) .addDefaultValue(stringValue.getClass()) .build(); final boolean passed = nullToleranceTest.check(); assertTrue(passed); }
Source:
<code>public void showEmptyCharges() { <START> if (recyclerCount() == 0) { <END> ll_error.setVisibility(View.VISIBLE); mNoChargesText.setText(getResources().getString(R.string.message_no_charges_available)); mNoChargesIcon.setImageResource(R.drawable.ic_assignment_turned_in_black_24dp); } }</code><technical_language>if (mChargesNameListAdapter.getItemCount() == 0) {</technical_language>

Target:
public void showEmptyCharges() { if (mChargesNameListAdapter == null || mChargesNameListAdapter.getItemCount() == 0) { ll_error.setVisibility(View.VISIBLE); mNoChargesText.setText(getResources().getString(R.string.message_no_charges_available)); mNoChargesIcon.setImageResource(R.drawable.ic_assignment_turned_in_black_24dp); } }
Source:
<code>public void shouldCheckRateLimitsWhenFilterIsInvoked() throws Exception { rateLimiterFilter.filter(mockContainerRequestContext); <START> verify(rateLimiter).checkRateOf(any(), any(), any()); <END> }</code><technical_language>This a bit tighter I called account-id mockSecurityContext return values for api key method checked too? assure correct values security context</technical_language>

Target:
public void shouldCheckRateLimitsWhenFilterIsInvoked() throws Exception { when(mockContainerRequestContext.getHeaderString("Authorization")).thenReturn("apiKey"); when(mockContainerRequestContext.getMethod()).thenReturn("POST"); rateLimiterFilter.filter(mockContainerRequestContext); verify(rateLimiter).checkRateOf(ACCOUNT_ID, "POST-apiKey", "POST"); }
Source:
<code>public void clearThreadLocalCache() { String canonicalPath = localRealm.get().getPath(); localCount.set(null); localRealm.set(null); globalCount--; if (globalCount < 0) { <START> throw new IllegalStateException("Global reference counter of Realm" + canonicalPath + " got corrupted."); <END> } }</code><technical_language>suggestion throw new IllegalStateException("Global reference counter of Realm" + canonicalPath + " negative.");</technical_language>

Target:
public void clearThreadLocalCache() { String canonicalPath = localRealm.get().getPath(); localCount.set(null); localRealm.set(null); if (globalCount.decrementAndGet() < 0) { throw new IllegalStateException("Global reference counter of Realm" + canonicalPath + " can not be negative."); } }
Source:
<code>public static List<HostAddress> parse(String spec, HaMode haMode) { if (spec == null) { throw new IllegalArgumentException("Invalid connection URL, host address must not be empty "); } if ("".equals(spec)) { return new ArrayList<>(0); } String[] tokens = spec.trim().split(","); List<HostAddress> arr = new ArrayList<>(tokens.length); if (haMode == HaMode.AURORA && System.getProperty("auroraFailoverTesting") == null) { Pattern clusterPattern = Pattern.compile("(.+)\\.cluster-([a-z0-9]+\\.[a-z0-9\\-]+\\.rds\\.amazonaws\\.com)"); Matcher matcher = clusterPattern.matcher(spec); if ((tokens.length > 1 || (tokens.length == 1 && !matcher.find()))) { <START> throw new IllegalArgumentException("Invalid Aurora connection URL, address should correspond to cluster endpoint"); <END> } } for (String token : tokens) { if (token.startsWith("address=")) { arr.add(parseParameterHostAddress(token)); } else { arr.add(parseSimpleHostAddress(token)); } } int defaultPort = arr.get(arr.size() - 1).port; if (defaultPort == 0) { defaultPort = 3306; } for (int i = 0; i < arr.size(); i++) { if (haMode == HaMode.REPLICATION) { if (i == 0 && arr.get(i).type == null) { arr.get(i).type = ParameterConstant.TYPE_MASTER; } else if (i != 0 && arr.get(i).type == null) { arr.get(i).type = ParameterConstant.TYPE_SLAVE; } } if (arr.get(i).port == 0) { arr.get(i).port = defaultPort; } } return arr; }</code><technical_language>cluster end point encouraged, for migration, driver need permit existing configuration. current user of aurora this exception thrown. A solution small adjustment this PR permit discovery cluster end-point, this PR merged new logging feature. add a warning If cluster end-point</technical_language>

Target:
public static List<HostAddress> parse(String spec, HaMode haMode) { if (spec == null) { throw new IllegalArgumentException("Invalid connection URL, host address must not be empty "); } if ("".equals(spec)) { return new ArrayList<>(0); } String[] tokens = spec.trim().split(","); List<HostAddress> arr = new ArrayList<>(tokens.length); for (String token : tokens) { if (token.startsWith("address=")) { arr.add(parseParameterHostAddress(token)); } else { arr.add(parseSimpleHostAddress(token)); } } int defaultPort = arr.get(arr.size() - 1).port; if (defaultPort == 0) { defaultPort = 3306; } for (int i = 0; i < arr.size(); i++) { if (haMode == HaMode.REPLICATION) { if (i == 0 && arr.get(i).type == null) { arr.get(i).type = ParameterConstant.TYPE_MASTER; } else if (i != 0 && arr.get(i).type == null) { arr.get(i).type = ParameterConstant.TYPE_SLAVE; } } if (arr.get(i).port == 0) { arr.get(i).port = defaultPort; } } return arr; }
Source:
<code>private void initPhotoPicker() { mPhotoPickerContainer = findViewById(R.id.photo_fragment_container); resizePhotoPicker(); <START> MediaBrowserType mediaBrowserType = <END> mShowAztecEditor ? MediaBrowserType.AZTEC_EDITOR_PICKER : MediaBrowserType.EDITOR_PICKER; mPhotoPickerFragment = (PhotoPickerFragment) getFragmentManager().findFragmentByTag(PHOTO_PICKER_TAG); if (mPhotoPickerFragment == null) { mPhotoPickerFragment = PhotoPickerFragment.newInstance(this, mediaBrowserType, getSite()); getFragmentManager() .beginTransaction() .add(R.id.photo_fragment_container, mPhotoPickerFragment, PHOTO_PICKER_TAG) .commit(); } }</code><technical_language>Super minor: picker fragment is conditionally recreated, wdyt including mediaBrowserType setup conditional? there</technical_language>

Target:
private void initPhotoPicker() { mPhotoPickerContainer = findViewById(R.id.photo_fragment_container); resizePhotoPicker(); mPhotoPickerFragment = (PhotoPickerFragment) getFragmentManager().findFragmentByTag(PHOTO_PICKER_TAG); if (mPhotoPickerFragment == null) { MediaBrowserType mediaBrowserType = mShowAztecEditor ? MediaBrowserType.AZTEC_EDITOR_PICKER : MediaBrowserType.EDITOR_PICKER; mPhotoPickerFragment = PhotoPickerFragment.newInstance(this, mediaBrowserType, getSite()); getFragmentManager() .beginTransaction() .add(R.id.photo_fragment_container, mPhotoPickerFragment, PHOTO_PICKER_TAG) .commit(); } }
Source:
<code>public PsiElement exposeByName(String name) { if (name == null) return null; if (hasWildcard()) { for (HaxeModel exposedMember : getExposedMembers()) { if (Objects.equals(exposedMember.getName(), name)) return exposedMember.getBasePsi(); } } else { if (getReferenceExpression() != null) { FullyQualifiedInfo qualifiedInfo = getQualifiedInfo(); if (equalsToAlias(name) || qualifiedInfo.equalsToNamedPart(name) || getExposedMember(name) != null) { HaxeModel result = getExposedMember(name); return result != null ? result.getBasePsi() : null; <START> } <END> } } return null; }</code><technical_language>block need if guard. In case, getExposedMember(name) is called of result tells return getBasePsi() null</technical_language>

Target:
public PsiElement exposeByName(String name) { if (name == null) return null; if (hasWildcard()) { for (HaxeModel exposedMember : getExposedMembers()) { if (Objects.equals(exposedMember.getName(), name)) return exposedMember.getBasePsi(); } } else { if (getReferenceExpression() != null) { FullyQualifiedInfo qualifiedInfo = getQualifiedInfo(); HaxeModel member = getExposedMember(name); if (((equalsToAlias(name) || qualifiedInfo.equalsToNamedPart(name)) && member != null) || member != null) { return member.getBasePsi(); } } } return null; }
Source:
<code>public PinotTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName) { if (!listSchemaNames(session).contains(tableName.getSchemaName().toLowerCase(ENGLISH))) { return null; <START> } <END> String pinotTableName; try { pinotTableName = getPinotTableNameFromPrestoTableName(tableName.getTableName()); PinotTable table = pinotPrestoConnection.getTable(pinotTableName); if (table == null) { return null; } } catch (Exception e) { throw new PrestoException( PINOT_FAILURE_GETTING_TABLE, String.format("Failed to get TableHandle for %s", tableName), e); } return new PinotTableHandle(connectorId, tableName.getSchemaName(), pinotTableName); }</code><technical_language>put empty line</technical_language>

Target:
public PinotTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName) { if (!listSchemaNames(session).contains(tableName.getSchemaName().toLowerCase(ENGLISH))) { return null; } String pinotTableName; try { pinotTableName = getPinotTableNameFromPrestoTableName(tableName.getTableName()); PinotTable table = pinotPrestoConnection.getTable(pinotTableName); if (table == null) { return null; } } catch (Exception e) { throw new PrestoException( PINOT_FAILURE_GETTING_TABLE, String.format("Failed to get TableHandle for %s", tableName), e); } return new PinotTableHandle(tableName.getSchemaName(), pinotTableName); }
Source:
<code>protected MapSqlParameterSource createFullParametersMapper(HostDevice entity) { return createIdParameterMapper(entity.getId()) .addValue("parent_device_name", entity.getParentDeviceName()) .addValue("capability", entity.getCapability()) .addValue("iommu_group", entity.getIommuGroup()) <START> .addValue("mdev_types", StringUtils.join(entity.getMdevTypes(), ",")) <END> .addValue("product_name", entity.getProductName()) .addValue("product_id", entity.getProductId()) .addValue("vendor_name", entity.getVendorName()) .addValue("vendor_id", entity.getVendorId()) .addValue("physfn", entity.getParentPhysicalFunction()) .addValue("total_vfs", entity.getTotalVirtualFunctions()) .addValue("net_iface_name", entity.getNetworkInterfaceName()) .addValue("driver", entity.getDriver()) .addValue("is_assignable", entity.isAssignable()) .addValue("address", SerializationFactory.getSerializer().serialize(entity.getAddress())); }</code><technical_language>is pure a pure Java solution: <LINK_0></technical_language>

Target:
protected MapSqlParameterSource createFullParametersMapper(HostDevice entity) { return createIdParameterMapper(entity.getId()) .addValue("parent_device_name", entity.getParentDeviceName()) .addValue("capability", entity.getCapability()) .addValue("iommu_group", entity.getIommuGroup()) .addValue("mdev_types", String.join(",", entity.getMdevTypes())) .addValue("product_name", entity.getProductName()) .addValue("product_id", entity.getProductId()) .addValue("vendor_name", entity.getVendorName()) .addValue("vendor_id", entity.getVendorId()) .addValue("physfn", entity.getParentPhysicalFunction()) .addValue("total_vfs", entity.getTotalVirtualFunctions()) .addValue("net_iface_name", entity.getNetworkInterfaceName()) .addValue("driver", entity.getDriver()) .addValue("is_assignable", entity.isAssignable()) .addValue("address", SerializationFactory.getSerializer().serialize(entity.getAddress())); }
Source:
<code><START> private void doubleClickXY(int x, int y) { <END> log.debug(MessageFormat.format("Double-clicking on {0}", widget)); notify(SWT.MouseEnter); notify(SWT.MouseMove); notify(SWT.Activate); notify(SWT.FocusIn); notify(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.NONE, 1)); notify(SWT.MouseUp, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); notify(SWT.Selection, createSelectionEvent(SWT.BUTTON1)); notify(SWT.MouseDoubleClick, createMouseEvent(x, y, 1, SWT.BUTTON1, 2)); notify(SWT.DefaultSelection); notify(SWT.MouseHover); notify(SWT.MouseMove); notify(SWT.MouseExit); notify(SWT.Deactivate); notify(SWT.FocusOut); log.debug(MessageFormat.format("Double-clicked on {0}", widget)); }</code><technical_language>This @Override of implemenatioin super type.</technical_language>

Target:
protected void doubleClickXY(int x, int y) { log.debug(MessageFormat.format("Double-clicking on {0}", widget)); notify(SWT.MouseEnter); notify(SWT.MouseMove); notify(SWT.Activate); notify(SWT.FocusIn); notify(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.NONE, 1)); notify(SWT.MouseUp, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); notify(SWT.Selection, createSelectionEvent(SWT.BUTTON1)); notify(SWT.MouseDoubleClick, createMouseEvent(x, y, 1, SWT.BUTTON1, 2)); notify(SWT.DefaultSelection); notify(SWT.MouseHover); notify(SWT.MouseMove); notify(SWT.MouseExit); notify(SWT.Deactivate); notify(SWT.FocusOut); log.debug(MessageFormat.format("Double-clicked on {0}", widget)); }
Source:
<code>public void testFindStorageDomainForMemoryWithEmptyDomainsList() { <START> verifyNoDomainForMemory(new ArrayList<StorageDomain>()); <END> }</code><technical_language>Collections.emptyList()</technical_language>

Target:
public void testFindStorageDomainForMemoryWithEmptyDomainsList() { verifyNoDomainForMemory(Collections.<StorageDomain>emptyList()); }
Source:
<code>public void runsOneIterationIfRequested() { <START> SweepResults resultsWithMoreToSweep = SweepResults.createEmptySweepResult(Optional.of(new byte[] {0x55})); <END> setupTaskRunner(resultsWithMoreToSweep); sweeperService.sweepTable(TABLE_REF.getQualifiedName(), Optional.empty(), Optional.of(false), Optional.empty(), Optional.empty(), Optional.empty()); verify(sweepTaskRunner, times(1)).run(any(), any(), any()); verifyNoMoreInteractions(sweepTaskRunner); }</code><technical_language>nit: verify results recorded well</technical_language>

Target:
public void runsOneIterationIfRequested() { setupTaskRunner(RESULTS_WITH_MORE_TO_SWEEP); sweeperService.sweepTable(TABLE_REF.getQualifiedName(), Optional.empty(), Optional.of(false), Optional.empty(), Optional.empty(), Optional.empty()); verify(sweepTaskRunner, times(1)).run(any(), any(), any()); verifyNoMoreInteractions(sweepTaskRunner); }
Source:
<code>public void testDeserialize() throws Exception { String data = getFixture("/v1/accounts/acct_123"); Account resource = APIResource.GSON.fromJson(data, Account.class); assertNotNull(resource); <START> assertNotNull(resource.getId()); <END> }</code><technical_language>want specific edge-case fixtures ensure deserialization works needed</technical_language>

Target:
public void testDeserialize() throws Exception { final String data = getFixture("/v1/accounts/acct_123"); final Account resource = APIResource.GSON.fromJson(data, Account.class); assertNotNull(resource); assertNotNull(resource.getId()); }
Source:
<code>private void processDiscriminator(String discriminator, Map<String, Property> properties, String file) { for (Map.Entry<String, Property> prop : properties.entrySet()) { if (prop.getKey().equals(discriminator)){ if (prop.getValue() instanceof StringProperty){ StringProperty stringProperty = (StringProperty) prop.getValue(); if(stringProperty.getEnum() != null){ for(String name: stringProperty.getEnum()){ processRefProperty(new RefProperty(RefType.DEFINITION.getInternalPrefix()+name), file); } } <START> }else if (prop.getValue() instanceof RefProperty) { <END> String ref = ((RefProperty) prop.getValue()).getSimpleRef(); Object resolved = swagger.getDefinitions().get(ref); if (resolved instanceof ModelImpl) { ModelImpl schema = (ModelImpl) resolved; if (schema.getEnum() != null) { for (String name : schema.getEnum()) { processRefProperty(new RefProperty(RefType.DEFINITION.getInternalPrefix() + name), file); } } } } } } }</code><technical_language>fix formatting add space bracket</technical_language>

Target:
private void processDiscriminator(String discriminator, Map<String, Property> properties, String file) { for (Map.Entry<String, Property> prop : properties.entrySet()) { if (prop.getKey().equals(discriminator)){ if (prop.getValue() instanceof StringProperty){ StringProperty stringProperty = (StringProperty) prop.getValue(); if(stringProperty.getEnum() != null){ for(String name: stringProperty.getEnum()){ processRefProperty(new RefProperty(RefType.DEFINITION.getInternalPrefix()+name), file); } } }else if (prop.getValue() instanceof RefProperty) { String ref = ((RefProperty) prop.getValue()).getSimpleRef(); Map<String, String> renameCache = cache.getRenameCache(); for (String key : renameCache.keySet()) { String value = renameCache.get(key); if (value.equals(ref)) { Object resolved = cache.getResolutionCache().get(key); if(resolved != null) { if (resolved instanceof ModelImpl) { ModelImpl schema = (ModelImpl) resolved; if (schema.getEnum() != null) { for (String name : schema.getEnum()) { processRefProperty(new RefProperty(RefType.DEFINITION.getInternalPrefix() + name), file); } } } } } } } } } }
Source:
<code><START> public Iterable<StreamInputReader> getStreamInputReaders() { <END> return fStreamInputReaders; }</code><technical_language>simple enough. OK exposing objects though? iterate modify readers individually. making sure..</technical_language>

Target:
public Iterable<IDeclarationProvider> getStreamInputReaders() { return new LinkedList<IDeclarationProvider>(fStreamInputReaders); }
Source:
<code>private void populateChangeRow(final int row, final ChangeInfo c, final ChangeRowFormatter changeRowFormatter) { ChangeCache cache = ChangeCache.get(c.getId()); cache.getChangeInfoCache().set(c); table.setWidget(row, C_ARROW, null); if (Gerrit.isSignedIn()) { table.setWidget(row, C_STAR, StarredChanges.createIcon(c.getId(), c.isStarred())); } String s = Util.cropSubject(c.getSubject()); if (c.getStatus() != null && c.getStatus() != Change.Status.NEW) { s += " (" + c.getStatus().name() + ")"; } if (changeRowFormatter != null) { removeChangeStyle(row, changeRowFormatter); final String rowStyle = changeRowFormatter.getRowStyle(c); if (rowStyle != null) { table.getRowFormatter().addStyleName(row, rowStyle); } s = changeRowFormatter.getDisplayText(c, s); } table.setWidget(row, C_SUBJECT, new TableChangeLink(s, c)); table.setWidget(row, C_OWNER, link(c.getOwner())); table.setWidget(row, C_PROJECT, new ProjectLink(c.getProject().getKey(), c .getStatus())); table.setWidget(row, C_BRANCH, new BranchLink(c.getProject().getKey(), c .getStatus(), c.getBranch(), c.getTopic())); String lastUpdate = shortFormat(c.getLastUpdatedOn()); if (showPatchsetLevel) { <START> lastUpdate = "PS-" + c.getPatchSetId().toString() + " " + lastUpdate; <END> } table.setText(row, C_LAST_UPDATE, lastUpdate); setRowItem(row, c); }</code><technical_language>a NPE if clicking a change in dependencies table. c.getPatchSetId() is null in this case</technical_language>

Target:
private void populateChangeRow(final int row, final ChangeInfo c, final ChangeRowFormatter changeRowFormatter) { ChangeCache cache = ChangeCache.get(c.getId()); cache.getChangeInfoCache().set(c); table.setWidget(row, C_ARROW, null); if (Gerrit.isSignedIn()) { table.setWidget(row, C_STAR, StarredChanges.createIcon(c.getId(), c.isStarred())); } String s = Util.cropSubject(c.getSubject()); if (c.getStatus() != null && c.getStatus() != Change.Status.NEW) { s += " (" + c.getStatus().name() + ")"; } if (changeRowFormatter != null) { removeChangeStyle(row, changeRowFormatter); final String rowStyle = changeRowFormatter.getRowStyle(c); if (rowStyle != null) { table.getRowFormatter().addStyleName(row, rowStyle); } s = changeRowFormatter.getDisplayText(c, s); } table.setWidget(row, C_SUBJECT, new TableChangeLink(s, c)); table.setWidget(row, C_OWNER, link(c.getOwner())); table.setWidget(row, C_PROJECT, new ProjectLink(c.getProject().getKey(), c .getStatus())); table.setWidget(row, C_BRANCH, new BranchLink(c.getProject().getKey(), c .getStatus(), c.getBranch(), c.getTopic())); table.setText(row, C_PATCHSET_NUM, String.format("%d", c.getPatchSetId().get())); table.setText(row, C_LAST_UPDATE, shortFormat(c.getLastUpdatedOn())); setRowItem(row, c); }
Source:
<code>private void publish(TimeAlert alert) { ScalingEvent event = new ScalingEvent(alert); int hostGroupNodeCount = getHostGroupNodeCount(alert.getCluster(), alert.getScalingPolicy()); int desiredNodeCount = scalingPolicyTargetCalculator.getDesiredNodeCount(event, hostGroupNodeCount); <START> int targetNodeCount = desiredNodeCount - hostGroupNodeCount; <END> event.setHostGroupNodeCount(hostGroupNodeCount); event.setDesiredHostGroupNodeCount(desiredNodeCount); if (targetNodeCount < 0) { populateDecommissionCandidates(event, alert.getCluster(), alert.getScalingPolicy(), -targetNodeCount); } eventPublisher.publishEvent(event); LOGGER.debug("Time alert '{}' triggered for cluster '{}'", alert.getName(), alert.getCluster().getStackCrn()); }</code><technical_language>Rename targetIncrementalNodeCount</technical_language>

Target:
private void publish(TimeAlert alert) { ScalingEvent event = new ScalingEvent(alert); StackV4Response stackV4Response = cloudbreakCommunicator.getByCrn(alert.getCluster().getStackCrn()); int hostGroupNodeCount = stackResponseUtils.getNodeCountForHostGroup(stackV4Response, alert.getScalingPolicy().getHostGroup()); int desiredAbsoluteNodeCount = scalingPolicyTargetCalculator.getDesiredAbsoluteNodeCount(event, hostGroupNodeCount); int targetIncrementNodeCount = desiredAbsoluteNodeCount - hostGroupNodeCount; event.setHostGroupNodeCount(hostGroupNodeCount); event.setDesiredAbsoluteHostGroupNodeCount(desiredAbsoluteNodeCount); if (targetIncrementNodeCount < 0) { populateDecommissionCandidates(event, stackV4Response, alert.getCluster(), alert.getScalingPolicy(), -targetIncrementNodeCount); } eventPublisher.publishEvent(event); LOGGER.debug("Time alert '{}' triggered for cluster '{}'", alert.getName(), alert.getCluster().getStackCrn()); }
Source:
<code>public static JButton createExtendSimulationButton(final MCMCWrapper model) { JButton button = new JButton(Main.IMAGELOADER.getIcon(FileNames.ICON_RESTART)); <START> button.setEnabled(false); <END> button.setText("No, extend"); button.setToolTipText("Extend the simulation"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ((MixedTreatmentComparison) getMTCModel(model.getModel())).setExtendSimulation(ExtendSimulation.EXTEND); } }); return button; }</code><technical_language>if simulation is in "decision phase" build panel</technical_language>

Target:
public static JButton createExtendSimulationButton(final MCMCWrapper model) { JButton button = new JButton(Main.IMAGELOADER.getIcon(FileNames.ICON_RESTART)); button.setText("No, extend"); button.setToolTipText("Extend the simulation"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ((MixedTreatmentComparison) ((MixedTreatmentComparison)model.getModel())).setExtendSimulation(ExtendSimulation.EXTEND); } }); return button; }