auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private RawPacket recover() { if (!canRecover()) { return null; } byte[] buf = new byte[1500]; RawPacket recoveredPacket = new RawPacket(buf, 0, 1500); if (!startPacketRecovery(this.fecPacket, recoveredPacket)) { return null; } for (Integer protectedSeqNum : fecPacket.getProtectedSequenceNumbers()) { if (protectedSeqNum != missingSequenceNumber) { <START> RawPacket mediaPacket = mediaPackets.get(protectedSeqNum); <END> xorHeaders(mediaPacket, recoveredPacket); xorPayloads( mediaPacket, RawPacket.FIXED_HEADER_SIZE, recoveredPacket, RawPacket.FIXED_HEADER_SIZE, mediaPacket.getLength() - RawPacket.FIXED_HEADER_SIZE); } } if (!finishPacketRecovery(fecPacket, recoveredPacket)) { return null; } return recoveredPacket; }</code><technical_language>deal case of media packet cleared cache? leave for switch reusing MediaStream's cache</technical_language>

Target:
private RawPacket recover() { if (!canRecover()) { return null; } byte[] buf = new byte[1500]; RawPacket recoveredPacket = new RawPacket(buf, 0, 1500); if (!startPacketRecovery(this.fecPacket, recoveredPacket)) { return null; } for (Integer protectedSeqNum : fecPacket.getProtectedSequenceNumbers()) { if (protectedSeqNum != missingSequenceNumber) { RawPacket mediaPacket = mediaPackets.get(protectedSeqNum); xorHeaders(mediaPacket, recoveredPacket); xorPayloads( mediaPacket.getBuffer(), mediaPacket.getOffset() + RawPacket.FIXED_HEADER_SIZE, recoveredPacket.getBuffer(), RawPacket.FIXED_HEADER_SIZE, mediaPacket.getLength() - RawPacket.FIXED_HEADER_SIZE); } } if (!finishPacketRecovery(fecPacket, recoveredPacket)) { return null; } return recoveredPacket; }
Source:
<code>public void testRedeclareXExpiresQueue() throws Exception { RabbitTemplate template = context.getBean(RabbitTemplate.class); template.convertAndSend("xExpires", "foo"); assertNotNull(queue.poll(10, TimeUnit.SECONDS)); SimpleMessageListenerContainer listenerContainer = context.getBean("container3", SimpleMessageListenerContainer.class); listenerContainer.stop(); RabbitAdmin admin = spy(TestUtils.getPropertyValue(this.listenerContainer1, "rabbitAdmin", RabbitAdmin.class)); new DirectFieldAccessor(listenerContainer).setPropertyValue("rabbitAdmin", admin); int n = 0; while (admin.getQueueProperties("xExpires") != null && n < 10) { Thread.sleep(100); n++; } assertTrue(n < 10); listenerContainer.start(); template.convertAndSend("xExpires", "foo"); <START> assertNotNull(queue.poll(10, TimeUnit.SECONDS)); <END> verify(admin, times(1)).initialize(); listenerContainer.stop(); }</code><technical_language>higher too. 10ms is short a busy CI server</technical_language>

Target:
public void testRedeclareXExpiresQueue() throws Exception { RabbitTemplate template = context.getBean(RabbitTemplate.class); template.convertAndSend("xExpires", "foo"); assertNotNull(queue.poll(10, TimeUnit.SECONDS)); SimpleMessageListenerContainer listenerContainer = context.getBean("container3", SimpleMessageListenerContainer.class); listenerContainer.stop(); RabbitAdmin admin = spy(TestUtils.getPropertyValue(listenerContainer, "rabbitAdmin", RabbitAdmin.class)); new DirectFieldAccessor(listenerContainer).setPropertyValue("rabbitAdmin", admin); int n = 0; while (admin.getQueueProperties("xExpires") != null && n < 100) { Thread.sleep(100); n++; } assertTrue(n < 100); listenerContainer.start(); template.convertAndSend("xExpires", "foo"); assertNotNull(queue.poll(10, TimeUnit.SECONDS)); verify(admin, times(1)).initialize(); }
Source:
<code>private void UpdateNumOfMonitors() { boolean isVnc = false; if (getOSType().getSelectedItem() != null) { VmOsType osType = (VmOsType) getOSType().getSelectedItem(); <START> } <END> if (getDisplayProtocol().getSelectedItem() != null) { DisplayType displayType = (DisplayType) ((EntityModel) getDisplayProtocol().getSelectedItem()).getEntity(); isVnc = displayType == DisplayType.vnc; } if (isVnc) { getNumOfMonitors().setSelectedItem(1); getNumOfMonitors().setIsChangable(false); } else { getNumOfMonitors().setIsChangable(true); } }</code><technical_language>"if" statement unnecessary. Please remove it</technical_language>

Target:
private void UpdateNumOfMonitors() { boolean isVnc = false; if (getDisplayProtocol().getSelectedItem() != null) { DisplayType displayType = (DisplayType) ((EntityModel) getDisplayProtocol().getSelectedItem()).getEntity(); isVnc = displayType == DisplayType.vnc; } if (isVnc) { getNumOfMonitors().setSelectedItem(1); getNumOfMonitors().setIsChangable(false); } else { getNumOfMonitors().setIsChangable(true); } }
Source:
<code>public InternalHiveBlock currentBlock() <START> { <END> checkState(!isDone(), "All blocks have been consumed"); List<HostAddress> addresses = blockAddresses.isEmpty() ? ImmutableList.of() : blockAddresses.get(currentBlockIndex); return new InternalHiveBlock(blockEnds[currentBlockIndex], addresses); }</code><technical_language>nit: if blockAddresses.isEmpty() ? is more clear blockAddresses == null. you</technical_language>

Target:
public InternalHiveBlock currentBlock() { checkState(!isDone(), "All blocks have been consumed"); List<HostAddress> addresses = blockAddresses.isEmpty() ? ImmutableList.of() : blockAddresses.get(currentBlockIndex); return new InternalHiveBlock(blockEndOffsets[currentBlockIndex], addresses); }
Source:
<code>public OpenShiftProject(OpenShiftClientFactory clientFactory, String name, String workspaceId) throws InfrastructureException { super(clientFactory, name, workspaceId, false); this.routes = new OpenShiftRoutes(name, workspaceId, clientFactory); <START> doPrepare(name, clientFactory.create(), clientFactory.createOC()); <END> }</code><technical_language>clientFactory.create() invoked workspaceId</technical_language>

Target:
public OpenShiftProject(OpenShiftClientFactory clientFactory, String name, String workspaceId) throws InfrastructureException { super(clientFactory, name, workspaceId, false); this.routes = new OpenShiftRoutes(name, workspaceId, clientFactory); doPrepare(name, clientFactory.create(workspaceId), clientFactory.createOC(workspaceId)); }
Source:
<code><START> WebClient getWebClient(String uri, Map<String, Serializable> properties) { <END> SecureCxfClientFactory<WebClient> factory; if (properties.get(USERNAME) != null && properties.get(PASSWORD) != null) { factory = clientFactoryFactory.getSecureCxfClientFactory( uri, WebClient.class, null, null, false, getFollowRedirects(), null, null, (String) properties.get(USERNAME), (String) properties.get(PASSWORD)); } else if (properties.get(ID_PROPERTY) != null && properties.get(OAUTH_DISCOVERY_URL) != null && properties.get(OAUTH_CLIENT_ID) != null && properties.get(OAUTH_CLIENT_SECRET) != null && properties.get(OAUTH_FLOW) != null) { factory = clientFactoryFactory.getSecureCxfClientFactory( uri, WebClient.class, null, null, false, getFollowRedirects(), null, null, (String) properties.get(ID_PROPERTY), (String) properties.get(OAUTH_DISCOVERY_URL), (String) properties.get(OAUTH_CLIENT_ID), (String) properties.get(OAUTH_CLIENT_SECRET), (String) properties.get(OAUTH_FLOW)); } else { factory = clientFactoryFactory.getSecureCxfClientFactory( uri, WebClient.class, null, null, false, getFollowRedirects()); } Serializable subject = properties.get(SecurityConstants.SECURITY_SUBJECT); if (subject instanceof org.apache.shiro.subject.Subject) { return factory.getClientForSubject((org.apache.shiro.subject.Subject) subject); } return factory.getWebClient(); }</code><technical_language>I get a compilation error building. This test needs updated new getWebClient method signature: <LINK_0></technical_language>

Target:
protected WebClient getWebClient(String uri, Map<String, Serializable> properties) { SecureCxfClientFactory<WebClient> factory; if (properties.get(USERNAME) != null && properties.get(PASSWORD) != null) { factory = clientFactoryFactory.getSecureCxfClientFactory( uri, WebClient.class, null, null, false, getFollowRedirects(), null, null, (String) properties.get(USERNAME), (String) properties.get(PASSWORD)); } else if (properties.get(ID_PROPERTY) != null && properties.get(OAUTH_DISCOVERY_URL) != null && properties.get(OAUTH_CLIENT_ID) != null && properties.get(OAUTH_CLIENT_SECRET) != null && properties.get(OAUTH_FLOW) != null) { factory = clientFactoryFactory.getSecureCxfClientFactory( uri, WebClient.class, null, null, false, getFollowRedirects(), null, null, (String) properties.get(ID_PROPERTY), (String) properties.get(OAUTH_DISCOVERY_URL), (String) properties.get(OAUTH_CLIENT_ID), (String) properties.get(OAUTH_CLIENT_SECRET), (String) properties.get(OAUTH_FLOW)); } else { factory = clientFactoryFactory.getSecureCxfClientFactory( uri, WebClient.class, null, null, false, getFollowRedirects()); } Serializable subject = properties.get(SecurityConstants.SECURITY_SUBJECT); if (subject instanceof org.apache.shiro.subject.Subject) { return factory.getClientForSubject((org.apache.shiro.subject.Subject) subject); } return factory.getWebClient(); }
Source:
<code>public MessagePackParser(SecorConfig config) { super(config); <START> mTimestampField = ValueFactory.createRawValue(mConfig.getMessageTimestampName()); <END> }</code><technical_language>Please lines < 80 chars</technical_language>

Target:
public MessagePackParser(SecorConfig config) { super(config); String timestampName = mConfig.getMessageTimestampName(); mTimestampField = ValueFactory.createRawValue(timestampName); }
Source:
<code>public FileBasedSystemAccessControlRules( @JsonProperty("catalogs") Optional<List<CatalogAccessControlRule>> catalogRules, @JsonProperty("principals") Optional<List<PrincipalUserMatchRule>> principalUserMatchRules) { this.catalogRules = catalogRules.map(ImmutableList::copyOf).orElse(ImmutableList.of()); <START> this.principalUserMatchRules = principalUserMatchRules.map(ImmutableList::copyOf).orElse(ImmutableList.of()); <END> }</code><technical_language>Yea, consistency is good. However, catalogRules access is denied. here, principalUserMatchRules rules access is allowed. semantics is inconsistent design</technical_language>

Target:
public FileBasedSystemAccessControlRules( @JsonProperty("catalogs") Optional<List<CatalogAccessControlRule>> catalogRules, @JsonProperty("principals") Optional<List<PrincipalUserMatchRule>> principalUserMatchRules) { this.catalogRules = catalogRules.map(ImmutableList::copyOf).orElse(ImmutableList.of()); this.principalUserMatchRules = principalUserMatchRules.map(ImmutableList::copyOf); }
Source:
<code>public boolean isValueSetPreExpandedForCodeValidation(ValueSet theValueSet) { ResourceTable resourceTable = (ResourceTable) myValueSetResourceDao.readEntity(theValueSet.getIdElement(), null); <START> Long valueSetResourcePid = resourceTable.getId(); <END> Optional<TermValueSet> optionalTermValueSet = myValueSetDao.findByResourcePid(valueSetResourcePid); if (!optionalTermValueSet.isPresent()) { ourLog.warn("ValueSet is not present in terminology tables. Will perform in-memory code validation. Will schedule this ValueSet for pre-expansion. {}", getValueSetInfo(theValueSet)); myDeferredValueSets.add(theValueSet); return false; } TermValueSet termValueSet = optionalTermValueSet.get(); if (termValueSet.getExpansionStatus() != TermValueSetPreExpansionStatusEnum.EXPANDED) { ourLog.warn("{} is present in terminology tables but not ready for persistence-backed invocation of operation $validation-code. Will perform in-memory code validation. Current status: | {}", getValueSetInfo(theValueSet), termValueSet.getExpansionStatus().name(), termValueSet.getExpansionStatus().getDescription()); return false; } return true; }</code><technical_language>lines refactored a utility method</technical_language>

Target:
public boolean isValueSetPreExpandedForCodeValidation(ValueSet theValueSet) { Long valueSetResourcePid = getValueSetResourcePid(theValueSet.getIdElement()); Optional<TermValueSet> optionalTermValueSet = myValueSetDao.findByResourcePid(valueSetResourcePid); if (!optionalTermValueSet.isPresent()) { ourLog.warn("ValueSet is not present in terminology tables. Will perform in-memory code validation. Will schedule this ValueSet for pre-expansion. {}", getValueSetInfo(theValueSet)); myDeferredValueSets.add(theValueSet); return false; } TermValueSet termValueSet = optionalTermValueSet.get(); if (termValueSet.getExpansionStatus() != TermValueSetPreExpansionStatusEnum.EXPANDED) { ourLog.warn("{} is present in terminology tables but not ready for persistence-backed invocation of operation $validation-code. Will perform in-memory code validation. Current status: | {}", getValueSetInfo(theValueSet), termValueSet.getExpansionStatus().name(), termValueSet.getExpansionStatus().getDescription()); return false; } return true; }
Source:
<code>public boolean test() { ProjectExplorer pe = new ProjectExplorer(); <START> pe.open(); <END> if (!pe.getProject(this.projectName).isSelected()) { return false; } return true; }</code><technical_language>open ProjectExplorer in constructor. Code more performant</technical_language>

Target:
public boolean test() { if (!pe.getProject(this.projectName).isSelected()) { return false; } return true; }
Source:
<code>public void scopeHandlesExceptions() throws WordsRuntimeException { AST statementList = new INodeStatementList(createObjectFred); AST iterativeLoop = new INodeRepeat(fiveLeaf, statementList); loop.enqueueAST(createObjectFred); loop.fastForwardEnvironment(1); <START> loop.enqueueAST(iterativeLoop); <END> assertEquals("Outside of loop, ends in global scope", environment.getNumberOfScopes(), 1); }</code><technical_language>this test is working? fast forwarding environment run loop, exceptions of create Fred exists in outer scope generated</technical_language>

Target:
public void scopeHandlesExceptions() throws WordsRuntimeException { AST statementList = new INodeStatementList(createObjectFred); AST iterativeLoop = new INodeRepeat(fiveLeaf, statementList); loop.enqueueAST(createObjectFred); loop.fastForwardEnvironment(1); loop.enqueueAST(iterativeLoop); loop.fastForwardEnvironment(2); assertEquals("Outside of loop, ends in global scope", environment.getNumberOfScopes(), 1); }
Source:
<code>public void logMTUDifferences(Map<String, network> clusterNetworkByName, List<VdsNetworkInterface> interfaces) { <START> for (VdsNetworkInterface iface: interfaces) { <END> if (iface.getNetworkName() != null && clusterNetworkByName.containsKey(iface.getNetworkName())) { if (iface.getMtu() != clusterNetworkByName.get(iface.getNetworkName()).getMtu()) { AuditLogableBase logable = new AuditLogableBase(); logable.AddCustomValue("NetworkName", iface.getNetworkName()); logable.AddCustomValue("VDS_MTU", String.valueOf(iface.getMtu())); logable.AddCustomValue("CLUSTER_MTU", String.valueOf(clusterNetworkByName.get(iface.getNetworkName()).getMtu())); AuditLogDirector.log(logable, AuditLogType.VDS_SET_NONOPERATIONAL_NETWORK_MTU_DIFFER); } } } }</code><technical_language>time interfaces</technical_language>

Target:
public void logMTUDifferences(Map<String, network> clusterNetworkByName, List<VdsNetworkInterface> interfaces) { for (VdsNetworkInterface iface : interfaces) { if (iface.getNetworkName() != null && clusterNetworkByName.containsKey(iface.getNetworkName()) && iface.getMtu() != clusterNetworkByName.get(iface.getNetworkName()).getMtu()) { AuditLogableBase logable = new AuditLogableBase(); logable.AddCustomValue(NetworkName, iface.getNetworkName()); logable.AddCustomValue(HostNetworkMTU, String.valueOf(iface.getMtu())); logable.AddCustomValue(LogicalNetworkMTU, String.valueOf(clusterNetworkByName.get(iface.getNetworkName()).getMtu())); AuditLogDirector.log(logable, AuditLogType.VDS_NETWORK_MTU_DIFFER_FROM_LOGICAL_NETWORK); } } }
Source:
<code><START> public static long calculateContentLength(final long plaintextSize, final int blockBytes, final int tagOrHmacBytes, final boolean hasIV) { <END> if (plaintextSize <= 0) { return blockBytes + tagOrHmacBytes; } long calculatedContentLength = plaintextSize; long padding = 0L; if (plaintextSize > blockBytes) { padding = plaintextSize % blockBytes; } else { calculatedContentLength = blockBytes; } if (padding > 0) { calculatedContentLength = (plaintextSize - padding) + blockBytes; } if (!hasIV && plaintextSize >= blockBytes) { final double blocks = Math.floor(plaintextSize / ((long) blockBytes)); calculatedContentLength = (((long)blocks + 1) * blockBytes); } calculatedContentLength += tagOrHmacBytes; return calculatedContentLength; }</code><technical_language>change scope of method default scope removing public. I this method is this class. changing default scope access is limited package. This allows tests run limit scope mark private</technical_language>

Target:
static long calculateContentLength(final long plaintextSize, final int blockBytes, final int tagOrHmacBytes, final boolean hasIV) { if (plaintextSize <= 0) { return blockBytes + tagOrHmacBytes; } long calculatedContentLength = plaintextSize; long padding = 0L; if (plaintextSize > blockBytes) { padding = plaintextSize % blockBytes; } else { calculatedContentLength = blockBytes; } if (padding > 0) { calculatedContentLength = (plaintextSize - padding) + blockBytes; } if (!hasIV && plaintextSize >= blockBytes) { final double blocks = Math.floor(plaintextSize / ((long) blockBytes)); calculatedContentLength = (((long)blocks + 1) * blockBytes); } calculatedContentLength += tagOrHmacBytes; return calculatedContentLength; }
Source:
<code>private boolean equalsIgnoreNull(Object o1, Object o2) { <START> return o1 != null ? o1.equals(o2) : o2 != null; <END> }</code><technical_language>If o1 is diff null, o1 equals o2. If o1 is null, return "o2 is _diff than_ null" ? I this part is wrong</technical_language>

Target:
private boolean equalsIgnoreNull(Object o1, Object o2) { return o1 != null ? o1.equals(o2) : o2 == null; }
Source:
<code>public IUser getUser(String userName) throws QuadrigaStorageException { IUser user = null; QuadrigaUserDTO userDTO = dbConnect.getUserDTO(userName); if (userDTO != null) { user = mapUser(userDTO); } if (user != null) { List<IQuadrigaRole> userRole = user.getQuadrigaRoles(); <START> IQuadrigaRole quadrigaRole = null; <END> List<IQuadrigaRole> rolesList = new ArrayList<IQuadrigaRole>(); for (int i = 0; i < userRole.size(); i++) { quadrigaRole = roleManager.getQuadrigaRoleByDbId(IQuadrigaRoleManager.MAIN_ROLES, userRole.get(i) .getDBid()); if (quadrigaRole.getId().equals( RoleNames.ROLE_QUADRIGA_DEACTIVATED)) { rolesList.clear(); rolesList.add(quadrigaRole); break; } rolesList.add(quadrigaRole); } user.setQuadrigaRoles(rolesList); } else { user = userFactory.createUserObject(); IQuadrigaRole quadrigaRole = roleManager .getQuadrigaRoleByDbId(IQuadrigaRoleManager.MAIN_ROLES, RoleNames.DB_ROLE_QUADRIGA_NOACCOUNT); List<IQuadrigaRole> rolesList = new ArrayList<IQuadrigaRole>(); rolesList.add(quadrigaRole); user.setQuadrigaRoles(rolesList); } return user; }</code><technical_language>declared needed (line 54)</technical_language>

Target:
public IUser getUser(String userName) throws QuadrigaStorageException { QuadrigaUserDTO userDTO = dbConnect.getUserDTO(userName); IUser user = constructUserWithRoles(userDTO); if (user == null) { user = userFactory.createUserObject(); IQuadrigaRole quadrigaRole = roleManager.getQuadrigaRoleByDbId(IQuadrigaRoleManager.MAIN_ROLES, RoleNames.DB_ROLE_QUADRIGA_NOACCOUNT); List<IQuadrigaRole> rolesList = new ArrayList<IQuadrigaRole>(); rolesList.add(quadrigaRole); user.setQuadrigaRoles(rolesList); } return user; }
Source:
<code>public static void compactTransient(FluoConfiguration fluoConfig) throws Exception { Connector conn = getConnector(fluoConfig); try (FluoClient client = FluoFactory.newClient(fluoConfig)) { Configuration appConfig = client.getAppConfiguration(); TransientRegistry transientRegistry = new TransientRegistry(appConfig); List<RowRange> ranges = transientRegistry.getTransientRanges(); <START> Logger logger = LoggerFactory.getLogger(TableOperations.class); <END> for (RowRange r : ranges) { logger.debug("Compacting {}", r.getStart(), r.getEnd()); conn.tableOperations().compact(fluoConfig.getAccumuloTable(), new Text(r.getStart().toArray()), new Text(r.getEnd().toArray()), true, true); } } }</code><technical_language>logger a static field</technical_language>

Target:
public static void compactTransient(FluoConfiguration fluoConfig) throws Exception { Connector conn = getConnector(fluoConfig); try (FluoClient client = FluoFactory.newClient(fluoConfig)) { Configuration appConfig = client.getAppConfiguration(); TransientRegistry transientRegistry = new TransientRegistry(appConfig); List<RowRange> ranges = transientRegistry.getTransientRanges(); for (RowRange r : ranges) { logger.debug("Compacting {}", r.getStart(), r.getEnd()); conn.tableOperations().compact(fluoConfig.getAccumuloTable(), new Text(r.getStart().toArray()), new Text(r.getEnd().toArray()), true, true); } } }
Source:
<code>public boolean isChecked(String title) throws RemoteException { Selector nodeSelector = new Selector("span[title=\"" + title + "\"]"); Object checked = browser.syncRun("return " <START> + nodeSelector.getStatement() <END> + ".prev().hasClass('rc-tree-checkbox-checked')"); return checked != null ? (Boolean) checked : null; }</code><technical_language>nice if wild stick string formatting style (either concatenation String.format) for creating statements. I String.format is more readable</technical_language>

Target:
public boolean isChecked(String title) throws RemoteException { Selector nodeSelector = new Selector("span[title=\"" + title + "\"]"); Object checked = browser.syncRun(String.format( "return %s.prev().hasClass('rc-tree-checkbox-checked')", nodeSelector.getStatement())); return checked != null ? (Boolean) checked : null; }
Source:
<code>final Snapshot toSnapshot() { S state; Version version; LifecycleFlags lifecycle; if (isTransactionInProgress()) { <START> AggregateTransaction tx = (AggregateTransaction) tx(); <END> state = builder().buildPartial(); version = tx.currentVersion(); lifecycle = tx.lifecycleFlags(); } else { state = state(); version = version(); lifecycle = lifecycleFlags(); } Any packedState = AnyPacker.pack(state); Snapshot.Builder builder = Snapshot .newBuilder() .setState(packedState) .setVersion(version) .setTimestamp(currentTime()) .setLifecycle(lifecycle); return builder.build(); }</code><technical_language>Please generic parameters having: java AggregateTransaction<?, ?, ?> tx = (AggregateTransaction<?, ?, ?>) tx(); eliminate IDEA's warning generics</technical_language>

Target:
final Snapshot toSnapshot() { S state; Version version; LifecycleFlags lifecycle; if (isTransactionInProgress()) { AggregateTransaction<?, ?, ?> tx = (AggregateTransaction<?, ?, ?>) tx(); state = builder().buildPartial(); version = tx.currentVersion(); lifecycle = tx.lifecycleFlags(); } else { state = state(); version = version(); lifecycle = lifecycleFlags(); } Any packedState = AnyPacker.pack(state); Snapshot.Builder builder = Snapshot .newBuilder() .setState(packedState) .setVersion(version) .setTimestamp(currentTime()) .setLifecycle(lifecycle); return builder.build(); }
Source:
<code>private void initProgramURLField() { <START> programURLContainer = loginActivity.findViewById(R.id.text_layout_program_server_url); <END> ((TextInputLayout) loginActivity.findViewById(R.id.text_layout_program_server_url)).setHint( Utils.getInternationalizedString(R.string.program_url, loginActivity)); }</code><technical_language>programURLContainer setHint avoid duplicate findViewById get view</technical_language>

Target:
private void initProgramURLField() { programURLContainer = initTextInputLayout(R.id.text_layout_program_server_url, R.string.program_url); }
Source:
<code>public Response listTestRunCaseSink(@PathParam("topologyId") Long topologyId, @PathParam("testCaseId") Long testCaseId) { <START> Collection<TopologyTestRunCaseSink> sources = catalogService.listTopologyTestRunCaseSink(testCaseId); <END> if (sources == null) { throw EntityNotFoundException.byFilter("topologyId: " + topologyId + " / testCaseId: " + testCaseId); } return WSUtils.respondEntities(sources, OK); }</code><technical_language>nit: sources -> sink</technical_language>

Target:
public Response listTestRunCaseSink(@PathParam("topologyId") Long topologyId, @PathParam("testCaseId") Long testCaseId) { Collection<TopologyTestRunCaseSink> sinks = catalogService.listTopologyTestRunCaseSink(testCaseId); if (sinks == null) { throw EntityNotFoundException.byFilter("topologyId: " + topologyId + " / testCaseId: " + testCaseId); } return WSUtils.respondEntities(sinks, OK); }
Source:
<code>public static LocalDateTimeValue truncate( TemporalUnit unit, TemporalValue input, MapValue fields, Supplier<ZoneId> defaultZone ) { if ( unit.isTimeBased() && !(input instanceof DateTimeValue || input instanceof LocalDateTimeValue) ) { throw new IllegalArgumentException( "Cannot truncate " + input + " to local date time with a time based unit." ); } LocalTime localTime = input.hasTime() ? input.getLocalTimePart() : LocalTimeValue.DEFAULT_LOCAL_TIME; LocalDate localDate = input.getDatePart(); LocalTime truncatedTime; LocalDate truncatedDate; if ( unit.isDateBased() ) { <START> truncatedDate = DateValue.truncateTo( localDate, unit ); <END> truncatedTime = LocalTimeValue.DEFAULT_LOCAL_TIME; } else { truncatedDate = localDate; truncatedTime = localTime.truncatedTo( unit ); } LocalDateTime truncatedLDT = LocalDateTime.of( truncatedDate, truncatedTime ); if ( fields.size() == 0 ) { return localDateTime( truncatedLDT ); } else { Map<String,AnyValue> updatedFields = fields.getMapCopy(); truncatedLDT = updateFieldMapWithConflictingSubseconds( updatedFields, unit, truncatedLDT ); if ( updatedFields.size() == 0 ) { return localDateTime( truncatedLDT ); } updatedFields.put( "datetime", localDateTime( truncatedLDT ) ); return build( VirtualValues.map( updatedFields ), defaultZone ); } }</code><technical_language>feels is code duplication this DateTime.truncate</technical_language>

Target:
public static LocalDateTimeValue truncate( TemporalUnit unit, TemporalValue input, MapValue fields, Supplier<ZoneId> defaultZone ) { Pair<LocalDate,LocalTime> pair = getTruncatedDateAndTime( unit, input, "local date time" ); LocalDate truncatedDate = pair.first(); LocalTime truncatedTime = pair.other(); LocalDateTime truncatedLDT = LocalDateTime.of( truncatedDate, truncatedTime ); if ( fields.size() == 0 ) { return localDateTime( truncatedLDT ); } else { Map<String,AnyValue> updatedFields = fields.getMapCopy(); truncatedLDT = updateFieldMapWithConflictingSubseconds( updatedFields, unit, truncatedLDT ); if ( updatedFields.size() == 0 ) { return localDateTime( truncatedLDT ); } updatedFields.put( "datetime", localDateTime( truncatedLDT ) ); return build( VirtualValues.map( updatedFields ), defaultZone ); } }
Source:
<code><START> public void copyChildren(Folder destinationFolder, Folder toCopyFolder) { <END> ItemIterable<CmisObject> immediateChildren = toCopyFolder.getChildren(); for (CmisObject child : immediateChildren) { if (child instanceof Document) { ((Document) child).copy(destinationFolder); } else if (child instanceof Folder) { copyFolderRecursive(destinationFolder, (Folder) child); } } }</code><technical_language>this method private</technical_language>

Target:
private void copyChildren(Folder destinationFolder, Folder toCopyFolder) { ItemIterable<CmisObject> immediateChildren = toCopyFolder.getChildren(); for (CmisObject child : immediateChildren) { if (child instanceof Document) { ((Document) child).copy(destinationFolder); } else if (child instanceof Folder) { copyFolderRecursive(destinationFolder, (Folder) child); } } }
Source:
<code>public boolean isDevPortalAnonymousEnabled(String tenantDomain) { try { org.json.simple.JSONObject tenantConfig = APIUtil.getTenantConfig(tenantDomain); Object value = tenantConfig.get(APIConstants.API_TENANT_CONF_ENABLE_ANONYMOUS_MODE); if (value != null) { return Boolean.parseBoolean(value.toString()); } else { return APIUtil.isDevPortalAnonymous(); } } catch (APIManagementException e) { <START> log.debug("Error while retrieving Recommendation config from registry", e); <END> } return true; }</code><technical_language>debug logs</technical_language>

Target:
public boolean isDevPortalAnonymousEnabled(String tenantDomain) { try { org.json.simple.JSONObject tenantConfig = APIUtil.getTenantConfig(tenantDomain); Object value = tenantConfig.get(APIConstants.API_TENANT_CONF_ENABLE_ANONYMOUS_MODE); if (value != null) { return Boolean.parseBoolean(value.toString()); } else { return APIUtil.isDevPortalAnonymous(); } } catch (APIManagementException e) { log.error("Error while retrieving Anonymous config from registry", e); } return true; }
Source:
<code>private void trackResult() { <START> if (!TextUtils.isEmpty(mReason)) { <END> AppLog.e(AppLog.T.API, "Could not connect to Jetpack, reason: " + mReason); ToastUtils.showToast(this, mReason); } else { trackWithSource(Stat.SIGNED_INTO_JETPACK, mSource); } }</code><technical_language>I mentioned mReason non-empty successful "already-connected". I this code is currently handling that</technical_language>

Target:
private void trackResult() { if (!TextUtils.isEmpty(mReason)) { if (mReason.equals(ALREADY_CONNECTED)) { AppLog.d(AppLog.T.API, "Already connected to Jetpack."); ToastUtils.showToast(this, getString(R.string.jetpack_already_connected_toast)); } else { AppLog.e(AppLog.T.API, "Could not connect to Jetpack, reason: " + mReason); JetpackConnectionUtils.trackFailureWithSource(mSource, mReason); ToastUtils.showToast(this, getString(R.string.jetpack_connection_failed_with_reason, mReason)); } } else { JetpackConnectionUtils.trackWithSource(Stat.SIGNED_INTO_JETPACK, mSource); } }
Source:
<code>private void checkIfUnused(MethodTree methodTree) { Symbol symbol = methodTree.symbol(); if (methodTree.modifiers().annotations().isEmpty() && symbol.isPrivate() && symbol.usages().isEmpty()) { if (methodTree.is(Tree.Kind.CONSTRUCTOR)) { <START> if (!methodTree.parameters().isEmpty()) { <END> unusedPrivateMethods.add(methodTree); } } else if (!SerializableContract.SERIALIZABLE_CONTRACT_METHODS.contains(symbol.name())) { unusedPrivateMethods.add(methodTree); } } }</code><technical_language>I a dedicated isConstructorWithNoParam method call .add</technical_language>

Target:
private void checkIfUnused(MethodTree methodTree) { Symbol symbol = methodTree.symbol(); if (isUnusedPrivate(symbol) && hasNoAnnotation(methodTree) && (isConstructorWithParameters(methodTree) || isNotMethodFromSerializable(methodTree, symbol))) { unusedPrivateMethods.add(methodTree); } }
Source:
<code>public Type getColumnType(int col) { try { <START> return getMetadata().getFieldType(col); <END> } catch (DriverException e) { return null; } }</code><technical_language>a DriverException is hidden behing a NullPointerException</technical_language>

Target:
public Type getColumnType(int col) { try { return getMetadata().getFieldType(col); } catch (DriverException e) { throw new IllegalStateException(e); } }
Source:
<code>public Map<ServerName, List<RegionInfo>> retainAssignment(Map<RegionInfo, ServerName> regions, List<ServerName> servers) throws HBaseIOException { try { Map<ServerName, List<RegionInfo>> assignments = new TreeMap<>(); List<Pair<List<RegionInfo>, List<ServerName>>> pairs = generateGroupAssignments(Lists.newArrayList(regions.keySet()), servers); for (Pair<List<RegionInfo>, List<ServerName>> pair : pairs) { List<RegionInfo> regionList = pair.getFirst(); Map<RegionInfo, ServerName> currentAssignmentMap = Maps.newTreeMap(); regionList.forEach(r -> currentAssignmentMap.put(r, regions.get(r))); Map<ServerName, List<RegionInfo>> pairResult = this.internalBalancer.retainAssignment(currentAssignmentMap, pair.getSecond()); <START> if (pairResult == null || pairResult.isEmpty()) { <END> continue; } pairResult.forEach((server, rs) -> assignments .computeIfAbsent(server, s -> Lists.newArrayList()).addAll(rs)); } return assignments; } catch (IOException e) { throw new HBaseIOException("Failed to do online retain assignment", e); } }</code><technical_language>retainAssignment return null? If is difference a null empty Map, return empty Map avoid null check here</technical_language>

Target:
public Map<ServerName, List<RegionInfo>> retainAssignment(Map<RegionInfo, ServerName> regions, List<ServerName> servers) throws HBaseIOException { try { Map<ServerName, List<RegionInfo>> assignments = new TreeMap<>(); List<Pair<List<RegionInfo>, List<ServerName>>> pairs = generateGroupAssignments(Lists.newArrayList(regions.keySet()), servers); for (Pair<List<RegionInfo>, List<ServerName>> pair : pairs) { List<RegionInfo> regionList = pair.getFirst(); Map<RegionInfo, ServerName> currentAssignmentMap = Maps.newTreeMap(); regionList.forEach(r -> currentAssignmentMap.put(r, regions.get(r))); Map<ServerName, List<RegionInfo>> pairResult = this.internalBalancer.retainAssignment(currentAssignmentMap, pair.getSecond()); pairResult.forEach((server, rs) -> assignments .computeIfAbsent(server, s -> Lists.newArrayList()).addAll(rs)); } return assignments; } catch (IOException e) { throw new HBaseIOException("Failed to do online retain assignment", e); } }
Source:
<code>public List<E> list(String field, String contains) { try { for (PropertyDescriptor pd : Introspector.getBeanInfo(entityClass).getPropertyDescriptors()) { if (pd.getReadMethod() != null && pd.getName().toLowerCase().equals(field.toLowerCase())) { final Method readMethod = pd.getReadMethod(); Predicate<E> builtPredicate = e -> { try { <START> return readMethod.invoke(e).toString().toLowerCase().replaceAll("\\s+", "") <END> .contains(contains.toLowerCase().replaceAll("\\s+", "")); } catch (IllegalAccessException e1) { return true; } catch (InvocationTargetException e1) { return true; } }; return list(builtPredicate); } } } catch (IntrospectionException e) { return list(); } return list(); }</code><technical_language>Need revert this line</technical_language>

Target:
public List<E> list(String field, String contains) { try { for (PropertyDescriptor pd : Introspector.getBeanInfo(entityClass).getPropertyDescriptors()) { if (pd.getReadMethod() != null && pd.getName().toLowerCase().equals(field.toLowerCase())) { final Method readMethod = pd.getReadMethod(); Predicate<E> builtPredicate = e -> { try { return containsIgnoreCaseIgnoreSpaces(readMethod.invoke(e).toString(), contains); } catch (IllegalAccessException | InvocationTargetException ex) { return true; } }; return list(builtPredicate); } } } catch (IntrospectionException e) { return list(); } return list(); }
Source:
<code>public void executeTransactionAsync_asyncQuery() { final Realm realm = looperThread.realm; RealmResults<AllTypes> results = realm.where(AllTypes.class).findAllAsync(); <START> looperThread.keepStrongReference.add(results); <END> realm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { realm.createObject(AllTypes.class); } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { assertEquals(realm.where(AllTypes.class).count(), 1); looperThread.testComplete(); } }, new Realm.Transaction.OnError() { @Override public void onError(Throwable error) { fail(); } }); }</code><technical_language>I this is needed</technical_language>

Target:
public void executeTransactionAsync_asyncQuery() { final Realm realm = looperThread.realm; final RealmResults<AllTypes> results = realm.where(AllTypes.class).findAllAsync(); assertEquals(0, results.size()); realm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { realm.createObject(AllTypes.class); } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { assertEquals(1, realm.where(AllTypes.class).count()); assertEquals(1, results.size()); looperThread.testComplete(); } }, new Realm.Transaction.OnError() { @Override public void onError(Throwable error) { fail(); } }); }
Source:
<code>public Object getPayload(CorfuRuntime runtime) { Object value = payload.get(); if (value == null) { synchronized (this.payload) { value = this.payload.get(); if (value == null) { if (data == null) { this.payload.set(null); } else { ByteBuf copyBuf = Unpooled.wrappedBuffer(data); final Object actualValue; try { actualValue = Serializers.CORFU.deserialize(copyBuf, runtime); } catch (Throwable throwable) { <START> log.error("Exception caught at address {}, {}, {}", <END> getGlobalAddress(), getStreams(), getType()); log.error("Raw data buffer {}", copyBuf.toString(Charset.defaultCharset())); copyBuf.release(); data = null; throw throwable; } if (actualValue instanceof LogEntry) { ((LogEntry) actualValue).setGlobalAddress(getGlobalAddress()); ((LogEntry) actualValue).setRuntime(runtime); } value = actualValue == null ? this.payload : actualValue; this.payload.set(value); copyBuf.release(); lastKnownSize = data.length; data = null; } } } } return value; }</code><technical_language>I need rewind copyBuf reader's index, print part of buffer unread</technical_language>

Target:
public Object getPayload(CorfuRuntime runtime) { Object value = payload.get(); if (value == null) { synchronized (this.payload) { value = this.payload.get(); if (value == null) { if (data == null) { this.payload.set(null); } else { ByteBuf copyBuf = Unpooled.wrappedBuffer(data); final Object actualValue; try { actualValue = Serializers.CORFU.deserialize(copyBuf, runtime); } catch (Throwable throwable) { log.error("Exception caught at address {}, {}, {}", getGlobalAddress(), getStreams(), getType()); log.error("Raw data buffer {}", copyBuf.resetReaderIndex().toString(Charset.defaultCharset())); copyBuf.release(); data = null; throw throwable; } if (actualValue instanceof LogEntry) { ((LogEntry) actualValue).setGlobalAddress(getGlobalAddress()); ((LogEntry) actualValue).setRuntime(runtime); } value = actualValue == null ? this.payload : actualValue; this.payload.set(value); copyBuf.release(); lastKnownSize = data.length; data = null; } } } } return value; }
Source:
<code><START> public void testOneSuccessfull() throws IOException { <END> final List<Pass> list = new ArrayList<Pass>(1); list.add(new PsFake(true)); final Opt<Identity> identity = new PsAll(list, 0).enter(new RqFake()); MatcherAssert.assertThat( identity.has(), Matchers.is(true) ); }</code><technical_language>@lautarobock here, declare throws Exception</technical_language>

Target:
public void testOneSuccessfull() throws Exception { final List<Pass> list = new ArrayList<Pass>(1); list.add(new PsFake(true)); final Opt<Identity> identity = new PsAll(list, 0).enter(new RqFake()); MatcherAssert.assertThat( identity.has(), Matchers.is(true) ); }
Source:
<code>private void serverSend(final ProtonServerReceiverContext context, final Transaction transaction, final Message message, final Delivery delivery, final Receiver receiver, final RoutingContext routingContext) throws Exception { message.setConnectionID(receiver.getSession().getConnection().getRemoteContainer()); if (invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection()) == null) { serverSession.send(transaction, message, directDeliver, false, routingContext); } <START> afterIO(new IOCallback() { <END> @Override public void done() { connection.runLater(() -> { if (delivery.getRemoteState() instanceof TransactionalState) { TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(((TransactionalState) delivery.getRemoteState()).getTxnId()); delivery.disposition(txAccepted); } else { delivery.disposition(Accepted.getInstance()); } delivery.settle(); context.flow(); connection.flush(); }); } @Override public void onError(int errorCode, String errorMessage) { connection.runNow(() -> { receiver.setCondition(new ErrorCondition(AmqpError.ILLEGAL_STATE, errorCode + ":" + errorMessage)); connection.flush(); }); } }); }</code><technical_language>implications of interceptor afterIO</technical_language>

Target:
private void serverSend(final ProtonServerReceiverContext context, final Transaction transaction, final Message message, final Delivery delivery, final Receiver receiver, final RoutingContext routingContext) throws Exception { message.setConnectionID(receiver.getSession().getConnection().getRemoteContainer()); if (invokeIncoming((AMQPMessage) message, (ActiveMQProtonRemotingConnection) transportConnection.getProtocolConnection()) == null) { serverSession.send(transaction, message, directDeliver, false, routingContext); afterIO(new IOCallback() { @Override public void done() { connection.runLater(() -> { if (delivery.getRemoteState() instanceof TransactionalState) { TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(((TransactionalState) delivery.getRemoteState()).getTxnId()); delivery.disposition(txAccepted); } else { delivery.disposition(Accepted.getInstance()); } delivery.settle(); context.flow(); connection.flush(); }); } @Override public void onError(int errorCode, String errorMessage) { connection.runNow(() -> { receiver.setCondition(new ErrorCondition(AmqpError.ILLEGAL_STATE, errorCode + ":" + errorMessage)); connection.flush(); }); } }); } else { rejectMessage(delivery, Symbol.valueOf("failed"), "Interceptor rejected message"); } }
Source:
<code>public String getOperation() { <START> return "delete"; <END> }</code><technical_language>Operation getOperation()</technical_language>

Target:
public Operation getOperation() { return Operation.DELETE; }
Source:
<code>public void onPreMerge(Repository repo, CodeReviewCommit commit, ProjectState destProject, NameKey destBranch, Id patchSetId) throws MergeValidationException { try { <START> db = schemaFactory.open(); <END> PatchSetApproval psa = approvalsUtil.getSubmitter(db, commit.notes(), patchSetId); if (psa == null) { throw new MergeValidationException( CommitMergeStatus.REJECTED_BY_PLUGIN, "Submitter not found"); } final IdentifiedUser submitter = identifiedUserFactory.create(psa.getAccountId()); if (!submitter.getCapabilities().canAdministrateServer()) { throw new MergeValidationException(CommitMergeStatus.REJECTED_BY_PLUGIN, "Submitter is not admin"); } } catch (OrmException e) { throw new MergeValidationException( CommitMergeStatus.REJECTED_BY_PLUGIN, "DB error"); } finally { if (db != null) { db.close(); } } }</code><technical_language>Hm, I checked Provider<ReviewDb> work merge thread :(</technical_language>

Target:
public void onPreMerge(Repository repo, CodeReviewCommit commit, ProjectState destProject, NameKey destBranch, Id patchSetId) throws MergeValidationException { try { db = schemaFactory.open(); PatchSetApproval psa = approvalsUtil.getSubmitter(db, commit.notes(), patchSetId); if (psa == null) { throw new MergeValidationException( CommitMergeStatus.REJECTED_BY_PLUGIN); } final IdentifiedUser submitter = identifiedUserFactory.create(psa.getAccountId()); if (!submitter.getCapabilities().canAdministrateServer()) { throw new MergeValidationException(CommitMergeStatus.REJECTED_BY_PLUGIN); } } catch (OrmException e) { throw new MergeValidationException(CommitMergeStatus.REJECTED_BY_PLUGIN); } finally { if (db != null) { db.close(); } } }
Source:
<code>public DruidAggregationColumnNode(ExpressionType expressionType, VariableReferenceExpression outputColumn) { <START> this.expressionType = expressionType; <END> this.outputColumn = outputColumn; }</code><technical_language>requireNonNull</technical_language>

Target:
public DruidAggregationColumnNode(ExpressionType expressionType, VariableReferenceExpression outputColumn) { this.expressionType = requireNonNull(expressionType, "expressionType is null"); this.outputColumn = requireNonNull(outputColumn, "outputColumn is null"); }
Source:
<code>private ConnectorBucketNodeMap(int bucketCount, Optional<Map<Integer, Node>> bucketToNode) { <START> if (bucketCount <= 0) { <END> throw new IllegalArgumentException("bucketCount must be positive"); } if (bucketToNode.isPresent() && bucketToNode.get().size() != bucketCount) { throw new IllegalArgumentException(format("Mismatched bucket count in bucketToNode (%s) and bucketCount (%s)", bucketToNode.get().size(), bucketCount)); } this.bucketCount = bucketCount; this.bucketToNode = requireNonNull(bucketToNode, "bucketCount is null"); }</code><technical_language>getAsInt throw</technical_language>

Target:
private ConnectorBucketNodeMap(int bucketCount, Optional<Map<Integer, Node>> bucketToNode) { if (bucketCount <= 0) { throw new IllegalArgumentException("bucketCount must be positive"); } if (bucketToNode.isPresent() && bucketToNode.get().size() != bucketCount) { throw new IllegalArgumentException(format("Mismatched bucket count in bucketToNode (%s) and bucketCount (%s)", bucketToNode.get().size(), bucketCount)); } this.bucketCount = bucketCount; this.bucketToNode = requireNonNull(bucketToNode, "bucketToNode is null") .map(mapping -> unmodifiableMap(new HashMap<>(mapping))); }
Source:
<code>public void testCorrectUserCustomCredentialSecurityFactoryException() throws Exception { try (CLIWrapper cli = new CLIWrapper(true)) { StringBuilder configuration = new StringBuilder("throwException").append("=").append(true); cli.sendLine(String.format( "/subsystem=elytron/custom-credential-security-factory=%s:write-attribute(name=configuration, value={%s})", CUSTOM_CRED_SEC_FACTORY_NAME, configuration)); <START> cli.sendLine("reload"); <END> } CoreUtils.makeCallWithBasicAuthn(createSimpleManagementOperationUrl(), USER, CORRECT_PASSWORD, HttpStatus.SC_INTERNAL_SERVER_ERROR); }</code><technical_language>ServerReload utility</technical_language>

Target:
public void testCorrectUserCustomCredentialSecurityFactoryException() throws Exception { try (CLIWrapper cli = new CLIWrapper(true)) { StringBuilder configuration = new StringBuilder("throwException").append("=").append(true); cli.sendLine(String.format( "/subsystem=elytron/custom-credential-security-factory=%s:write-attribute(name=configuration, value={%s})", CUSTOM_CRED_SEC_FACTORY_NAME, configuration)); ServerReload.executeReloadAndWaitForCompletion(CONTROLLER.getClient().getControllerClient()); } CoreUtils.makeCallWithBasicAuthn(createSimpleManagementOperationUrl(), USER, CORRECT_PASSWORD, HttpStatus.SC_INTERNAL_SERVER_ERROR); }
Source:
<code>public int setCustomValues(User loggedInUser, Integer sid, Map<String, String> values) throws FaultException { Server server = lookupServer(loggedInUser, sid); Org org = loggedInUser.getOrg(); List<String> skippedKeys = new ArrayList<String>(); Set<String> keys = values.keySet(); for (Iterator<String> itr = keys.iterator(); itr.hasNext();) { String label = itr.next(); <START> String value = StringUtils.trim(values.get(label).toString()); <END> if (org.hasCustomDataKey(label) && !value.isEmpty()) { server.addCustomDataValue(label, values.get(label).toString(), loggedInUser); } else { skippedKeys.add(label); } } if (skippedKeys.size() > 0) { StringBuilder msg = new StringBuilder("One or more of the following " + "custom info fields was not defined: "); for (Iterator<String> itr = skippedKeys.iterator(); itr.hasNext();) { String label = itr.next(); msg.append("\n" + label); } throw new UndefinedCustomFieldsException(msg.toString()); } return 1; }</code><technical_language>is reason for calling toString() method StringUtils.trim() returns a String? I pointed out in <LINK_0></technical_language>

Target:
public int setCustomValues(User loggedInUser, Integer sid, Map<String, String> values) throws FaultException { Server server = lookupServer(loggedInUser, sid); Org org = loggedInUser.getOrg(); List<String> skippedKeys = new ArrayList<String>(); Set<String> keys = values.keySet(); for (Iterator<String> itr = keys.iterator(); itr.hasNext();) { String label = itr.next(); String value = StringUtils.trim(values.get(label)); if (org.hasCustomDataKey(label) && !value.isEmpty()) { server.addCustomDataValue(label, values.get(label), loggedInUser); } else { skippedKeys.add(label); } } if (skippedKeys.size() > 0) { StringBuilder msg = new StringBuilder("One or more of the following " + "custom info fields was not defined: "); for (Iterator<String> itr = skippedKeys.iterator(); itr.hasNext();) { String label = itr.next(); msg.append("\n" + label); } throw new UndefinedCustomFieldsException(msg.toString()); } return 1; }