auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testDisorder(){ ByteToMessageDecoder decoder = new ByteToMessageDecoder() { int count = 0; @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) { out.add(in.readBytes(1)); if (++count >= 4) { ctx.pipeline().remove(this); } } }; EmbeddedChannel channel = new EmbeddedChannel(decoder); assertTrue(channel.writeInbound(Unpooled.wrappedBuffer(new byte[]{1, 2, 3, 4, 5}))); assertEquals(1, ((ByteBuf) channel.readInbound()).readByte()); assertEquals(2, ((ByteBuf) channel.readInbound()).readByte()); assertEquals(3, ((ByteBuf) channel.readInbound()).readByte()); assertEquals(4, ((ByteBuf) channel.readInbound()).readByte()); <START> assertEquals(5, ((ByteBuf) channel.readInbound()).readByte()); <END> assertFalse(channel.finish()); }</code><technical_language>need call release() of ByteBuf instances... Alternative change decoder do: out.add(in.readByte()); assert returned byte</technical_language>

Target:
public void testDisorder() { ByteToMessageDecoder decoder = new ByteToMessageDecoder() { int count; @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) { out.add(in.readByte()); if (++count >= 4) { ctx.pipeline().remove(this); } } }; EmbeddedChannel channel = new EmbeddedChannel(decoder); assertTrue(channel.writeInbound(Unpooled.wrappedBuffer(new byte[]{1, 2, 3, 4, 5}))); assertEquals((byte) 1, channel.readInbound()); assertEquals((byte) 2, channel.readInbound()); assertEquals((byte) 3, channel.readInbound()); assertEquals((byte) 4, channel.readInbound()); ByteBuf buffer5 = channel.readInbound(); assertEquals((byte) 5, buffer5.readByte()); assertFalse(buffer5.isReadable()); assertTrue(buffer5.release()); assertFalse(channel.finish()); }
Source:
<code>protected List<Property> getProperties() { Object[] allProperties = antPropertiesBlock.getProperties(); List<Property> properties = new ArrayList<>(allProperties.length); for (Object <START> currproperty : <END> allProperties) { Property property = (Property) currproperty; if (!property.isDefault()) { properties.add(property); } } return properties; }</code><technical_language>rename p, prop, currProperty</technical_language>

Target:
protected List<Property> getProperties() { Object[] allProperties = antPropertiesBlock.getProperties(); List<Property> properties = new ArrayList<>(allProperties.length); for (Object prop : allProperties) { Property property = (Property) prop; if (!property.isDefault()) { properties.add(property); } } return properties; }
Source:
<code>public static String setupBucketsPath(final ConfigContext config, final String testName) { <START> String testPathPrefix = String.format("%s/buckets/%s", config.getMantaHomeDirectory(), <END> testName + UUID.randomUUID()); return testPathPrefix + MantaClient.SEPARATOR; }</code><technical_language>Please MantaClient.SEPERATOR do hardcode slashes</technical_language>

Target:
private static String setupBucketsPath(final ConfigContext config, final String testName) { String bucketPathPrefix = String.format("%s%sbuckets%s%s", config.getMantaHomeDirectory(), MantaClient.SEPARATOR, MantaClient.SEPARATOR, testName.toLowerCase() + UUID.randomUUID()); return bucketPathPrefix + MantaClient.SEPARATOR + "objects" + MantaClient.SEPARATOR; }
Source:
<code>public void send(final KafkaRecord record) { if (kafkaProducer.isPresent()) { try { final Future<RecordMetadata> future = kafkaProducer.get().send( new ProducerRecord<String, byte[]>(record.getKafkaTopic(), record.getKafkaData())); <START> final RecordMetadata metadata = future.get(5, TimeUnit.SECONDS); <END> log.debug("Sent an event to Kafka, meta: {}", metadata); } catch (ExecutionException | InterruptedException | TimeoutException e) { log.error("Unable to send an event to Kafka", e); } } else { log.debug("KafkaProducer isn't set. Not sending anything."); } }</code><technical_language>I s/5/KAFKA_SEND_TIMEOUT/ similar, a magic number in middle of class</technical_language>

Target:
public void send(final KafkaRecord record) { if (kafkaProducer.isPresent()) { try { final Future<RecordMetadata> future = kafkaProducer.get().send( new ProducerRecord<String, byte[]>(record.getKafkaTopic(), record.getKafkaData())); final RecordMetadata metadata = future.get(KAFKA_SEND_TIMEOUT, TimeUnit.SECONDS); log.debug("Sent an event to Kafka, meta: {}", metadata); } catch (ExecutionException | InterruptedException | TimeoutException e) { log.error("Unable to send an event to Kafka", e); } } else { log.debug("KafkaProducer isn't set. Not sending anything."); } }
Source:
<code>private List<Artifact> parseArtifacts(String messagePayload, String messageId){ List<Artifact> artifacts = messageArtifactTranslator.parseArtifacts(messagePayload); <START> if (artifacts == null) { <END> log.debug("No artifacts were found for subscription: and messageId: {}", subscription.getName(), messageId); } else { artifacts.forEach( a -> a.setArtifactAccount(subscription.getAccountName())); log.debug( "Artifacts found for subscription: {}: {}", subscription.getName(), String.join(", ", artifacts.stream().map(Artifact::toString).collect(Collectors.toList())) ); } return artifacts; }</code><technical_language>null empty</technical_language>

Target:
private List<Artifact> parseArtifacts(String messagePayload, String messageId){ List<Artifact> artifacts = messageArtifactTranslator.parseArtifacts(messagePayload); if (artifacts == null || artifacts.size() == 0) { log.debug("No artifacts were found for subscription: and messageId: {}", subscription.getName(), messageId); } else { log.debug( "Artifacts found for subscription: {}: {}", subscription.getName(), String.join(", ", artifacts.stream().map(Artifact::toString).collect(Collectors.toList())) ); } return artifacts; }
Source:
<code>private ArrayList<String> getAllHarFiles(String harDirPath) { ArrayList<String> fileNamesList = new ArrayList<String>(); String fileName; File Folder = new File(harDirPath); File[] listOfFiles = Folder.listFiles(); for (int i = 0; i < listOfFiles.length; i++) { <START> <END> if (listOfFiles[i].isFile()) { fileName = listOfFiles[i].getName(); fileNamesList.add(fileName); } } return fileNamesList; }</code><technical_language>unnecessary new line</technical_language>

Target:
private ArrayList<String> getAllHarFiles(String harDirPath) { ArrayList<String> fileNamesList = new ArrayList<String>(); File Folder = new File(harDirPath); File[] listOfFiles = Folder.listFiles(); for (File file : listOfFiles) { if (file.isFile()) { fileNamesList.add(file.getName()); } } return fileNamesList; }
Source:
<code>public ModuleDeploymentProperties propertiesForDescriptor(ModuleDescriptor descriptor, Container container) { List<ModuleDescriptor> streamModules = stream.getDescriptorsAsList(); ModuleDeploymentProperties properties = propertiesForDescriptor(descriptor); int moduleIndex = descriptor.getIndex(); if (moduleIndex > 0) { ModuleDescriptor previous = streamModules.get(moduleIndex - 1); ModuleDeploymentProperties previousProperties = propertiesForDescriptor(previous); if (previousProperties.containsKey("producer.partitionKeyExpression")) { ModuleDescriptor.Key moduleKey = descriptor.createKey(); Integer index = mapModuleCount.get(moduleKey); if (index == null) { index = 0; } properties.put("consumer.partitionIndex", String.valueOf(index++)); mapModuleCount.put(moduleKey, index); } } if (properties.containsKey("producer.partitionKeyExpression")) { try { ModuleDeploymentProperties nextProperties = propertiesForDescriptor(streamModules.get(moduleIndex + 1)); String count = nextProperties.get("count"); Assert.hasText(count, String.format("'count' property is required " + <START> "in properties for module '%s' in order to support partitioning", descriptor)); <END> properties.put("producer.partitionCount", count); } catch (IndexOutOfBoundsException e) { logger.warn("Module '{}' is a sink module which contains a property " + "of '{}' used for data partitioning; this feature is only " + "supported for modules that produce data", descriptor, "producer.partitionKeyExpression"); } } mapDeploymentProperties.put(descriptor.createKey(), properties); return properties; }</code><technical_language>reject if count < 2</technical_language>

Target:
public ModuleDeploymentProperties propertiesForDescriptor(ModuleDescriptor descriptor, Container container) { List<ModuleDescriptor> streamModules = stream.getDescriptorsAsList(); ModuleDeploymentProperties properties = propertiesForDescriptor(descriptor); int moduleIndex = descriptor.getIndex(); if (moduleIndex > 0) { ModuleDescriptor previous = streamModules.get(moduleIndex - 1); ModuleDeploymentProperties previousProperties = propertiesForDescriptor(previous); if (hasPartitionKeyProperty(previousProperties)) { ModuleDescriptor.Key moduleKey = descriptor.createKey(); Integer index = mapModuleCount.get(moduleKey); if (index == null) { index = 0; } properties.put("consumer.partitionIndex", String.valueOf(index++)); mapModuleCount.put(moduleKey, index); } } if (hasPartitionKeyProperty(properties)) { try { ModuleDeploymentProperties nextProperties = propertiesForDescriptor(streamModules.get(moduleIndex + 1)); String count = nextProperties.get("count"); validateCountProperty(count, descriptor); properties.put("producer.partitionCount", count); } catch (IndexOutOfBoundsException e) { logger.warn("Module '{}' is a sink module which contains a property " + "of '{}' used for data partitioning; this feature is only " + "supported for modules that produce data", descriptor, "producer.partitionKeyExpression"); } } mapDeploymentProperties.put(descriptor.createKey(), properties); return properties; }
Source:
<code>public RecommendationList getRecommendations(String postUuid) throws ForumServiceException{ if(StringUtil.isNotEmpty(this.endpoint.getApiVersion())){ double apiVersion = Double.parseDouble(this.endpoint.getApiVersion()); if(APIVERSION > apiVersion ){ <START> throw new UnsupportedOperationException("This API is only supported on connections 4.5 or above"); <END> } } String recommendationsUrl = resolveUrl(ForumType.RECOMMENDATIONS, FilterType.ENTRIES); RecommendationList recommendations; Map<String, String> parameters = new HashMap<String, String>(); parameters.put(POST_UNIQUE_IDENTIFIER, postUuid); try { recommendations = (RecommendationList) getEntities(recommendationsUrl, parameters, new RecommendationsFeedHandler(this)); } catch (Exception e) { throw new ForumServiceException(e); } return recommendations; }</code><technical_language>This wrapped ForumServiceException</technical_language>

Target:
public RecommendationList getRecommendations(String postUuid) throws ForumServiceException{ if(StringUtil.isNotEmpty(this.endpoint.getApiVersion())){ double apiVersion = Double.parseDouble(this.endpoint.getApiVersion()); if(APIVERSION > apiVersion ){ UnsupportedOperationException ex = new UnsupportedOperationException("This API is only supported on connections 4.5 or above"); throw new ForumServiceException(ex); } } String recommendationsUrl = resolveUrl(ForumType.RECOMMENDATIONS, FilterType.ENTRIES); RecommendationList recommendations; Map<String, String> parameters = new HashMap<String, String>(); parameters.put(POST_UNIQUE_IDENTIFIER, postUuid); try { recommendations = (RecommendationList) getEntities(recommendationsUrl, parameters, new RecommendationsFeedHandler(this)); } catch (Exception e) { throw new ForumServiceException(e); } return recommendations; }
Source:
<code>public TreeMap<String, String> getDefaultEnvVars() { TreeMap<String,String> envs = new TreeMap<>(); envs.put("MESOS_QUORUM", "1"); envs.put("MESOS_ZK", getFormattedZKAddress()); <START> envs.put("MESOS_LOGGING_LEVEL", config.getLoggingLevel()); <END> return envs; }</code><technical_language>do play environment variables in MesosMaster MesosContainer? I know, changes in this PR ;)</technical_language>

Target:
public TreeMap<String, String> getDefaultEnvVars() { TreeMap<String, String> envs = new TreeMap<>(); envs.put("MESOS_QUORUM", "1"); envs.put("MESOS_ZK", getFormattedZKAddress()); envs.put("MESOS_LOGGING_LEVEL", getLoggingLevel()); if (getCluster() != null) { envs.put("MESOS_CLUSTER", getCluster().getClusterName()); } return envs; }
Source:
<code>private void getUnExternalizedStrings(IProject project, IProgressMonitor monitor) { PDEModelUtility.modifyModel(new ModelModification(project) { @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) inspectManifest((IBundlePluginModelBase) model, monitor); if (monitor.isCanceled()) { fCanceled = true; return; } if (model instanceof IPluginModelBase) inspectXML((IPluginModelBase) model, monitor); if (monitor.isCanceled()) { fCanceled = true; return; } } }, monitor); <START> monitor.done(); <END> }</code><technical_language>removed</technical_language>

Target:
private void getUnExternalizedStrings(IProject project, IProgressMonitor monitor) { PDEModelUtility.modifyModel(new ModelModification(project) { @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) inspectManifest((IBundlePluginModelBase) model, monitor); if (monitor.isCanceled()) { fCanceled = true; return; } if (model instanceof IPluginModelBase) inspectXML((IPluginModelBase) model, monitor); if (monitor.isCanceled()) { fCanceled = true; return; } } }, monitor); }
Source:
<code>public void close() { synchronized (files) { if (closed) { return; } closed = true; for (File file : ImmutableSet.copyOf(files)) { delete(file); } <START> if (files.size() > 0 && storageDirectory.exists() && !storageDirectory.delete()) { <END> log.warn("Cannot delete storageDirectory: %s", storageDirectory); } files.clear(); } }</code><technical_language>size check object, depending collection, traverse do other special record keeping operations. Some collections optimize this others cannot. isEmpty() simply checking for emptyness</technical_language>

Target:
public void close() { synchronized (files) { if (closed) { return; } closed = true; for (File file : ImmutableSet.copyOf(files)) { delete(file); } files.clear(); if (createdStorageDirectory && storageDirectory.exists() && !storageDirectory.delete()) { log.warn("Cannot delete storageDirectory: %s", storageDirectory); } } }
Source:
<code>private String getSearchImageUrl(final PostImage postImage) { <START> return postImage.extension.matches("^webm$") ? postImage.thumbnailUrl : postImage.imageUrl; <END> }</code><technical_language>I .matches("^webm$") is .equals("webm"). Replace equals avoid unnecessary regex check</technical_language>

Target:
private String getSearchImageUrl(final PostImage postImage) { return postImage.type == PostImage.Type.MOVIE ? postImage.thumbnailUrl : postImage.imageUrl; }
Source:
<code>protected List<Mutation> convert(String key, long seq, String value) { Mutation m = new Mutation(key); m.put("cf", "cq", seq, value); <START> return Arrays.asList(m); <END> }</code><technical_language>Collections.singletonList()</technical_language>

Target:
protected List<Mutation> convert(String key, long seq, String value) { Mutation m = new Mutation(key); m.put("cf", "cq", seq, value); return Collections.singletonList(m); }
Source:
<code>public void testDigits() { testingClient.server("passwordPolicy").run(session -> { RealmModel realmModel = session.getContext().getRealm(); PasswordPolicyManagerProvider policyManager = session.getProvider(PasswordPolicyManagerProvider.class); <START> realmModel.setPasswordPolicy(PasswordPolicy.parse(session, DigitsPasswordPolicyProviderFactory.ID)); <END> Assert.assertEquals("invalidPasswordMinDigitsMessage", policyManager.validate("jdoe", "abcd").getMessage()); Assert.assertArrayEquals(new Object[]{1}, policyManager.validate("jdoe", "abcd").getParameters()); assertNull(policyManager.validate("jdoe", "abcd1")); realmModel.setPasswordPolicy(PasswordPolicy.parse(session, "digits(2)")); Assert.assertEquals("invalidPasswordMinDigitsMessage", policyManager.validate("jdoe", "abcd1").getMessage()); Assert.assertArrayEquals(new Object[]{2}, policyManager.validate("jdoe", "abcd1").getParameters()); assertNull(policyManager.validate("jdoe", "abcd12")); }); }</code><technical_language>Please remove this. Tests intent a string a constant here</technical_language>

Target:
public void testDigits() { testingClient.server("passwordPolicy").run(session -> { RealmModel realmModel = session.getContext().getRealm(); PasswordPolicyManagerProvider policyManager = session.getProvider(PasswordPolicyManagerProvider.class); realmModel.setPasswordPolicy(PasswordPolicy.parse(session, "digits")); Assert.assertEquals("invalidPasswordMinDigitsMessage", policyManager.validate("jdoe", "abcd").getMessage()); Assert.assertArrayEquals(new Object[]{1}, policyManager.validate("jdoe", "abcd").getParameters()); assertNull(policyManager.validate("jdoe", "abcd1")); realmModel.setPasswordPolicy(PasswordPolicy.parse(session, "digits(2)")); Assert.assertEquals("invalidPasswordMinDigitsMessage", policyManager.validate("jdoe", "abcd1").getMessage()); Assert.assertArrayEquals(new Object[]{2}, policyManager.validate("jdoe", "abcd1").getParameters()); assertNull(policyManager.validate("jdoe", "abcd12")); }); }
Source:
<code>public boolean apply(Game game, Ability source) { for (UUID playerId : game.getOpponents(source.getControllerId())) { Player opponent = game.getPlayer(playerId); if (opponent == null) { continue; } opponent.damage(2, source.getSourceId(), game); <START> opponent.discard(2, true, source, game); <END> } return true; }</code><technical_language>card's bug: I cycles (damage first, discard -- card's rules)</technical_language>

Target:
public boolean apply(Game game, Ability source) { List<Player> opponents = game .getOpponents(source.getControllerId()) .stream().map(game::getPlayer) .filter(Objects::nonNull) .collect(Collectors.toList()); for (Player opponent : opponents) { opponent.damage(2, source.getSourceId(), game); } for (Player opponent : opponents) { opponent.discard(2, true, source, game); } return true; }
Source:
<code>protected Optional<? extends D> getDispatcher(C messageClass) { Set<D> dispatchers = getDispatchers(messageClass); if (dispatchers.isEmpty()) { return Optional.empty(); } int size = dispatchers.size(); checkState(size == 1, "More than one (%s) dispatchers found for the message class `%s`.", size, messageClass); D result = dispatchers.stream() .findFirst() <START> .get(); <END> return Optional.of(result); }</code><technical_language>long return optional result in next line, is need .get result of findFirst(). simply return findFirst() outcome, assured is a single element in collection</technical_language>

Target:
protected Optional<? extends D> getDispatcher(C messageClass) { Set<D> dispatchers = getDispatchers(messageClass); if (dispatchers.isEmpty()) { return Optional.empty(); } int size = dispatchers.size(); checkState(size == 1, "More than one (%s) dispatchers found for the message class `%s`.", size, messageClass); Optional<? extends D> result = dispatchers.stream() .findFirst(); return result; }
Source:
<code>public void serializationRoundTripTest() throws Exception { final Event event = Event.create("create", "foo", "nginx", Event.Type.CONTAINER, "create", Event.Actor.create("bar", ImmutableMap.of("image", "nginx", "name", "docker-nginx")), new Date(1487356000), 100L); final ObjectMapperProvider omp = new ObjectMapperProvider(); final ObjectMapper mapper = omp.getContext(Event.class); final String json = mapper.writerWithView(Event.class).writeValueAsString(event); <START> final Event event2 = mapper.getFactory().createParser(json).readValueAs(Event.class); <END> assertThat(event, equalTo(event2)); }</code><technical_language>do need mapper.writerWithView(Event.class).writeValueAsString(event) instead of mapper.writeValueAsString(event)? question for mapper.getFactory().createParser(json).readValueAs(Event.class) instead of mapper.readValue(json, Event.class)</technical_language>

Target:
public void serializationRoundTripTest() throws Exception { final Event event = Event.create("create", "foo", "nginx", Event.Type.CONTAINER, "create", Event.Actor.create("bar", ImmutableMap.of("image", "nginx", "name", "docker-nginx")), new Date(1487356000), 100L); final ObjectMapper mapper = ObjectMapperProvider.objectMapper(); final String json = mapper.writeValueAsString(event); final Event event2 = mapper.readValue(json, Event.class); assertThat(event, equalTo(event2)); }
Source:
<code>@Test public void legacy() throws Exception { assumeFalse("Symlinks don't work well on Windows", Functions.isWindows()); <START> write("2014-01-02_03-04-05/build.xml", "<?xml version='1.1' encoding='UTF-8'?>\n<run>\n <stuff>ok</stuff>\n <number>99</number>\n <otherstuff>ok</otherstuff>\n</run>"); <END> link("99", "2014-01-02_03-04-05"); link("lastFailedBuild", "-1"); link("lastSuccessfulBuild", "99"); assertEquals("{2014-01-02_03-04-05={build.xml='<?xml version='1.1' encoding='UTF-8'?>\n<run>\n <stuff>ok</stuff>\n <number>99</number>\n <otherstuff>ok</otherstuff>\n</run>'}, 99=→2014-01-02_03-04-05, lastFailedBuild=→-1, lastSuccessfulBuild=→99}", summarize()); assertTrue(migrator.migrate(dir, null)); assertEquals("{99={build.xml='<?xml version='1.1' encoding='UTF-8'?>\n<run>\n <stuff>ok</stuff>\n <id>2014-01-02_03-04-05</id>\n <timestamp>1388649845000</timestamp>\n <otherstuff>ok</otherstuff>\n</run>'}, lastFailedBuild=→-1, lastSuccessfulBuild=→99, legacyIds='2014-01-02_03-04-05 99\n'}", summarize()); assertEquals(99, migrator.findNumber("2014-01-02_03-04-05")); migrator = new RunIdMigrator(); assertFalse(migrator.migrate(dir, null)); assertEquals(99, migrator.findNumber("2014-01-02_03-04-05")); migrator.delete(dir, "2014-01-02_03-04-05"); FileUtils.deleteDirectory(new File(dir, "99")); new File(dir, "lastSuccessfulBuild").delete(); assertEquals("{lastFailedBuild=→-1, legacyIds=''}", summarize()); }</code><technical_language>I changes wrong - testing migrate build layout new layout - files written XStream utilities xml 1.0</technical_language>

Target:
@Test public void legacy() throws Exception { assumeFalse("Symlinks don't work well on Windows", Functions.isWindows()); write("2014-01-02_03-04-05/build.xml", "<?xml version='1.0' encoding='UTF-8'?>\n<run>\n <stuff>ok</stuff>\n <number>99</number>\n <otherstuff>ok</otherstuff>\n</run>"); link("99", "2014-01-02_03-04-05"); link("lastFailedBuild", "-1"); link("lastSuccessfulBuild", "99"); assertEquals("{2014-01-02_03-04-05={build.xml='<?xml version='1.0' encoding='UTF-8'?>\n<run>\n <stuff>ok</stuff>\n <number>99</number>\n <otherstuff>ok</otherstuff>\n</run>'}, 99=→2014-01-02_03-04-05, lastFailedBuild=→-1, lastSuccessfulBuild=→99}", summarize()); assertTrue(migrator.migrate(dir, null)); assertEquals("{99={build.xml='<?xml version='1.0' encoding='UTF-8'?>\n<run>\n <stuff>ok</stuff>\n <id>2014-01-02_03-04-05</id>\n <timestamp>1388649845000</timestamp>\n <otherstuff>ok</otherstuff>\n</run>'}, lastFailedBuild=→-1, lastSuccessfulBuild=→99, legacyIds='2014-01-02_03-04-05 99\n'}", summarize()); assertEquals(99, migrator.findNumber("2014-01-02_03-04-05")); migrator = new RunIdMigrator(); assertFalse(migrator.migrate(dir, null)); assertEquals(99, migrator.findNumber("2014-01-02_03-04-05")); migrator.delete(dir, "2014-01-02_03-04-05"); FileUtils.deleteDirectory(new File(dir, "99")); new File(dir, "lastSuccessfulBuild").delete(); assertEquals("{lastFailedBuild=→-1, legacyIds=''}", summarize()); }
Source:
<code>void submitSavingsAccount() { SavingsPayload savingsPayload = new SavingsPayload(); savingsPayload.setExternalId(et_client_external_id.getEditableText().toString()); savingsPayload.setLocale("en"); savingsPayload.setSubmittedOnDate(submission_date); savingsPayload.setDateFormat("dd MMMM yyyy"); if (clientId != 0) { savingsPayload.setClientId(clientId); } if (groupId != 0) { savingsPayload.setGroupId(groupId); <START> } <END> savingsPayload.setProductId(productId); savingsPayload.setNominalAnnualInterestRate(et_nominal_annual.getEditableText() .toString()); savingsPayload.setInterestCompoundingPeriodType(interestCompoundingPeriodTypeId); savingsPayload.setInterestPostingPeriodType(interestPostingPeriodTypeId); savingsPayload.setInterestCalculationType(interestCalculationTypeAdapterId); savingsPayload.getInterestCalculationDaysInYearType(); mSavingsAccountPresenter.createSavingsAccount(savingsPayload); }</code><technical_language>This is a good add Ids. Do this. java if (isGroupAccount) { savingsPayload.setGroupId(groupId); } else { savingsPayload.setClientId(clientId); }</technical_language>

Target:
void submitSavingsAccount() { SavingsPayload savingsPayload = new SavingsPayload(); savingsPayload.setExternalId(et_client_external_id.getEditableText().toString()); savingsPayload.setLocale("en"); savingsPayload.setSubmittedOnDate(submission_date); savingsPayload.setDateFormat("dd MMMM yyyy"); if (isGroupAccount) { savingsPayload.setGroupId(groupId); } else { savingsPayload.setClientId(clientId); } savingsPayload.setProductId(productId); savingsPayload.setNominalAnnualInterestRate(et_nominal_annual.getEditableText() .toString()); savingsPayload.setInterestCompoundingPeriodType(interestCompoundingPeriodTypeId); savingsPayload.setInterestPostingPeriodType(interestPostingPeriodTypeId); savingsPayload.setInterestCalculationType(interestCalculationTypeAdapterId); savingsPayload.getInterestCalculationDaysInYearType(); mSavingsAccountPresenter.createSavingsAccount(savingsPayload); }
Source:
<code>public void testIsNullOrBlankEmpty() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException, NoSuchMethodException, InstantiationException { assertTrue("empty", StringExtensions.isNullOrBlank("")); <START> assertTrue("empty", StringExtensions.isNullOrBlank(" ")); <END> assertTrue("empty", StringExtensions.isNullOrBlank(" ")); }</code><technical_language>For line 56 lien 58, is difference two? testing trim, need two. #Closed</technical_language>

Target:
public void testIsNullOrBlankEmpty() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException, NoSuchMethodException, InstantiationException { assertTrue("empty", StringExtensions.isNullOrBlank("")); assertTrue("empty", StringExtensions.isNullOrBlank(" ")); }
Source:
<code>public void refresh() { boolean releaseLock = true; if (lockManager.acquireLock(monitoringLock).getFirst()) { try { setIsSetNonOperationalExecuted(false); synchronized (this) { refreshCachedVds(); if (cachedVds == null) { log.error("VdsManager::refreshVdsRunTimeInfo - onTimer is NULL for '{}'", getVdsId()); return; } try { updateIteration(); if (isMonitoringNeeded()) { setStartTime(); releaseLock = false; <START> hostMonitoring = new HostMonitoring(this, cachedVds, monitoringStrategy, resourceManager, dbFacade, auditLogDirector); hostMonitoring.refresh(); unrespondedAttempts.set(0); setLastUpdate(); <END> afterRefreshTreatment(); } } catch (VDSNetworkException e) { logNetworkException(e); } catch (VDSRecoveringException ex) { handleVdsRecoveringException(ex); } catch (RuntimeException ex) { logFailureMessage(ex); } } } catch (Throwable e) { releaseLock = true; log.error("Timer update runtime info failed. Exception:", ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception:", e); } finally { if (releaseLock) { lockManager.releaseLock(monitoringLock); } } } }</code><technical_language>if exception is thrown this block, caught line 278. logged, continue rest of flow, releaseLock is set false. get tot finally block - lock released</technical_language>

Target:
public void refresh() { boolean releaseLock = true; if (lockManager.acquireLock(monitoringLock).getFirst()) { try { setIsSetNonOperationalExecuted(false); synchronized (this) { refreshCachedVds(); if (cachedVds == null) { log.error("VdsManager::refreshVdsRunTimeInfo - onTimer is NULL for '{}'", getVdsId()); return; } try { updateIteration(); if (isMonitoringNeeded()) { setStartTime(); releaseLock = false; hostMonitoring = new HostMonitoring(this, cachedVds, monitoringStrategy, resourceManager, dbFacade, auditLogDirector); hostMonitoring.refresh(); } } catch (VDSNetworkException e) { logNetworkException(e); releaseLock = true; } catch (VDSRecoveringException ex) { handleVdsRecoveringException(ex); releaseLock = true; } catch (RuntimeException ex) { logFailureMessage(ex); releaseLock = true; } } } catch (Throwable e) { releaseLock = true; log.error("Timer update runtime info failed. Exception:", ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception:", e); } finally { if (releaseLock) { lockManager.releaseLock(monitoringLock); } } } }
Source:
<code>public <START> synchronized void <END> onPackageAdded(String packageName) { final PackageInfo app; try { app = mPackageManager.getPackageInfo(packageName, GET_PERMISSIONS); } catch (NameNotFoundException e) { Slog.wtf(TAG, "NameNotFoundException " + packageName); return; } int uid = app.applicationInfo != null ? app.applicationInfo.uid : INVALID_UID; if (uid == INVALID_UID) { return; } processPackagePermissions(uid, Arrays.asList(app.requestedPermissions)); mPackageNameUidMap.put(packageName, uid); }</code><technical_language>This necessary if onPackageAdded onPackageRemoved methods guaranteed called thread, lock held. guarantee reasonable for PackageManagerService provide. Marking synchronized is fine for now, thread called on? easy, Log.d(TAG, Thread.currentThread().getName())</technical_language>

Target:
public void onPackageAdded(String packageName) { final PackageInfo app; try { app = mPackageManager.getPackageInfo(packageName, GET_PERMISSIONS); } catch (NameNotFoundException e) { Slog.wtf(TAG, "NameNotFoundException " + packageName); return; } int uid = app.applicationInfo != null ? app.applicationInfo.uid : INVALID_UID; if (uid == INVALID_UID) { return; } processPackagePermissions(uid, Arrays.asList(app.requestedPermissions)); synchronized (mPackageNameUidMap) { mPackageNameUidMap.put(packageName, uid); } }
Source:
<code>public static TLSSocketChannel create( ByteChannel channel, Logger logger, SSLEngine sslEngine ) throws IOException { TLSSocketChannel tlsChannel = new TLSSocketChannel( channel, logger, sslEngine ); try { tlsChannel.runHandshake(); } catch ( SSLHandshakeException e ) { throw new ClientException( "Failed to establish secured connection with the server: " + e.getMessage(), <START> e.getCause() ); <END> } return tlsChannel; }</code><technical_language>reason get cause</technical_language>

Target:
public static TLSSocketChannel create( ByteChannel channel, Logger logger, SSLEngine sslEngine ) throws IOException { TLSSocketChannel tlsChannel = new TLSSocketChannel( channel, logger, sslEngine ); try { tlsChannel.runHandshake(); } catch ( SSLHandshakeException e ) { throw new ClientException( "Failed to establish secured connection with the server: " + e.getMessage(), e ); } return tlsChannel; }
Source:
<code><START> public HaplotypeProbabilities deepCopy() { <END> return new HaplotypeProbabilitiesFromContaminatorSequence(this); }</code><technical_language>I covariant return types write suggestion public HaplotypeProbabilitiesFromContaminatorSequence deepCopy() {</technical_language>

Target:
public HaplotypeProbabilitiesFromContaminatorSequence deepCopy() { return new HaplotypeProbabilitiesFromContaminatorSequence(this); }
Source:
<code>protected RestRequest convertRequest() throws Exception { HttpServletRequest req = getRequest(); <START> log.warning(req.getPathInfo()); <END> RestRequest restRequest = new WebFormRequest(); restRequest.populateFromHttpRequest(req); return restRequest; }</code><technical_language>Is this for debugging</technical_language>

Target:
protected RestRequest convertRequest() throws Exception { HttpServletRequest req = getRequest(); RestRequest restRequest = new WebFormRequest(); restRequest.populateFromHttpRequest(req); return restRequest; }
Source:
<code>public int compareValueTo( ZonedDateTimeSchemaKey other ) { int compare = Long.compare( epochSecondUTC, other.epochSecondUTC ); if ( compare == 0 ) { compare = Integer.compare( nanoOfSecond, other.nanoOfSecond ); if ( compare == 0 && TimeZones.validZoneOffset( zoneOffsetMinutes * 60 ) && <START> TimeZones.validZoneOffset( other.zoneOffsetMinutes * 60 ) ) <END> { compare = Values.COMPARATOR.compare( asValue(), other.asValue() ); } } return compare; }</code><technical_language>I if this is correct behaviour in case of garbage returned. contract retry in case of invalid reads</technical_language>

Target:
public int compareValueTo( ZonedDateTimeSchemaKey other ) { int compare = Long.compare( epochSecondUTC, other.epochSecondUTC ); if ( compare == 0 ) { compare = Integer.compare( nanoOfSecond, other.nanoOfSecond ); if ( compare == 0 && TimeZones.validZoneOffset( zoneOffsetSeconds ) && TimeZones.validZoneOffset( other.zoneOffsetSeconds ) ) { compare = Values.COMPARATOR.compare( asValue(), other.asValue() ); } } return compare; }
Source:
<code>private static void addVariableAttributesHeaders(ValueTable table, Collection<String> headers) { for(Variable variable : table.getVariables()) { for(Attribute attribute : variable.getAttributes()) { String header = attribute.getName(); <START> if (attribute.hasNamespace()) { <END> header = attribute.getNamespace() + "::" + header; } if(attribute.isLocalised()) { header += ":" + attribute.getLocale(); } if(!headers.contains(header)) { headers.add(header); } } } }</code><technical_language>overwriting created variable header... String header = (attribute.hasNamespace() ? attribute.getNamespace() + "::" : "") + attribute.getName();</technical_language>

Target:
private static void addVariableAttributesHeaders(ValueTable table, Collection<String> headers) { for(Variable variable : table.getVariables()) { for(Attribute attribute : variable.getAttributes()) { String header = (attribute.hasNamespace() ? attribute.getNamespace() + "::" : "") + attribute.getName(); if(attribute.isLocalised()) { header += ":" + attribute.getLocale(); } if(!headers.contains(header)) { headers.add(header); } } } }
Source:
<code>public PremisEventObject createPremisEvent(PID eventPid, Model model) throws FedoraException { try (FcrepoResponse response = getClient().put(eventPid.getRepositoryUri()) .body(RDFModelUtil.streamModel(model), "text/turtle") .perform()) { return new PremisEventObject(PIDs.get(response.getLocation()), this, repositoryObjectDataLoader); } catch (IOException e) { throw new FedoraException("Unable to create premis event for " + eventPid, e); } catch (FcrepoOperationFailedException e) { <START> throw ClientFaultResolver.resolve(e); <END> } }</code><technical_language>scenes here? guessing resolve() returns a throwable, is else</technical_language>

Target:
public PremisEventObject createPremisEvent(PID eventPid, Model model) throws FedoraException { try (FcrepoResponse response = getClient().put(eventPid.getRepositoryUri()) .body(RDFModelUtil.streamModel(model), TURTLE_MIMETYPE) .perform()) { return new PremisEventObject(PIDs.get(response.getLocation()), this, repositoryObjectDataLoader); } catch (IOException e) { throw new FedoraException("Unable to create premis event for " + eventPid, e); } catch (FcrepoOperationFailedException e) { throw ClientFaultResolver.resolve(e); } }
Source:
<code>public void addResults(QueryStatusInfo statusInfo, QueryData data) { if (types.get() == null && statusInfo.getColumns() != null) { types.set(getTypes(statusInfo.getColumns())); } if (data.getData() != null) { <START> checkState(types.get() != null, "Data without types received!"); <END> List<Column> columns = statusInfo.getColumns(); for (List<Object> fields : data.getData()) { try { XContentBuilder dataBuilder = jsonBuilder().startObject(); for (int i = 0; i < fields.size(); i++) { Type type = types.get().get(i); Object value = convertValue(fields.get(i), type); dataBuilder.field(columns.get(i).getName(), value); } dataBuilder.endObject(); client.prepareIndex(tableName, "doc").setSource(dataBuilder.string(), JSON).get(); } catch (IOException e) { throw new RuntimeException("Failure loading data into Elasticsearch index: " + tableName, e); } } } }</code><technical_language>"Data types received!" -> "Type information is missing" sth</technical_language>

Target:
public void addResults(QueryStatusInfo statusInfo, QueryData data) { if (types.get() == null && statusInfo.getColumns() != null) { types.set(getTypes(statusInfo.getColumns())); } if (data.getData() != null) { checkState(types.get() != null, "Type information is missing"); List<Column> columns = statusInfo.getColumns(); for (List<Object> fields : data.getData()) { try { XContentBuilder dataBuilder = jsonBuilder().startObject(); for (int i = 0; i < fields.size(); i++) { Type type = types.get().get(i); Object value = convertValue(fields.get(i), type); dataBuilder.field(columns.get(i).getName(), value); } dataBuilder.endObject(); client.prepareIndex(tableName, "doc").setSource(dataBuilder.string(), JSON).get(); } catch (IOException e) { throw new UncheckedIOException("Failure loading data into Elasticsearch index: " + tableName, e); } } } }
Source:
<code>public void serverShutDown() throws Exception { <START> CarbonCommandToolsUtil.serverShutdown(1,context); <END> }</code><technical_language>apply correct code formatting.. spaces method parameters</technical_language>

Target:
public void serverShutDown() throws CarbonToolsIntegrationTestException { CarbonCommandToolsUtil.serverShutdown(portOffset, automationContext); }
Source:
<code>public void setup() { view.init(this); if (userCanCreateProjects()) { addProjectButtonPresenter.addOtherActions(this.translationService.getTranslation("TrySamples"), () -> trySamples()); <START> addProjectButtonPresenter.addOtherActions(this.translationService.getTranslation("ImportProject"), () -> importProject()); <END> view.addAction(addProjectButtonPresenter.getView().getElement()); } libraryService.call((RemoteCallback<LibraryInfo>) this::setupLibrary) .getLibraryInfo(getOrganizationalUnit()); }</code><technical_language>actions default, is if added (hard coded) in AddProjectButtonView.html</technical_language>

Target:
public void setup() { view.init(this); if (userCanCreateProjects()) { addProjectButtonPresenter.enableTrySamples(); addProjectButtonPresenter.enableImportProject(); view.addAction(addProjectButtonPresenter.getView().getElement()); } libraryService.call((RemoteCallback<LibraryInfo>) this::setupLibrary) .getLibraryInfo(getOrganizationalUnit()); }
Source:
<code>private void reportToServerIfNeeded(String tokenString){ if (isReporting){ return; } <START> boolean needToResport = false; <END> long currentTime = new Date().getTime(); if (recorderTempFile.exists()){ needToResport = true; } else if ((recorderFile.length() > config.uploadThreshold) && (lastReportTime == 0 || (currentTime - lastReportTime) > config.interval * 60)){ boolean isSuccess = recorderFile.renameTo(recorderTempFile); if (isSuccess) { needToResport = true; } } if (needToResport && !this.isReporting){ reportToServer(tokenString); } }</code><technical_language>needToResport => needToReport</technical_language>

Target:
private void reportToServerIfNeeded(String tokenString){ if (isReporting){ return; } boolean needToReport = false; long currentTime = new Date().getTime(); if (recorderTempFile.exists()){ needToReport = true; } else if ((recorderFile.length() > config.uploadThreshold) && (lastReportTime == 0 || (currentTime - lastReportTime) > config.interval * 60)){ boolean isSuccess = recorderFile.renameTo(recorderTempFile); if (isSuccess) { needToReport = true; } } if (needToReport && !this.isReporting){ reportToServer(tokenString); } }
Source:
<code>public void shouldRemoveNonExistingElements() { <START> assertThat(this.<Integer> empty().reject(i -> i == 0)).isSameAs(empty()); <END> assertThat(of(1, 2, 3).reject(i -> i != 0)).isSameAs(empty()); }</code><technical_language>removeAll</technical_language>

Target:
public void shouldRemoveNonExistingElements() { assertThat(this.<Integer> empty().removeAll(i -> i == 0)).isSameAs(empty()); assertThat(of(1, 2, 3).removeAll(i -> i != 0)).isSameAs(empty()); }
Source:
<code>private void writeTable(AutoConfiguration autoConfigurationClasses) throws IOException { this.outputDir.mkdirs(); try (PrintWriter writer = new PrintWriter( new FileWriter(new File(this.outputDir, autoConfigurationClasses.module + ".adoc")))) { writer.println("[cols=\"4,1\"]"); writer.println("|==="); writer.println("| Configuration Class | Links"); for (AutoConfigurationClass autoConfigurationClass : autoConfigurationClasses.classes) { writer.println(); writer.printf("| {spring-boot-code}/spring-boot-project/%s/src/main/java/%s.java[`%s`]%n", autoConfigurationClasses.module, autoConfigurationClass.path, autoConfigurationClass.name); <START> writer.printf("| {spring-boot-api}%s.html[javadoc]%n", autoConfigurationClass.path); <END> } writer.println("|==="); } }</code><technical_language>I stick a / variable slash. This means {spring-boot-api} end a slash</technical_language>

Target:
private void writeTable(AutoConfiguration autoConfigurationClasses) throws IOException { this.outputDir.mkdirs(); try (PrintWriter writer = new PrintWriter( new FileWriter(new File(this.outputDir, autoConfigurationClasses.module + ".adoc")))) { writer.println("[cols=\"4,1\"]"); writer.println("|==="); writer.println("| Configuration Class | Links"); for (AutoConfigurationClass autoConfigurationClass : autoConfigurationClasses.classes) { writer.println(); writer.printf("| {spring-boot-code}/spring-boot-project/%s/src/main/java/%s.java[`%s`]%n", autoConfigurationClasses.module, autoConfigurationClass.path, autoConfigurationClass.name); writer.printf("| {spring-boot-api}/%s.html[javadoc]%n", autoConfigurationClass.path); } writer.println("|==="); } }
Source:
<code>private boolean isDeleteAllowedByTool() { final EObject semanticContainer = ((DSemanticDecorator) diagramElement).getTarget(); final EObject viewContainer = diagramElement.eContainer(); boolean delete = true; if (tool.getPrecondition() != null && !StringUtil.isEmpty(tool.getPrecondition().trim())) { delete = false; final IInterpreter interpreter = InterpreterUtil.getInterpreter(diagramElement); interpreter.setVariable(IInterpreterSiriusVariables.CONTAINER_VIEW, viewContainer); interpreter.setVariable(IInterpreterSiriusVariables.VIEW, diagramElement); interpreter.setVariable(IInterpreterSiriusVariables.ELEMENT, semanticContainer); try { <START> delete = false; <END> delete = interpreter.evaluateBoolean(semanticContainer, tool.getPrecondition()); } catch (final EvaluationException e) { RuntimeLoggerManager.INSTANCE.error(tool, ToolPackage.eINSTANCE.getAbstractToolDescription_Precondition(), e); } interpreter.unSetVariable(IInterpreterSiriusVariables.CONTAINER_VIEW); interpreter.unSetVariable(IInterpreterSiriusVariables.VIEW); interpreter.unSetVariable(IInterpreterSiriusVariables.ELEMENT); } return delete; }</code><technical_language>This line is necessary. Remove it</technical_language>

Target:
private boolean isDeleteAllowedByTool() { final EObject semanticContainer = ((DSemanticDecorator) diagramElement).getTarget(); final EObject viewContainer = diagramElement.eContainer(); boolean delete = true; if (tool.getPrecondition() != null && !StringUtil.isEmpty(tool.getPrecondition().trim())) { delete = false; final IInterpreter interpreter = InterpreterUtil.getInterpreter(diagramElement); interpreter.setVariable(IInterpreterSiriusVariables.CONTAINER_VIEW, viewContainer); interpreter.setVariable(IInterpreterSiriusVariables.VIEW, diagramElement); interpreter.setVariable(IInterpreterSiriusVariables.ELEMENT, semanticContainer); try { delete = interpreter.evaluateBoolean(semanticContainer, tool.getPrecondition()); } catch (final EvaluationException e) { RuntimeLoggerManager.INSTANCE.error(tool, ToolPackage.eINSTANCE.getAbstractToolDescription_Precondition(), e); } interpreter.unSetVariable(IInterpreterSiriusVariables.CONTAINER_VIEW); interpreter.unSetVariable(IInterpreterSiriusVariables.VIEW); interpreter.unSetVariable(IInterpreterSiriusVariables.ELEMENT); } return delete; }
Source:
<code>public static Method[] excludingMain(Class<?> clazz) { Method[] declaredMethods = clazz.getDeclaredMethods(); List<Method> pruned = new LinkedList<>(); for (Method declaredMethod :declaredMethods) { if ("main".equals(declaredMethod.getName()) && isStaticVoid(declaredMethod) && acceptsStringArray(declaredMethod)) { continue; } pruned.add(declaredMethod); } <START> return pruned.toArray(new Method[0]); <END> }</code><technical_language>size of pruned for array</technical_language>

Target:
public static Method[] excludingMain(Class<?> clazz) { Method[] declaredMethods = clazz.getDeclaredMethods(); List<Method> pruned = new LinkedList<>(); for (Method declaredMethod :declaredMethods) { if ("main".equals(declaredMethod.getName()) && isStaticVoid(declaredMethod) && acceptsStringArray(declaredMethod)) { continue; } pruned.add(declaredMethod); } return pruned.toArray(new Method[pruned.size()]); }
Source:
<code>private void exportDevResElements(String elementType) { NodeList l1 = docel.getElementsByTagName(elementType); for (int i = 0; i < l1.getLength(); i++) { org.w3c.dom.Node node = l1.item(i); if (node instanceof Element) { Element el = (Element) node; pwCPP.println(" m_roObjectHandler.addFB(CTypeLib::createFB(g_nStringId" + el.getAttribute("Name") + ", g_nStringId" + el.getAttribute("Type") + ", this));"); NodeList childs = el.getChildNodes(); for (int j = 0; j < childs.getLength(); j++) { org.w3c.dom.Node childnode = childs.item(j); if (childnode instanceof Element) { Element <START> childel = <END> (Element) childnode; pwCPP.println(MessageFormat.format( " m_roObjectHandler.getFB(g_nStringId{0})->getDataInput(g_nStringId{1})->fromString(\"{2}\");", el.getAttribute("Name"), childel.getAttribute("Name"), childel.getAttribute("Value"))); } } } } }</code><technical_language>spelled child not? whats a childel</technical_language>

Target:
private void exportDevResElements(String elementType) { NodeList l1 = docel.getElementsByTagName(elementType); for (int i = 0; i < l1.getLength(); i++) { org.w3c.dom.Node node = l1.item(i); if (node instanceof Element) { Element el = (Element) node; pwCPP.println(" m_roObjectHandler.addFB(CTypeLib::createFB(g_nStringId" + el.getAttribute("Name") + ", g_nStringId" + el.getAttribute("Type") + ", this));"); NodeList childs = el.getChildNodes(); for (int j = 0; j < childs.getLength(); j++) { org.w3c.dom.Node childnode = childs.item(j); if (childnode instanceof Element) { Element childElem = (Element) childnode; pwCPP.println(MessageFormat.format( " m_roObjectHandler.getFB(g_nStringId{0})->getDataInput(g_nStringId{1})->fromString(\"{2}\");", el.getAttribute("Name"), childElem.getAttribute("Name"), childElem.getAttribute("Value"))); } } } } }
Source:
<code>public void getAttribute_shouldReturnNullIfAttributeNameIsVoided() throws Exception { Person person = personHelper(true, 1, 2, 3, "name1", "name2", "name3", "value1", "value2", "value3"); <START> Assert.assertEquals(null, person.getAttribute("name3")); <END> }</code><technical_language>user Assert.assertNull instead</technical_language>

Target:
public void getAttribute_shouldReturnNullIfAttributeNameIsVoided() throws Exception { Person person = personHelper(true, 1, 2, 3, "name1", "name2", "name3", "value1", "value2", "value3"); Assert.assertNull(person.getAttribute("name3")); }
Source:
<code>public DocumentModel run(DocumentModel input) { input.addFacet(facet); <START> <END> session.saveDocument(input); return input; }</code><technical_language>For small method (next in next file too) extra blank lines bring anything</technical_language>

Target:
public DocumentModel run(DocumentModel input) { input.addFacet(facet); input = session.saveDocument(input); return input; }
Source:
<code>public Set<String> getIgnoredFields() { Set<String> ignoredFields = new HashSet<>(); <START> if (excludedFields.isEmpty() && !includedFields.isEmpty()) { <END> for (String name: actualFields) { if (!includedFields.contains(name)) { ignoredFields.add(name); } } return Collections.unmodifiableSet(ignoredFields); } return Collections.unmodifiableSet(excludedFields); }</code><technical_language>reduce cyclomatic complexity inverting condition returning ignoredFields immediately, de-indent for loop</technical_language>

Target:
public Set<String> getIgnoredFields() { return Collections.unmodifiableSet(includedFields.isEmpty() ? excludedFields : invertIncludedFields()); }