auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void render() { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); stage.act(); stage.draw(); <START> Table.drawDebug(stage); <END> }</code><technical_language>do control drawing debug lines? conditioned a global variable sets editor in debug (pass command line argument)</technical_language>

Target:
public void render() { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); stage.act(); stage.draw(); }
Source:
<code>protected void executeCommand() { StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); <START> ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (!proccessedDomains.isEmpty()) { <END> runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); } setSucceeded(true); }</code><technical_language>for noticing earlier - check actionReturnValue.getSucceeded()</technical_language>

Target:
protected void executeCommand() { StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (actionReturnValue.getSucceeded() && !proccessedDomains.isEmpty()) { runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); } setSucceeded(true); }
Source:
<code><START> public static ThreadPoolExecutor newBoundedThreadPool(int maxThreads, ThreadFactory threadFactory) <END> { BlockingQueue<Runnable> queue = new RefusingQueue<>(); return new ThreadPoolExecutor( 0, maxThreads, 60, TimeUnit.SECONDS, queue, threadFactory, (runnable, executor) -> queue.add(runnable)); }</code><technical_language>add: java newBoundedThreadPool(int minThreads, int maxThreads, ThreadFactory threadFactory) newBoundedThreadPool(int minThreads, int maxThreads, ThreadFactory threadFactory, Duration keepAlive)</technical_language>

Target:
public static ThreadPoolExecutor newBoundedThreadPool(int maxThreads, ThreadFactory threadFactory) { return newBoundedThreadPool(0, maxThreads, threadFactory); }
Source:
<code>public void testProfileEntry() { com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue profileEntryValueVo = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue( "test"); ProfileEntryValue profileEntryValue = this.monitoringMapper.map(profileEntryValueVo, ProfileEntryValue.class); Assert.assertTrue(profileEntryValue.getStringValueOrDateValueOrFloatValue().get(0).equals("test")); profileEntryValueVo = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue( new Date()); profileEntryValue = this.monitoringMapper.map(profileEntryValueVo, ProfileEntryValue.class); <START> Assert.assertTrue(profileEntryValue.getStringValueOrDateValueOrFloatValue().get(0) instanceof Date); <END> profileEntryValueVo = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue( new BigDecimal(100.0d)); profileEntryValue = this.monitoringMapper.map(profileEntryValueVo, ProfileEntryValue.class); Assert.assertTrue(((BigDecimal) profileEntryValue.getStringValueOrDateValueOrFloatValue().get(0)).doubleValue() == 100.d); profileEntryValueVo = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue(12345L); profileEntryValue = this.monitoringMapper.map(profileEntryValueVo, ProfileEntryValue.class); Assert.assertTrue(((Long) profileEntryValue.getStringValueOrDateValueOrFloatValue().get(0)).doubleValue() == 12345L); }</code><technical_language>use: import static org.hamcrest.CoreMatchers.instanceOf; ... assertThat(result, instanceOf(ClassName.class));</technical_language>

Target:
public void testProfileEntry() { com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue profileEntryValueVo = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue( "test"); ProfileEntryValue profileEntryValue = this.monitoringMapper.map(profileEntryValueVo, ProfileEntryValue.class); assertEquals(profileEntryValue.getStringValueOrDateValueOrFloatValue().get(0), "test"); profileEntryValueVo = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue( new Date()); profileEntryValue = this.monitoringMapper.map(profileEntryValueVo, ProfileEntryValue.class); assertThat(profileEntryValue.getStringValueOrDateValueOrFloatValue().get(0), instanceOf(Date.class)); profileEntryValueVo = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue( new BigDecimal(100.0d)); profileEntryValue = this.monitoringMapper.map(profileEntryValueVo, ProfileEntryValue.class); assertTrue(((BigDecimal) profileEntryValue.getStringValueOrDateValueOrFloatValue().get(0)).doubleValue() == 100.d); profileEntryValueVo = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue(12345L); profileEntryValue = this.monitoringMapper.map(profileEntryValueVo, ProfileEntryValue.class); assertTrue(((Long) profileEntryValue.getStringValueOrDateValueOrFloatValue().get(0)).doubleValue() == 12345L); }
Source:
<code>private IRefactorService getRefactorService() { IRefactorService refactorService = null; try { refactorService = ServiceUtilsForResourceSet.getInstance().getService(IRefactorService.class, getTarget().getResourceSet()); } catch (ServiceException e) { <START> Activator.log.error(e); <END> } return refactorService; }</code><technical_language>If get refactoring service, spam log for notification. This logged once: remember service is try get it</technical_language>

Target:
private IRefactorService getRefactorService() { IRefactorService refactorService = null; try { refactorService = ServiceUtilsForResourceSet.getInstance().getService(IRefactorService.class, getTarget().getResourceSet()); unavailableService = false; } catch (ServiceException e) { if (!unavailableService) { Activator.log.error(e); unavailableService = true; } } return refactorService; }
Source:
<code>public InputRow parse(GenericRecord record) { LogicalType logicalType; if (null != _timestampSpecLogicalType) { logicalType = _timestampSpecLogicalType; } else { logicalType = determineTimestampSpecLogicalType(record.getSchema(), timestampSpec.getTimestampColumn()); } GenericRecordAsMap genericRecordAsMap = new GenericRecordAsMap(record, false, binaryAsString); DateTime dateTime; if (logicalType instanceof LogicalTypes.Date) { int daysSinceEpoch = (Integer) genericRecordAsMap.get(timestampSpec.getTimestampColumn()); long DAY_IN_MILISECONDS = 1000L * 60L * 60L * 24L; <START> dateTime = new DateTime(daysSinceEpoch * DAY_IN_MILISECONDS); <END> } else { dateTime = timestampSpec.extractTimestamp(genericRecordAsMap); } return new MapBasedInputRow(dateTime, dimensions, genericRecordAsMap); }</code><technical_language>TimeUnit.DAYS.toMillis(daysSinceEpoch)</technical_language>

Target:
public InputRow parse(GenericRecord record) { GenericRecordAsMap genericRecordAsMap = new GenericRecordAsMap(record, false, binaryAsString); LogicalType logicalType = determineTimestampSpecLogicalType(record.getSchema(), timestampSpec.getTimestampColumn()); DateTime dateTime; if (logicalType instanceof LogicalTypes.Date) { int daysSinceEpoch = (Integer) genericRecordAsMap.get(timestampSpec.getTimestampColumn()); dateTime = new DateTime(TimeUnit.DAYS.toMillis(daysSinceEpoch)); } else { dateTime = timestampSpec.extractTimestamp(genericRecordAsMap); } return new MapBasedInputRow(dateTime, dimensions, genericRecordAsMap); }
Source:
<code>public void addEmptyRowWithPrimaryKeyLong() { Table t = getTableWithIntegerPrimaryKey(); long rowIndex = t.addEmptyRowWithPrimaryKey(42); assertEquals(1, t.size()); <START> assertEquals(42, t.getUncheckedRow(rowIndex).getLong(0)); <END> sharedRealm.cancelTransaction(); }</code><technical_language>minor: this compared long int (42L)</technical_language>

Target:
public void addEmptyRowWithPrimaryKeyLong() { Table t = getTableWithIntegerPrimaryKey(); long rowIndex = t.addEmptyRowWithPrimaryKey(42); assertEquals(1, t.size()); assertEquals(42L, t.getUncheckedRow(rowIndex).getLong(0)); sharedRealm.cancelTransaction(); }
Source:
<code>public PatchIdDiffFormatter() { <START> super(new DigestOutputStream(new ByteArrayOutputStream(), <END> Constants.newMessageDigest())); digest = ((DigestOutputStream) getOutputStream()).getMessageDigest(); }</code><technical_language>Instead of buffering a byte[], please create a NullOutputStream in org.eclipse.jgit/src/org/eclipse/jgit/util/io. I thought already, I created for a change applied. declare class, override 3 write methods: @Override public void write(int b) { // Discard. } @Override public void write(byte[] buf) { // Discard. } @Override public void write(byte[] buf, int pos, int cnt) { // Discard. }</technical_language>

Target:
public PatchIdDiffFormatter() { super(new DigestOutputStream(NullOutputStream.INSTANCE, Constants.newMessageDigest())); digest = ((DigestOutputStream) getOutputStream()).getMessageDigest(); }
Source:
<code>public String getIdentificationString() { <START> return courseId + "/" + feedbackPathId; <END> }</code><technical_language>include giver recipient</technical_language>

Target:
public String getIdentificationString() { return courseId + "/" + feedbackPathId + "/" + giver + "/" + recipient; }
Source:
<code>private void testProfileEditBox(StudentProfileEditBox profileEditBox) { assertEquals(acct.name, profileEditBox.getName()); assertEquals(isEditingPhoto, profileEditBox.getEditingPhoto()); assertEquals(StringHelper.convertToEmptyStringIfNull(spa.shortName), profileEditBox.getShortName()); assertEquals(StringHelper.convertToEmptyStringIfNull(spa.email), profileEditBox.getEmail()); assertEquals(StringHelper.convertToEmptyStringIfNull(spa.institute), profileEditBox.getInstitute()); assertEquals(StringHelper.convertToEmptyStringIfNull(spa.nationality), profileEditBox.getNationality()); <START> assertEquals(spa.gender.name(), profileEditBox.getGender().name()); <END> assertEquals(StringHelper.convertToEmptyStringIfNull(spa.moreInfo), profileEditBox.getMoreInfo()); assertEquals(acct.googleId, profileEditBox.getGoogleId()); assertEquals(pictureUrl, profileEditBox.getPictureUrl()); }</code><technical_language>is this necessary</technical_language>

Target:
private void testProfileEditBox(StudentProfileEditBox profileEditBox) { assertEquals(acct.name, profileEditBox.getName()); assertEquals(isEditingPhoto, profileEditBox.getEditingPhoto()); assertEquals(StringHelper.convertToEmptyStringIfNull(spa.shortName), profileEditBox.getShortName()); assertEquals(StringHelper.convertToEmptyStringIfNull(spa.email), profileEditBox.getEmail()); assertEquals(StringHelper.convertToEmptyStringIfNull(spa.institute), profileEditBox.getInstitute()); assertEquals(StringHelper.convertToEmptyStringIfNull(spa.nationality), profileEditBox.getNationality()); assertEquals(spa.gender, profileEditBox.getGender()); assertEquals(StringHelper.convertToEmptyStringIfNull(spa.moreInfo), profileEditBox.getMoreInfo()); assertEquals(acct.googleId, profileEditBox.getGoogleId()); assertEquals(pictureUrl, profileEditBox.getPictureUrl()); }
Source:
<code>protected LanguageServer doInitialize(LanguageDescription language, LanguageServerLauncher launcher, String projectPath) throws LanguageServerException { String languageId = launcher.getLanguageId(); InitializeParams initializeParams = prepareInitializeParams(projectPath); LanguageServer server; try { server = launcher.launch(projectPath, languageClient); } catch (LanguageServerException e) { throw new LanguageServerException( <START> "Can't initialize Language Server " + languageId + " on " + projectPath + ". " + e.getMessage(), e); <END> } registerCallbacks(server); CompletableFuture<InitializeResult> completableFuture = server.initialize(initializeParams); try { InitializeResult initializeResult = completableFuture.get(); serversToInitResult.put(server, new LanguageServerDescription(initializeResult, language)); } catch (InterruptedException | ExecutionException e) { server.shutdown(); server.exit(); throw new LanguageServerException("Error fetching server capabilities " + languageId + ". " + e.getMessage(), e); } LOG.info("Initialized Language Server on project {}", languageId, projectPath); return server; }</code><technical_language>format</technical_language>

Target:
protected LanguageServer doInitialize(LanguageDescription language, LanguageServerLauncher launcher, String projectPath) throws LanguageServerException { String languageId = launcher.getLanguageId(); InitializeParams initializeParams = prepareInitializeParams(projectPath); LanguageServer server; try { server = launcher.launch(projectPath, languageClient); } catch (LanguageServerException e) { throw new LanguageServerException( "Can't initialize Language Server " + languageId + " on " + projectPath + ". " + e.getMessage(), e); } registerCallbacks(server, launcher); CompletableFuture<InitializeResult> completableFuture = server.initialize(initializeParams); try { InitializeResult initializeResult = completableFuture.get(); serversToInitResult.put(server, new LanguageServerDescription(initializeResult, language)); } catch (InterruptedException | ExecutionException e) { server.shutdown(); server.exit(); throw new LanguageServerException("Error fetching server capabilities " + languageId + ". " + e.getMessage(), e); } LOG.info("Initialized Language Server on project {}", languageId, projectPath); return server; }
Source:
<code>public void save(Object object, int operatorId, long windowId) throws IOException { try { store(generateKey(operatorId, windowId), object); logger.info("saved check point object key region {}", generateKey(operatorId, windowId), applicationId); <START> } catch (Throwable t) { <END> logger.info("while saving {}", operatorId, windowId, t); DTThrowable.rethrow(t); } }</code><technical_language>catch Throwable</technical_language>

Target:
public void save(Object object, int operatorId, long windowId) throws IOException { try { store(generateKey(operatorId, windowId), object); logger.debug("saved check point object key region {}", generateKey(operatorId, windowId), applicationId); } catch (Exception ex) { throw new RuntimeException(ex); } }
Source:
<code>public void updateNonExistingCustomer() { <START> final int nonExistingId = 999; <END> final String newFirstname = "Douglas"; final String newLastname = "MacArthur"; final Customer customer = new Customer(nonExistingId, newFirstname, newLastname); impl.updateCustomer(customer); assertNull(impl.getCustomerById(nonExistingId)); final Customer existingCustomer = impl.getCustomerById(CUSTOMER.getId()); assertEquals(CUSTOMER.getFirstName(), existingCustomer.getFirstName()); assertEquals(CUSTOMER.getLastName(), existingCustomer.getLastName()); }</code><technical_language>Logic: final int nonExistingId = getNonExistingCustomerId();</technical_language>

Target:
public void updateNonExistingCustomer() { final int nonExistingId = getNonExistingCustomerId(); final String newFirstname = "Douglas"; final String newLastname = "MacArthur"; final Customer customer = new Customer(nonExistingId, newFirstname, newLastname); impl.updateCustomer(customer); assertNull(impl.getCustomerById(nonExistingId)); final Customer existingCustomer = impl.getCustomerById(CUSTOMER.getId()); assertEquals(CUSTOMER.getFirstName(), existingCustomer.getFirstName()); assertEquals(CUSTOMER.getLastName(), existingCustomer.getLastName()); }
Source:
<code>public Object evaluate(Row row, Object[] parameters, SelectItem operandItem) { SelectItem[] selectItems = row.getSelectItems(); if (parameters.length == 0) { throw new IllegalArgumentException("Expecting some parameters to CONCAT function"); } StringBuilder strBuilder = new StringBuilder(); for (Object parameter: parameters) { <START> String parameterAsString = parameter.toString(); <END> final int startLiteral = parameterAsString.indexOf('\''); if (startLiteral == 0) { String literalWithoutTicks = parameterAsString.substring(1, parameterAsString.length() - 1); strBuilder.append(literalWithoutTicks); } else { Column column = getColumnValueFromRow(parameterAsString, selectItems); strBuilder.append(row.getValue(column)); } } return strBuilder; }</code><technical_language>a lot of easier if decided treat parameters SelectItems instead of Strings? I is - in this part of code (and in ScalarFunctionRow) changes involved parameters of type String. if instead changed parameters simply SelectItems. I guess is _are_ a (SQL) language perspective: CONCAT(foo, bar) "foo" "bar" select items, CONCAT(foo, " ", bar) a select item, a string a select item. I greatly simplify code if work this model instead</technical_language>

Target:
public Object evaluate(Row row, Object[] parameters, SelectItem operandItem) { if (parameters.length == 0) { throw new IllegalArgumentException("Expecting some parameters to CONCAT function"); } StringBuilder strBuilder = new StringBuilder(); for (Object parameter: parameters) { final Object valueToConcat; if (parameter instanceof SelectItem) { valueToConcat = row.getValue((SelectItem) parameter); } else if (parameter instanceof Column) { valueToConcat = row.getValue((Column) parameter); } else { valueToConcat = parameter; } strBuilder.append(valueToConcat.toString()); } return strBuilder.toString(); }
Source:
<code>public ServiceBuilder<SecurityConfiguration> build(ServiceTarget target) { ServiceBuilder<SecurityConfiguration> builder = target.addService(this.getServiceName(), new ValueService<>(this)).setInitialMode(ServiceController.Mode.ON_DEMAND); <START> if (sslContextDependency != null) { <END> this.sslContextDependency.register(builder); } return builder; }</code><technical_language>return (this.sslContextDependency != null) ? this.sslContextDependency.register(builder) : builder; :)</technical_language>

Target:
public ServiceBuilder<SecurityConfiguration> build(ServiceTarget target) { ServiceBuilder<SecurityConfiguration> builder = target.addService(this.getServiceName(), new ValueService<>(this)).setInitialMode(ServiceController.Mode.ON_DEMAND); return (this.sslContextDependency != null) ? this.sslContextDependency.register(builder) : builder; }
Source:
<code>private Supplier<ZkUtils> getZkConnection() { String zkConnect = config.get(String.format(KafkaConfig.CONSUMER_CONFIGS_CONFIG_KEY(), systemName, ZOOKEEPER_CONNECT)); if (StringUtils.isBlank(zkConnect)) { throw new SamzaException("Missing zookeeper.connect config for admin for system " + systemName); } return () -> { <START> return ZkUtils.apply(zkConnect, 6000, 6000, false); <END> }; }</code><technical_language>simplified () -> ZkUtils.apply(zkConnect, 6000, 6000, false);</technical_language>

Target:
private Supplier<ZkUtils> getZkConnection() { String zkConnect = config.get(String.format(KafkaConfig.CONSUMER_CONFIGS_CONFIG_KEY(), systemName, ZOOKEEPER_CONNECT)); if (StringUtils.isBlank(zkConnect)) { throw new SamzaException("Missing zookeeper.connect config for admin for system " + systemName); } return () -> ZkUtils.apply(zkConnect, 6000, 6000, false); }
Source:
<code>private long balanceCost(MrBalancePenalty penalty, MrMachine machine, long originalUsage, long targetUsage) { long originalAvailability = machine.getMachineCapacity(penalty.getOriginResource()).getMaximumCapacity() - originalUsage; long targetAvailability = machine.getMachineCapacity(penalty.getTargetResource()).getMaximumCapacity() - targetUsage; long balanceCost = penalty.getMultiplicand() * originalAvailability - targetAvailability; <START> return balanceCost < 0 ? 0 : balanceCost; <END> }</code><technical_language>Math.max(0, balanceCost)</technical_language>

Target:
private long balanceCost(MrBalancePenalty penalty, MrMachine machine, long originalUsage, long targetUsage) { long originalAvailability = machine.getMachineCapacity(penalty.getOriginResource()).getMaximumCapacity() - originalUsage; long targetAvailability = machine.getMachineCapacity(penalty.getTargetResource()).getMaximumCapacity() - targetUsage; long balanceCost = penalty.getMultiplicand() * originalAvailability - targetAvailability; return Math.max(0, balanceCost); }
Source:
<code><START> static Long toMillis(Duration duration) <END> { if (duration == null) { return null; } return duration.toMillis(); }</code><technical_language>Instead of exporting this, I simply replace future usages Optional.ofNullable(duration).map(Duration::toMillis).orElse(null)</technical_language>

Target:
private static Long toMillis(Duration duration) { if (duration == null) { return null; } return duration.toMillis(); }
Source:
<code>public Object create(SimpleObject post, RequestContext context) throws ResponseException { moduleFactoryWrapper.checkPrivilege(); ModuleAction action = parseAction(post, context); Collection<Module> modules = action.isAllModules() ? moduleFactoryWrapper.getLoadedModules() : action.getModules(); ServletContext servletContext = getServletContext(context); if (modules.isEmpty()) { <START> throw new IllegalArgumentException("Cannot execute action " + action.getType() + " on empty set of modules."); <END> } else { switch (action.getType()) { case START: startModules(modules, servletContext); break; case STOP: stopModules(modules, servletContext); break; case RESTART: restartModules(modules, servletContext); break; case UNLOAD: unloadModules(modules, servletContext); break; } } return ConversionUtil.convertToRepresentation(action, Representation.DEFAULT); }</code><technical_language>Please throw REST specific exceptions extending ResponseException. IllegalPropertyException, in this case I create a new IllegalRequestException</technical_language>

Target:
public Object create(SimpleObject post, RequestContext context) throws ResponseException { moduleFactoryWrapper.checkPrivilege(); ModuleAction action = newDelegate(); setConvertedProperties(action, post, getCreatableProperties(), true); Collection<Module> modules; if (action.isAllModules() != null && action.isAllModules()) { modules = moduleFactoryWrapper.getLoadedModules(); action.setModules(new ArrayList<Module>(modules)); } else { modules = action.getModules(); } ServletContext servletContext = getServletContext(context); if (modules == null || modules.isEmpty()) { throw new IllegalRequestException("Cannot execute action " + action.getAction() + " on empty set of modules."); } else { Module restModule = moduleFactoryWrapper.getModuleById(RestConstants.MODULE_ID); modules.remove(restModule); switch (action.getAction()) { case START: startModules(modules, servletContext); break; case STOP: stopModules(modules, servletContext, true); break; case RESTART: restartModules(modules, servletContext); break; case UNLOAD: unloadModules(modules, servletContext); break; } } return ConversionUtil.convertToRepresentation(action, Representation.DEFAULT); }
Source:
<code>protected List getModelChildren() { <START> if (eic == null) { eic = new EventInputContainer(getModel()); } if (eoc == null) { eoc = new EventOutputContainer(getModel()); } if (vic == null) { vic = new VariableInputContainer(getModel()); } if (socketcont == null) { socketcont = new SocketContainer(getModel()); } if (voc == null) { voc = new VariableOutputContainer(getModel()); } if (plugcont == null) { plugcont = new PlugContainer(getModel()); } <END> ArrayList<Object> temp = new ArrayList<>(6); temp.add(eic); temp.add(eoc); temp.add(vic); if (!(getModel() instanceof AdapterFBType)) { temp.add(socketcont); } temp.add(voc); if (!(getModel() instanceof AdapterFBType)) { temp.add(plugcont); } return temp; }</code><technical_language>constants in if condition preferably left hand side</technical_language>

Target:
protected List getModelChildren() { if (null == eic) { eic = new EventInputContainer(getModel()); } if (null == eoc) { eoc = new EventOutputContainer(getModel()); } if (null == vic) { vic = new VariableInputContainer(getModel()); } if (null == socketcont) { socketcont = new SocketContainer(getModel()); } if (null == voc) { voc = new VariableOutputContainer(getModel()); } if (null == plugcont) { plugcont = new PlugContainer(getModel()); } ArrayList<Object> temp = new ArrayList<>(6); temp.add(eic); temp.add(eoc); temp.add(vic); if (!(getModel() instanceof AdapterFBType)) { temp.add(socketcont); } temp.add(voc); if (!(getModel() instanceof AdapterFBType)) { temp.add(plugcont); } return temp; }
Source:
<code>public GHBranch apply(GHBranch remoteBranch) { <START> LOGGER.trace("updating local branch repository with [{}]", remoteBranch.getName()); <END> localRepo.getBranches().put(remoteBranch.getName(), new GitHubBranch(remoteBranch)); return remoteBranch; }</code><technical_language>Start message capital letter</technical_language>

Target:
public GHBranch apply(GHBranch remoteBranch) { LOGGER.trace("Updating local branch repository with [{}]", remoteBranch.getName()); localRepo.getBranches().put(remoteBranch.getName(), new GitHubBranch(remoteBranch)); return remoteBranch; }
Source:
<code>private static void trainData(DataNormalization dataNormalization, ParentPathLabelGenerator labelMaker, ComputationGraph computationGraph) { <START> try { <END> for (int i = 0; i < numEpochs; ++i) { currentEpoch = i; ImageRecordReader recordReader = new ImageRecordReader(height, width, channels, labelMaker); recordReader.initialize(trainingData, getImageTransform(i)); DataSetIterator dataSetIterator = new RecordReaderDataSetIterator(recordReader, batchSize, 1, outputNum); dataNormalization.fit(dataSetIterator); dataSetIterator.setPreProcessor(dataNormalization); computationGraph.fit(dataSetIterator); dataSetIterator.reset(); } } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>sending sample indefinite loop. I figure out sample creates a new window for iteration</technical_language>

Target:
private static void trainData(DataNormalization dataNormalization, ParentPathLabelGenerator labelMaker, ComputationGraph computationGraph) { try { ImageRecordReader recordReader = new ImageRecordReader(height, width, channels, labelMaker); recordReader.initialize(trainingData, getImageTransform()); DataSetIterator dataSetIterator = new RecordReaderDataSetIterator(recordReader, batchSize, 1, outputNum); dataNormalization.fit(dataSetIterator); dataSetIterator.setPreProcessor(dataNormalization); computationGraph.fit(dataSetIterator, numEpochs); dataSetIterator.reset(); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code><START> public synchronized VDS getFullVds() { <END> if (fullVds == null) { fullVds = DbFacade.getInstance().getVdsDao().get(vdsStatic.getId()); } return fullVds; }</code><technical_language>reason this synced? fullVDs variable volatile visibility problem solved</technical_language>

Target:
public VDS getFullVds() { if (fullVds == null) { synchronized (this) { if (fullVds == null) { fullVds = DbFacade.getInstance().getVdsDao().get(vdsStatic.getId()); } } } return fullVds; }
Source:
<code>public StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (obj != null && obj instanceof Number && toAppendTo != null) { @Nullable LamiGraphRange internalRange = fInternalRange; @Nullable LamiGraphRange externalRange = fExternalRange; if (internalRange == null || externalRange == null) { long time = ((Number)obj).longValue(); return checkNotNull(toAppendTo.append(fFormat.format(time))); } if (internalRange.getDelta().compareTo(BigDecimal.ZERO) == 0) { long time = externalRange.getMinimum().longValue(); return checkNotNull(toAppendTo.append(fFormat.format(time))); } <START> <END> BigDecimal externalValue = (new BigDecimal(obj.toString())) .subtract(internalRange.getMinimum()) .multiply(externalRange.getDelta()) .divide(internalRange.getDelta(), 22, BigDecimal.ROUND_DOWN) .add(externalRange.getMinimum()); return checkNotNull(toAppendTo.append(fFormat.format(externalValue.longValue()))); } return new StringBuffer(); }</code><technical_language>checking zero external range in other class, is this intentional</technical_language>

Target:
public StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (obj != null && obj instanceof Number && toAppendTo != null) { @Nullable LamiGraphRange internalRange = fInternalRange; @Nullable LamiGraphRange externalRange = fExternalRange; if (internalRange == null || externalRange == null) { long time = ((Number)obj).longValue(); return checkNotNull(toAppendTo.append(fFormat.format(time))); } BigDecimal externalDelta = externalRange.getDelta(); if (externalRange.getDelta().compareTo(BigDecimal.ZERO) == 0) { externalDelta = BigDecimal.ONE; } BigDecimal externalValue = (new BigDecimal(obj.toString())) .subtract(internalRange.getMinimum()) .multiply(externalDelta) .divide(internalRange.getDelta(), BIG_DECIMAL_DIVISION_SCALE, BigDecimal.ROUND_DOWN) .add(externalRange.getMinimum()); return checkNotNull(toAppendTo.append(fFormat.format(externalValue.longValue()))); } return new StringBuffer(); }
Source:
<code>public int run() throws IOException { Preconditions.checkArgument(samplePaths != null && !samplePaths.isEmpty(), "Sample JSON path is required"); Preconditions.checkArgument(samplePaths.size() == 1, "Only one JSON sample can be given"); Preconditions.checkArgument(objectsToSample > 0, "At least one object must be sampled"); Schema sampleSchema = JsonUtil.inferSchema( <START> open(samplePaths.get(0)), recordName, objectsToSample); <END> if (sampleSchema != null) { output(sampleSchema.toString(!minimize), console, outputPath); return 0; } else { console.error("Sample file did not contain any records"); return 1; } }</code><technical_language>This merged another PR, need do anymore. Thanks for fixing though</technical_language>

Target:
public int run() throws IOException { Preconditions.checkArgument(samplePaths != null && !samplePaths.isEmpty(), "Sample JSON path is required"); Preconditions.checkArgument(samplePaths.size() == 1, "Only one JSON sample can be given"); Schema sampleSchema = JsonUtil.inferSchema( open(samplePaths.get(0)), recordName, 10); if (sampleSchema != null) { output(sampleSchema.toString(!minimize), console, outputPath); return 0; } else { console.error("Sample file did not contain any records"); return 1; } }
Source:
<code>private String getTextForSegments(VDomainModelReference dmr) { final EList<VDomainModelReferenceSegment> segments = dmr.getSegments(); if (segments.isEmpty()) { return adapterFactoryItemDelegator.getText(dmr); } String attributeType = null; try { <START> final IEMFValueProperty valueProperty = Activator.getDefault().getEMFFormsDatabinding().getValueProperty( <END> dmr, Helper.getRootEClass(dmr)); attributeType = valueProperty.getStructuralFeature().getEType().getName(); } catch (final DatabindingFailedException ex) { } final String className = Helper.getRootEClass(dmr).getName(); String attributeName = " -> " + adapterFactoryItemDelegator.getText(segments.get(segments.size() - 1)); if (attributeType != null && !attributeType.isEmpty()) { attributeName += " : " + attributeType; } String referencePath = ""; for (int i = 0; i < segments.size() - 1; i++) { referencePath = referencePath + " -> " + adapterFactoryItemDelegator.getText(segments.get(i)); } final String linkText = className + referencePath + attributeName; if (linkText.equals(" -> ")) { return null; } return linkText; }</code><technical_language>able retrieve emfformsdatabing context</technical_language>

Target:
private String getTextForSegments(VDomainModelReference dmr) { final EList<VDomainModelReferenceSegment> segments = dmr.getSegments(); if (segments.isEmpty()) { return adapterFactoryItemDelegator.getText(dmr); } String attributeType = null; final EClass rootEClass = Helper.getRootEClass(dmr); try { final IValueProperty<?, ?> valueProperty = getEMFFormsDatabinding().getValueProperty( dmr, rootEClass); final EStructuralFeature feature = (EStructuralFeature) valueProperty.getValueType(); attributeType = feature.getEType().getName(); } catch (final DatabindingFailedException ex) { } final String className = rootEClass.getName(); String attributeName = " -> " + adapterFactoryItemDelegator.getText(segments.get(segments.size() - 1)); if (attributeType != null && !attributeType.isEmpty()) { attributeName += " : " + attributeType; } String referencePath = ""; for (int i = 0; i < segments.size() - 1; i++) { referencePath = referencePath + " -> " + adapterFactoryItemDelegator.getText(segments.get(i)); } final String linkText = className + referencePath + attributeName; if (linkText.equals(" -> ")) { return null; } return linkText; }
Source:
<code>private CoverageProvider getUberallsCoverage(AbstractBuild build, BuildListener listener) { if (!build.getResult().isBetterOrEqualTo(Result.UNSTABLE) || !uberallsEnabled) { return null; } Logger logger = new Logger(listener.getLogger()); InstanceProvider<CoverageProvider> provider = new InstanceProvider<CoverageProvider>( Jenkins.getInstance(), <START> "cobertura", <END> COBERTURA_CLASS_NAME, logger ); CoverageProvider coverage = provider.getInstance(); if (coverage == null) { return null; } coverage.setBuild(build); if (coverage.hasCoverage()) { return coverage; } else { logger.info(UBERALLS_TAG, "No cobertura results found"); return null; } }</code><technical_language>this a constant</technical_language>

Target:
private CoverageProvider getUberallsCoverage(AbstractBuild build, BuildListener listener) { if (!build.getResult().isBetterOrEqualTo(Result.UNSTABLE) || !uberallsEnabled) { return null; } Logger logger = new Logger(listener.getLogger()); InstanceProvider<CoverageProvider> provider = new InstanceProvider<CoverageProvider>( Jenkins.getInstance(), COBERTURA_PLUGIN_NAME, COBERTURA_CLASS_NAME, logger ); CoverageProvider coverage = provider.getInstance(); if (coverage == null) { return null; } coverage.setBuild(build); if (coverage.hasCoverage()) { return coverage; } else { logger.info(UBERALLS_TAG, "No cobertura results found"); return null; } }
Source:
<code>protected HashMap<XPathExpression, ArrayList<String>> loadConfig(String filename) throws XPathExpressionException { HashMap<XPathExpression, ArrayList<String>> configMap = new HashMap<XPathExpression, ArrayList<String>>(); FileInputStream fstream; try { fstream = new FileInputStream(filename); } catch (FileNotFoundException e) { log.warn("XPATH Extractor config file not found: {}" , filename); e.printStackTrace(); <START> return null; <END> } DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; try { while ((strLine = br.readLine()) != null) { strLine = strLine.trim(); if (strLine.matches("^#.*")) { continue; } if (strLine.length() == 0) { continue; } String fieldName = strLine.split(",")[0]; int offset = fieldName.length() + 1; String strXPath = strLine.substring(offset, strLine.length()); XPathExpression xPath = xpath.compile(strXPath); if (debug) { log.info("Adding XPATH Maps To : {}",strXPath , fieldName); } if (configMap.containsKey(xPath)) { configMap.get(xPath).add(fieldName); } else { ArrayList<String> fields = new ArrayList<String>(); fields.add(fieldName); configMap.put(xPath, fields); } } } catch (IOException e) { log.warn("IO Exception reading from file : {}" , filename, e); return configMap; } try { br.close(); } catch (IOException e) { log.warn("Exception occured when trying to close the config file.. {}", e); } return configMap; }</code><technical_language>Stacktrace log if 'do not' put a auto formatter bracket for .. this log.warn("XPATH Extractor config file found: " , filename, e);</technical_language>

Target:
protected HashMap<XPathExpression, ArrayList<String>> loadConfig(String filename) throws XPathExpressionException { HashMap<XPathExpression, ArrayList<String>> configMap = new HashMap<XPathExpression, ArrayList<String>>(); FileInputStream fstream; try { fstream = new FileInputStream(filename); } catch (FileNotFoundException e) { log.warn("XPATH Extractor config file not found: {}" , filename, e); return null; } DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; try { while ((strLine = br.readLine()) != null) { strLine = strLine.trim(); if (strLine.matches("^#.*")) { continue; } if (strLine.length() == 0) { continue; } String fieldName = strLine.split(",")[0]; int offset = fieldName.length() + 1; String strXPath = strLine.substring(offset, strLine.length()); XPathExpression xPath = xpath.compile(strXPath); if (debug) { log.info("Adding XPATH Maps To : {}",strXPath , fieldName); } if (configMap.containsKey(xPath)) { configMap.get(xPath).add(fieldName); } else { ArrayList<String> fields = new ArrayList<String>(); fields.add(fieldName); configMap.put(xPath, fields); } } } catch (IOException e) { log.warn("IO Exception reading from file {}" , filename, e); return configMap; } try { br.close(); } catch (IOException e) { log.warn("Exception occured when trying to close the config file.", e); } return configMap; }
Source:
<code>public View getView(int position, View convertView, ViewGroup parent) { Contest contest = getItem(position); ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.contest_list_item, parent, false); viewHolder.title = (TextView) convertView.findViewById(R.id.contest_list_item_title); viewHolder.subTitle = (TextView) convertView.findViewById(R.id.contest_list_item_subtitle); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } if (contest.type.equals("Referendum")) { if (contest.referendumTitle != null && !contest.referendumTitle.isEmpty()) { viewHolder.title.setText(contest.referendumTitle); } else { viewHolder.title.setVisibility(View.GONE); } if (contest.referendumSubtitle != null && !contest.referendumSubtitle.isEmpty()) { viewHolder.subTitle.setText(contest.referendumSubtitle); } else { viewHolder.subTitle.setVisibility(View.GONE); } } else { <START> if (contest.office != null && !contest.office.isEmpty()) { <END> viewHolder.title.setText(contest.office); } else { viewHolder.title.setVisibility(View.GONE); } if (electionName != null && !electionName.isEmpty()) { viewHolder.subTitle.setText(electionName); } else { viewHolder.subTitle.setVisibility(View.GONE); } } return convertView; }</code><technical_language>refactore of similar if/else text/visibility blocks a function</technical_language>

Target:
public View getView(int position, View convertView, ViewGroup parent) { Contest contest = getItem(position); ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.contest_list_item, parent, false); viewHolder.title = (TextView) convertView.findViewById(R.id.contest_list_item_title); viewHolder.subTitle = (TextView) convertView.findViewById(R.id.contest_list_item_subtitle); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } if (contest.type.equals("Referendum")) { setTextView(viewHolder.title, contest.referendumTitle); setTextView(viewHolder.subTitle, contest.referendumSubtitle); } else { setTextView(viewHolder.title, contest.office); setTextView(viewHolder.subTitle, electionName); } return convertView; }
Source:
<code>public void run() { this.thread = Thread.currentThread(); while ( true ) { try { if (queue.peek() instanceof HeartbeatRowMap) { RowMap row = queue.take(); this.push(row); } else if (connectionListener.isNatsRunning()){ RowMap row = queue.take(); this.push(row); <START> } <END> } catch ( Exception e ) { LOGGER.info("Error: ", e); } } }</code><technical_language>this a tight loop if nats is in a not-yet-connected state, want sleep for a milliseconds if waiting for connection online, no</technical_language>

Target:
public void run() { int attempts = 0; try { Thread.sleep(1000L); while ( true ) { if (connectionListener.isNatsRunning()){ attempts = 0; RowMap row = queue.take(); this.push(row); } else { if (queue.peek() instanceof HeartbeatRowMap) { RowMap row = queue.take(); this.push(row); } if (attempts < natsMaxAttempts) { long sleepTime = (long) (Math.pow(2, attempts++) * 1000); Thread.sleep(sleepTime); } else { this.context.terminate(new RuntimeException("Nats Disconnected")); return; } } } } catch ( Exception e ) { LOGGER.info("Error: ", e); } }
Source:
<code>protected StatusRow lockStatusRow(UUID queryId) { try (Statement stmt = connection.createStatement()) { ResultSet rs = stmt.executeQuery(String.format(ENGLISH, <START> "SELECT completed_at FROM %s WHERE query_id = '%s' FOR UPDATE", <END> escapeIdent(statusTableName), queryId.toString()) ); if (rs.next()) { Timestamp completedAt = rs.getTimestamp(1); if (rs.wasNull()) { return StatusRow.LOCKED_NOT_COMPLETED; } else { return StatusRow.LOCKED_COMPLETED; } } else { return StatusRow.NOT_EXISTS; } } catch (SQLException ex) { throw new DatabaseException("Failed to lock a status row", ex); } }</code><technical_language>NOWAIT, blocks agent. Is okay</technical_language>

Target:
protected StatusRow lockStatusRow(UUID queryId) { try (Statement stmt = connection.createStatement()) { ResultSet rs = stmt.executeQuery(String.format(ENGLISH, "SELECT completed_at FROM %s WHERE query_id = '%s' FOR UPDATE", escapeIdent(statusTableName), queryId.toString()) ); if (rs.next()) { rs.getTimestamp(1); if (rs.wasNull()) { return StatusRow.LOCKED_NOT_COMPLETED; } else { return StatusRow.LOCKED_COMPLETED; } } else { return StatusRow.NOT_EXISTS; } } catch (SQLException ex) { throw new DatabaseException("Failed to lock a status row", ex); } }
Source:
<code>private void createNote(NotebookSocket conn, HashSet<String> userAndRoles, Notebook notebook, Message message) throws IOException { AuthenticationInfo subject = new AuthenticationInfo(message.principal); try { Note note = notebook.createNote(subject); note.addParagraph(); if (message != null) { String noteName = (String) message.get("name"); if (noteName == null || noteName.isEmpty()){ noteName = "Note " + note.getId(); } note.setName(noteName); } note.persist(subject); addConnectionToNote(note.getId(), (NotebookSocket) conn); conn.send(serializeMessage(new Message(OP.NEW_NOTE).put("note", note))); } catch (FileSystemException e) { LOG.error("Exception from createNote", e); conn.send(serializeMessage(new Message(OP.ERROR_INFO).put("info", "Oops! There is something wrong with the notebook file system. " <START> + "Please check the logs for more details."))); <END> return; } broadcastNoteList(subject); }</code><technical_language>@kavinkumarks Thanks for contribution! Some ppl idea log files. if log files are. do think? :)</technical_language>

Target:
private void createNote(NotebookSocket conn, HashSet<String> userAndRoles, Notebook notebook, Message message) throws IOException { AuthenticationInfo subject = new AuthenticationInfo(message.principal); try { Note note = null; String defaultInterpreterId = (String) message.get("defaultInterpreterId"); if (!StringUtils.isEmpty(defaultInterpreterId)) { List<String> interpreterSettingIds = new LinkedList<>(); interpreterSettingIds.add(defaultInterpreterId); for (String interpreterSettingId : notebook.getInterpreterFactory(). getDefaultInterpreterSettingList()) { if (!interpreterSettingId.equals(defaultInterpreterId)) { interpreterSettingIds.add(interpreterSettingId); } } note = notebook.createNote(interpreterSettingIds, subject); } else { note = notebook.createNote(subject); } note.addParagraph(); if (message != null) { String noteName = (String) message.get("name"); if (StringUtils.isEmpty(noteName)) { noteName = "Note " + note.getId(); } note.setName(noteName); } note.persist(subject); addConnectionToNote(note.getId(), (NotebookSocket) conn); conn.send(serializeMessage(new Message(OP.NEW_NOTE).put("note", note))); } catch (FileSystemException e) { LOG.error("Exception from createNote", e); conn.send(serializeMessage(new Message(OP.ERROR_INFO).put("info", "Oops! There is something wrong with the notebook file system. " + "Please check the logs for more details."))); return; } broadcastNoteList(subject, userAndRoles); }
Source:
<code>public List<String> getNegativePriorityScoreReasonsFromDB(DBObject priorityReasons) { <START> List<String> negativeScoreReasons = new ArrayList<>(); <END> Optional<List<String>> negativeReasons = Optional.of(TranslatorUtils .toList(priorityReasons, NEGATIVE_REASONS_KEY)); if (negativeReasons.isPresent()) { Iterator<String> negativeReasonsIterator = negativeReasons.get().iterator(); while (negativeReasonsIterator.hasNext()) { negativeScoreReasons.add(negativeReasonsIterator.next()); } return negativeScoreReasons; } else { return negativeScoreReasons; } }</code><technical_language>Lists.newArrayList() for consistency tests? Lists.newArrayList() there. :)</technical_language>

Target:
public List<String> getNegativePriorityScoreReasonsFromDB(DBObject priorityReasons) { List<String> negativeScoreReasons = Lists.newArrayList(); Optional<List<String>> negativeReasons = Optional.of(TranslatorUtils .toList(priorityReasons, NEGATIVE_REASONS_KEY)); if (negativeReasons.isPresent()) { Iterator<String> negativeReasonsIterator = negativeReasons.get().iterator(); while (negativeReasonsIterator.hasNext()) { negativeScoreReasons.add(negativeReasonsIterator.next()); } return negativeScoreReasons; } else { return negativeScoreReasons; } }
Source:
<code>public List<Tree.Kind> nodesToVisit() { <START> return ImmutableList.of(Tree.Kind.CLASS); <END> }</code><technical_language>Collections.singletonList</technical_language>

Target:
public List<Tree.Kind> nodesToVisit() { return Collections.singletonList(Tree.Kind.CLASS); }
Source:
<code>public void returnsLatestCacheKeyForOldCacheKeys() throws InvalidAcceptorCacheKeyException { AcceptorCache cache = cache(ImmutableMap.of()); <START> AcceptorCacheKey newCacheKey = cache.getAllUpdates().newCacheKey(); <END> cache.updateSequenceNumbers(ImmutableSet.of(WithSeq.of(20L, Client.of("client1")))); AcceptorCacheKey newCacheKeyAfterFirstUpdate = cache.getAllUpdates().newCacheKey(); cache.updateSequenceNumbers(ImmutableSet.of(WithSeq.of(25L, Client.of("client4")))); AcceptorCacheKey newCacheKeyAfterSecondUpdate = cache.getAllUpdates().newCacheKey(); assertThat(cache.updatesSinceCacheKey(newCacheKey)) .map(AcceptorCacheDigest::newCacheKey) .as("asking with first cache key after two updates should return latest cache key") .contains(newCacheKeyAfterSecondUpdate); assertThat(cache.updatesSinceCacheKey(newCacheKeyAfterFirstUpdate)) .map(AcceptorCacheDigest::newCacheKey) .as("asking with second cache key after one update should also return latest cache key") .contains(newCacheKeyAfterSecondUpdate); assertThat(cache.updatesSinceCacheKey(newCacheKeyAfterSecondUpdate)) .as("no updates past this cache key as this is the latest cache key, return empty") .isEmpty(); }</code><technical_language>rename easier read, initialCacheKey, cacheKeyAfterFirstUpdate,</technical_language>

Target:
public void returnsLatestCacheKeyForOldCacheKeys() throws InvalidAcceptorCacheKeyException { AcceptorCache cache = cache(ImmutableMap.of()); AcceptorCacheKey initialCacheKey = cache.getAllUpdates().newCacheKey(); cache.updateSequenceNumbers(ImmutableSet.of(WithSeq.of(20L, Client.of("client1")))); AcceptorCacheKey cacheKeyAfterFirstUpdate = cache.getAllUpdates().newCacheKey(); cache.updateSequenceNumbers(ImmutableSet.of(WithSeq.of(25L, Client.of("client4")))); AcceptorCacheKey cacheKeyAfterSecondUpdate = cache.getAllUpdates().newCacheKey(); assertThat(cache.updatesSinceCacheKey(initialCacheKey)) .map(AcceptorCacheDigest::newCacheKey) .as("asking with first cache key after two updates should return latest cache key") .contains(cacheKeyAfterSecondUpdate); assertThat(cache.updatesSinceCacheKey(cacheKeyAfterFirstUpdate)) .map(AcceptorCacheDigest::newCacheKey) .as("asking with second cache key after one update should also return latest cache key") .contains(cacheKeyAfterSecondUpdate); assertThat(cache.updatesSinceCacheKey(cacheKeyAfterSecondUpdate)) .as("no updates past this cache key as this is the latest cache key, return empty") .isEmpty(); }
Source:
<code>public VCardBuilder addAdr(final Map parameters, final List values) { <START> properties.add(new VCardProperty("adr", parameters, "text", (List) getAdrTextOrDefault(values))); <END> return this; }</code><technical_language>(List) cast is redundant</technical_language>

Target:
public VCardBuilder addAdr(final Map parameters, final List values) { properties.add(new VCardProperty("adr", parameters, "text", getAdrTextOrDefault(values))); return this; }