auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<UserExtSource> getActiveUserExtSources(PerunSession sess, User user) throws InternalErrorException { LocalDate date = LocalDate.now(); date = date.minusMonths(MAX_OLD_OF_ACTIVE_USER_EXTSOURCE); try { String query = "select " + userExtSourceMappingSelectQuery + ", " + ExtSourcesManagerImpl.extSourceMappingSelectQuery + " from user_ext_sources left join ext_sources on user_ext_sources.ext_sources_id=ext_sources.id where " + " user_ext_sources.user_id=? and " + " user_ext_sources.last_access > " + Compatibility.toDate("'" + date.toString() + "'", "'YYYY-MM-DD'"); return jdbc.query(query, USEREXTSOURCE_MAPPER, user.getId()); } catch(EmptyResultDataAccessException ex) { return new ArrayList<>(); } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }

Target:
public List<UserExtSource> getActiveUserExtSources(PerunSession sess, User user) throws InternalErrorException { LocalDate date = LocalDate.now(); date = date.minusMonths(MAX_OLD_OF_ACTIVE_USER_EXTSOURCE); try { String query = "select " + userExtSourceMappingSelectQuery + ", " + ExtSourcesManagerImpl.extSourceMappingSelectQuery + " from user_ext_sources left join ext_sources on user_ext_sources.ext_sources_id=ext_sources.id where " + " user_ext_sources.user_id=? and " + " user_ext_sources.last_access > " + Compatibility.toDate("'" + date + "'", "'YYYY-MM-DD'"); return jdbc.query(query, USEREXTSOURCE_MAPPER, user.getId()); } catch(EmptyResultDataAccessException ex) { return new ArrayList<>(); } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
private static Error error() { return Error.newBuilder() .setMessage("Task can not be created done.") .build(); }

Target:
private static Error error() { return Error.newBuilder() .setMessage("The task cannot be created in a 'completed' state.") .build(); }
Source:
public void testSimpleBatch() { Batch batch = handle.createBatch(); batch.add("INSERT INTO fruit VALUES(0, 'apple')"); batch.add("INSERT INTO fruit VALUES(1, 'banana')"); int[] rowsModified = batch.execute(); assertThat(rowsModified).hasSize(2).containsOnly(1); assertThat(handle.createQuery("SELECT count(1) FROM fruit") .mapTo(int.class) .findOnly() .intValue()) .isEqualTo(2); }

Target:
public void testSimpleBatch() { Batch batch = handle.createBatch(); batch.add("INSERT INTO fruit VALUES(0, 'apple')"); batch.add("INSERT INTO fruit VALUES(1, 'banana')"); int[] rowsModified = batch.execute(); assertThat(rowsModified).containsExactly(1, 1); assertThat(handle.createQuery("SELECT count(1) FROM fruit") .mapTo(int.class) .findOnly() .intValue()) .isEqualTo(2); }
Source:
public boolean block() { if (yielder.isDone()) { return true; } if (resultBatch == null || resultBatch.isDrained()) { final Yielder<ResultBatch<E>> nextYielder = yielder.next(resultBatch); yielder = nextYielder; } return true; }

Target:
public boolean block() { if (yielder.isDone()) { return true; } if (resultBatch == null || resultBatch.isDrained()) { resultBatch = new ResultBatch<>(batcher.batchSize); final Yielder<ResultBatch<E>> nextYielder = yielder.next(resultBatch); yielder = nextYielder; } return true; }
Source:
public Treatment(String name, String description) { this.validateName(name); this.name = name; this.description = description; }

Target:
public Treatment(String name, String description) throws ValidationException { this.name = name; this.description = description; validateName(); }
Source:
public Map<String, URL> getLocalArtifactUrls(RobolectricTestRunner robolectricTestRunner, Dependency... dependencies) { String cacheName = cacheNamingStrategy.getName(dependencies); Hashtable<String, URL> urlsFromCache = cache.load(cacheName, Hashtable.class); if(urlsFromCache != null) { return new HashMap<String, URL>(urlsFromCache); } Map<String, URL> urls = mavenCentral.getLocalArtifactUrls(robolectricTestRunner, dependencies); cache.write(cacheName, new Hashtable<String, URL>(urls)); return urls; }

Target:
public URL[] getLocalArtifactUrls(RobolectricTestRunner robolectricTestRunner, Dependency... dependencies) { String cacheName = cacheNamingStrategy.getName(CACHE_PREFIX_1, dependencies); URL[] urlsFromCache = cache.load(cacheName, URL[].class); if(urlsFromCache != null) { return urlsFromCache; } URL[] urls = mavenCentral.getLocalArtifactUrls(robolectricTestRunner, dependencies); cache.write(cacheName, urls); return urls; }
Source:
private void subscribeToAlternate() { add(alternate.unsafeSubscribe(new Subscriber<T>() { @Override public void onStart() { final long capacity = consumerCapacity.get(); if (capacity > 0) { request(capacity); } } @Override public void onCompleted() { child.onCompleted(); } @Override public void onError(Throwable e) { child.onError(e); } @Override public void onNext(T t) { child.onNext(t); } })); }

Target:
private void subscribeToAlternate() { child.add(alternate.unsafeSubscribe(new Subscriber<T>() { @Override public void setProducer(final Producer producer) { child.setProducer(new Producer() { @Override public void request(long n) { producer.request(n); } }); } @Override public void onStart() { final long capacity = consumerCapacity.get(); if (capacity > 0) { request(capacity); } } @Override public void onCompleted() { child.onCompleted(); } @Override public void onError(Throwable e) { child.onError(e); } @Override public void onNext(T t) { child.onNext(t); } })); }
Source:
public void visitUseStatement(UseStatementTree tree) { useNodes.add(tree); if (nextStatement != null && !nextStatement.is(USE_KINDS)) { checkUsesAreBeforeNamespace(); checkBlankLineAfterUses(tree); useNodes.clear(); } }

Target:
public void visitUseStatement(UseStatementTree tree) { useStatements.add(tree); if (nextStatement != null && !nextStatement.is(USE_KINDS)) { checkUsesAreBeforeNamespace(); checkBlankLineAfterUses(tree); useStatements.clear(); } }
Source:
public void setupDataCall(int radioTechnology, DataProfile dataProfile, boolean isRoaming, boolean allowRoaming, Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource); DataProfileInfo dpi = convertToHalDataProfile(dataProfile); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",radioTechnology=" + radioTechnology + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + ("user".equals(Build.TYPE) ? "***" : dataProfile.toString())); } try { radioProxy.setupDataCall(rr.mSerial, radioTechnology, dpi, dataProfile.modemCognitive, allowRoaming, isRoaming); mMetrics.writeRilSetupDataCall(mPhoneId, rr.mSerial, radioTechnology, dpi.profileId, dpi.apn, dpi.authType, dpi.protocol); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setupDataCall", e); } } }

Target:
public void setupDataCall(int radioTechnology, DataProfile dataProfile, boolean isRoaming, boolean allowRoaming, Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource); DataProfileInfo dpi = convertToHalDataProfile(dataProfile); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",radioTechnology=" + radioTechnology + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile); } try { radioProxy.setupDataCall(rr.mSerial, radioTechnology, dpi, dataProfile.modemCognitive, allowRoaming, isRoaming); mMetrics.writeRilSetupDataCall(mPhoneId, rr.mSerial, radioTechnology, dpi.profileId, dpi.apn, dpi.authType, dpi.protocol); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setupDataCall", e); } } }
Source:
public void testClientResponseStatsUpdate() throws IOException, InterruptedException, KeeperException { try (ZooKeeper zk = createClient()) { ProposalStats stats = serverFactory.getZooKeeperServer().serverStats().getClientResponseStats(); assertEquals("", -1, stats.getLast()); zk.create("/a", "test".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); assertThat(stats.getLast(), greaterThan(0)); } }

Target:
public void testClientResponseStatsUpdate() throws IOException, InterruptedException, KeeperException { try (ZooKeeper zk = createClient()) { BufferStats clientResponseStats = serverFactory.getZooKeeperServer().serverStats().getClientResponseStats(); assertThat("Last client response size should be initialized with INIT_VALUE", clientResponseStats.getLastBufferSize(), equalTo(BufferStats.INIT_VALUE)); zk.create("/a", "test".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); assertThat("Last client response size should be greater then zero after client request was performed", clientResponseStats.getLastBufferSize(), greaterThan(0)); } }
Source:
private Map<Integer, List<Pair<Long, Long>>> splitIntoSubKeyRanges(final List<Pair<Long, Long>> dataKeyRanges) { final Map<Integer, List<Pair<Long, Long>>> blockToSubKeyRangesMap = new HashMap<>(); for (final Pair<Long, Long> keyRange : dataKeyRanges) { final Map<Integer, Pair<Long, Long>> blockToSubKeyRangeMap = blockResolver.resolveBlocksForOrderedKeys(keyRange.getFirst(), keyRange.getSecond()); for (final Map.Entry<Integer, Pair<Long, Long>> blockToSubKeyRange : blockToSubKeyRangeMap.entrySet()) { final int blockId = blockToSubKeyRange.getKey(); final Pair<Long, Long> subKeyRange = blockToSubKeyRange.getValue(); if (!blockToSubKeyRangesMap.containsKey(blockId)) { blockToSubKeyRangesMap.put(blockId, new LinkedList<>()); } final List<Pair<Long, Long>> subKeyRangeList = blockToSubKeyRangesMap.get(blockId); subKeyRangeList.add(subKeyRange); } } return blockToSubKeyRangesMap; }

Target:
private Map<Integer, List<Pair<Long, Long>>> splitIntoSubKeyRanges(final List<Pair<Long, Long>> dataKeyRanges) { final Map<Integer, List<Pair<Long, Long>>> blockToSubKeyRangesMap = new HashMap<>(); for (final Pair<Long, Long> keyRange : dataKeyRanges) { final Map<Integer, Pair<Long, Long>> blockToSubKeyRangeMap = blockResolver.resolveBlocksForOrderedKeys(keyRange.getFirst(), keyRange.getSecond()); for (final Map.Entry<Integer, Pair<Long, Long>> blockToSubKeyRange : blockToSubKeyRangeMap.entrySet()) { final int blockId = blockToSubKeyRange.getKey(); final Pair<Long, Long> subKeyRange = blockToSubKeyRange.getValue(); blockToSubKeyRangesMap.computeIfAbsent(blockId, integer -> new LinkedList<>()); final List<Pair<Long, Long>> subKeyRangeList = blockToSubKeyRangesMap.get(blockId); subKeyRangeList.add(subKeyRange); } } return blockToSubKeyRangesMap; }
Source:
private void updateCounter(ISegment segment) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); assertNotNull(ss); try { int quark = ss.getQuarkAbsoluteAndAdd(TmfPatternSegmentManagerTest.COUNTER_STRING, ((TmfXmlPatternSegment) segment).getName().substring(4)); ss.incrementAttribute(segment.getStart(), quark); } catch (StateValueTypeException | AttributeNotFoundException e) { e.printStackTrace(); } }

Target:
private void updateCounter(ISegment segment) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); assertNotNull(ss); try { int quark = ss.getQuarkAbsoluteAndAdd(TmfXmlPatternSegmentBaseAnalysisForTest.COUNTER_STRING, ((TmfXmlPatternSegment) segment).getName().substring(4)); ss.incrementAttribute(segment.getStart(), quark); } catch (StateValueTypeException | AttributeNotFoundException e) { fail("Failed to update the counter for segment " + ((TmfXmlPatternSegment)segment).getName()); } }
Source:
public static boolean verifyTokenSignature(SignedJWT jwt, String alias) throws APIManagementException { Certificate publicCert = null; try { publicCert = APIUtil.getCertificateFromTrustStore(alias); } catch (APIManagementException e) { throw new APIManagementException("Error retrieving certificate from truststore ",e); } if (publicCert != null) { JWSAlgorithm algorithm = jwt.getHeader().getAlgorithm(); if ((JWSAlgorithm.RS256.equals(algorithm) || JWSAlgorithm.RS512.equals(algorithm) || JWSAlgorithm.RS384.equals(algorithm))) { return verifyTokenSignature(jwt, (RSAPublicKey) publicCert.getPublicKey()); } else { log.error("Public key is not a RSA"); throw new APIManagementException("Public key is not a RSA"); } } else { log.error("Couldn't find a public certificate to verify signature with alias " + alias); throw new APIManagementException("Couldn't find a public certificate to verify signature with alias "); } }

Target:
public static boolean verifyTokenSignature(SignedJWT jwt, String alias) throws APIManagementException { Certificate publicCert = null; try { publicCert = APIUtil.getCertificateFromTrustStore(alias); } catch (APIManagementException e) { throw new APIManagementException("Error retrieving certificate from truststore ",e); } if (publicCert != null) { JWSAlgorithm algorithm = jwt.getHeader().getAlgorithm(); if ((JWSAlgorithm.RS256.equals(algorithm) || JWSAlgorithm.RS512.equals(algorithm) || JWSAlgorithm.RS384.equals(algorithm))) { return verifyTokenSignature(jwt, (RSAPublicKey) publicCert.getPublicKey()); } else { log.error("Public key is not RSA"); throw new APIManagementException("Public key is not RSA"); } } else { log.error("Couldn't find a public certificate with alias " + alias + " to verify the signature"); throw new APIManagementException( "Couldn't find a public certificate with alias " + alias + " to verify the signature"); } }
Source:
public int add(InputRow row, Supplier<Committer> committerSupplier) throws IndexSizeExceededException { final Sink sink = getSink(row.getTimestampFromEpoch()); metrics.reportMessageMaxTimestamp(rejectionPolicy.getCurrMaxTime().getMillis()); if (sink == null) { return -1; } final int numRows = sink.add(row); if (!sink.canAppendRow() || System.currentTimeMillis() > nextFlush) { persist(committerSupplier.get()); } return numRows; }

Target:
public int add(InputRow row, Supplier<Committer> committerSupplier) throws IndexSizeExceededException { long messageTimestamp = row.getTimestampFromEpoch(); final Sink sink = getSink(messageTimestamp); metrics.reportMessageMaxTimestamp(messageTimestamp); if (sink == null) { return -1; } final int numRows = sink.add(row); if (!sink.canAppendRow() || System.currentTimeMillis() > nextFlush) { persist(committerSupplier.get()); } return numRows; }
Source:
public void configure() throws ConfigurationException { super.configure(); if(StringUtils.isNotEmpty(tempFolder)) { File outputLocation = new File(tempFolder); if (!outputLocation.exists()) { throw new ConfigurationException( "Pdf output location does not exist. Please specify an existing location "); } if (!outputLocation.isDirectory()) { throw new ConfigurationException("Pdf output location is not directory. Please specify a diretory"); } } if (!availableActions.contains(action)) { throw new ConfigurationException( "Please specify an action for pdf pipe. Possible values: {convert, combine}"); } if (StringUtils.isEmpty(license)) { throw new ConfigurationException("Please specify the full path to aspose license including file name."); } try (InputStream inputStream = new FileInputStream(license)) { } catch (FileNotFoundException notFound) { throw new ConfigurationException("Specified file for aspose license is not found", notFound); } catch (IOException e1) { throw new ConfigurationException(e1); } try { loader = new AsposeLicenseLoader(license, fontsDirectory); loader.loadLicense(); } catch (Exception e) { throw new ConfigurationException(e); } }

Target:
public void configure() throws ConfigurationException { super.configure(); if(StringUtils.isNotEmpty(pdfOutputLocation)) { File outputLocation = new File(pdfOutputLocation); if (!outputLocation.exists()) { throw new ConfigurationException( "Pdf output location does not exist. Please specify an existing location "); } if (!outputLocation.isDirectory()) { throw new ConfigurationException("Pdf output location is not directory. Please specify a diretory"); } } if (!availableActions.contains(action)) { throw new ConfigurationException( "Please specify an action for pdf pipe. Possible values: {convert, combine}"); } if (StringUtils.isEmpty(license)) { ConfigurationWarnings.add(this, log, "Aspose License is not configured. There will be evaluation watermarks on the converted documents. There are also some restrictions in the API use. License field could be set with a valid information to avoid this. "); }else { if(ClassUtils.getResourceURL(this, license) == null) { throw new ConfigurationException("Specified file for aspose license is not found"); } } try { loader = new AsposeLicenseLoader(license, fontsDirectory); loader.loadLicense(); } catch (Exception e) { throw new ConfigurationException("Error occured while loading the license", e); } }
Source:
public void assertAndConsume() { TestSubscriber<Integer> ts = TestSubscriber.create(); ts.assertNoValues(); ts.onNext(1); ts.assertAndConsume(1); ts.assertNoValues(); ts.onNext(2); ts.onNext(3); ts.assertValueCount(2); ts.assertAndConsume(2, 3); ts.onNext(4); ts.onNext(5); try { ts.assertAndConsume(4); Assert.fail("Should have thrown AssertionError"); } catch (AssertionError ex) { } ts.assertValueCount(2); try { ts.assertAndConsume(4, 5, 6); Assert.fail("Should have thrown AssertionError"); } catch (AssertionError ex) { } ts.assertAndConsume(4, 5); ts.assertNoValues(); }

Target:
public void assertAndConsume() { TestSubscriber<Integer> ts = TestSubscriber.create(); ts.assertNoValues(); ts.onNext(1); ts.assertValuesAndClear(1); ts.assertNoValues(); ts.onNext(2); ts.onNext(3); ts.assertValueCount(2); ts.assertValuesAndClear(2, 3); ts.onNext(4); ts.onNext(5); try { ts.assertValuesAndClear(4); Assert.fail("Should have thrown AssertionError"); } catch (AssertionError ex) { } ts.assertValueCount(2); try { ts.assertValuesAndClear(4, 5, 6); Assert.fail("Should have thrown AssertionError"); } catch (AssertionError ex) { } ts.assertValuesAndClear(4, 5); ts.assertNoValues(); }
Source:
protected SAMSequenceDictionary findAndLoadSequenceDictionary(final Path fasta) { final Path dictPath = findSequenceDictionary(path); if (dictPath == null) { return null; } else { IOUtil.assertFileIsReadable(dictPath); try (InputStream dictionaryIn = IOUtil.openFileForReading(dictPath)) { return ReferenceSequenceFileFactory.loadDictionary(dictionaryIn); } catch (Exception e) { throw new SAMException("Could not open sequence dictionary file: " + dictPath, e); } } }

Target:
protected SAMSequenceDictionary findAndLoadSequenceDictionary(final Path fasta) { final Path dictPath = findSequenceDictionary(path); if (dictPath == null) return null; IOUtil.assertFileIsReadable(dictPath); try (InputStream dictionaryIn = IOUtil.openFileForReading(dictPath)) { return ReferenceSequenceFileFactory.loadDictionary(dictionaryIn); } catch (Exception e) { throw new SAMException("Could not open sequence dictionary file: " + dictPath, e); } }
Source:
public void setIgnoredPlayer(IUser user, boolean set) { String uuid = user.getBase().getUniqueId().toString(); if (set) { if (!ignoredPlayers.contains(uuid)) { ignoredPlayers.add(uuid); } } else { ignoredPlayers.remove(uuid); } setIgnoredPlayers(ignoredPlayers); }

Target:
public void setIgnoredPlayer(IUser user, boolean set) { UUID uuid = user.getBase().getUniqueId(); if (set) { if (!ignoredPlayers.contains(uuid)) { ignoredPlayers.add(uuid); } } else { ignoredPlayers.remove(uuid); } setIgnoredPlayerUUIDs(ignoredPlayers); }
Source:
public void testDoesNotAttemptToDeserializeExtremelyBigNumbers() { assertThatExceptionOfType(JsonMappingException.class).isThrownBy( () -> objectMapper.readValue("{\"id\": 42, \"duration\": 1e1000000000}", Task.class)); }

Target:
public void testDoesNotAttemptToDeserializeExtremelyBigNumbers() { assertThatExceptionOfType(JsonMappingException.class).isThrownBy( () -> objectMapper.readValue("{\"id\": 42, \"duration\": 1e1000000000}", Task.class)) .withMessageStartingWith("Value is out of range of Duration"); }
Source:
public HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map<String, Filter> enabledFilters) throws QueryException, MappingException { final HQLQueryPlanKey key = new HQLQueryPlanKey( queryString, shallow, enabledFilters ); HQLQueryPlan value = (HQLQueryPlan) queryPlanCache.get( key ); final StatisticsImplementor statistics = factory.getStatistics(); boolean stats = statistics.isStatisticsEnabled(); if ( value == null ) { final long startTime = ( stats ) ? System.nanoTime() : 0L; LOG.tracev( "Unable to locate HQL query plan in cache; generating ({0})", queryString ); value = createHQLQueryPlan( queryString, shallow, enabledFilters, factory ); if ( stats ) { final long endTime = System.nanoTime(); final long microseconds = TimeUnit.MICROSECONDS.convert( endTime - startTime, TimeUnit.NANOSECONDS ); statistics.queryCompiled( queryString, microseconds ); } queryPlanCache.putIfAbsent( key, value ); } else { LOG.tracev( "Located HQL query plan in cache ({0})", queryString ); if ( stats ) { statistics.queryPlanCacheHit( queryString ); } } return value; }

Target:
public HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map<String, Filter> enabledFilters) throws QueryException, MappingException { final HQLQueryPlanKey key = new HQLQueryPlanKey( queryString, shallow, enabledFilters ); HQLQueryPlan value = (HQLQueryPlan) queryPlanCache.get( key ); final StatisticsImplementor statistics = factory.getStatistics(); boolean stats = statistics.isStatisticsEnabled(); if ( value == null ) { final long startTime = ( stats ) ? System.nanoTime() : 0L; LOG.tracev( "Unable to locate HQL query plan in cache; generating ({0})", queryString ); value = queryPlanCreator.createQueryPlan( queryString, shallow, enabledFilters, factory ); if ( stats ) { final long endTime = System.nanoTime(); final long microseconds = TimeUnit.MICROSECONDS.convert( endTime - startTime, TimeUnit.NANOSECONDS ); statistics.queryCompiled( queryString, microseconds ); } queryPlanCache.putIfAbsent( key, value ); } else { LOG.tracev( "Located HQL query plan in cache ({0})", queryString ); if ( stats ) { statistics.queryPlanCacheHit( queryString ); } } return value; }
Source:
public VolumeInfo copyVolumeFromSecToPrimary(VolumeInfo volume, VirtualMachine vm, VirtualMachineTemplate template, DataCenter dc, Pod pod, Long clusterId, ServiceOffering offering, DiskOffering diskOffering, List<StoragePool> avoids, long size, HypervisorType hyperType) throws NoTransitionException { final HashSet<StoragePool> avoidPools = new HashSet<StoragePool>(avoids); DiskProfile dskCh = createDiskCharacteristics(volume, template, dc, diskOffering); dskCh.setHyperType(vm.getHypervisorType()); storageMgr.setDiskProfileThrottling(dskCh, null, diskOffering); StoragePool destPool = findStoragePool(dskCh, dc, pod, clusterId, null, vm, avoidPools); if (destPool == null) { throw new CloudRuntimeException("Failed to find a storage pool with enough capacity to copy the volume to."); } DataStore destStore = dataStoreMgr.getDataStore(destPool.getId(), DataStoreRole.Primary); AsyncCallFuture<VolumeApiResult> future = volService.copyVolume(volume, destStore); try { VolumeApiResult result = future.get(); if (result.isFailed()) { s_logger.debug("copy volume failed: " + result.getResult()); throw new CloudRuntimeException("copy volume failed: " + result.getResult()); } return result.getVolume(); } catch (InterruptedException e) { s_logger.debug("Failed to copy volume: " + volume.getId(), e); throw new CloudRuntimeException("Failed to copy volume", e); } catch (ExecutionException e) { s_logger.debug("Failed to copy volume: " + volume.getId(), e); throw new CloudRuntimeException("Failed to copy volume", e); } }

Target:
public VolumeInfo copyVolumeFromSecToPrimary(VolumeInfo volume, VirtualMachine vm, VirtualMachineTemplate template, DataCenter dc, Pod pod, Long clusterId, ServiceOffering offering, DiskOffering diskOffering, List<StoragePool> avoids, long size, HypervisorType hyperType) throws NoTransitionException { final HashSet<StoragePool> avoidPools = new HashSet<StoragePool>(avoids); DiskProfile dskCh = createDiskCharacteristics(volume, template, dc, diskOffering); dskCh.setHyperType(vm.getHypervisorType()); storageMgr.setDiskProfileThrottling(dskCh, null, diskOffering); StoragePool destPool = findStoragePool(dskCh, dc, pod, clusterId, null, vm, avoidPools); if (destPool == null) { throw new CloudRuntimeException("Failed to find a suitable storage pool to create Volume in the pod/cluster of the provided VM "+ vm.getUuid()); } DataStore destStore = dataStoreMgr.getDataStore(destPool.getId(), DataStoreRole.Primary); AsyncCallFuture<VolumeApiResult> future = volService.copyVolume(volume, destStore); try { VolumeApiResult result = future.get(); if (result.isFailed()) { s_logger.debug("copy volume failed: " + result.getResult()); throw new CloudRuntimeException("copy volume failed: " + result.getResult()); } return result.getVolume(); } catch (InterruptedException e) { s_logger.debug("Failed to copy volume: " + volume.getId(), e); throw new CloudRuntimeException("Failed to copy volume", e); } catch (ExecutionException e) { s_logger.debug("Failed to copy volume: " + volume.getId(), e); throw new CloudRuntimeException("Failed to copy volume", e); } }
Source:
private void safeMove( final String s3Bucket, final String s3Path, final String targetS3Bucket, final String targetS3Path ) throws ServiceException, SegmentLoadingException { try { S3Utils.retryS3Operation( (Callable<Void>) () -> { final String copyMsg = StringUtils.format( "[s3://%s/%s] to [s3://%s/%s]", s3Bucket, s3Path, targetS3Bucket, targetS3Path ); try { selfCheckingMove(s3Bucket, targetS3Bucket, s3Path, targetS3Path, copyMsg); return null; } catch (Exception e) { log.info(e, "Error while trying to move " + copyMsg); throw e; } } ); } catch (Exception e) { Throwables.propagateIfInstanceOf(e, ServiceException.class); Throwables.propagateIfInstanceOf(e, SegmentLoadingException.class); throw Throwables.propagate(e); } }

Target:
private void safeMove( final String s3Bucket, final String s3Path, final String targetS3Bucket, final String targetS3Path ) throws ServiceException, SegmentLoadingException { try { S3Utils.retryS3Operation( (Callable<Void>) () -> { final String copyMsg = StringUtils.format( "[s3://%s/%s] to [s3://%s/%s]", s3Bucket, s3Path, targetS3Bucket, targetS3Path ); try { selfCheckingMove(s3Bucket, targetS3Bucket, s3Path, targetS3Path, copyMsg); return null; } catch (ServiceException | IOException | SegmentLoadingException e) { log.info(e, "Error while trying to move " + copyMsg); throw e; } } ); } catch (Exception e) { Throwables.propagateIfInstanceOf(e, ServiceException.class); Throwables.propagateIfInstanceOf(e, SegmentLoadingException.class); throw Throwables.propagate(e); } }
Source:
public String getCrepoKey() { return entry; }

Target:
public String getCrepoKey() { return key; }
Source:
public void createActions(IComparisonScope scope, Comparison comparison) { if (menuManager.isEmpty()) { IDifferenceFilter.Registry registry = EMFCompareRCPUIPlugin.getDefault() .getFilterActionRegistry(); Collection<IDifferenceFilter> filters = registry.getFilters(scope, comparison); for (IDifferenceFilter filter : filters) { FilterAction action = new FilterAction(filter.getLabel(), structureMergeViewerFilter, filter); if (filter.defaultSelected()) { action.setChecked(true); } menuManager.add(action); } structureMergeViewerFilter.addFilters(filters); } }

Target:
public void createActions(IComparisonScope scope, Comparison comparison) { if (menuManager.isEmpty()) { IDifferenceFilter.Registry registry = EMFCompareRCPUIPlugin.getDefault() .getFilterActionRegistry(); Collection<IDifferenceFilter> filters = registry.getFilters(scope, comparison); Collection<IDifferenceFilter> filtersSelected = Lists.newArrayList(); for (IDifferenceFilter filter : filters) { FilterAction action = new FilterAction(filter.getLabel(), structureMergeViewerFilter, filter); if (filter.defaultSelected()) { action.setChecked(true); filtersSelected.add(filter); } menuManager.add(action); } structureMergeViewerFilter.addFilters(filtersSelected); } }
Source:
protected boolean validateDiscardAfterDeleteLegal(StorageDomainValidator storageDomainValidator, Version compatibilityVersion) { if (getStorageDomain().isDiscardAfterDelete() && !FeatureSupported.discardAfterDeleteSupported(compatibilityVersion)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_DISCARD_AFTER_DELETE_NOT_SUPPORTED_BY_DC_VERSION, String.format("$dataCenterVersion %s", compatibilityVersion.toString())); } ArrayList<LUNs> luns = (ArrayList<LUNs>) runVdsCommand(VDSCommandType.GetDeviceList, new GetDeviceListVDSCommandParameters(getVds().getId(), getStorageDomain().getStorageType(), false, getParameters().getLunIds())).getReturnValue(); return validate(storageDomainValidator.isDiscardAfterDeleteLegalForNewBlockStorageDomain(luns)); }

Target:
protected boolean validateDiscardAfterDeleteLegal(StorageDomainValidator storageDomainValidator, Version compatibilityVersion) { if (!validate(storageDomainValidator.isDiscardAfterDeleteSupportedByDcVersion(compatibilityVersion))) { return false; } ArrayList<LUNs> luns = (ArrayList<LUNs>) runVdsCommand(VDSCommandType.GetDeviceList, new GetDeviceListVDSCommandParameters(getVds().getId(), getStorageDomain().getStorageType(), false, getParameters().getLunIds())).getReturnValue(); return validate(storageDomainValidator.isDiscardAfterDeleteLegalForNewBlockStorageDomain(luns)); }
Source:
public Optional<String> namespace() { return Optional.of("Jdbc namespace"); }

Target:
public Optional<String> namespace() { return Optional.empty(); }
Source:
private void toggleFollowStatus() { if (!NetworkUtils.checkConnection(getContext())) { return; } final boolean isAskingToFollow; if (mFeedId != 0) { isAskingToFollow = !ReaderBlogTable.isFollowedFeed(mFeedId); } else { isAskingToFollow = !ReaderBlogTable.isFollowedBlog(mBlogId); } ReaderActions.ActionListener listener = new ReaderActions.ActionListener() { @Override public void onActionResult(boolean succeeded) { if (!succeeded && getContext() != null) { int errResId = isAskingToFollow ? R.string.reader_toast_err_follow_blog : R.string.reader_toast_err_unfollow_blog; ToastUtils.showToast(getContext(), errResId); mFollowButton.setIsFollowed(!isAskingToFollow); } } }; boolean result; if (mFeedId != 0) { result = ReaderBlogActions.followFeedById(mFeedId, isAskingToFollow, listener); } else { result = ReaderBlogActions.followBlogById(mBlogId, isAskingToFollow, listener); } if (result) { mFollowButton.setIsFollowedAnimated(isAskingToFollow); } }

Target:
private void toggleFollowStatus() { if (!NetworkUtils.checkConnection(getContext())) { return; } final boolean isAskingToFollow; if (mFeedId != 0) { isAskingToFollow = !ReaderBlogTable.isFollowedFeed(mFeedId); } else { isAskingToFollow = !ReaderBlogTable.isFollowedBlog(mBlogId); } ReaderActions.ActionListener listener = new ReaderActions.ActionListener() { @Override public void onActionResult(boolean succeeded) { if (getContext() == null) { return; } mFollowButton.setEnabled(true); if (!succeeded) { int errResId = isAskingToFollow ? R.string.reader_toast_err_follow_blog : R.string.reader_toast_err_unfollow_blog; ToastUtils.showToast(getContext(), errResId); mFollowButton.setIsFollowed(!isAskingToFollow); } } }; mFollowButton.setEnabled(false); boolean result; if (mFeedId != 0) { result = ReaderBlogActions.followFeedById(mFeedId, isAskingToFollow, listener); } else { result = ReaderBlogActions.followBlogById(mBlogId, isAskingToFollow, listener); } if (result) { mFollowButton.setIsFollowedAnimated(isAskingToFollow); } }
Source:
public Map<TaskId, TaskState> getHMTasks() { Map<String, TaskStateData> taskStateMap = jobStateData.getTasks(); Map<TaskId, TaskState> hmTasks = new HashMap<>(); for (TaskStateData ts : taskStateMap.values()) { TaskIdData taskIdData = ts.getTaskInfo().getTaskId(); hmTasks.put(DataUtility.taskId(DataUtility.jobId(jobStateData.getJobInfo().getJobId()), taskIdData), DataUtility.taskState(ts)); } return hmTasks; }

Target:
public Map<TaskId, TaskState> getHMTasks() { Map<String, TaskStateData> taskStateDataMap = jobStateData.getTasks(); Map<TaskId, TaskState> taskStateMap = new HashMap<>(); for (TaskStateData taskStateData : taskStateDataMap.values()) { TaskIdData taskIdData = taskStateData.getTaskInfo().getTaskId(); taskStateMap.put(DataUtility.taskId(DataUtility.jobId(jobStateData.getJobInfo().getJobId()), taskIdData), DataUtility.taskState(taskStateData)); } return taskStateMap; }
Source:
protected Void doInBackground(Void... params) { MimeMessage message; try { message = createMessage(); } catch (Exception me) { Log.e(K9.LOG_TAG, "Failed to create new message for send or save.", me); throw new RuntimeException("Failed to create a new message for send or save.", me); } try { mContacts.markAsContacted(message.getRecipients(RecipientType.TO)); mContacts.markAsContacted(message.getRecipients(RecipientType.CC)); mContacts.markAsContacted(message.getRecipients(RecipientType.BCC)); } catch (Exception e) { Log.e(K9.LOG_TAG, "Failed to mark contact as contacted.", e); } MessagingController.getInstance(getApplication()).sendMessage(mAccount, message, null); long draftId = mDraftId; if (draftId != INVALID_DRAFT_ID) { mDraftId = INVALID_DRAFT_ID; MessagingController.getInstance(getApplication()).deleteDraft(mAccount, draftId); } return null; }

Target:
protected Void doInBackground(Void... params) { MimeMessage message; try { message = createMessage(); } catch (OpenPgpApiException e){ Log.e(K9.LOG_TAG, "Failed to create new message for send or save.", e); throw new RuntimeException("Failed to create a new message for send or save.", e); } catch (MessagingException me) { Log.e(K9.LOG_TAG, "Failed to create new message for send or save.", me); throw new RuntimeException("Failed to create a new message for send or save.", me); } try { mContacts.markAsContacted(message.getRecipients(RecipientType.TO)); mContacts.markAsContacted(message.getRecipients(RecipientType.CC)); mContacts.markAsContacted(message.getRecipients(RecipientType.BCC)); } catch (Exception e) { Log.e(K9.LOG_TAG, "Failed to mark contact as contacted.", e); } MessagingController.getInstance(getApplication()).sendMessage(mAccount, message, null); long draftId = mDraftId; if (draftId != INVALID_DRAFT_ID) { mDraftId = INVALID_DRAFT_ID; MessagingController.getInstance(getApplication()).deleteDraft(mAccount, draftId); } return null; }
Source:
public static void compareAndSetMaxLong( Object object, long fieldOffset, long newValue ) { long currentValue; do { currentValue = UnsafeUtil.getLong( object, fieldOffset ); if ( currentValue >= newValue ) { return; } } while ( !UnsafeUtil.compareAndSwapLong( object, fieldOffset, currentValue, newValue ) ); }

Target:
public static void compareAndSetMaxLong( Object object, long fieldOffset, long newValue ) { long currentValue; do { currentValue = UnsafeUtil.getLongVolatile( object, fieldOffset ); if ( currentValue >= newValue ) { return; } } while ( !UnsafeUtil.compareAndSwapLong( object, fieldOffset, currentValue, newValue ) ); }
Source:
public Iterator<List<ExternalTupleSet>> getValidIndexCombos( List<ExternalTupleSet> indexSet) { Collections.shuffle(indexSet); final List<ExternalTupleSet> list = indexSet; final Iterator<List<Integer>> iter = getValidCombos(list); return new Iterator<List<ExternalTupleSet>>() { private List<ExternalTupleSet> next = null; private List<Integer> nextCombo = null; private boolean hasNextCalled = false; private boolean isEmpty = false; @Override public boolean hasNext() { if (!hasNextCalled && !isEmpty) { if (!iter.hasNext()) { isEmpty = true; return false; } else { nextCombo = iter.next(); List<ExternalTupleSet> indexCombo = Lists .newArrayList(); for (Integer i : nextCombo) { indexCombo.add(list.get(i)); } next = indexCombo; hasNextCalled = true; return true; } } else return !isEmpty; } @Override public List<ExternalTupleSet> next() { if (hasNextCalled) { hasNextCalled = false; return next; } else if (isEmpty) { throw new NoSuchElementException(); } else { if (this.hasNext()) { hasNextCalled = false; return next; } else { throw new NoSuchElementException(); } } } @Override public void remove() { throw new UnsupportedOperationException( "Cannot delete from iterator!"); } }; }

Target:
public Iterator<List<ExternalTupleSet>> getValidIndexCombos( List<ExternalTupleSet> indexSet) { Collections.shuffle(indexSet); final List<ExternalTupleSet> list = indexSet; final Iterator<List<Integer>> iter = getValidCombos(list); return new Iterator<List<ExternalTupleSet>>() { private List<ExternalTupleSet> next = null; private List<Integer> nextCombo = null; private boolean hasNextCalled = false; private boolean isEmpty = false; @Override public boolean hasNext() { if (!hasNextCalled && !isEmpty) { if (!iter.hasNext()) { isEmpty = true; return false; } else { nextCombo = iter.next(); List<ExternalTupleSet> indexCombo = Lists .newArrayList(); for (Integer i : nextCombo) { indexCombo.add(list.get(i)); } next = indexCombo; hasNextCalled = true; return true; } } else { return !isEmpty; } } @Override public List<ExternalTupleSet> next() { if (hasNextCalled) { hasNextCalled = false; return next; } else if (isEmpty) { throw new NoSuchElementException(); } else { if (this.hasNext()) { hasNextCalled = false; return next; } else { throw new NoSuchElementException(); } } } @Override public void remove() { throw new UnsupportedOperationException( "Cannot delete from iterator!"); } }; }
Source:
public List<TaskInfo> apply(ConfigResource resource) throws AuthException, ResourceNotFoundException { CurrentUser user = self.get(); if (user instanceof AnonymousUser) { throw new AuthException("Authentication required"); } else if (!user.isIdentifiedUser()) { throw new ResourceNotFoundException(); } List<TaskInfo> allTasks = getTasks(); if (user.getCapabilities().canViewQueue()) { return allTasks; } else { List<TaskInfo> visibleTasks = new ArrayList<>(); for (TaskInfo task : allTasks) { if (task.projectName != null) { ProjectState e = projectCache.get(new Project.NameKey(task.projectName)); if (e != null && e.controlFor(user).isVisible()) { visibleTasks.add(task); } } } return visibleTasks; } }

Target:
public List<TaskInfo> apply(ConfigResource resource) throws AuthException { CurrentUser user = self.get(); if (!user.isIdentifiedUser()) { throw new AuthException("Authentication required"); } List<TaskInfo> allTasks = getTasks(); if (user.getCapabilities().canViewQueue()) { return allTasks; } else { Map<String, Boolean> visibilityCache = new HashMap<>(); List<TaskInfo> visibleTasks = new ArrayList<>(); for (TaskInfo task : allTasks) { if (task.projectName != null) { Boolean visible = visibilityCache.get(task.projectName); if (visible == null) { ProjectState e = projectCache.get(new Project.NameKey(task.projectName)); visible = e != null ? e.controlFor(user).isVisible() : false; visibilityCache.put(task.projectName, visible); } if (visible) { visibleTasks.add(task); } } } return visibleTasks; } }
Source:
private StatusAdapter getSingleSelection() { IStructuredSelection rawSelection = statusListViewer.getStructuredSelection(); if (rawSelection != null && rawSelection.size() == 1) { return (StatusAdapter) rawSelection.getFirstElement(); } return null; }

Target:
private StatusAdapter getSingleSelection() { IStructuredSelection selection = statusListViewer.getStructuredSelection(); if (selection != null && selection.size() == 1) { return (StatusAdapter) selection.getFirstElement(); } return null; }
Source:
public void test_sleepJ() { long stime = 0, ftime = 0; try { stime = System.currentTimeMillis(); Thread.sleep(1000); ftime = System.currentTimeMillis(); } catch (InterruptedException e) { fail("Unexpected interrupt received"); } long result = ftime - stime; assertTrue("Failed to sleep long enough: " + result, result >= 998); assertTrue("Overslept: " + result, result <= 1300); }

Target:
public void test_sleepJ() { long stime = 0, ftime = 0; try { stime = System.currentTimeMillis(); Thread.sleep(1000); ftime = System.currentTimeMillis(); } catch (InterruptedException e) { fail("Unexpected interrupt received"); } long elapsedMillis = ftime - stime; assertTrue("Failed to sleep long enough: " + elapsedMillis, elapsedMillis >= 998); assertTrue("Overslept: " + elapsedMillis, elapsedMillis <= 1300); }
Source:
protected void close() { try { task.stop(); } catch (Throwable t) { log.warn("Could not stop task", t); } if (consumer != null) { try { consumer.close(); } catch (Throwable t) { log.warn("Could not close consumer", t); } } try { transformationChain.close(); } catch (Throwable t) { log.warn("Could not close transformation chain", t); } try { retryWithToleranceOperator.close(); } catch (Throwable t) { log.warn("Could not close retry operator", t); } }

Target:
protected void close() { try { task.stop(); } catch (Throwable t) { log.warn("Could not stop task", t); } if (consumer != null) { try { consumer.close(); } catch (Throwable t) { log.warn("Could not close consumer", t); } } try { transformationChain.close(); } catch (Throwable t) { log.warn("Could not close transformation chain", t); } Utils.closeQuietly(retryWithToleranceOperator, "retry operator"); }
Source:
public static String getUserTimeZonePostfix() { if (!useUserTimeZone()) { return ""; } TimeZone tz = TimeZone.getTimeZone(getUserTimeZone()); return tz.getDisplayName(tz.observesDaylightTime(), TimeZone.SHORT); }

Target:
public static String getUserTimeZonePostfix() { if (!isUserTimeZoneOverride()) { return ""; } TimeZone tz = TimeZone.getTimeZone(getUserTimeZone()); return tz.getDisplayName(tz.observesDaylightTime(), TimeZone.SHORT); }
Source:
public void setDeviceTags() { setTag("Device", DeviceUtils.getModel()); setTag("OS", "Android " + DeviceUtils.getOsVersion()); setTag("Language", DeviceUtils.getLanguage()); setTag("Time Zone", DeviceUtils.getTimeZone()); try { PackageInfo packageInfo = GrowthbeatCore.getInstance().getContext().getPackageManager() .getPackageInfo(GrowthbeatCore.getInstance().getContext().getPackageName(), PackageManager.GET_META_DATA); setTag("Version", packageInfo.versionName); setTag("Build", String.valueOf(packageInfo.versionCode)); } catch (PackageManager.NameNotFoundException e) { } }

Target:
public void setDeviceTags() { setTag("Device", DeviceUtils.getModel()); setTag("OS", "Android " + DeviceUtils.getOsVersion()); setTag("Language", DeviceUtils.getLanguage()); setTag("Time Zone", DeviceUtils.getTimeZone()); setTag("Version", AppUtils.getaAppVersion(GrowthbeatCore.getInstance().getContext())); setTag("Build", AppUtils.getAppBuild(GrowthbeatCore.getInstance().getContext())); }
Source:
public void getConceptByNameOrIdOrMap_shouldFindAConceptByItsUuid() { String uuid = "0cbe2ed3-cd5f-4f46-9459-26127c9265ab"; Concept concept = Context.getConceptService().getConceptByNameOrIdOrMap(uuid); Assert.assertEquals(3, (int) concept.getConceptId()); }

Target:
public void getConceptByNameOrIdOrMap_shouldFindAConceptByItsUuid() { String uuid = "7d104a6f-8337-4afa-b936-41083a5d9d88"; Assert.assertEquals(uuid, conceptService.getConceptByNameOrIdOrMap(uuid).getUuid()); }
Source:
private void setIncludedResources(Set<IResource> includedResources) { this.includedPaths = includedResources; Set<String> paths = new LinkedHashSet<String>(includedResources.size()); RepositoryMapping rm = RepositoryMapping.findRepositoryMapping(repo); for (IResource resource : includedResources) { String repoRelativePath = rm.getRepoRelativePath(resource); if (repoRelativePath.length() > 0) paths.add(repoRelativePath); } if (!paths.isEmpty()) pathFilter = PathFilterGroup.createFromStrings(paths); }

Target:
public void setIncludedResources(Set<IResource> includedResources) { this.includedResources = includedResources; Set<String> paths = new HashSet<String>(); RepositoryMapping rm = RepositoryMapping.findRepositoryMapping(repo); for (IResource resource : includedResources) { String repoRelativePath = rm.getRepoRelativePath(resource); if (repoRelativePath.length() > 0) paths.add(repoRelativePath); } if (!paths.isEmpty()) pathFilter = PathFilterGroup.createFromStrings(paths); }
Source:
public void setEnvironment(Environment environment) { this.environment = (ConfigurableEnvironment) environment; }

Target:
public void setEnvironment(Environment environment) { Assert.isInstanceOf(ConfigurableEnvironment.class, environment, "unsupported environment type. " + environment.getClass()); this.environment = (ConfigurableEnvironment) environment; }
Source:
private ConsumerRecords<K, V> poll(final Timer timer, final boolean includeMetadataInTimeout) { acquireAndEnsureOpen(); try { if (this.subscriptions.hasNoSubscriptionOrUserAssignment()) { throw new IllegalStateException("Consumer is not subscribed to any topics or assigned any partitions"); } do { client.maybeTriggerWakeup(); if (includeMetadataInTimeout) { updateAssignmentMetadataIfNeeded(time.timer(0L)); } else { while (!updateAssignmentMetadataIfNeeded(time.timer(Long.MAX_VALUE))) { log.warn("Still waiting for metadata"); } } final Map<TopicPartition, List<ConsumerRecord<K, V>>> records = pollForFetches(timer); if (!records.isEmpty()) { if (fetcher.sendFetches() > 0 || client.hasPendingRequests()) { client.pollNoWakeup(); } final Set<TopicPartition> assignedPartitions = subscriptions.assignedPartitions(); return this.interceptors.onConsume(new ConsumerRecords<>(records.entrySet() .stream() .filter(entry -> assignedPartitions.contains(entry.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)))); } } while (timer.notExpired()); return ConsumerRecords.empty(); } finally { release(); } }

Target:
private ConsumerRecords<K, V> poll(final Timer timer, final boolean includeMetadataInTimeout) { acquireAndEnsureOpen(); try { this.kafkaConsumerMetrics.recordPollStart(timer.currentTimeMs()); if (this.subscriptions.hasNoSubscriptionOrUserAssignment()) { throw new IllegalStateException("Consumer is not subscribed to any topics or assigned any partitions"); } do { client.maybeTriggerWakeup(); if (includeMetadataInTimeout) { updateAssignmentMetadataIfNeeded(time.timer(0L)); } else { while (!updateAssignmentMetadataIfNeeded(time.timer(Long.MAX_VALUE))) { log.warn("Still waiting for metadata"); } } final Map<TopicPartition, List<ConsumerRecord<K, V>>> records = pollForFetches(timer); if (!records.isEmpty()) { if (fetcher.sendFetches() > 0 || client.hasPendingRequests()) { client.transmitSends(); } return this.interceptors.onConsume(new ConsumerRecords<>(records)); } } while (timer.notExpired()); return ConsumerRecords.empty(); } finally { release(); this.kafkaConsumerMetrics.recordPollEnd(timer.currentTimeMs()); } }
Source:
public UserDTO addUser(UserDTO userResource) { validateUserFields(userResource); User user = userResource.createUserEntity(); user = User.getRepository().save(user); UserDTO savedUser = UserDTO.createInstanceWithPrivateData(user); return savedUser; }

Target:
public UserDTO addUser(UserDTO userResource) { validateUserFields(userResource); User userEntity = userResource.createUserEntity(); userEntity = User.getRepository().save(userEntity); return UserDTO.createInstanceWithPrivateData(userEntity); }