auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testExecute_withInvalidEnrollRequests_shouldNotBeEnrolled() { String courseId = typicalBundle.students.get("student1InCourse1").getCourse(); StudentAttributes validNewStudent = getTypicalNewStudent(courseId); StudentAttributes invalidNewStudent = getTypicalNewStudent(courseId); invalidNewStudent.email = "invalidEmail"; StudentAttributes validExistingStudent = typicalBundle.students.get("student1InCourse1"); validExistingStudent.name = "new name"; StudentAttributes invalidExistingStudent = typicalBundle.students.get("student2InCourse1"); invalidExistingStudent.team = "invalid | team % name"; StudentsEnrollRequest req = prepareRequest( Arrays.asList(validNewStudent, invalidNewStudent, validExistingStudent, invalidExistingStudent)); loginAsInstructor(typicalBundle.instructors.get("instructor1OfCourse1").getGoogleId()); List<StudentData> enrolledStudents = executeActionAndReturnResults(courseId, req); <START> <END> assertEquals(2, enrolledStudents.size()); verifyStudentInDatabase(validNewStudent, enrolledStudents.get(0).getCourseId(), enrolledStudents.get(0).getEmail()); verifyStudentInDatabase(validExistingStudent, enrolledStudents.get(1).getCourseId(), enrolledStudents.get(1).getEmail()); }</code><technical_language>here. enrolledStudents verified</technical_language>

Target:
public void testExecute_withInvalidEnrollRequests_shouldNotBeEnrolled() { String courseId = typicalBundle.students.get("student1InCourse1").getCourse(); StudentAttributes validNewStudent = getTypicalNewStudent(courseId); StudentAttributes invalidNewStudent = getTypicalNewStudent(courseId); invalidNewStudent.email = "invalidEmail"; StudentAttributes validExistingStudent = typicalBundle.students.get("student1InCourse1"); validExistingStudent.name = "new name"; StudentAttributes invalidExistingStudent = typicalBundle.students.get("student2InCourse1"); invalidExistingStudent.team = "invalid | team % name"; StudentsEnrollRequest req = prepareRequest( Arrays.asList(validNewStudent, invalidNewStudent, validExistingStudent, invalidExistingStudent)); loginAsInstructor(typicalBundle.instructors.get("instructor1OfCourse1").getGoogleId()); List<StudentData> enrolledStudents = executeActionAndReturnResults(courseId, req); assertEquals(2, enrolledStudents.size()); verifyStudentInDatabase(validNewStudent, enrolledStudents.get(0).getCourseId(), enrolledStudents.get(0).getEmail()); verifyStudentInDatabase(validExistingStudent, enrolledStudents.get(1).getCourseId(), enrolledStudents.get(1).getEmail()); verifyCorrectResponseData(req.getStudentEnrollRequests().get(0), enrolledStudents.get(0)); verifyCorrectResponseData(req.getStudentEnrollRequests().get(2), enrolledStudents.get(1)); }
Source:
<code>public Mono<String> convert(@NonNull ServerWebExchange exchange) { return this.converter.convert(exchange).handle((convertedToken, sink) -> { BearerTokenAuthenticationToken token = (BearerTokenAuthenticationToken) convertedToken; try { String issuer = JWTParser.parse(token.getToken()).getJWTClaimsSet().getIssuer(); if (issuer == null) { sink.error(new InvalidBearerTokenException("Missing issuer")); } else { sink.next(issuer); } } catch (Exception e) { sink.error(new InvalidBearerTokenException(e.getMessage())); <START> } <END> }); }</code><technical_language>oversight, especially servlet version wraps exception. update PR include this change well</technical_language>

Target:
public Mono<String> convert(@NonNull ServerWebExchange exchange) { return this.converter.convert(exchange).map(convertedToken -> { BearerTokenAuthenticationToken token = (BearerTokenAuthenticationToken) convertedToken; try { String issuer = JWTParser.parse(token.getToken()).getJWTClaimsSet().getIssuer(); if (issuer == null) { throw new InvalidBearerTokenException("Missing issuer"); } else { return issuer; } } catch (Exception e) { throw new InvalidBearerTokenException(e.getMessage(), e); } }); }
Source:
<code>public int size() { int size = 0; for (Iterator<InternalCacheEntry<K, V>> iter = iterator(); iter.hasNext(); ) { <START> if (iter.next().getValue() == null) continue; <END> if (++size == Integer.MAX_VALUE) return Integer.MAX_VALUE; } return size; }</code><technical_language>iterator() excluding expired Tombstones</technical_language>

Target:
public int size() { int size = 0; for (Iterator<InternalCacheEntry<K, V>> iter = iterator(); iter.hasNext(); ) { iter.next(); if (++size == Integer.MAX_VALUE) return Integer.MAX_VALUE; } return size; }
Source:
<code>public AbstractSerializationNode getSerializer() { <START> return ((SerializerRootNode) serializationRoot.getRootNode()).getSerializer(); <END> }</code><technical_language>This serializationRoot.getSerializer() no</technical_language>

Target:
public AbstractSerializationNode getSerializer() { return instanceClassGroup.getSerializer(); }
Source:
<code>public PdpFeedTrailerEntry buildPdpFeedTrailerEntry(PdpFeedFileBaseEntry pdpFeedFileBaseEntry, ConcurStandardAccountingExtractBatchReportData reportData) { PdpFeedTrailerEntry trailerEntry = new PdpFeedTrailerEntry(); KualiDecimal pdpTotal = KualiDecimal.ZERO; int numberOfDetails = 0; for (PdpFeedGroupEntry group : pdpFeedFileBaseEntry.getGroup()) { numberOfDetails += group.getDetail().size(); for(PdpFeedDetailEntry detailEntry : group.getDetail()) { for (PdpFeedAccountingEntry accountingEntry : detailEntry.getAccounting()) { pdpTotal = pdpTotal.add(accountingEntry.getAmount()); } } } trailerEntry.setDetailCount(numberOfDetails); trailerEntry.setDetailTotAmt(pdpTotal); reportData.getPdpRecordsProcessed().setRecordCount(numberOfDetails); <START> reportData.getPdpRecordsProcessed().setDollarAmount(pdpTotal);; <END> return trailerEntry; }</code><technical_language>Unneeded duplicate semicolon</technical_language>

Target:
public PdpFeedTrailerEntry buildPdpFeedTrailerEntry(PdpFeedFileBaseEntry pdpFeedFileBaseEntry, ConcurStandardAccountingExtractBatchReportData reportData) { PdpFeedTrailerEntry trailerEntry = new PdpFeedTrailerEntry(); KualiDecimal pdpTotal = KualiDecimal.ZERO; int numberOfDetails = 0; for (PdpFeedGroupEntry group : pdpFeedFileBaseEntry.getGroup()) { numberOfDetails += group.getDetail().size(); for(PdpFeedDetailEntry detailEntry : group.getDetail()) { for (PdpFeedAccountingEntry accountingEntry : detailEntry.getAccounting()) { pdpTotal = pdpTotal.add(accountingEntry.getAmount()); } } } trailerEntry.setDetailCount(numberOfDetails); trailerEntry.setDetailTotAmt(pdpTotal); reportData.getPdpRecordsProcessed().setRecordCount(numberOfDetails); reportData.getPdpRecordsProcessed().setDollarAmount(pdpTotal); return trailerEntry; }
Source:
<code>void notifyCurrentMediaItemChanged(final MediaItem item, int currentMediaItemIndex, int previousMediaItemIndex, int nextMediaItemIndex) { synchronized (mLock) { mCurrentMediaItem = item; mCurrentMediaItemIndex = currentMediaItemIndex; mPreviousMediaItemIndex = previousMediaItemIndex; mNextMediaItemIndex = nextMediaItemIndex; if (mPlaylist != null && currentMediaItemIndex <START> != -1 <END> && currentMediaItemIndex < mPlaylist.size()) { mPlaylist.set(currentMediaItemIndex, item); } } mCallbackExecutor.execute(new Runnable() { @Override public void run() { if (!mInstance.isConnected()) { return; } mCallback.onCurrentMediaItemChanged(mInstance, item); } }); }</code><technical_language>constant</technical_language>

Target:
void notifyCurrentMediaItemChanged(final MediaItem item, int currentMediaItemIndex, int previousMediaItemIndex, int nextMediaItemIndex) { synchronized (mLock) { mCurrentMediaItem = item; mCurrentMediaItemIndex = currentMediaItemIndex; mPreviousMediaItemIndex = previousMediaItemIndex; mNextMediaItemIndex = nextMediaItemIndex; if (mPlaylist != null && currentMediaItemIndex != ITEM_INDEX_INVALID && currentMediaItemIndex < mPlaylist.size()) { mPlaylist.set(currentMediaItemIndex, item); } } mCallbackExecutor.execute(new Runnable() { @Override public void run() { if (!mInstance.isConnected()) { return; } mCallback.onCurrentMediaItemChanged(mInstance, item); } }); }
Source:
<code>void should_create_error_message_with_escaping_percent() { RuntimeException actual = new RuntimeException("You know nothing %"); String errorMessage = ShouldContainCharSequence.shouldContain(actual, "You know nothing % Jon Snow") <START> .create(new TestDescription("TEST")); <END> assertThat(errorMessage).isEqualTo("[TEST] %n" + "Expecting:%n" + " <\"You know nothing %%\">%n" + "to contain:%n" + " <\"You know nothing %% Jon Snow\">%n" + "but did not.%n" + "%n" + "Throwable that failed the check:%n" + "%n%s", getStackTrace(actual)); }</code><technical_language>static import om shouldContain code a bit lighter</technical_language>

Target:
void should_create_error_message_with_escaping_percent() { RuntimeException actual = new RuntimeException("You know nothing %"); String errorMessage = shouldContain(actual, "You know nothing % Jon Snow") .create(new TestDescription("TEST")); then(errorMessage).isEqualTo("[TEST] %n" + "Expecting throwable message:%n" + " <\"You know nothing %%\">%n" + "to contain:%n" + " <\"You know nothing %% Jon Snow\">%n" + "but did not.%n" + "%n" + "Throwable that failed the check:%n" + "%n%s", getStackTrace(actual)); }
Source:
<code>public void resetsProgressIfNotEnoughLogsForVerification() { helper.writeLogsOnDefaultLocalServer(1, 1); helper.assertLocalTimestampInvariantsStand(); helper.writeLogsOnDefaultLocalServer(2, LEARNER_LOG_BATCH_SIZE_LIMIT); <START> helper.forceTimestampToGoBackwards(LEARNER_LOG_BATCH_SIZE_LIMIT / 2); <END> helper.assertClockWentBackwards(); }</code><technical_language>suggestion helper.forceTimestampToGoBackwards(1); This test skip entry check. I guess do this check consistent</technical_language>

Target:
public void resetsProgressIfNotEnoughLogsForVerification() { helper.createTimestampInversion(1); helper.assertLocalTimestampInvariantsStandInNextBatch(); helper.writeLogsOnDefaultLocalServer(2, LEARNER_LOG_BATCH_SIZE_LIMIT); helper.assertClockGoesBackwardsInNextBatch(); }
Source:
<code>public ICommand<MIinfoRecord> createCLIInfoRecord(ICommandControlDMContext ctx) { return new CLIInfoRecord(ctx); <START> } <END></code><technical_language>Please move in aphabetical order. This is class require that</technical_language>

Target:
public ICommand<CLIInfoRecordInfo> createCLIInfoRecord(ICommandControlDMContext ctx) { return new CLIInfoRecord(ctx); }
Source:
<code>public long open(DataSpec dataSpec) throws ContentDataSourceException { try { uri = dataSpec.uri; assetFileDescriptor = resolver.openAssetFileDescriptor(uri, "r"); <START> inputStream = assetFileDescriptor.createInputStream(); <END> long skipped = inputStream.skip(dataSpec.position); if (skipped < dataSpec.position) { throw new EOFException(); } if (dataSpec.length != C.LENGTH_UNSET) { bytesRemaining = dataSpec.length; } else { bytesRemaining = inputStream.available(); if (bytesRemaining == 0) { bytesRemaining = C.LENGTH_UNSET; } } } catch (IOException e) { throw new ContentDataSourceException(e); } opened = true; if (listener != null) { listener.onTransferStart(this, dataSpec); } return bytesRemaining; }</code><technical_language>this, I preferable modify L84 do: bytesRemaining = assetFileDescriptor.getLength(); if (bytesRemaining == AssetFileDescriptor.UNKNOWN_LENGTH) { // asset extend end of file. bytesRemaining = inputStream.available(); if (bytesRemaining == 0) { // FileInputStream.available() returns 0 if remaining length determined, // if greater Integer.MAX_VALUE. true length in case, // treat unbounded. bytesRemaining = C.LENGTH_UNSET; } } explicit (and allows bytesRemaining greater Integer.MAX_VALUE, in theory)</technical_language>

Target:
public long open(DataSpec dataSpec) throws ContentDataSourceException { try { uri = dataSpec.uri; assetFileDescriptor = resolver.openAssetFileDescriptor(uri, "r"); if (assetFileDescriptor == null) { throw new FileNotFoundException("Could not open file descriptor for: " + uri); } inputStream = new FileInputStream(assetFileDescriptor.getFileDescriptor()); long skipped = inputStream.skip(dataSpec.position); if (skipped < dataSpec.position) { throw new EOFException(); } if (dataSpec.length != C.LENGTH_UNSET) { bytesRemaining = dataSpec.length; } else { bytesRemaining = assetFileDescriptor.getLength(); if (bytesRemaining == AssetFileDescriptor.UNKNOWN_LENGTH) { bytesRemaining = inputStream.available(); if (bytesRemaining == 0) { bytesRemaining = C.LENGTH_UNSET; } } } } catch (IOException e) { throw new ContentDataSourceException(e); } opened = true; if (listener != null) { listener.onTransferStart(this, dataSpec); } return bytesRemaining; }
Source:
<code>public boolean sendSerialData(XBee64BitAddress address, byte[] data) throws InvalidOperatingModeException, XBeeException { XBeePacket xbeePacket; XBeePacket receivedPacket; if (address == null || data == null) throw new XBeeException(XBeeException.INVALID_ARGUMENT, "Address and data cannot be null"); switch (getXBeeProtocol()) { case RAW_802_15_4: xbeePacket = new TX64Packet(getNextFrameID(), address, XBeeTransmitOptions.NONE, data); receivedPacket = sendXBeePacket(xbeePacket); <START> if (receivedPacket instanceof TXStatusPacket) { <END> switch (((TXStatusPacket)receivedPacket).getStatus()) { case SUCCESS: return true; default: return false; } } else return false; default: xbeePacket = new TransmitPacket(getNextFrameID(), address, XBee16BitAddress.UNKNOWN_ADDRESS, 0, XBeeTransmitOptions.NONE, data); receivedPacket = sendXBeePacket(xbeePacket); if (receivedPacket instanceof TransmitStatusPacket) { switch (((TransmitStatusPacket)receivedPacket).getDeliveryStatus()) { case SUCCESS: return true; default: return false; } } else return false; } }</code><technical_language>checking type of received packet check for null value. null returned executing sendXBeePacket</technical_language>

Target:
public boolean sendSerialData(XBee64BitAddress address, byte[] data) throws InvalidOperatingModeException, XBeeException { if (!connectionInterface.isOpen()) throw new XBeeException(XBeeException.CONNECTION_NOT_OPEN); XBeePacket xbeePacket; XBeePacket receivedPacket; if (address == null || data == null) throw new XBeeException(XBeeException.INVALID_ARGUMENT, "Address and data cannot be null"); switch (getXBeeProtocol()) { case RAW_802_15_4: xbeePacket = new TX64Packet(getNextFrameID(), address, XBeeTransmitOptions.NONE, data); receivedPacket = sendXBeePacket(xbeePacket); if (receivedPacket == null) return true; if (receivedPacket instanceof TXStatusPacket) { switch (((TXStatusPacket)receivedPacket).getTransmitStatus()) { case SUCCESS: return true; default: return false; } } else return false; default: xbeePacket = new TransmitPacket(getNextFrameID(), address, XBee16BitAddress.UNKNOWN_ADDRESS, 0, XBeeTransmitOptions.NONE, data); receivedPacket = sendXBeePacket(xbeePacket); if (receivedPacket == null) return true; if (receivedPacket instanceof TransmitStatusPacket) { switch (((TransmitStatusPacket)receivedPacket).getTransmitStatus()) { case SUCCESS: return true; default: return false; } } else return false; } }
Source:
<code>public void requestPulse(GlowBlock block, int tickRate) { Map<Location, Integer> map = getTickMap(); Location target = block.getLocation(); <START> for (Location location : map.keySet()) { <END> if (target.equals(location)) { if (tickRate > 0) tickMap.put(location, tickRate); else tickMap.remove(location); return; } } if (tickRate > 0) tickMap.put(target, tickRate); }</code><technical_language>This for-loop is necessary, remove put directly</technical_language>

Target:
public void requestPulse(GlowBlock block, int tickRate) { Location target = block.getLocation(); if (tickRate > 0) tickMap.put(target, tickRate); else if (tickMap.containsKey(target)) tickMap.remove(target); }
Source:
<code><START> public FeedbackQuestionAttributes() { <END> }</code><technical_language>this constructor more. For methods (e.g. in InstructorFeedbackQuestionAddAction, mentioned), consider local variables first, checking for nulls local variables, building FeedbackQuestionAttributes object right returning</technical_language>

Target:
protected FeedbackQuestionAttributes() { }
Source:
<code>private void updateDefaultQuota() { if (_oldStoragePool.getQuotaEnforcementType() != QuotaEnforcementTypeEnum.DISABLED <START> && getStoragePool().getQuotaEnforcementType() == QuotaEnforcementTypeEnum.DISABLED) { <END> RefObject<Boolean> reuseQuota = new RefObject<Boolean>(true); Quota newDefaultQuota = getQutoaHelper().getUnlimitedQuota(getStoragePool(), true, reuseQuota); if (reuseQuota.argvalue) { log.infoFormat("Reusing quota {0} as the default quota for Storage Pool {1}", newDefaultQuota.getId(), newDefaultQuota.getStoragePoolId()); } else { newDefaultQuota.setQuotaName(getQutoaHelper().getDefaultQuotaName(getStoragePool())); } getQutoaHelper().saveQuotaForUser(newDefaultQuota, MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID, reuseQuota.argvalue); } }</code><technical_language>RefObject is legacy code c# drop code base</technical_language>

Target:
private void updateDefaultQuota() { if (_oldStoragePool.getQuotaEnforcementType() != QuotaEnforcementTypeEnum.DISABLED && getStoragePool().getQuotaEnforcementType() == QuotaEnforcementTypeEnum.DISABLED) { RefObject<Boolean> reuseQuota = new RefObject<Boolean>(true); Quota newDefaultQuota = getQutoaHelper().getUnlimitedQuota(getStoragePool(), true, reuseQuota); if (reuseQuota.argvalue) { log.debugFormat("Reusing quota {0} as the default quota for Storage Pool {1}", newDefaultQuota.getId(), newDefaultQuota.getStoragePoolId()); } else { newDefaultQuota.setQuotaName(getQutoaHelper().getDefaultQuotaName(getStoragePool())); } getQutoaHelper().saveQuotaForUser(newDefaultQuota, MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID, reuseQuota.argvalue); } }
Source:
<code>private ClusterComposition lookupClusterCompositionOnKnownRouters( ConnectionPool connections, RoutingTable routingTable ) { int size = routingTable.routerSize(); <START> Set<BoltServerAddress> triedServers = new HashSet<>( size ); <END> for ( int i = 0; i < size; i++ ) { BoltServerAddress address = routingTable.nextRouter(); if ( address == null ) { break; } ClusterComposition composition = lookupClusterCompositionOnRouter( address, connections, routingTable ); if ( composition != null ) { return composition; } else { triedServers.add( address ); } } Set<BoltServerAddress> ips = dnsResolver.resolve( initialRouter ); ips.removeAll( triedServers ); for ( BoltServerAddress address : ips ) { ClusterComposition composition = lookupClusterCompositionOnRouter( address, connections, routingTable ); if ( composition != null ) { return composition; } } return null; }</code><technical_language>HashSet's initial capacity tricky well</technical_language>

Target:
private ClusterComposition lookupClusterCompositionOnKnownRouters( ConnectionPool connections, RoutingTable routingTable ) { int size = routingTable.routerSize(); Set<BoltServerAddress> triedServers = new HashSet<>(); for ( int i = 0; i < size; i++ ) { BoltServerAddress address = routingTable.nextRouter(); if ( address == null ) { break; } ClusterComposition composition = lookupClusterCompositionOnRouter( address, connections, routingTable ); if ( composition != null ) { return composition; } else { triedServers.add( address ); } } Set<BoltServerAddress> ips = hostNameResolver.resolve( initialRouter ); ips.removeAll( triedServers ); for ( BoltServerAddress address : ips ) { ClusterComposition composition = lookupClusterCompositionOnRouter( address, connections, routingTable ); if ( composition != null ) { return composition; } } return null; }
Source:
<code>long setLastAddConfirmed(long lac) { long lacToReturn; synchronized (this) { if (null == this.lac || this.lac < lac) { this.lac = lac; setChanged(); } lacToReturn = this.lac; } <START> LOG.trace("Updating LAC , {}", lacToReturn, lac); <END> notifyObservers(new LastAddConfirmedUpdateNotification(lacToReturn)); return lacToReturn; }</code><technical_language>if (LOG.isTraceEnabled()) {}</technical_language>

Target:
long setLastAddConfirmed(long lac) { long lacToReturn; synchronized (this) { if (null == this.lac || this.lac < lac) { this.lac = lac; setChanged(); } lacToReturn = this.lac; } if (LOG.isTraceEnabled()) { LOG.trace("Updating LAC , {}", lacToReturn, lac); } notifyObservers(new LastAddConfirmedUpdateNotification(lacToReturn)); return lacToReturn; }
Source:
<code>public void dropRole(String role) { try { delegate.dropRole(role); } finally { <START> rolesCache.invalidateAll(); <END> } }</code><technical_language>invalidate usersRoleCache roles for grantor change result of dropRole</technical_language>

Target:
public void dropRole(String role) { try { delegate.dropRole(role); } finally { rolesCache.invalidateAll(); roleGrantsCache.invalidateAll(); } }
Source:
<code><START> public int getDirectionForBlocks(LayoutBlock a, LayoutBlock b) { <END> if (containsBlock(b.getBlock())) { if (getBlockSequenceNumber(a.getBlock()) > getBlockSequenceNumber(b.getBlock())) { return EntryPoint.FORWARD; } else { return EntryPoint.REVERSE; } } for (int i = 0; i < mForwardEntryPoints.size(); i++) { if (mForwardEntryPoints.get(i).getFromBlock() == b.getBlock()) { return EntryPoint.FORWARD; } } for (int j = 0; j < mReverseEntryPoints.size(); j++) { if (mReverseEntryPoints.get(j).getFromBlock() == b.getBlock()) { return EntryPoint.REVERSE; } } log.error("Unexpected error in getDirectionForBlocks when working with LevelCrossing in Section {}", getDisplayName(USERSYS)); return EntryPoint.UNKNOWN; }</code><technical_language>is this method public</technical_language>

Target:
private int getDirectionForBlocks(LayoutBlock a, LayoutBlock b) { if (containsBlock(b.getBlock())) { if (getBlockSequenceNumber(a.getBlock()) > getBlockSequenceNumber(b.getBlock())) { return EntryPoint.FORWARD; } else { return EntryPoint.REVERSE; } } for (int i = 0; i < mForwardEntryPoints.size(); i++) { if (mForwardEntryPoints.get(i).getFromBlock() == b.getBlock()) { return EntryPoint.FORWARD; } } for (int j = 0; j < mReverseEntryPoints.size(); j++) { if (mReverseEntryPoints.get(j).getFromBlock() == b.getBlock()) { return EntryPoint.REVERSE; } } log.error("Unexpected error in getDirectionForBlocks when working with LevelCrossing in Section {}", getDisplayName(USERSYS)); return EntryPoint.UNKNOWN; }
Source:
<code>public void addChild(LaunchObjectModel model) { <START> for (LaunchObjectModel e : children) { model.compareTo(e); } <END> children.add(model); }</code><technical_language>This superfluous, compareTo() side effects</technical_language>

Target:
public void addChild(LaunchObjectModel model) { children.add(model); }
Source:
<code>public void requireSystemDuringLoad() throws Exception { r.jenkins.setSecurityRealm(r.createDummySecurityRealm()); r.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy()); <START> try (ACLContext context = ACL.as(User.getOrCreateByIdOrFullName("underprivileged").impersonate())) { <END> dynamicLoad("require-system-during-load.hpi"); } }</code><technical_language>suggestion try (ACLContext context = ACL.as(User.getById("underprivileged", true).impersonate())) {</technical_language>

Target:
public void requireSystemDuringLoad() throws Exception { r.jenkins.setSecurityRealm(r.createDummySecurityRealm()); r.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy()); try (ACLContext context = ACL.as(User.getById("underprivileged", true).impersonate())) { dynamicLoad("require-system-during-load.hpi"); } }
Source:
<code>public boolean deleteIndicatorData(long indicator, long regionset, int year) { try (final SqlSession session = factory.openSession()) { int updated = getMapper(session).deleteData(indicator, regionset, year); if(updated != 1) { <START> throw new ServiceRuntimeException("Delete wasn't successful"); <END> } } return true; }</code><technical_language>I expect public boolean delete() throw a RuntimeException in case delete. Instead expect false returned, Exception thrown in case actual Exception (like DB connection unexpectedly error'd something)</technical_language>

Target:
public boolean deleteIndicatorData(long indicator, long regionset, int year) { try (final SqlSession session = factory.openSession()) { int updated = getMapper(session).deleteData(indicator, regionset, year); return updated != 0; } }
Source:
<code>public Map<String, Short> toMap() { <START> return new HashMap<String, Short>() { <END> { put(minKeyLabel, min()); put(maxKeyLabel, max()); } }; }</code><technical_language>nit: Utils.mkMap</technical_language>

Target:
public Map<String, Short> toMap() { return Utils.mkMap(Utils.mkEntry(minKeyLabel, min()), Utils.mkEntry(maxKeyLabel, max())); }
Source:
<code><START> protected RecordingTransactionBase(TransactionBase txb) { <END> this.txb = txb; }</code><technical_language>protected private</technical_language>

Target:
RecordingTransactionBase(TransactionBase txb) { this.txb = txb; }
Source:
<code>public void complexity() { String path = "src/test/resources/metrics/complexity.js"; Tree tree = p.parse(new File(path)); <START> assertThat(new ComplexityVisitor().getComplexity(tree)).isEqualTo(22); <END> }</code><technical_language>@ivandalbosco this number same: file complexity</technical_language>

Target:
public void complexity() { String path = "src/test/resources/metrics/complexity.js"; Tree tree = p.parse(new File(path)); assertThat(new ComplexityVisitor(true).getComplexity(tree)).isEqualTo(29); }
Source:
<code>private byte[] encrypt(final String name, final Date date, final byte[] rawText) throws NoSuchProviderException, PGPException, IOException { final byte[] zText = compress(name, date, rawText); final BcPGPDataEncryptorBuilder builder = new BcPGPDataEncryptorBuilder(PGPEncryptedData.CAST5) .setSecureRandom(prng); final PGPEncryptedDataGenerator cpk = new PGPEncryptedDataGenerator(builder, true); final BcPublicKeyKeyEncryptionMethodGenerator methodGenerator = new BcPublicKeyKeyEncryptionMethodGenerator(dest); <START> cpk.addMethod(methodGenerator); <END> final ByteArrayOutputStream buf = new ByteArrayOutputStream(); final ArmoredOutputStream aout = new ArmoredOutputStream(buf); final OutputStream cout = cpk.open(aout, zText.length); cout.write(zText); cout.close(); aout.close(); return buf.toByteArray(); }</code><technical_language>[optional] Extract previous 9 lines in function: private PGPEncryptedDataGenerator cpk() { [ ] BcPGPDataEncryptorBuilder builder = [ ] [...] return cpk; }</technical_language>

Target:
private byte[] encrypt(final String name, final Date date, final byte[] rawText) throws NoSuchProviderException, PGPException, IOException { final byte[] zText = compress(name, date, rawText); final ByteArrayOutputStream buf = new ByteArrayOutputStream(); final ArmoredOutputStream aout = new ArmoredOutputStream(buf); final OutputStream cout = cpk().open(aout, zText.length); cout.write(zText); cout.close(); aout.close(); return buf.toByteArray(); }
Source:
<code>public void setAge(Duration age) { <START> setAge(age.get(ChronoUnit.SECONDS)); <END> }</code><technical_language>age.getSeconds() ? Simpler, functionally same</technical_language>

Target:
public void setAge(Duration age) { setAge(age.getSeconds()); }
Source:
<code><START> private static String indentSql(String sql) { <END> StringBuilder builder = new StringBuilder(); String[] lines = sql.split("\n"); builder.append(lines[0]); for (int i = 1; i < lines.length; i++) { builder.append("\n ").append(lines[i]); } return builder.toString(); }</code><technical_language>return sql.replaceAll("\\n", "\n ");</technical_language>

Target:
private static String indentSql(String sql) { return sql.replace("\n", "\n "); }
Source:
<code>public HttpRequest<T> build() { return new HttpRequestImpl<T>(url, method, headers, outputStreamHandler, new HttpClient.ResponseHandler<T>() { @Override public T handleResponse(InputStream is, Integer statusCode, IOException e) throws IOException { if (errorStatusCodesIgnored.contains(statusCode)) { return null; <START> } else if (statusCode >= 400) { <END> new ErrorLoggingResponseHandler(HttpClient.removeUserInfo(url)).handleResponse(is, statusCode, e); return null; } else { return responseHandler.handleResponse(is, statusCode, e); } } }); }</code><technical_language>InputStream is read closed: NoopResponseHandler.INSTANCE.handleResponse</technical_language>

Target:
public HttpRequest<T> build() { return new HttpRequestImpl<T>(url, method, headers, outputStreamHandler, new HttpClient.ResponseHandler<T>() { @Override public T handleResponse(InputStream is, Integer statusCode, IOException e) throws IOException { if (errorStatusCodesIgnored.contains(statusCode)) { IOUtils.consumeAndClose(is); return null; } else if (statusCode >= 400) { new ErrorLoggingResponseHandler(HttpClient.removeUserInfo(url)).handleResponse(is, statusCode, e); return null; } else { return responseHandler.handleResponse(is, statusCode, e); } } }); }
Source:
<code>protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitVarDeclaration(@NotNull GoVarDeclaration o) { super.visitVarDeclaration(o); for (GoVarSpec spec : o.getVarSpecList()) { checkVar(spec); } } @Override public void visitShortVarDeclaration(@NotNull GoShortVarDeclaration o) { super.visitShortVarDeclaration(o); checkVar(o); } @Override public void visitConstDeclaration(@NotNull GoConstDeclaration o) { super.visitConstDeclaration(o); for (GoConstSpec spec : o.getConstSpecList()) { checkConst(spec); } } private void checkVar(@NotNull GoVarSpec spec) { if (spec.getType() != null) return; checkExpressions(spec.getRightExpressionsList()); } private void checkConst(@NotNull GoConstSpec spec) { if (spec.getType() != null) return; checkExpressions(spec.getExpressionList()); } private void checkExpressions(@NotNull List<GoExpression> expressions) { for (GoExpression expr : expressions) { <START> ProgressManager.checkCanceled(); <END> if (expr instanceof GoReferenceExpressionImpl) { GoReferenceExpressionImpl ref = (GoReferenceExpressionImpl)expr; PsiElement resolve = ref.resolve(); if (ref.getIdentifier().textMatches(GoConstants.NIL) && resolve != null && GoPsiImplUtil.builtin(resolve)) { holder.registerProblem(expr, "Cannot assign nil without explicit type", GENERIC_ERROR_OR_WARNING); } } } } }; }</code><technical_language>this is good! ref.resolve expensive operation, it's' check inspection interrupted iteration</technical_language>

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitVarDeclaration(@NotNull GoVarDeclaration o) { for (GoVarSpec spec : o.getVarSpecList()) { checkVar(spec); } } @Override public void visitShortVarDeclaration(@NotNull GoShortVarDeclaration o) { checkVar(o); } @Override public void visitConstDeclaration(@NotNull GoConstDeclaration o) { for (GoConstSpec spec : o.getConstSpecList()) { checkConst(spec); } } private void checkVar(@NotNull GoVarSpec spec) { if (spec.getType() != null) return; checkExpressions(spec.getRightExpressionsList()); } private void checkConst(@NotNull GoConstSpec spec) { if (spec.getType() != null) return; checkExpressions(spec.getExpressionList()); } private void checkExpressions(@NotNull List<GoExpression> expressions) { for (GoExpression expr : expressions) { ProgressManager.checkCanceled(); if (expr instanceof GoReferenceExpressionImpl) { GoReferenceExpressionImpl ref = (GoReferenceExpressionImpl)expr; PsiElement resolve = ref.resolve(); if (ref.getIdentifier().textMatches(GoConstants.NIL) && resolve != null && GoPsiImplUtil.builtin(resolve)) { holder.registerProblem(expr, "Cannot assign nil without explicit type", GENERIC_ERROR_OR_WARNING); } } } } }; }
Source:
<code>public MarketHistory(Market market) { <START> super(); <END> this.market = market; history = new HashMap<String, List<Double>>(); }</code><technical_language>I do need super() in this file</technical_language>

Target:
public MarketHistory(Market market) { this.market = market; history = new HashMap<String, List<Double>>(); }
Source:
<code><START> public int double getScreenWidth() { <END> return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(); }</code><technical_language>int int double</technical_language>

Target:
public int getScreenWidth() { return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(); }
Source:
<code>public void commit() throws IOException { if (basicFuture != null) { long beforeWait = System.currentTimeMillis(); try { JestResult result = basicFuture.get(); if (result == null) { throw new RuntimeException(); } long msWaited = System.currentTimeMillis() - beforeWait; <START> LOG.info("Previous took in ms " + millis <END> + ", including wait " + msWaited); } catch (InterruptedException | ExecutionException e) { LOG.error("Error waiting for result ", e); } basicFuture = null; } if (bulkBuilder != null) { if (bulkDocs > 0) { basicFuture = new BasicFuture<>(null); millis = System.currentTimeMillis(); client.executeAsync(bulkBuilder.build(), new JestResultHandler<BulkResult>() { @Override public void completed(BulkResult bulkResult) { basicFuture.completed(bulkResult); millis = System.currentTimeMillis() - millis; } @Override public void failed(Exception e) { basicFuture.completed(null); LOG.error("Failed result: ", e); } }); } bulkBuilder = null; } if (createNewBulk) { bulkBuilder = new Bulk.Builder() .defaultIndex(defaultIndex) .defaultType(defaultType); bulkDocs = 0; bulkLength = 0; } }</code><technical_language>here, please parameterized logging</technical_language>

Target:
public void commit() throws IOException { if (basicFuture != null) { long beforeWait = System.currentTimeMillis(); try { JestResult result = basicFuture.get(); if (result == null) { throw new RuntimeException(); } long msWaited = System.currentTimeMillis() - beforeWait; LOG.info("Previous took in ms {}, including wait {}", millis, msWaited); } catch (InterruptedException | ExecutionException e) { LOG.error("Error waiting for result ", e); } basicFuture = null; } if (bulkBuilder != null) { if (bulkDocs > 0) { basicFuture = new BasicFuture<>(null); millis = System.currentTimeMillis(); client.executeAsync(bulkBuilder.build(), new JestResultHandler<BulkResult>() { @Override public void completed(BulkResult bulkResult) { basicFuture.completed(bulkResult); millis = System.currentTimeMillis() - millis; } @Override public void failed(Exception e) { basicFuture.completed(null); LOG.error("Failed result: ", e); } }); } bulkBuilder = null; } if (createNewBulk) { bulkBuilder = new Bulk.Builder().defaultIndex(defaultIndex) .defaultType(defaultType); bulkDocs = 0; bulkLength = 0; } }
Source:
<code><START> @Override public OutputStream openOutputStream() { <END> return stream; }</code><technical_language>I this method wants create a new stream invocation</technical_language>

Target:
@Override public OutputStream openOutputStream() throws IOException { Path parent = path.getParent(); if (!Files.exists(parent)) fileSystemProvider.createDirectory(parent); return fileSystemProvider.newOutputStream(path); }
Source:
<code>public StringBuilder getNegatedQuery() { StringBuilder builder = new StringBuilder(); int counter = 1; builder.append( "(" ); <START> for ( Predicate<StringBuilder> child : children ) { <END> builder.append( ( (NegatablePredicate<StringBuilder>) child ).getNegatedQuery() ); builder.append( ")" ); if ( counter++ < children.size() ) { builder.append( " and (" ); } } return builder; }</code><technical_language>is a lot of duplicated code</technical_language>

Target:
public InfinispanRemoteQueryBuilder getNegatedQuery() { return new InfinispanRemoteQueryBuilder( "and", true, children ); }
Source:
<code>public boolean isSameRM(XAResource xares) throws XAException { <START> log.infof("isSameRM returning false to xares: %s", xares); <END> return false; }</code><technical_language>tracef</technical_language>

Target:
public boolean isSameRM(XAResource xares) throws XAException { log.tracef("isSameRM returning false to xares: %s", xares); return false; }
Source:
<code>public void setter_nonLatinFieldName() { RealmConfiguration config = configFactory.createConfigurationBuilder().name("greekWTF").schema(NonLatinFieldNames.class).build(); Realm realm = Realm.getInstance(config); try { realm.beginTransaction(); RealmObjectSchema schema = realm.getSchema().get(NonLatinFieldNames.class.getSimpleName()); <START> schema.getFieldType("델타"); <END> NonLatinFieldNames obj = realm.createObject(NonLatinFieldNames.class); obj.setΔέλτα(0); realm.commitTransaction(); } finally { realm.close(); } }</code><technical_language>If call schema.getFieldType() a field, setter crash?? O_O</technical_language>

Target:
public void setter_nonLatinFieldName() { realm.beginTransaction(); NonLatinFieldNames obj = realm.createObject(NonLatinFieldNames.class); obj.setΔέλτα(42); realm.commitTransaction(); }
Source:
<code><START> protected void initShareFragment(boolean afterLogin) { <END> ShareIntentReceiverFragment shareIntentReceiverFragment = ShareIntentReceiverFragment .newInstance(!isSharingText(), loadLastUsedBlogLocalId(), afterLogin); getSupportFragmentManager() .beginTransaction() .replace(R.id.fragment_container, shareIntentReceiverFragment, ShareIntentReceiverFragment.TAG) .commit(); }</code><technical_language>for refreshContent() above, marking this method private denote a local helper method</technical_language>

Target:
private void initShareFragment(boolean afterLogin) { ShareIntentReceiverFragment shareIntentReceiverFragment = ShareIntentReceiverFragment .newInstance(!isSharingText(), loadLastUsedBlogLocalId(), afterLogin); getSupportFragmentManager() .beginTransaction() .replace(R.id.fragment_container, shareIntentReceiverFragment, ShareIntentReceiverFragment.TAG) .commit(); }
Source:
<code>public void deleteUser(String username) { <START> throw new RuntimeException("Deleting a user is not supporting in LDAP"); <END> }</code><technical_language>UnsupportedOperationException instead of a generic RuntimeException</technical_language>

Target:
public void deleteUser(String username) { throw new UnsupportedOperationException("Deleting a user is not supporting in LDAP"); }
Source:
<code>private void drawVariables(List<UserVariable> variableList, Batch batch) { if (variableList == null) { return; } if (variableToShow.isDummy()) { drawText(batch, Utils.getStringfromResource(R.string.no_variable_selected), xPosition, yPosition, color); } else { for (UserVariable variable : variableList) { if (variable.getName().equals(variableToShow.getName())) { String variableValue = variable.getValue().toString(); if (variable.getVisible()) { if (isNumberAndInteger(variableValue)) { <START> drawText(batch, variableValueWithoutDecimal, xPosition, yPosition, color); <END> } else { drawText(batch, variableValue, xPosition, yPosition, color); } } break; } } } }</code><technical_language>please this line move line 159-162 discussed slack</technical_language>

Target:
private void drawVariables(List<UserVariable> variableList, Batch batch) { if (variableList == null) { return; } if (variableToShow.isDummy()) { drawText(batch, Utils.getStringfromResource(R.string.no_variable_selected), xPosition, yPosition, color); } else { for (UserVariable variable : variableList) { if (variable.getName().equals(variableToShow.getName())) { String variableValue = variable.getValue().toString(); if (variable.getVisible()) { if (isNumberAndInteger(variableValue)) { drawText(batch, variableValueWithoutDecimal, xPosition, yPosition, color); } else if (variableValue.isEmpty()) { return; } else { drawText(batch, variableValue, xPosition, yPosition, color); } } break; } } } }
Source:
<code>public static void ensureZkDirectoryStructureExists(Directory rootDir, String basePath) throws KeeperException, InterruptedException { ensureBasePathExists(rootDir, basePath); PathBuilder pathMgr = new PathBuilder(basePath); for (String path : Setup.getTopLevelPaths(pathMgr)) { <START> if (!rootDir.has(path)) { <END> rootDir.ensureHas(path, null); } } if (!rootDir.has(pathMgr.getVniCounterPath())) { rootDir.ensureHas(pathMgr.getVniCounterPath(), Integer.toString(MIN_VNI).getBytes()); } if (!rootDir.has(pathMgr.getWriteVersionPath())) { rootDir.ensureHas(pathMgr.getWriteVersionPath(), DataWriteVersion.CURRENT.getBytes()); } }</code><technical_language>this check in ensureHas</technical_language>

Target:
public static void ensureZkDirectoryStructureExists(Directory rootDir, String basePath) throws KeeperException, InterruptedException { ensureBasePathExists(rootDir, basePath); PathBuilder pathMgr = new PathBuilder(basePath); for (String path : Setup.getTopLevelPaths(pathMgr)) { rootDir.ensureHas(path, null); } rootDir.ensureHas(pathMgr.getVniCounterPath(), Integer.toString(MIN_VNI).getBytes()); rootDir.ensureHas(pathMgr.getWriteVersionPath(), DataWriteVersion.CURRENT.getBytes()); }
Source:
<code><START> public void deregesterSpecialPathSet( SpecialPathSet pathSet ) <END> { if ( !pkgtypes.containsKey( pathSet.getPackageType() ) ) { logger.warn( "[Galley] The package does not contain the path set for this package type {}, no deregister operation there", pathSet.getPackageType() ); } pkgtypes.remove( pathSet.getPackageType() ); }</code><technical_language>IMO return removed SpecialPathSet. similar Map semantics, if people need return discard it</technical_language>

Target:
public SpecialPathSet deregesterSpecialPathSet( SpecialPathSet pathSet ) { if ( !pkgtypes.containsKey( pathSet.getPackageType() ) ) { logger.warn( "[Galley] The package does not contain the path set for this package type {}, no deregister operation there", pathSet.getPackageType() ); } return pkgtypes.remove( pathSet.getPackageType() ); }
Source:
<code>public void testNonCyclicHashFunction() { <START> HashFunctionIdentity hfi = new HashFunctionIdentity() { <END> @Override public String getName() { return "Testing-NonCyclic-Hash"; } @Override public ProcessType getProcessType() { return ProcessType.ITERATIVE; } @Override public String getProvider() { return "Apache Commons Collection Testing"; } @Override public long getSignature() { return 0; } @Override public Signedness getSignedness() { return Signedness.SIGNED; } }; try { new CachingHasher(hfi, new long[][] { { 1, 4 }, { 3, 6 } }); fail("Should have thrown exception"); } catch (IllegalArgumentException expected) { } }</code><technical_language>Cleaner HashFunctionIdentityImpl here</technical_language>

Target:
public void testNonCyclicHashFunction() { HashFunctionIdentity hfi = new HashFunctionIdentityImpl("Apache Commons Collection Testing", "Testing-NonCyclic-Hash", Signedness.SIGNED, ProcessType.ITERATIVE, 0 ); try { new CachingHasher(hfi, new long[][] { { 1, 4 }, { 3, 6 } }); fail("Should have thrown exception"); } catch (IllegalArgumentException expected) { } }
Source:
<code>public void run() { connectionTimeout = config.getConnectionTimeout(); poolElf.setValidationTimeout(config.getValidationTimeout()); leakTask.updateLeakDetectionThreshold(config.getLeakDetectionThreshold()); final long now = clockSource.currentTime(); final long idleTimeout = config.getIdleTimeout(); if (now < previous || now > clockSource.plusMillis(previous, (2 * HOUSEKEEPING_PERIOD_MS))) { LOGGER.warn("{} - Unusual system clock change detected, soft-evicting connections from pool.", poolName); previous = now; softEvictConnections(); fillPool(); return; } previous = now; logPoolState("Before cleanup\t"); <START> if(idleTimeout > 0L) { <END> final List<PoolBagEntry> bag = connectionBag.values(STATE_NOT_IN_USE); int removable = bag.size() - config.getMinimumIdle(); if (removable > 0) { for (PoolBagEntry bagEntry : bag) { if (clockSource.elapsedMillis(bagEntry.lastAccess, now) > idleTimeout) { if (connectionBag.reserve(bagEntry)) { closeConnection(bagEntry, "(connection passed idleTimeout)"); removable--; } } } } } logPoolState("After cleanup\t"); fillPool(); }</code><technical_language>Space 'if' parenthesis. Indentation is 3 spaces, 4</technical_language>

Target:
public void run() { connectionTimeout = config.getConnectionTimeout(); poolElf.setValidationTimeout(config.getValidationTimeout()); leakTask.updateLeakDetectionThreshold(config.getLeakDetectionThreshold()); final long now = clockSource.currentTime(); final long idleTimeout = config.getIdleTimeout(); if (now < previous || now > clockSource.plusMillis(previous, (2 * HOUSEKEEPING_PERIOD_MS))) { LOGGER.warn("{} - Unusual system clock change detected, soft-evicting connections from pool.", poolName); previous = now; softEvictConnections(); fillPool(); return; } previous = now; if (idleTimeout > 0L) { logPoolState("Before cleanup\t"); final List<PoolBagEntry> bag = connectionBag.values(STATE_NOT_IN_USE); int removable = bag.size() - config.getMinimumIdle(); for (PoolBagEntry bagEntry : bag) { if (removable <= 0) { break; } if (clockSource.elapsedMillis(bagEntry.lastAccess, now) > idleTimeout) { if (connectionBag.reserve(bagEntry)) { closeConnection(bagEntry, "(connection passed idleTimeout)"); removable--; } } } logPoolState("After cleanup\t"); } fillPool(); }
Source:
<code>public void endOfAnalysis() { if(!classesNotFound.isEmpty()) { <START> LOG.warn("Classes not found during the analysis : {}", classesNotFound.stream().collect(Collectors.joining(", "))); <END> } }</code><technical_language>add brackets list of classes? "Classes analysis : [x.y.z.myClass, x.z.MyOtherClass, ...]" I volume of data end displaying (analysis poorly configured?). displaying 50 classes, if more display of in debug? Splitting hairs..</technical_language>

Target:
public void endOfAnalysis() { if(!classesNotFound.isEmpty()) { String message = ""; if(classesNotFound.size() > 50) { message = ", ..."; } LOG.warn("Classes not found during the analysis : [{}{}]", classesNotFound.stream().limit(50).collect(Collectors.joining(", ")), message); } }
Source:
<code>private void saveProcess(Process process) { try { serviceManager.getProcessService().save(process); } catch (DataException e) { <START> Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while saving process: " + process.getTitle(), e); <END> logger.error(KITODO_SCRIPT_FIELD + "Error while saving process: " + process.getTitle(), e); } }</code><technical_language>Please log error inform user</technical_language>

Target:
private void saveProcess(Process process) { try { serviceManager.getProcessService().save(process); } catch (DataException e) { logger.error(KITODO_SCRIPT_FIELD + "Error while saving process: " + process.getTitle(), e); Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while saving process: " + process.getTitle(), e); } }
Source:
<code>private static void checkModulusAndResidue(int residue, int modulus) { Preconditions.checkArgument(modulus > 0, "Modulus should be positive, but found %s.", modulus); Preconditions.checkArgument(Math.abs(residue) < modulus, "Absolute value of residue %s equals or exceeds modulus %s - no solutions", residue, <START> modulus); <END> }</code><technical_language>Non-actionable: a bit sad checkModulusAndResidue(Integer.MIN_VALUE, 2); pass. If want defensive, arrest case explicitly ruling out, casting residue a long calling abs</technical_language>

Target:
private static void checkModulusAndResidue(int residue, int modulus) { Preconditions.checkArgument(modulus > 0, "Modulus should be positive, but found %s.", modulus); Preconditions.checkArgument(Math.abs((long) residue) < modulus, "Absolute value of residue %s equals or exceeds modulus %s - no solutions", residue, modulus); }