auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setupMock() { clusterUtils = mock(ClusterUtils.class); vdsDao = mock(VdsDAO.class); volumeDao = mock(GlusterVolumeDao.class); brickDao = mock(GlusterBrickDao.class); doReturn(clusterUtils).when(getQuery()).getClusterUtils(); doReturn(getVds(VDSStatus.Up)).when(clusterUtils).getUpServer(CLUSTER_ID); doReturn(vdsDao).when(clusterUtils).getVdsDao(); doReturn(vdsDao).when(getQuery()).getVdsDao(); when(vdsDao.getAllForVdsGroupWithStatus(CLUSTER_ID, VDSStatus.Up)).thenReturn(Collections.singletonList(getVds(VDSStatus.Up))); when(vdsDao.get(SERVER_ID)).thenReturn(getVds(VDSStatus.Up)); doReturn(volumeDao).when(getQuery()).getGlusterVolumeDao(); when(volumeDao.getById(VOLUME_ID)).thenReturn(getVolume()); doReturn(brickDao).when(getQuery()).getGlusterBrickDao(); when(brickDao.getById(BRICK_ID)).thenReturn(getBrick()); doReturn(CLUSTER_ID).when(getQueryParameters()).getClusterId(); doReturn(VOLUME_ID).when(getQueryParameters()).getVolumeId(); doReturn(BRICK_ID).when(getQueryParameters()).getBrickId(); doReturn(true).when(getQueryParameters()).isDetailRequired(); VDSReturnValue returnValue = new VDSReturnValue(); returnValue.setSucceeded(true); returnValue.setReturnValue(expectedVolumeAdvancedDetails); doReturn(returnValue).when(getQuery()).runVdsCommand(eq(VDSCommandType.GetGlusterVolumeAdvancedDetails), any(VDSParametersBase.class)); }

Target:
private void setupMock() { clusterUtils = mock(ClusterUtils.class); vdsDao = mock(VdsDAO.class); volumeDao = mock(GlusterVolumeDao.class); brickDao = mock(GlusterBrickDao.class); doReturn(vdsDao).when(getQuery()).getVdsDao(); doReturn(volumeDao).when(getQuery()).getGlusterVolumeDao(); when(volumeDao.getById(VOLUME_ID)).thenReturn(getVolume()); doReturn(brickDao).when(getQuery()).getGlusterBrickDao(); when(brickDao.getById(BRICK_ID)).thenReturn(getBrick()); doReturn(CLUSTER_ID).when(getQueryParameters()).getClusterId(); doReturn(VOLUME_ID).when(getQueryParameters()).getVolumeId(); doReturn(true).when(getQueryParameters()).isDetailRequired(); VDSReturnValue returnValue = new VDSReturnValue(); returnValue.setSucceeded(true); returnValue.setReturnValue(expectedVolumeAdvancedDetails); doReturn(returnValue).when(getQuery()).runVdsCommand(eq(VDSCommandType.GetGlusterVolumeAdvancedDetails), any(VDSParametersBase.class)); }
Source:
public void test_Call_Method_In_JDK_Sandbox_Thread_Safety() throws Exception { final OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null); final GenericService service = new GenericServiceImpl(); MethodBodyExecutionSandbox.enable(null, null, null); try { final int NUM_THREADS = 1000; final int MAX_WAIT_MS = 3000; ExecutorService exec = Executors.newFixedThreadPool(NUM_THREADS); final CountDownLatch allThreadsWaitOnThis = new CountDownLatch(1); final AtomicInteger numThreadsFailedTest = new AtomicInteger(0); for (int i = 0; i < NUM_THREADS; ++i) { exec.submit(new Runnable() { public void run() { try { allThreadsWaitOnThis.await(); } catch (InterruptedException ignored) { } try { Thread.sleep((long) (Math.random() * MAX_WAIT_MS)); } catch (InterruptedException ignored) { } Object[] args = OgnlRuntime.getObjectArrayPool().create(1); args[0] = Math.random() * MAX_WAIT_MS; try { OgnlRuntime.callMethod(context, service, "exec", args); numThreadsFailedTest.incrementAndGet(); } catch (Exception ex) { if (!(ex.getCause() instanceof SecurityException)) { numThreadsFailedTest.incrementAndGet(); } } } }); } allThreadsWaitOnThis.countDown(); Thread.sleep(MAX_WAIT_MS * 2); exec.shutdown(); exec.awaitTermination(MAX_WAIT_MS * 2, TimeUnit.MILLISECONDS); assertTrue(exec.isTerminated()); assertEquals(0, numThreadsFailedTest.get()); } finally { MethodBodyExecutionSandbox.disable(); } }

Target:
public void test_Call_Method_In_JDK_Sandbox_Thread_Safety() throws Exception { final OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null); final GenericService service = new GenericServiceImpl(); boolean temporaryEnabled = false; try { System.setProperty("ognl.security.manager", ""); temporaryEnabled = true; } catch (Exception ignore) { } try { final int NUM_THREADS = 100; final int MAX_WAIT_MS = 300; ExecutorService exec = Executors.newFixedThreadPool(NUM_THREADS); final CountDownLatch allThreadsWaitOnThis = new CountDownLatch(1); final AtomicInteger numThreadsFailedTest = new AtomicInteger(0); for (int i = 0; i < NUM_THREADS; ++i) { exec.submit(new Runnable() { public void run() { try { allThreadsWaitOnThis.await(); } catch (InterruptedException ignored) { } try { Thread.sleep((long) (Math.random() * MAX_WAIT_MS)); } catch (InterruptedException ignored) { } Object[] args = OgnlRuntime.getObjectArrayPool().create(1); args[0] = Math.random() * MAX_WAIT_MS; try { OgnlRuntime.callMethod(context, service, "exec", args); numThreadsFailedTest.incrementAndGet(); } catch (Exception ex) { if (!((ex.getCause() instanceof InvocationTargetException && ((InvocationTargetException)ex.getCause()).getTargetException().getMessage().contains("execute")) || (ex.getCause() instanceof SecurityException && ex.getCause().getMessage().contains("createClassLoader")))) { numThreadsFailedTest.incrementAndGet(); } } } }); } allThreadsWaitOnThis.countDown(); Thread.sleep(MAX_WAIT_MS * 3); exec.shutdown(); exec.awaitTermination(MAX_WAIT_MS * 3, TimeUnit.MILLISECONDS); assertTrue(exec.isTerminated()); assertEquals(0, numThreadsFailedTest.get()); } finally { if (temporaryEnabled) { System.clearProperty("ognl.security.manager"); } } }
Source:
private SampleTester(Consumer<Sample> callback) { ArrayList<GError> errors = new ArrayList<GError>(); String pipeline_descr = "videotestsrc is-live=true ! videoconvert ! appsink name=myappsink"; Bin bin = Gst.parseBinFromDescription(pipeline_descr, false, errors); assertNotNull("Unable to create Bin from pipeline description: ", bin); AppSink appSink = (AppSink)bin.getElementByName("myappsink"); appSink.set("emit-signals", true); NewSampleListener sampleListener = new NewSampleListener(callback); appSink.connect(sampleListener); bin.play(); try { synchronized (sampleListener) { sampleListener.wait(); } } catch (InterruptedException e) { fail("Unexpected interruption waiting for sample"); } bin.stop(); appSink.disconnect(sampleListener); if (sampleListener.exception != null) { throw new AssertionError(sampleListener.exception); } }

Target:
private SampleTester(Consumer<Sample> callback) { ArrayList<GError> errors = new ArrayList<GError>(); String pipeline_descr = "videotestsrc ! videoconvert ! appsink name=myappsink"; Bin bin = Gst.parseBinFromDescription(pipeline_descr, false, errors); assertNotNull("Unable to create Bin from pipeline description: ", bin); AppSink appSink = (AppSink)bin.getElementByName("myappsink"); appSink.set("emit-signals", true); NewSampleListener sampleListener = new NewSampleListener(callback); appSink.connect(sampleListener); bin.play(); try { synchronized (sampleListener) { sampleListener.wait(); } } catch (InterruptedException e) { fail("Unexpected interruption waiting for sample"); } bin.stop(); appSink.disconnect(sampleListener); if (sampleListener.exception != null) { throw new AssertionError(sampleListener.exception); } }
Source:
private LoadingCache<Cell, byte[]> createNewCacheForTable(TableReference tableRef) { return CacheBuilder.newBuilder() .softValues() .maximumWeight(maxCacheWeightPerTable) .weigher((Weigher<Cell, byte[]>) (key, value) -> value.length) .build(getCacheLoader(tableRef)); }

Target:
private LoadingCache<Cell, byte[]> createNewCacheForTable(TableReference tableRef) { return CacheBuilder.newBuilder() .softValues() .maximumWeight(maxCacheWeightPerTable) .weigher((Weigher<Cell, byte[]>) (key, value) -> value.length) .removalListener(notification -> { if (log.isDebugEnabled() && notification.wasEvicted()) { String rowName = notification.getKey() == null ? "null cell" : Arrays.toString(notification.getKey().getRowName()); String colName = notification.getKey() == null ? "null cell" : Arrays.toString(notification.getKey().getColumnName()); log.debug("Removing entry from caching transaction cache: Table {}, Row {}, Column {}," + " Eviction reason {}", tableRef.getQualifiedName(), rowName, colName, notification.getCause().toString()); } }) .build(getCacheLoader(tableRef)); }
Source:
public ScalerUnit getScalerUnit() { return this.scalerUnit; }

Target:
public ScalerUnit getScalerUnit() { return new ScalerUnit(this.scalerUnit.getDlmsUnit(), this.scalerUnit.getScaler()); }
Source:
public SpiderHtmlFormParser(SpiderParam param, ValueGenerator valueGenerator) { super(); if (param == null) { throw new IllegalArgumentException("Parameter param must not be null."); } this.param = param; this.valueGenerator = valueGenerator; }

Target:
public SpiderHtmlFormParser(SpiderParam param, ValueGenerator valueGenerator) { super(); if (param == null) { throw new IllegalArgumentException("Parameter param must not be null."); } if (valueGenerator == null){ throw new IllegalArgumentException("Parameter valueGenerator must not be null."); } this.param = param; this.valueGenerator = valueGenerator; }
Source:
public void testIntRead() throws Exception { MessageType requestedSchema = parseMessageType("message test { required int32 int32_field;}"); ParquetMetadata metadata = ParquetFileReader.readFooter(conf, file); ParquetFileReader fileReader = new ParquetFileReader(conf, metadata.getFileMetaData(), file, metadata.getBlocks(), requestedSchema.getColumns()); DictionaryPageReadStore dictionaryReadStore = fileReader.readNextRowGroupDictionaries(requestedSchema); ColumnDescriptor column = requestedSchema.getColumns().get(0); DictionaryPageReader dictionaryPageReader = dictionaryReadStore.getDictionaryPageReader(column); DictionaryPage dictionaryPage = dictionaryPageReader.readDictionaryPage(); Dictionary dictionary = dictionaryPage.getEncoding().initDictionary(column, dictionaryPage); for (int i = 0; i < intValues.length; i++) { assertEquals(intValues[i % intValues.length], dictionary.decodeToInt(i)); } fileReader.close(); }

Target:
public void testIntRead() throws Exception { MessageType requestedSchema = parseMessageType("message test { required int32 int32_field;}"); ParquetMetadata metadata = ParquetFileReader.readFooter(conf, file); ParquetFileReader fileReader = new ParquetFileReader(conf, metadata.getFileMetaData(), file, metadata.getBlocks(), requestedSchema.getColumns()); DictionaryPageReadStore dictionaryReadStore = fileReader.getCurrentRowGroupDictionaries(requestedSchema); ColumnDescriptor column = requestedSchema.getColumns().get(0); DictionaryReader dictionaryReader = new DictionaryReader(column, dictionaryReadStore); Dictionary dictionary = dictionaryReader.readDictionary(); for (int i = 0; i < intValues.length; i++) { assertEquals(intValues[i % intValues.length], dictionary.decodeToInt(i)); } fileReader.close(); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } Condition condition = (Condition) o; if (!patient.equals(condition.patient)) { return false; } if (clinicalStatus != condition.clinicalStatus) { return false; } if (verificationStatus != condition.verificationStatus) { return false; } if (this.condition.getCoded() != null ? !this.condition.getCoded().equals(condition.getCondition().getCoded()) : condition.getCondition().getCoded() != null) { return false; } if (this.condition.getNonCoded() != null ? !this.condition.getNonCoded().equals(condition.getCondition().getNonCoded()) : condition.getCondition().getNonCoded() != null) { return false; } if (onsetDate != null ? !onsetDate.equals(condition.onsetDate) : condition.onsetDate != null) { return false; } if (additionalDetail != null ? !additionalDetail.equals(condition.additionalDetail) : condition.additionalDetail != null) { return false; } if (endDate != null ? !endDate.equals(condition.endDate) : condition.endDate != null) { return false; } return endReason != null ? endReason.equals(condition.endReason) : condition.endReason == null; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } Condition condition = (Condition) o; if (!patient.equals(condition.patient)) { return false; } if (clinicalStatus != condition.clinicalStatus) { return false; } if (verificationStatus != condition.verificationStatus) { return false; } if (this.condition.getCoded() != null && !this.condition.getCoded().equals(condition.getCondition().getCoded())) { return false; } if (this.condition.getNonCoded() != null ? !this.condition.getNonCoded().equals(condition.getCondition().getNonCoded()) : condition.getCondition().getNonCoded() != null) { return false; } if (onsetDate != null ? !onsetDate.equals(condition.onsetDate) : condition.onsetDate != null) { return false; } if (additionalDetail != null ? !additionalDetail.equals(condition.additionalDetail) : condition.additionalDetail != null) { return false; } if (endDate != null ? !endDate.equals(condition.endDate) : condition.endDate != null) { return false; } return endReason != null ? endReason.equals(condition.endReason) : condition.endReason == null; }
Source:
public void performRemove(String id) { StorageDomain storageDomain = getAttachedStorageDomainSubResource(id).get(); if (storageDomain.getStorage().getType().equals(StorageType.LOCALFS.value())) { RemoveStorageDomainParameters params = new RemoveStorageDomainParameters(asGuid(id)); params.setDoFormat(true); performAction(VdcActionType.RemoveStorageDomain, params); } else { performAction(VdcActionType.DetachStorageDomainFromPool, new DetachStorageDomainFromPoolParameters(asGuid(id), dataCenterId)); } }

Target:
public Response performRemove(String id) { StorageDomain storageDomain = getAttachedStorageDomainSubResource(id).get(); if (storageDomain.getStorage().getType().equals(StorageType.LOCALFS.value())) { RemoveStorageDomainParameters params = new RemoveStorageDomainParameters(asGuid(id)); params.setDoFormat(true); return (performAction(VdcActionType.RemoveStorageDomain, params)); } else { return (performAction(VdcActionType.DetachStorageDomainFromPool, new DetachStorageDomainFromPoolParameters(asGuid(id), dataCenterId))); } }
Source:
private boolean checkFileAreSame(String filePath1, String filePath) { try (BufferedReader br = new BufferedReader(new FileReader(new File(filePath)))) { try (BufferedReader br2 = new BufferedReader(new FileReader(new File(filePath1)))) { String lineRead = br.readLine(); String lineRead2 = br2.readLine(); while (lineRead != null) { if (!lineRead.equals(lineRead2)) { return false; } lineRead = br.readLine(); lineRead2 = br2.readLine(); } } } catch (IOException e) { e.printStackTrace(); } return true; }

Target:
private boolean checkFileAreSame(String filePath1, String filePath) throws IOException { try (BufferedReader br = new BufferedReader(new FileReader(new File(filePath)))) { try (BufferedReader br2 = new BufferedReader(new FileReader(new File(filePath1)))) { String lineRead = br.readLine(); String lineRead2 = br2.readLine(); while (lineRead != null) { if (!lineRead.equals(lineRead2)) { return false; } lineRead = br.readLine(); lineRead2 = br2.readLine(); } } } return true; }
Source:
public static void main(String[] args) { NewCalendar myCalendar = new NewCalendar(); TimeZone tZone = TimeZone.getDefault(); Calendar calendar = Calendar.getInstance(); boolean printWeek = false; boolean printZone = false; for (int i = 0; i < args.length; ++i) { if (args[i].equals("-w")) { printWeek = true; } else if (args[i].equals("-m") && args.length >= i + 2) { try { int month = Integer.parseInt(args[++i]); if (month <= calendar.getActualMaximum(Calendar.MONTH) && month >= calendar .getActualMinimum(Calendar.MONTH)) { calendar.set(Calendar.MONTH, month); } else { throw new Exception(); } } catch (Exception e) { Errors.printErrAndExit("Kye '-m': Invalid argument. Use: [-m MONTH] , MONTH = {1, ..., 12}"); } } else if (args[i].equals("-y") && args.length >= i + 2) { try { int year = Integer.parseInt(args[++i]); if (year >= 999 && year <= 10000) { calendar.set(Calendar.YEAR, year); } else { throw new Exception(); } } catch (Exception e) { Errors.printErrAndExit("Kye '-y': Invalid argument. Use: [-y YEAR] , YEAR = 4 digits."); } } else if (args[i].equals("-t") && args.length >= i + 2) { tZone = TimeZone.getTimeZone(args[++i]); printZone = true; } else { Errors.printErrAndExit("Invalid argument. Use: 'java Calendar [-m MONTH] [-y YEAR] [-w] [-t TIMEZONE]'."); } } myCalendar.executeCalendar(calendar, printWeek, tZone, printZone); }

Target:
public static void main(String[] args) { NewCalendar myCalendar = new NewCalendar(); TimeZone tZone = TimeZone.getDefault(); Calendar calendar = Calendar.getInstance(); boolean printWeek = false; boolean printZone = false; for (int i = 0; i < args.length; ++i) { if (args[i].equals("-w")) { printWeek = true; } else if (args[i].equals("-m") && args.length >= i + 2) { try { int month = Integer.parseInt(args[++i]); if (month <= calendar.getActualMaximum(Calendar.MONTH) && month >= calendar .getActualMinimum(Calendar.MONTH)) { calendar.set(Calendar.MONTH, --month); } else { throw new Exception(); } } catch (Exception e) { Closers.printErrAndExit("Key '-m': Invalid argument. Use: [-m MONTH] , MONTH = {1, ..., 12}"); } } else if (args[i].equals("-y") && args.length >= i + 2) { try { int year = Integer.parseInt(args[++i]); if (year >= 999 && year <= 10000) { calendar.set(Calendar.YEAR, year); } else { throw new Exception(); } } catch (Exception e) { Closers.printErrAndExit("Key '-y': Invalid argument. Use: [-y YEAR] , YEAR = 4 digits."); } } else if (args[i].equals("-t") && args.length >= i + 2) { tZone = TimeZone.getTimeZone(args[++i]); printZone = true; } else { Closers.printErrAndExit("Invalid argument. Use: 'java Calendar [-m MONTH] [-y YEAR] [-w] [-t TIMEZONE]'."); } } myCalendar.executeCalendar(calendar, printWeek, tZone, printZone); }
Source:
public static <A> F<Future<A>, P1<Either<Exception, A>>> Future_P1() { return a -> new P1<Either<Exception, A>>() { @SuppressWarnings({"OverlyBroadCatchBlock"}) public Either<Exception, A> _1() { Either<Exception, A> r; try { r = Either.right(a.get()); } catch (Exception e) { r = Either.left(e); } return r; } }; }

Target:
public static <A> F<Future<A>, P1<Either<Exception, A>>> Future_P1() { return a -> P.lazy(u -> { Either<Exception, A> r; try { r = Either.right(a.get()); } catch (Exception e) { r = Either.left(e); } return r; }); }
Source:
public void AddPenaltyModel(String id, boolean foulout_explusion, int period, int jam, String code) { synchronized (penaltiesLock) { if (foulout_explusion && code != null) { Penalty prev = foexp_penalty; id = UUID.randomUUID().toString(); if (prev != null) { id = prev.getId(); } foexp_penalty = new DefaultPenaltyModel(id, period, jam, code); scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_PENALTY_FOEXP, foexp_penalty, null)); } else if (foulout_explusion && code == null) { Penalty prev = foexp_penalty; foexp_penalty = null; scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_PENALTY_REMOVE_FOEXP, null, prev)); } else if (id == null ) { id = UUID.randomUUID().toString(); if (penalties.size() < 9) { DefaultPenaltyModel dpm = new DefaultPenaltyModel(id, period, jam, code); penalties.add(dpm); sortPenalties(); scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_PENALTY, dpm, null)); } } else { for (DefaultPenaltyModel p2 : penalties) { if (p2.getId().equals(id)) { if (code != null) { p2.period = period; p2.jam = jam; p2.code = code; sortPenalties(); scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_PENALTY, p2, null)); } else { penalties.remove(p2); scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_REMOVE_PENALTY, null, p2)); } break; } } } } }

Target:
public void AddPenaltyModel(String id, boolean foulout_explusion, int period, int jam, String code) { synchronized (penaltiesLock) { if (foulout_explusion && code != null) { Penalty prev = foexp_penalty; id = UUID.randomUUID().toString(); if (prev != null) { id = prev.getId(); } foexp_penalty = new DefaultPenaltyModel(id, period, jam, code); scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_PENALTY_FOEXP, foexp_penalty, null)); } else if (foulout_explusion && code == null) { Penalty prev = foexp_penalty; foexp_penalty = null; scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_PENALTY_REMOVE_FOEXP, null, prev)); } else if (id == null ) { id = UUID.randomUUID().toString(); if (penalties.size() < 9) { DefaultPenaltyModel dpm = new DefaultPenaltyModel(id, period, jam, code); penalties.add(dpm); sortPenalties(); scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_PENALTY, getPenalties(), null)); } } else { for (DefaultPenaltyModel p2 : penalties) { if (p2.getId().equals(id)) { if (code != null) { p2.period = period; p2.jam = jam; p2.code = code; sortPenalties(); scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_PENALTY, getPenalties(), null)); } else { penalties.remove(p2); scoreBoardChange(new ScoreBoardEvent(getSkater(), EVENT_REMOVE_PENALTY, null, p2)); } break; } } } } }
Source:
private static void doEvictionConfigChecks(EvictionConfig evictionConfig, boolean isIMap, boolean isNearCache) { if (isIMap) { checkMapMaxSizePolicyConfig(evictionConfig.getMaxSizePolicy()); return; } if (isNearCache) { checkNearCacheEvictionConfig(evictionConfig.getEvictionPolicy(), evictionConfig.getComparatorClassName(), evictionConfig.getComparator()); return; } checkEvictionConfig(evictionConfig); }

Target:
private static void doEvictionConfigChecks(EvictionConfig evictionConfig, boolean isIMap, boolean isNearCache) { if (isIMap) { checkMapEvictionConfig(evictionConfig); return; } if (isNearCache) { checkNearCacheEvictionConfig(evictionConfig.getEvictionPolicy(), evictionConfig.getComparatorClassName(), evictionConfig.getComparator()); return; } checkCacheEvictionConfig(evictionConfig); }
Source:
public void select_entity_singleton_by_id_and_apply_field_masks() { final Stand stand = prepareStandWithAggregateRepo(InMemoryStandStorage.newBuilder() .build()); final String customerFqn = Customer.getDescriptor() .getFullName(); final String[] paths = {customerFqn + ".id", customerFqn + ".name"}; final FieldMask fieldMask = FieldMask.newBuilder() .addAllPaths(Arrays.asList(paths)) .build(); final List<Customer> customers = new LinkedList<>(); final int count = 10; for (int i = 0; i < count; i++) { final Customer customer = getSampleCustomer(); customers.add(customer); stand.update(customer.getId(), AnyPacker.pack(customer)); } final Set<CustomerId> ids = Collections.singleton(customers.get(0) .getId()); final Query customerQuery = Queries.readByIds(Customer.class, ids, paths); final MemoizeQueryResponseObserver observer = new MemoizeQueryResponseObserver(); stand.execute(customerQuery, observer); final List<Any> read = observer.responseHandled.getMessagesList(); assertSize(1, read); final Customer customer = AnyPacker.unpack(read.get(0)); assertMatches(customer, fieldMask); assertTrue(ids.contains(customer.getId())); verifyObserver(observer); }

Target:
public void select_entity_singleton_by_id_and_apply_field_masks() { final Stand stand = prepareStandWithAggregateRepo(InMemoryStandStorage.newBuilder() .build()); final String customerDescriptor = Customer.getDescriptor() .getFullName(); final String[] paths = {customerDescriptor + ".id", customerDescriptor + ".name"}; final FieldMask fieldMask = FieldMask.newBuilder() .addAllPaths(Arrays.asList(paths)) .build(); final List<Customer> customers = new LinkedList<>(); final int count = 10; for (int i = 0; i < count; i++) { final Customer customer = getSampleCustomer(); customers.add(customer); stand.update(customer.getId(), AnyPacker.pack(customer)); } final Set<CustomerId> ids = Collections.singleton(customers.get(0) .getId()); final Query customerQuery = Queries.readByIds(Customer.class, ids, paths); final MemoizeQueryResponseObserver observer = new MemoizeQueryResponseObserver(); stand.execute(customerQuery, observer); final List<Any> read = observer.responseHandled.getMessagesList(); assertSize(1, read); final Customer customer = AnyPacker.unpack(read.get(0)); assertMatches(customer, fieldMask); assertTrue(ids.contains(customer.getId())); verifyObserver(observer); }
Source:
protected void rebuild() { setStartTime(Long.MAX_VALUE); setEndTime(Long.MIN_VALUE); refresh(); ITmfTrace viewTrace = fTrace; if (viewTrace == null) { return; } resetView(viewTrace); List<IMarkerEventSource> markerEventSources = new ArrayList<>(); synchronized (fBuildJobMap) { for (ITmfTrace trace : getTracesToBuild(viewTrace)) { if (trace == null) { break; } markerEventSources.addAll(TmfTraceAdapterManager.getAdapters(trace, IMarkerEventSource.class)); Job buildJob = Job.create(getName() + Messages.AbstractTimeGraphView_BuildJob, new BuildRunnable(trace, viewTrace)); fBuildJobMap.put(trace, buildJob); buildJob.schedule(); } } fMarkerEventSourcesMap.put(viewTrace, markerEventSources); }

Target:
protected void rebuild() { setStartTime(Long.MAX_VALUE); setEndTime(Long.MIN_VALUE); refresh(); ITmfTrace viewTrace = fTrace; if (viewTrace == null) { return; } resetView(viewTrace); List<IMarkerEventSource> markerEventSources = new ArrayList<>(); synchronized (fBuildJobMap) { for (ITmfTrace trace : getTracesToBuild(viewTrace)) { if (trace == null) { break; } markerEventSources.addAll(TmfTraceAdapterManager.getAdapters(trace, IMarkerEventSource.class)); Job buildJob = Job.create(getTitle() + Messages.AbstractTimeGraphView_BuildJob, new BuildRunnable(trace, viewTrace)); fBuildJobMap.put(trace, buildJob); buildJob.schedule(); } } fMarkerEventSourcesMap.put(viewTrace, markerEventSources); }
Source:
public HttpRequest sign(String method, String container, String name, @Nullable GetOptions options, long expires, @Nullable Long contentLength, @Nullable String contentType) { boolean isSAS = auth.authSAS(this.credential); HttpRequest request = null; if (isSAS) { request = signSAS(method, container, name, options, expires, contentLength, contentType); } else { request = signKey(method, container, name, options, expires, contentLength, contentType); } return request; }

Target:
public HttpRequest sign(String method, String container, String name, @Nullable GetOptions options, long expires, @Nullable Long contentLength, @Nullable String contentType) { if (isSAS) { return signSAS(method, container, name, options, expires, contentLength, contentType); } return signKey(method, container, name, options, expires, contentLength, contentType); }
Source:
private EditableValue createOwnerWidget(ServiceUserInfo info) { EditableValue ownerWidget = new EditableValue(info.username(), info.owner() != null ? info.owner().name() : "") { @Override protected void save(String serviceUser, final String newValue) { new RestApi("config").id("server") .view(Plugin.get().getPluginName(), "serviceusers").id(serviceUser) .view("owner").put(newValue, new AsyncCallback<GroupInfo>() { @Override public void onSuccess(GroupInfo result) { updateValue(result != null ? result.name() : ""); Plugin.get().refresh(); } @Override public void onFailure(Throwable caught) { } }); } }; StringBuilder ownerWarning = new StringBuilder(); ownerWarning.append("If "); ownerWarning.append(info.owner() != null ? "the owner group is changed" : "an owner group is set"); ownerWarning.append(" only members of the "); ownerWarning.append(info.owner() != null ? "new " : ""); ownerWarning.append("owner group can see and administrate the service user."); if (info.owner() != null) { ownerWarning.append(" If the owner group is removed only the creator of the service user " + "can see and administrate the service user."); } else { ownerWarning.append(" The creator of the service user cannot anymore see and " + "administrate the service user if she/he is not member of the owner group."); } ownerWidget.setWarning(ownerWarning.toString()); return ownerWidget; }

Target:
private EditableValue createOwnerWidget(ServiceUserInfo info) { EditableValue ownerWidget = new EditableValue(info.username(), info.owner() != null ? info.owner().name() : "") { @Override protected void save(String serviceUser, final String newValue) { new RestApi("config").id("server") .view(Plugin.get().getPluginName(), "serviceusers").id(serviceUser) .view("owner").put(newValue, new AsyncCallback<GroupInfo>() { @Override public void onSuccess(GroupInfo result) { updateValue(result != null ? result.name() : ""); Plugin.get().refresh(); } @Override public void onFailure(Throwable caught) { } }); } }; StringBuilder ownerWarning = new StringBuilder(); ownerWarning.append("If "); ownerWarning.append(info.owner() != null ? "the owner group is changed" : "an owner group is set"); ownerWarning.append(" only members of the "); ownerWarning.append(info.owner() != null ? "new " : ""); ownerWarning.append("owner group can see and administrate" + " the service user."); if (info.owner() != null) { ownerWarning.append(" If the owner group is removed only the" + " creator of the service user can see and administrate" + " the service user."); } else { ownerWarning.append(" The creator of the service user can no" + " longer see and administrate the service user if she/he" + " is not member of the owner group."); } ownerWidget.setWarning(ownerWarning.toString()); return ownerWidget; }
Source:
private void rewireBundle(ResolverBundle rb, List<ResolverBundle> visited) { if (visited.contains(rb)) return; visited.add(rb); BundleConstraint[] requires = rb.getRequires(); for (BundleConstraint require : requires) { rewireRequire(require, visited); } ResolverImport[] imports = rb.getImportPackages(); for (ResolverImport import1 : imports) { rewireImport(import1, visited); } GenericConstraint[] genericRequires = rb.getGenericRequires(); for (GenericConstraint genericRequire : genericRequires) { rewireGeneric(genericRequire, visited); } }

Target:
private void rewireBundle(ResolverBundle rb, List<ResolverBundle> visited) { if (visited.contains(rb)) return; visited.add(rb); BundleConstraint[] requires = rb.getRequires(); for (BundleConstraint require : requires) { rewireRequire(require, visited); } ResolverImport[] imports = rb.getImportPackages(); for (ResolverImport resolverImport : imports) { rewireImport(resolverImport, visited); } GenericConstraint[] genericRequires = rb.getGenericRequires(); for (GenericConstraint genericRequire : genericRequires) { rewireGeneric(genericRequire, visited); } }
Source:
public Position(int line, int column) { this.line = line; this.column = column; }

Target:
public Position(int line, int column) { if (line < Node.ABSOLUTE_END_LINE) { throw new IllegalArgumentException("Can't position at line " + line); } if (column < -1) { throw new IllegalArgumentException("Can't position at column " + column); } this.line = line; this.column = column; }
Source:
public void fetchEntries(final Budget b, final ApiCallback<List<Entry>> callback) { Log.d(TAG, "Fetching entries for budget # " + b.getId()); String requestUrl = entriesUrl + "/" + b.getId() + "/by_budget"; client.get(requestUrl, new JsonHttpResponseHandler() { @Override public void onSuccess(JSONArray entriesJson) { List<Entry> entriesList = new ArrayList<Entry>(); int entriesLen = entriesJson.length(); for (int i = 0; i < entriesLen; ++i) { try { JSONObject entriesObject = entriesJson.getJSONObject(i); long id = entriesObject.getLong("id"); int amount = entriesObject.getInt("amount"); String date = entriesObject.getString("expenditure_date"); String notes = entriesObject.getString("notes"); Entry newEntry = new Entry(id, amount, b, notes, date); b.addEntry(newEntry); } catch (JSONException e) { Log.e(TAG, e.getMessage()); } } callback.onSuccess(entriesList); } @Override public void onFailure(Throwable e, JSONObject obj) { String status = obj.optString("status", "Service Error"); callback.onFailure(status); } }); }

Target:
public void fetchEntries(final Budget b, final ApiCallback<List<Entry>> callback) { Log.d(TAG, "Fetching entries for budget # " + b.getId()); String requestUrl = entriesUrl + "/" + b.getId() + "/by_budget"; client.get(requestUrl, new JsonHttpResponseHandler() { @Override public void onSuccess(JSONArray entriesJson) { int entriesLen = entriesJson.length(); for (int i = 0; i < entriesLen; ++i) { try { JSONObject entriesObject = entriesJson.getJSONObject(i); long id = entriesObject.getLong("id"); int amount = entriesObject.getInt("amount"); String date = entriesObject.getString("expenditure_date"); String notes = entriesObject.getString("notes"); Entry newEntry = new Entry(id, amount, b, notes, date); b.addEntry(newEntry); } catch (JSONException e) { Log.e(TAG, e.getMessage()); } } callback.onSuccess(b.getEntries()); } @Override public void onFailure(Throwable e, JSONObject obj) { String status = obj.optString("status", "Service Error"); callback.onFailure(status); } }); }
Source:
public SWTBotRootMenu contextMenu(final Control control) throws WidgetNotFoundException { waitForEnabled(); Rectangle location = widgetBounds(); return NatTableContextMenuFinder.contextMenu(widget, location.width / 2, location.height / 2); }

Target:
protected SWTBotRootMenu contextMenu(final Control control) throws WidgetNotFoundException { waitForEnabled(); Rectangle location = widgetBounds(); return NatTableContextMenuFinder.contextMenu(widget, location.width / 2, location.height / 2); }
Source:
public void initialize(URL location, ResourceBundle resources) { Callback<ListView<SelectableResource>, ListCell<SelectableResource>> forListView = CheckBoxListCell.forListView(SelectableResource::selectedProperty); favoritesList.setCellFactory(forListView); updateFavorites(); }

Target:
public void initialize(URL location, ResourceBundle resources) { updateFavorites(); favoritesList.setItems(items); favoritesList.getCheckModel().checkAll(); favoritesList.getCheckModel().getCheckedItems().addListener( (ListChangeListener.Change<? extends ResourceAdapter> l) -> cs.getSelectedTypes().setAll(favoritesList.getCheckModel().getCheckedItems()) ); ps.configProperty().addListener((p, o, n) -> { updateFavorites(); favoritesList.getCheckModel().checkAll(); }); }
Source:
public long getPacketSizeBits() { return 0; }

Target:
public long getPacketSizeBits() { return 3; }
Source:
public void testMultiThreadPull() throws InterruptedException, TimeoutException, ExecutionException { final int numPullThreads = 8; final int numPullPerThread = 1000; final CountDownLatch countDownLatch = new CountDownLatch(numPullThreads); final Runnable[] threads = new Runnable[numPullThreads]; final AtomicBoolean correctResultReturned = new AtomicBoolean(true); for (int index = 0; index < numPullThreads; ++index) { final int key = index % 4; threads[index] = () -> { for (int pull = 0; pull < numPullPerThread; ++pull) { final Integer val = worker.pull(key); if (val == null || !val.equals(key)) { correctResultReturned.set(false); break; } } countDownLatch.countDown(); }; } ThreadUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(60, TimeUnit.SECONDS); worker.close(CLOSE_TIMEOUT); assertTrue(MSG_THREADS_SHOULD_FINISH, allThreadsFinished); assertTrue(MSG_RESULT_ASSERTION, correctResultReturned.get()); }

Target:
public void testMultiThreadPull() throws InterruptedException, TimeoutException, ExecutionException, NetworkException { final int numPullThreads = 8; final int numKeys = 4; final int numPullPerThread = 1000; final CountDownLatch countDownLatch = new CountDownLatch(numPullThreads); final Runnable[] threads = new Runnable[numPullThreads]; final AtomicBoolean correctResultReturned = new AtomicBoolean(true); for (int index = 0; index < numPullThreads; ++index) { final int key = index % numKeys; threads[index] = () -> { for (int pull = 0; pull < numPullPerThread; ++pull) { final Integer val = worker.pull(key); if (val == null || !val.equals(key)) { correctResultReturned.set(false); break; } } countDownLatch.countDown(); }; } ThreadUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(60, TimeUnit.SECONDS); worker.close(CLOSE_TIMEOUT); assertTrue(MSG_THREADS_SHOULD_FINISH, allThreadsFinished); assertTrue(MSG_RESULT_ASSERTION, correctResultReturned.get()); }
Source:
public BsonDocument toBsonDocument() { final BsonDocument asDoc = new BsonDocument(); asDoc.put(Fields.ID_FIELD, id); asDoc.put(Fields.OPERATION_TYPE_FIELD, new BsonString(toRemote(getOperationType()))); final BsonDocument nsDoc = new BsonDocument(); nsDoc.put(Fields.NS_DB_FIELD, new BsonString(ns.getDatabaseName())); nsDoc.put(Fields.NS_COLL_FIELD, new BsonString(getNamespace().getCollectionName())); asDoc.put(Fields.NS_FIELD, nsDoc); asDoc.put(Fields.DOCUMENT_KEY_FIELD, getDocumentKey()); if (getFullDocument() != null && (getFullDocument() instanceof BsonValue) && ((BsonValue) getFullDocument()).isDocument()) { asDoc.put(Fields.FULL_DOCUMENT_FIELD, (BsonValue) getFullDocument()); } if (getUpdateDescription() != null) { asDoc.put(Fields.UPDATE_DESCRIPTION_FIELD, getUpdateDescription().toBsonDocument()); } asDoc.put(Fields.WRITE_PENDING_FIELD, new BsonBoolean(hasUncommittedWrites())); return asDoc; }

Target:
public BsonDocument toBsonDocument() { final BsonDocument asDoc = new BsonDocument(); asDoc.put(Fields.ID_FIELD, id); asDoc.put(Fields.OPERATION_TYPE_FIELD, new BsonString(toRemote(getOperationType()))); final BsonDocument nsDoc = new BsonDocument(); nsDoc.put(Fields.NS_DB_FIELD, new BsonString(ns.getDatabaseName())); nsDoc.put(Fields.NS_COLL_FIELD, new BsonString(getNamespace().getCollectionName())); asDoc.put(Fields.NS_FIELD, nsDoc); asDoc.put(Fields.DOCUMENT_KEY_FIELD, getDocumentKey()); DocumentT fullDocument = getFullDocument(); if ((fullDocument instanceof BsonValue) && ((BsonValue) fullDocument).isDocument()) { asDoc.put(Fields.FULL_DOCUMENT_FIELD, (BsonValue) fullDocument); } UpdateDescription updateDescription = getUpdateDescription(); if (updateDescription != null) { asDoc.put(Fields.UPDATE_DESCRIPTION_FIELD, updateDescription.toBsonDocument()); } asDoc.put(Fields.WRITE_PENDING_FIELD, new BsonBoolean(hasUncommittedWrites())); return asDoc; }
Source:
public String getTableSize( @ApiParam(value = "Table Name with type", required = true) @PathParam("tableName") String tableName) throws WebApplicationException { double memoryConsumed = 0; TableType tableType = TableNameBuilder.getTableTypeFromTableName(tableName); if (tableType != TableType.REALTIME) { throw new WebApplicationException("This api cannot be used with non real-time table: " + tableName, Response.Status.BAD_REQUEST); } InstanceDataManager instanceDataManager = serverInstance.getInstanceDataManager(); if (instanceDataManager == null) { throw new WebApplicationException("Invalid server initialization", Response.Status.INTERNAL_SERVER_ERROR); } RealtimeTableDataManager realtimeTableDataManager = (RealtimeTableDataManager) instanceDataManager.getTableDataManager(tableName); if (realtimeTableDataManager == null) { throw new WebApplicationException("Table: " + tableName + " is not found", Response.Status.NOT_FOUND); } memoryConsumed = realtimeTableDataManager.getStatsHistory().getLatestSegmentMemoryConsumed(); return ResourceUtils.convertToJsonString(memoryConsumed); }

Target:
public String getTableSize( @ApiParam(value = "Table Name with type", required = true) @PathParam("tableName") String tableName) throws WebApplicationException { TableType tableType = TableNameBuilder.getTableTypeFromTableName(tableName); if (tableType != TableType.REALTIME) { throw new WebApplicationException("This api cannot be used with non real-time table: " + tableName, Response.Status.BAD_REQUEST); } InstanceDataManager instanceDataManager = _serverInstance.getInstanceDataManager(); if (instanceDataManager == null) { throw new WebApplicationException("Invalid server initialization", Response.Status.INTERNAL_SERVER_ERROR); } RealtimeTableDataManager realtimeTableDataManager = (RealtimeTableDataManager) instanceDataManager.getTableDataManager(tableName); if (realtimeTableDataManager == null) { throw new WebApplicationException("Table: " + tableName + " is not found", Response.Status.NOT_FOUND); } long memoryConsumed = realtimeTableDataManager.getStatsHistory().getLatestSegmentMemoryConsumed(); return ResourceUtils.convertToJsonString(Collections.singletonMap("offheapMemoryConsumed", memoryConsumed)); }
Source:
private void dropConglomerate() throws StandardException { TransactionController tc = activation.getTransactionController(); LOG.trace(format("Dropping temporary conglomerate splice:%d", CID)); try { tc.dropConglomerate(CID); } catch (StandardException e) { } try { dropTable(CID); } catch (StandardException e) { } conglomCreated = false; CID = 0; }

Target:
private void dropConglomerate() throws StandardException { TransactionController tc = activation.getTransactionController(); LOG.trace(format("Dropping temporary conglomerate splice:%d", CID)); try { tc.dropConglomerate(CID); } catch (StandardException e) { LOG.warn(format("Unable to drop temporary trigger conglomerate %d. Cleanup may have been called twice.", CID), e); } try { dropTable(CID); } catch (StandardException e) { LOG.warn(format("Unable to drop HBase table for temporary trigger conglomerate %d. Cleanup may have been called twice.", CID), e); } conglomCreated = false; CID = 0; }
Source:
public static Map<String, Class> getFieldNamesToTypes(Class clazz) { Field[] declaredFields = clazz.getDeclaredFields(); Map<String, Class> instanceVariableNamesToTypes = new HashMap<>(); for(Field field : declaredFields) { if(!Modifier.isStatic(field.getModifiers())) { instanceVariableNamesToTypes.put(field.getName(), field.getType()); } } if(clazz.getSuperclass() != Object.class) { instanceVariableNamesToTypes.putAll(getFieldNamesToTypes(clazz.getSuperclass())); } return instanceVariableNamesToTypes; }

Target:
public static Map<String, Class> getFieldNamesToTypes(Class clazz) { Field[] declaredFields = clazz.getDeclaredFields(); Map<String, Class> instanceVariableNamesToTypes = new HashMap<>(); for(Field field : declaredFields) { if(!Modifier.isStatic(field.getModifiers())) { LOG.trace("clazz has field with type {}", clazz.getName(), field.getName(), field.getType().getName()); instanceVariableNamesToTypes.put(field.getName(), field.getType()); } else { LOG.trace("clazz has field with type {}, which is static so ignoring", clazz.getName(), field.getName(), field.getType().getName()); } } if(!clazz.getSuperclass().equals(Object.class)) { instanceVariableNamesToTypes.putAll(getFieldNamesToTypes(clazz.getSuperclass())); } return instanceVariableNamesToTypes; }
Source:
public void synchronizeKeyToPassive(PassiveSynchronizationChannel<EhcacheEntityMessage> syncChannel, int concurrencyKey) { if (concurrencyKey == 1) { ServerSideConfiguration configuration = new ServerSideConfiguration(ehcacheStateService.getDefaultServerResource(), ehcacheStateService.getSharedResourcePools()); Map<String, ServerStoreConfiguration> storeConfigs = new HashMap<>(); for (String storeName : ehcacheStateService.getStores()) { ServerStoreImpl store = ehcacheStateService.getStore(storeName); storeConfigs.put(storeName, store.getStoreConfiguration()); } UUID configuredEntityId = ehcacheStateService.getClientMessageTracker().getConfiguredEntityId(); long configuredTimeStamp = ehcacheStateService.getClientMessageTracker().getConfiguredTimeStamp(); syncChannel.synchronizeToPassive( new EntityStateSyncMessage(configuration, storeConfigs, trackedClients, configuredEntityId, configuredTimeStamp)); } }

Target:
public void synchronizeKeyToPassive(PassiveSynchronizationChannel<EhcacheEntityMessage> syncChannel, int concurrencyKey) { if (concurrencyKey == ConcurrencyStrategies.DefaultConcurrencyStrategy.DEFAULT_KEY) { ServerSideConfiguration configuration = new ServerSideConfiguration(ehcacheStateService.getDefaultServerResource(), ehcacheStateService.getSharedResourcePools()); Map<String, ServerStoreConfiguration> storeConfigs = new HashMap<>(); for (String storeName : ehcacheStateService.getStores()) { ServerStoreImpl store = ehcacheStateService.getStore(storeName); storeConfigs.put(storeName, store.getStoreConfiguration()); } syncChannel.synchronizeToPassive(new EntityStateSyncMessage(configuration, storeConfigs, trackedClients)); } }
Source:
public QuadrigaUserDTO findUserByProviderUserId(String userId, String provider) throws QuadrigaStorageException { QuadrigaUserDTO userDTO = null; try { Query query = sessionFactory.getCurrentSession().createQuery( " from QuadrigaUserDTO user where user.userIdOfProvider=:userId AND user.provider=:provider"); query.setParameter("userId", userId); query.setParameter("provider", provider); List resultList = query.list(); if(resultList != null){ System.out.println("resultList.size() : "+resultList.size()); if(resultList.size() > 0) userDTO = (QuadrigaUserDTO)(resultList.get(0)); else userDTO = null; } else return null; return userDTO; } catch (Exception e) { logger.error("Error in adding an account request: ", e); throw new QuadrigaStorageException(e); } }

Target:
public QuadrigaUserDTO findUserByProviderUserId(String userId, String provider) { Query query = sessionFactory.getCurrentSession().createQuery( " from QuadrigaUserDTO user where user.userIdOfProvider=:userId AND user.provider=:provider"); query.setParameter("userId", userId); query.setParameter("provider", provider); List resultList = query.list(); if (resultList != null && resultList.size() > 0) { return (QuadrigaUserDTO) resultList.get(0); } return null; }
Source:
public List<Order> getOrders(OrderType orderType, List<Patient> patients, List<Concept> concepts, List<User> orderers, List<Encounter> encounters) { Criteria crit = sessionFactory.getCurrentSession().createCriteria(Order.class); if (orderType != null) { crit.add(Restrictions.eq("orderType", orderType)); } if (!patients.isEmpty()) { crit.add(Restrictions.in("patient", patients)); } if (!concepts.isEmpty()) { crit.add(Restrictions.in("concept", concepts)); } if (!orderers.isEmpty()) { crit.add(Restrictions.in("orderer", orderers)); } if (!encounters.isEmpty()) { crit.add(Restrictions.in("encounter", encounters)); } crit.addOrder(org.hibernate.criterion.Order.desc("dateActivated")); return crit.list(); }

Target:
public List<Order> getOrders(OrderType orderType, List<Patient> patients, List<Concept> concepts, List<User> orderers, List<Encounter> encounters) { Criteria crit = sessionFactory.getCurrentSession().createCriteria(Order.class); if (orderType != null) { crit.add(Restrictions.eq("orderType", orderType)); } if (CollectionUtils.isNotEmpty(patients)) { crit.add(Restrictions.in("patient", patients)); } if (CollectionUtils.isNotEmpty(concepts)) { crit.add(Restrictions.in("concept", concepts)); } if (CollectionUtils.isNotEmpty(orderers)) { crit.add(Restrictions.in("orderer", orderers)); } if (CollectionUtils.isNotEmpty(encounters)) { crit.add(Restrictions.in("encounter", encounters)); } crit.addOrder(org.hibernate.criterion.Order.desc("dateActivated")); return crit.list(); }
Source:
public void test() { connect(); click(jq(".z-button")); waitResponse(); Assert.assertTrue(!jq(".z-error").exists()); }

Target:
public void test() { connect(); click(jq(".z-button:eq(0)")); waitResponse(); Assert.assertFalse(jq(".z-error").exists()); click(jq(".z-button:eq(1)")); waitResponse(); Assert.assertFalse(jq(".z-error").exists()); }