auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void backfillUpdateStrategy(JobUpdateSettings settings) { IJobUpdateSettings updateSettings = IJobUpdateSettings.build(settings); if (!updateSettings.isSetUpdateStrategy()) { if (updateSettings.isWaitForBatchCompletion()) { settings.setUpdateStrategy( JobUpdateStrategy.batchStrategy( new BatchJobUpdateStrategy().setGroupSize(updateSettings.getUpdateGroupSize()))); } else { settings.setUpdateStrategy( JobUpdateStrategy.queueStrategy( new QueueJobUpdateStrategy().setGroupSize(updateSettings.getUpdateGroupSize()))); } } }

Target:
public static void backfillUpdateStrategy(JobUpdateSettings settings) { IJobUpdateSettings updateSettings = IJobUpdateSettings.build(settings); if (!updateSettings.isSetUpdateStrategy()) { if (updateSettings.isWaitForBatchCompletion()) { settings.setUpdateStrategy( JobUpdateStrategy.batchStrategy( new BatchJobUpdateStrategy().setGroupSize(updateSettings.getUpdateGroupSize()))); } else { settings.setUpdateStrategy( JobUpdateStrategy.queueStrategy( new QueueJobUpdateStrategy().setGroupSize(updateSettings.getUpdateGroupSize()))); } } }
Source:
private Response cloneVmFromSnapshot(VmStatic staticVm, Snapshots snapshots, ArrayList<DiskImage> diskInfoList) { Guid sourceSnapshotId = Guid.createGuidFromString(snapshots.getSnapshots().get(0).getId()); AddVmFromSnapshotParameters params = new AddVmFromSnapshotParameters(staticVm, diskInfoList, sourceSnapshotId); return performCreation(VdcActionType.AddVmFromSnapshot, params, new QueryIdResolver(VdcQueryType.GetVmByVmId, GetVmByVmIdParameters.class)); }

Target:
private Response cloneVmFromSnapshot(VmStatic staticVm, Snapshots snapshots, ArrayList<DiskImage> diskInfoList) { Guid sourceSnapshotId = asGuid(snapshots.getSnapshots().get(0).getId()); AddVmFromSnapshotParameters params = new AddVmFromSnapshotParameters(staticVm, diskInfoList, sourceSnapshotId); return performCreation(VdcActionType.AddVmFromSnapshot, params, new QueryIdResolver(VdcQueryType.GetVmByVmId, GetVmByVmIdParameters.class)); }
Source:
@Test public void normalGet() throws Exception { Request request = new RequestBuilderHelper() .setMethod("GET") .setPath("foo/bar/") .build(); assertThat(request.getMethod()).isEqualTo("GET"); assertThat(request.getHeaders()).isEmpty(); assertThat(request.getUrl()).isEqualTo(URL + "foo/bar/"); assertThat(request.getBody()).isNull(); assertThat(request.getBodyParameters()).isNull(); }

Target:
@Test public void normalGet() throws Exception { Request request = new Helper() .setMethod("GET") .setUrl("<LINK_1>") .setPath("/foo/bar/") .build(); assertThat(request.getMethod()).isEqualTo("GET"); assertThat(request.getHeaders()).isEmpty(); assertThat(request.getUrl()).isEqualTo("<LINK_0>"); assertThat(request.getBody()).isNull(); assertThat(request.getBodyParameters()).isEmpty(); }
Source:
private synchronized BridgeHandler getDssBridgeHandler() { if (this.dssBridgeHandler == null) { Bridge bridge = getBridge(); if (bridge == null) { logger.debug("Bride cannot be found"); return null; } ThingHandler handler = bridge.getHandler(); if (handler instanceof BridgeHandler) { dssBridgeHandler = (BridgeHandler) handler; if (device == null) { dssBridgeHandler.registerDeviceStatusListener(this); } } else { return null; } } else if (device == null) { dssBridgeHandler.registerDeviceStatusListener(this); } return dssBridgeHandler; }

Target:
private synchronized BridgeHandler getDssBridgeHandler() { if (this.dssBridgeHandler == null) { Bridge bridge = getBridge(); if (bridge == null) { logger.debug("Bride cannot be found"); return null; } ThingHandler handler = bridge.getHandler(); if (handler instanceof BridgeHandler) { dssBridgeHandler = (BridgeHandler) handler; } else { return null; } } return dssBridgeHandler; }
Source:
public String getAgentStatusReport(String pluginId, JobIdentifier jobIdentifier, String elasticAgentId) { final ElasticAgentPluginInfo pluginInfo = elasticAgentMetadataStore.getPluginInfo(pluginId); if (pluginInfo.getCapabilities().supportsAgentStatusReport()) { ClusterProfile clusterProfile = jobInstanceSqlMapDao.loadPlan(jobIdentifier.getId()).getClusterProfile(); return elasticAgentPluginRegistry.getAgentStatusReport(pluginId, jobIdentifier, elasticAgentId, clusterProfile.getConfigurationAsMap(true)); } throw new UnsupportedOperationException("Plugin does not support agent status report."); }

Target:
public String getAgentStatusReport(String pluginId, JobIdentifier jobIdentifier, String elasticAgentId) throws Exception { final ElasticAgentPluginInfo pluginInfo = elasticAgentMetadataStore.getPluginInfo(pluginId); if (pluginInfo.getCapabilities().supportsAgentStatusReport()) { JobPlan jobPlan = jobInstanceSqlMapDao.loadPlan(jobIdentifier.getId()); if (jobPlan != null) { ClusterProfile clusterProfile = jobPlan.getClusterProfile(); Map<String, String> clusterProfileConfigurations = (clusterProfile == null) ? Collections.emptyMap() : clusterProfile.getConfigurationAsMap(true); return elasticAgentPluginRegistry.getAgentStatusReport(pluginId, jobIdentifier, elasticAgentId, clusterProfileConfigurations); } throw new Exception(format("Could not fetch agent status report for agent %s as either the job running on the agent has been completed or the agent has been terminated.", elasticAgentId)); } throw new UnsupportedOperationException("Plugin does not support agent status report."); }
Source:
public AsyncReader(TransactionImpl tx) { this.tx = tx; getsQueue = new PriorityQueue<>(); executorService = Executors.newSingleThreadExecutor(); }

Target:
public AsyncReader(TransactionImpl tx) { this.tx = tx; asyncGetsQueue = new LinkedBlockingQueue<>(); executorService = Executors.newSingleThreadExecutor(); }
Source:
public void handleMessage(final Message msg) { Stats stats = mStats.get(); if (stats != null) { synchronized (StatsHandler.class) { switch (msg.what) { case CACHE_HIT : stats.performCacheHit(); break; case CACHE_MISS : stats.performCacheMiss(); break; case BITMAP_DECODE_FINISHED : stats.performBitmapDecoded(msg.arg1); break; case BITMAP_TRANSFORMED_FINISHED : stats.performBitmapTransformed(msg.arg1); break; case REQUESTED_COMPLETED : break; default : Handler mainHandler = new Handler(Looper.getMainLooper()); mainHandler.post(new Runnable() { @Override public void run() { throw new AssertionError("Unhandled stats message." + msg.what); } }); } } } }

Target:
@Override public void handleMessage(final Message msg) { Stats stats = statsRef.get(); if (stats == null) { return; } synchronized (StatsHandler.class) { switch (msg.what) { case CACHE_HIT : stats.performCacheHit(); break; case CACHE_MISS : stats.performCacheMiss(); break; case BITMAP_DECODE_FINISHED : stats.performBitmapDecoded(msg.arg1); break; case BITMAP_TRANSFORMED_FINISHED : stats.performBitmapTransformed(msg.arg1); break; case REQUESTED_COMPLETED : break; default : Handler mainHandler = new Handler(Looper.getMainLooper()); mainHandler.post(new Runnable() { @Override public void run() { throw new AssertionError("Unhandled stats message." + msg.what); } }); } } }
Source:
public IntArrayList(int initialCapacity) { if (initialCapacity < 0) { throw new IllegalArgumentException("Initial initialCapacity (" + initialCapacity + ") is negative"); } else { array = new int[initialCapacity]; } }

Target:
public IntArrayList(int initialCapacity) { if (initialCapacity < 0) { throw new IllegalArgumentException(String.format("Initial capacity '%s' is negative", initialCapacity)); } array = new int[initialCapacity]; }
Source:
private boolean hasBeenInitialized(Symbol symbol) { VariableTree source = (VariableTree) getSemanticModel().getTree(symbol); return source.initializer() != null; }

Target:
private boolean hasBeenInitialized(Symbol symbol) { ExpressionTree initializer = ((VariableTree) getSemanticModel().getTree(symbol)).initializer(); return initializer != null && initializer.is(Kind.NEW_CLASS); }
Source:
public DataSet<LocatedRow> getDataSet(DataSetProcessor dsp) throws StandardException { dsp.setSchedulerPool("admin"); try { DataSet statsDataSet; OperationContext<StatisticsOperation> operationContext = dsp.createOperationContext(this); if (scanSetBuilder.getStoredAs() != null) { ScanSetBuilder builder = scanSetBuilder; String storedAs = scanSetBuilder.getStoredAs(); if (storedAs.equals("T")) statsDataSet = dsp.readTextFile(null, builder.getLocation(), builder.getDelimited(), null, builder.getColumnPositionMap(), null, null, null, builder.getTemplate(), useSample, sampleFraction); else if (storedAs.equals("P")) statsDataSet = dsp.readParquetFile(builder.getColumnPositionMap(), builder.getPartitionByColumnMap() , builder.getLocation(), null, null, null, builder.getTemplate(), useSample, sampleFraction); else if (storedAs.equals("O")) { int[] baseColumnMap = builder.getColumnPositionMap(); for (int i = 0; i < baseColumnMap.length; i++) { baseColumnMap[i] = baseColumnMap[i] - 1; } statsDataSet = dsp.readORCFile(baseColumnMap, builder.getPartitionByColumnMap(), builder.getLocation(), null, null, null, builder.getTemplate(), useSample, sampleFraction); } else { throw new UnsupportedOperationException("storedAs Type not supported -> " + storedAs); } } else { statsDataSet = scanSetBuilder.buildDataSet(scope); } return statsDataSet .mapPartitions( new StatisticsFlatMapFunction(operationContext, scanSetBuilder.getBaseTableConglomId(), scanSetBuilder.getColumnPositionMap(), scanSetBuilder.getTemplate())); } catch (StandardException se) { throw se; } }

Target:
public DataSet<LocatedRow> getDataSet(DataSetProcessor dsp) throws StandardException { dsp.setSchedulerPool("admin"); try { DataSet statsDataSet; OperationContext<StatisticsOperation> operationContext = dsp.createOperationContext(this); if (scanSetBuilder.getStoredAs() != null) { ScanSetBuilder builder = scanSetBuilder; String storedAs = scanSetBuilder.getStoredAs(); if (storedAs.equals("T")) statsDataSet = dsp.readTextFile(null, builder.getLocation(), builder.getDelimited(), null, builder.getColumnPositionMap(), null, null, null, builder.getTemplate(), useSample, sampleFraction); else if (storedAs.equals("P")) statsDataSet = dsp.readParquetFile(builder.getColumnPositionMap(), builder.getPartitionByColumnMap() , builder.getLocation(), null, null, null, builder.getTemplate(), useSample, sampleFraction); else if (storedAs.equals("O")) statsDataSet = dsp.readORCFile(builder.getColumnPositionMap(), builder.getPartitionByColumnMap(), builder.getLocation(), null, null, null, builder.getTemplate(), useSample, sampleFraction, true); else { throw new UnsupportedOperationException("storedAs Type not supported -> " + storedAs); } } else { statsDataSet = scanSetBuilder.buildDataSet(scope); } return statsDataSet .mapPartitions( new StatisticsFlatMapFunction(operationContext, scanSetBuilder.getBaseTableConglomId(), scanSetBuilder.getColumnPositionMap(), scanSetBuilder.getTemplate())); } catch (StandardException se) { throw se; } }
Source:
public boolean hasNext() { if (recordCounter >= records.size()) { try { nextContainer(); if (records.isEmpty()) return false; } catch (Exception e) { throw new RuntimeEOFException(e); } } nextRecord = records.get(recordCounter++); return true; }

Target:
public boolean hasNext() { if (container != null && container.isEOF()) return false ; if (container == null || recordCounter >= records.size()) { try { nextContainer(); if (records.isEmpty()) return false; } catch (Exception e) { throw new RuntimeEOFException(e); } } nextRecord = records.get(recordCounter++); return true; }
Source:
@Override public void remove() { throw new UnsupportedOperationException(); }

Target:
public void remove() { throw new UnsupportedOperationException(); }
Source:
private long executeSqlCountComputingResourcesForAccount(long accountId, String sqlCountComputingResourcesAllocatedToAccount) { TransactionLegacy tx = TransactionLegacy.currentTxn() try { PreparedStatement pstmt = tx.prepareAutoCloseStatement(sqlCountComputingResourcesAllocatedToAccount); pstmt.setLong(1, accountId); ResultSet rs = pstmt.executeQuery(); if (!rs.next()) { return 0L; } return rs.getLong("total"); } catch (SQLException e) { throw new CloudRuntimeException(e); } }

Target:
private long executeSqlCountComputingResourcesForAccount(long accountId, String sqlCountComputingResourcesAllocatedToAccount) { TransactionLegacy tx = TransactionLegacy.currentTxn(); try { PreparedStatement pstmt = tx.prepareAutoCloseStatement(sqlCountComputingResourcesAllocatedToAccount); pstmt.setLong(1, accountId); ResultSet rs = pstmt.executeQuery(); if (!rs.next()) { return 0L; } return rs.getLong("total"); } catch (SQLException e) { throw new CloudRuntimeException(e); } }
Source:
public static void setup() throws Exception { Path cnfPath = FileSystems.getDefault().getPath("target/test-classes/hbase-site.xml"); Path cnf2Path = FileSystems.getDefault().getPath("target/test-classes/hbase-site2.xml"); Path cnf3Path = FileSystems.getDefault().getPath("target/test-classes/hbase-site3.xml"); String absoluteDataPath = TEST_UTIL.getDataTestDir().toString(); String dataBasePath = System.getProperty(HBaseCommonTestingUtility.BASE_TEST_DIRECTORY_KEY, HBaseCommonTestingUtility.DEFAULT_BASE_TEST_DIRECTORY); String dataPath = absoluteDataPath.substring(absoluteDataPath.indexOf(dataBasePath)); newCnfPath = Paths.get(dataPath + "/hbase-site.xml"); newCnf2Path = Paths.get(dataPath + "/hbase-site2.xml"); newCnf3Path = Paths.get(dataPath + "/hbase-site3.xml"); Files.createDirectories(Paths.get(dataPath)); Files.copy(cnfPath, newCnfPath); Files.copy(cnf2Path, newCnf2Path); Files.copy(cnf3Path, newCnf3Path); TEST_UTIL.getConfiguration().addResource(TEST_UTIL.getDataTestDir("hbase-site.xml")); StartMiniClusterOption option = StartMiniClusterOption.builder().numMasters(2).build(); TEST_UTIL.startMiniCluster(option); TEST_UTIL.getMiniHBaseCluster().getRegionServer(0).getConfiguration(). addResource(TEST_UTIL.getDataTestDir("hbase-site.xml")); }

Target:
public static void setup() throws Exception { setUpConfigurationFiles(TEST_UTIL); StartMiniClusterOption option = StartMiniClusterOption.builder().numMasters(2).build(); TEST_UTIL.startMiniCluster(option); addResourceToRegionServerConfiguration(TEST_UTIL); }
Source:
public StudyRepository(Path pathToRepository, GitHandler gitHandler, ImportFormatPreferences importFormatPreferences, FileUpdateMonitor fileUpdateMonitor, SavePreferences savePreferences, BibEntryTypesManager bibEntryTypesManager) throws IOException, ParseException, GitAPIException { this.repositoryPath = pathToRepository; this.gitHandler = gitHandler; try { gitHandler.updateLocalRepository(); } catch (GitAPIException e) { LOGGER.info("Updating repository from remote failed"); } this.importFormatPreferences = importFormatPreferences; this.fileUpdateMonitor = fileUpdateMonitor; this.studyDefinitionBib = Path.of(repositoryPath.toString(), STUDY_DEFINITION_FILE_NAME); this.savePreferences = savePreferences; this.bibEntryTypesManager = bibEntryTypesManager; if (Files.notExists(repositoryPath)) { throw new IOException("The given repository does not exists."); } else if (Files.notExists(studyDefinitionBib)) { throw new IOException("The study definition file does not exist in the given repository."); } study = parseStudyFile(); this.setUpRepositoryStructure(); }

Target:
public StudyRepository(Path pathToRepository, GitHandler gitHandler, ImportFormatPreferences importFormatPreferences, FileUpdateMonitor fileUpdateMonitor, SavePreferences savePreferences, BibEntryTypesManager bibEntryTypesManager) throws IOException, ParseException, GitAPIException { this.repositoryPath = pathToRepository; this.gitHandler = gitHandler; try { gitHandler.updateLocalRepository(); } catch (GitAPIException e) { LOGGER.error("Updating repository from remote failed"); } this.importFormatPreferences = importFormatPreferences; this.fileUpdateMonitor = fileUpdateMonitor; this.studyDefinitionBib = Path.of(repositoryPath.toString(), STUDY_DEFINITION_FILE_NAME); this.savePreferences = savePreferences; this.bibEntryTypesManager = bibEntryTypesManager; if (Files.notExists(repositoryPath)) { throw new IOException("The given repository does not exists."); } else if (Files.notExists(studyDefinitionBib)) { throw new IOException("The study definition file does not exist in the given repository."); } study = parseStudyFile(); this.setUpRepositoryStructure(); }
Source:
public void setPreProcessor(DataSetPreProcessor preProcessor) { throw new UnsupportedOperationException(); }

Target:
public void setPreProcessor(DataSetPreProcessor preProcessor) { this.preProcessor = preProcessor; }
Source:
public void testUpdateServer() { assertDataCenterAvailable(dataCenter); Server updated = api.serverApi().updateServer( Server.Request.updatingBuilder() .id(testServer.id()) .dataCenterId(testServer.dataCenterId()) .name("apache-node") .ram(1024 * 2) .cores(2) .build()); assertRequestCompleted(updated); assertRequestCompleted(updated); assertNodeAvailable(ServerRef.create(dataCenter.id(), testServer.id())); assertDataCenterAvailable(dataCenter); assertNodeRunning(ServerRef.create(dataCenter.id(), testServer.id())); Server server = serverApi().getServer(dataCenter.id(), testServer.id()); assertEquals(server.properties().name(), "apache-node"); }

Target:
public void testUpdateServer() { assertDataCenterAvailable(dataCenter); Server updated = api.serverApi().updateServer( Server.Request.updatingBuilder() .id(testServer.id()) .dataCenterId(testServer.dataCenterId()) .name("apache-node") .ram(1024 * 2) .cores(2) .build()); assertRequestCompleted(updated); assertNodeAvailable(ServerRef.create(dataCenter.id(), testServer.id())); assertDataCenterAvailable(dataCenter); assertNodeRunning(ServerRef.create(dataCenter.id(), testServer.id())); Server server = serverApi().getServer(dataCenter.id(), testServer.id()); assertEquals(server.properties().name(), "apache-node"); }
Source:
public static @Nullable List<Long> extractSelectedItems(Map<String, Object> parameters) { Object selectedItemObject = parameters.get(SELECTED_ITEMS_KEY); if (selectedItemObject instanceof List<?>) { List<Long> selectedItems = new ArrayList<>(); List<?> selectedItemList = (List<?>) selectedItemObject; if (!selectedItemList.isEmpty()) { if (selectedItemList.get(0) instanceof Long) { selectedItems = (List<Long>) selectedItemList; } else if (selectedItemList.get(0) instanceof Integer) { for (Integer time : (List<Integer>) selectedItemList) { selectedItems.add(time.longValue()); } } else { return null; } } return selectedItems; } return null; }

Target:
public static @Nullable List<Long> extractSelectedItems(Map<String, Object> parameters) { Object selectedItemObject = parameters.get(SELECTED_ITEMS_KEY); if (selectedItemObject instanceof List<?>) { return transformToLongList((List<?>) selectedItemObject); } return null; }
Source:
public void findOneTest() throws Exception { context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context).withName("My community").build(); ResourcePolicy resourcePolicy = ResourcePolicyBuilder.createResourcePolicy(context).withDspaceObject(community) .withAction(Constants.READ).withPolicyType(ResourcePolicy.TYPE_CUSTOM).withUser(admin).build(); context.restoreAuthSystemState(); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform(get("/api/authz/resourcepolicies/" + resourcePolicy.getID())) .andExpect(status().isOk()).andExpect(content().contentType(contentType)) .andExpect(jsonPath("$", is( ResoucePolicyMatcher.matchResourcePolicy(resourcePolicy) ))) .andExpect(jsonPath("$._links.self.href", Matchers .containsString("/api/authz/resourcepolicies/" + resourcePolicy.getID()))); }

Target:
public void findOneTest() throws Exception { context.turnOffAuthorisationSystem(); EPerson eperson1 = EPersonBuilder.createEPerson(context) .withEmail("eperson1@mail.com") .withPassword("qwerty01") .build(); Community community = CommunityBuilder.createCommunity(context).withName("My community").build(); ResourcePolicy resourcePolicy = ResourcePolicyBuilder.createResourcePolicy(context) .withDspaceObject(community) .withAction(Constants.READ) .withUser(eperson1) .build(); context.restoreAuthSystemState(); String authToken = getAuthToken(eperson1.getEmail(), "qwerty01"); getClient(authToken).perform(get("/api/authz/resourcepolicies/" + resourcePolicy.getID())) .andExpect(status().isOk()).andExpect(content().contentType(contentType)) .andExpect(jsonPath("$", is( ResoucePolicyMatcher.matchResourcePolicy(resourcePolicy) ))) .andExpect(jsonPath("$._links.self.href", Matchers .containsString("/api/authz/resourcepolicies/" + resourcePolicy.getID()))); }
Source:
private void beginCommitAsync(CommitData cd, AsyncCommitObserver commitCallback, RowColumn primary) { if (updates.size() == 0) { deleteWeakRow(); commitCallback.committed(); return; } for (Map<Column, Bytes> cols : updates.values()) { stats.incrementEntriesSet(cols.size()); } Bytes primRow = null; Column primCol = null; if (primary != null) { primRow = primary.getRow(); primCol = primary.getColumn(); if (notification != null && !primary.equals(notification.getRowColumn())) { throw new IllegalArgumentException("Primary must be notification"); } } else if (notification != null) { primRow = notification.getRow(); primCol = notification.getColumn(); } else { outer: for (Entry<Bytes, Map<Column, Bytes>> entry : updates.entrySet()) { for (Entry<Column, Bytes> entry2 : entry.getValue().entrySet()) { if (!isReadLock(entry2.getValue())) { primRow = entry.getKey(); primCol = entry2.getKey(); break outer; } } } if (primRow == null) { deleteWeakRow(); commitCallback.committed(); return; } } cd.prow = primRow; Map<Column, Bytes> colSet = updates.get(cd.prow); cd.pcol = primCol; cd.pval = colSet.remove(primCol); if (colSet.size() == 0) { updates.remove(cd.prow); } cd.commitObserver = commitCallback; final ConditionalMutation pcm = prewrite(cd.prow, cd.pcol, cd.pval, cd.prow, cd.pcol, isTriggerRow(cd.prow)); CompletableFuture<Iterator<Result>> cfuture = cd.acw.apply(Collections.singletonList(pcm)); addCallback(cfuture, cd, (cd2, result) -> postLockPrimary(cd2, pcm, Iterators.getOnlyElement((Iterator<Result>) result))); }

Target:
private void beginCommitAsync(CommitData cd, AsyncCommitObserver commitCallback, RowColumn primary) { if (updates.size() == 0) { deleteWeakRow(); commitCallback.committed(); return; } for (Map<Column, Bytes> cols : updates.values()) { stats.incrementEntriesSet(cols.size()); } Bytes primRow = null; Column primCol = null; if (primary != null) { primRow = primary.getRow(); primCol = primary.getColumn(); if (notification != null && !primary.equals(notification.getRowColumn())) { throw new IllegalArgumentException("Primary must be notification"); } } else if (notification != null) { primRow = notification.getRow(); primCol = notification.getColumn(); } else { outer: for (Entry<Bytes, Map<Column, Bytes>> entry : updates.entrySet()) { for (Entry<Column, Bytes> entry2 : entry.getValue().entrySet()) { if (!isReadLock(entry2.getValue())) { primRow = entry.getKey(); primCol = entry2.getKey(); break outer; } } } if (primRow == null) { deleteWeakRow(); commitCallback.committed(); return; } } cd.prow = primRow; Map<Column, Bytes> colSet = updates.get(cd.prow); cd.pcol = primCol; cd.pval = colSet.remove(primCol); if (colSet.size() == 0) { updates.remove(cd.prow); } cd.commitObserver = commitCallback; final ConditionalMutation pcm = prewrite(cd.prow, cd.pcol, cd.pval, cd.prow, cd.pcol, isTriggerRow(cd.prow)); CompletableFuture<Iterator<Result>> cfuture = cd.acw.apply(Collections.singletonList(pcm)); addCallback(cfuture, cd, result -> postLockPrimary(cd, pcm, Iterators.getOnlyElement(result))); }
Source:
public void testHandlePermissionRequestResultForRequestAfterSaveCopyClickedPermissionGranted() { presenter.handlePermissionRequestResults(PERMISSION_EXTERNAL_STORAGE_SAVE_COPY, new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE}, new int[] {PackageManager.PERMISSION_GRANTED}); verify(presenter).saveCopyClicked(); }

Target:
public void testHandlePermissionRequestResultForRequestAfterSaveCopyClickedPermissionGranted() { presenter.handlePermissionRequestResults(PERMISSION_EXTERNAL_STORAGE_SAVE_COPY, new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE}, new int[] {PackageManager.PERMISSION_GRANTED}); verify(interactor).saveCopy(any(SaveImageAsync.SaveImageCallback.class), eq(SAVE_IMAGE_DEFAULT)); }
Source:
public void started() { log.info("Started the REST Web Service module"); new SwaggerSpecificationCreator("host/openmrs/ws/rest").BuildJSON(); }

Target:
public void started() { log.info("Started the REST Web Service module"); }
Source:
public static void assertNotZipSlipVulnerable(String fileName) throws IOException { if (fileName.startsWith(ZIP_SLIP_EXPRESSION)) throw new IOException("Vulnerable File Name"); }

Target:
public static void assertNotZipSlipVulnerable(String fileName) throws IOException { File destinationfile = new File(fileName); String canonicalDestinationFile = destinationfile.getCanonicalPath(); if (canonicalDestinationFile.startsWith(ZIP_SLIP_EXPRESSION)) { throw new IOException("Vulnerable File Name"); } }
Source:
public KieContainerResource createContainer(String id, String containerId, KieContainerResource container) { ServerTemplate serverTemplate = this.templateStorage.load(id); if (serverTemplate == null) { throw new KieServerControllerException("KieServerInstance not found with id: " + id); } ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerId); if (containerSpec != null) { throw new KieServerControllerException("KieContainer already exists with id: " + id); } containerSpec = new ContainerSpec(); containerSpec.setStatus(KieContainerStatus.STOPPED); containerSpec.setId(container.getContainerId()); containerSpec.setReleasedId(container.getReleaseId()); containerSpec.setServerTemplateKey(serverTemplate); containerSpec.setContainerName(container.getContainerId()); if (container.getScanner() != null) { RuleConfig ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(container.getScanner().getPollInterval()); ruleConfig.setScannerStatus(container.getScanner().getStatus()); containerSpec.addConfig(Capability.RULE, ruleConfig); } serverTemplate.addContainerSpec(containerSpec); this.templateStorage.update(serverTemplate); container.setStatus(KieContainerStatus.STOPPED); return container; }

Target:
public KieContainerResource createContainer(String id, String containerId, KieContainerResource container) { ServerTemplate serverTemplate = this.templateStorage.load(id); if (serverTemplate == null) { throw new KieServerControllerException("KieServerInstance not found with id: " + id); } ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerId); if (containerSpec != null) { throw new KieServerControllerException("KieContainer already exists with id: " + id); } containerSpec = new ContainerSpec(container.getContainerId(), container.getContainerId(), serverTemplate, container.getReleaseId(), KieContainerStatus.STOPPED, new HashMap<Capability, ContainerConfig>()); if (container.getScanner() != null) { RuleConfig ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(container.getScanner().getPollInterval()); ruleConfig.setScannerStatus(container.getScanner().getStatus()); containerSpec.addConfig(Capability.RULE, ruleConfig); } serverTemplate.addContainerSpec(containerSpec); this.templateStorage.update(serverTemplate); container.setStatus(KieContainerStatus.STOPPED); return container; }
Source:
private static void validateGroupDuplicationInGroup(List<String> groups, List<String> parentGroups) throws RestAPIException { List<String> checkList = new ArrayList<String>(); for (String group : groups) { if (!checkList.contains(group)) { checkList.add(group); } else { if (log.isDebugEnabled()) { log.debug("duplicate group defined: " + group); } throw new RestAPIException("Invalid Service Group definition, duplicate groups defined: " + group); } if (parentGroups.contains(group)) { if (log.isDebugEnabled()) { log.debug("cyclic group behaviour identified [group-name]: " + group); } throw new RestAPIException("Invalid Service Group definition, cyclic group behaviour identified: " + group); } } }

Target:
private static void validateGroupDuplicationInGroup(List<String> groups, List<String> parentGroups) throws InvalidCartridgeGroupDefinitionException { List<String> checkList = new ArrayList<String>(); for (String group : groups) { if (!checkList.contains(group)) { checkList.add(group); } else { if (log.isDebugEnabled()) { log.debug("duplicate group defined: " + group); } throw new InvalidCartridgeGroupDefinitionException("Invalid cartridge group definition, " + "duplicate groups defined: " + group); } if (parentGroups.contains(group)) { if (log.isDebugEnabled()) { log.debug("cyclic group behaviour identified [group-name]: " + group); } throw new InvalidCartridgeGroupDefinitionException("Invalid cartridge group definition, " + "cyclic group behaviour identified: " + group); } } }
Source:
public CsvSchema csvSchema() { CsvMapper csvMapper = new CsvMapper(); csvMapper.disable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY); CsvSchema entrySchema = csvMapper.schemaFor(Entry.class); CsvSchema.Builder schemaBuilder = entrySchema.rebuild(); for (String value : getRegister().getFields()) { schemaBuilder.addColumn(value, CsvSchema.ColumnType.STRING); } return schemaBuilder.build(); }

Target:
public CsvSchema csvSchema() { return Record.csvSchema(getRegister().getFields()); }
Source:
public void invite(final String friend) throws IOException { final RestResponse response = this.request .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .rel("/page/links/link[@rel='invite']/@href") .method(Request.POST) .body().formParam("name", friend).back() .fetch() .as(RestResponse.class); if (response.status() == HttpURLConnection.HTTP_MOVED_PERM && response.cookie(RtFriends.COOKIE_RS_FLASH).getValue() .startsWith("incorrect+alias") ) { throw new Friends.UnknownAliasException( response.cookie(RtFriends.COOKIE_RS_FLASH).getValue() ); } if (response.status() != HttpURLConnection.HTTP_SEE_OTHER) { throw new IOException( String.format( "HTTP response status is not equal to %d", HttpURLConnection.HTTP_SEE_OTHER ) ); } Logger.info(this, "friend '%s' invited", friend); }

Target:
public void invite(final String friend) throws IOException { final RestResponse response = this.request .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .rel("/page/links/link[@rel='invite']/@href") .method(Request.POST) .body().formParam("name", friend).back() .fetch() .as(RestResponse.class); if (response.status() == HttpURLConnection.HTTP_MOVED_PERM && response.cookie(RtFriends.COOKIE_RS_FLASH).getValue() .startsWith("incorrect+alias") ) { throw new Friends.UnknownAliasException( response.cookie(RtFriends.COOKIE_RS_FLASH).getValue() ); } response.assertStatus(HttpURLConnection.HTTP_SEE_OTHER); Logger.info(this, "friend '%s' invited", friend); }
Source:
public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<Row> bigtableResultScanner) { return new AbstractClientScanner() { @Override public Result next() throws IOException { Row row = bigtableResultScanner.next(); if (row == null) { return null; } return rowAdapter.adaptResponse(row); } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } } public boolean renewLease() { return false; } }; }

Target:
public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<Row> bigtableResultScanner) { return new AbstractClientScanner() { @Override public Result next() throws IOException { Row row = bigtableResultScanner.next(); if (row == null) { return null; } return rowAdapter.adaptResponse(row); } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } } public boolean renewLease() { throw new UnsupportedOperationException("renewLease"); } }; }
Source:
public String getCSSName() { return mCSSName; }

Target:
public final String getCSSName() { return mCSSName; }
Source:
public void testScenarios() throws IOException { String testResourcesPath = getClass().getClassLoader().getResource(".").getPath(); System.out.println(testResourcesPath); TestScenariosFinder testScenariosFinder = new TestScenariosFinder(testResourcesPath); List<TestScenario> testScenarios = testScenariosFinder.getScenarios(); TestScenarioRunner caseRunner = new TestScenarioRunner(9080); int successfulScenarios = 0; int failedScenarios = 0; for (TestScenario testScenario: testScenarios) { if (testScenario.enabledTests() == 0) { continue; } int successfulTestCases = 0; try { successfulTestCases = caseRunner.run(testScenario); } catch (Throwable throwable) { throwable.printStackTrace(); System.out.print("Exception while running test scenario: " + testScenario); } if (successfulTestCases == testScenario.enabledTests()) { System.out.println("\nScenario success: " + testScenario + "\n"); System.out.println("Number of successful test cases: " + successfulTestCases); successfulScenarios++; } else { System.out.println("\nScenario failed: " + testScenario + "\n"); System.out.println("Number of failed test cases: " + (testScenario.enabledTests() - successfulTestCases)); failedScenarios++; } } System.out.println("\n\nScenarios results:\nSuccessful: " + successfulScenarios + ", Failed: " + failedScenarios + "\n\n"); if (failedScenarios > 0) { Assert.fail(); } }

Target:
public void testScenarios() throws IOException { String testResourcesPath = getClass().getClassLoader().getResource(".").getPath(); TestScenariosFinder testScenariosFinder = new TestScenariosFinder(testResourcesPath); List<TestScenario> testScenarios = testScenariosFinder.getScenarios(); TestScenarioRunner caseRunner = new TestScenarioRunner(9080); int successfulScenarios = 0; int failedScenarios = 0; for (TestScenario testScenario: testScenarios) { if (testScenario.enabledTests() == 0) { continue; } int successfulTestCases = 0; try { successfulTestCases = caseRunner.run(testScenario); } catch (Throwable throwable) { throwable.printStackTrace(); System.out.print("Exception while running test scenario: " + testScenario); } if (successfulTestCases == testScenario.enabledTests()) { System.out.println("\nScenario success: " + testScenario + "\n"); System.out.println("Number of successful test cases: " + successfulTestCases); successfulScenarios++; } else { System.out.println("\nScenario failed: " + testScenario + "\n"); System.out.println("Number of failed test cases: " + (testScenario.enabledTests() - successfulTestCases)); failedScenarios++; } } System.out.println("\n\nScenarios results:\nSuccessful: " + successfulScenarios + ", Failed: " + failedScenarios + "\n\n"); if (failedScenarios > 0) { Assert.fail(); } }
Source:
public void disable() throws IOException { throw new IllegalStateException("does not support disable/enable"); }

Target:
public void disable() throws IOException { throw new IOException("does not support disable/enable"); }
Source:
public synchronized void sendQueuedEvents(KeenProject project, KeenCallback callback) { if (!isActive) { handleLibraryInactive(callback); return; } if (project == null && defaultProject == null) { handleFailure(null, new IllegalStateException("No project specified, but no default project found")); return; } if (!isNetworkConnected()) { KeenLogging.log("Not sending events because there is no network connection. " + "Events will be retried next time `sendQueuedEvents` is called."); return; } KeenProject useProject = (project == null ? defaultProject : project); try { String projectId = useProject.getProjectId(); Map<String, List<Object>> eventHandles = eventStore.getHandles(projectId); Map<String, List<Map<String, Object>>> events = buildEventMap(eventHandles); String response = publishAll(useProject, events); if (response != null) { try { handleAddEventsResponse(eventHandles, response); } catch (Exception e) { KeenLogging.log("Error handling response to batch publish: " + e.getMessage()); } } handleSuccess(callback); } catch (Exception e) { handleFailure(callback, e); } }

Target:
public synchronized void sendQueuedEvents(KeenProject project, KeenCallback callback) { if (!isActive) { handleLibraryInactive(callback); return; } if (project == null && defaultProject == null) { handleFailure(null, new IllegalStateException("No project specified, but no default project found")); return; } if (!isNetworkConnected()) { KeenLogging.log("Not sending events because there is no network connection. " + "Events will be retried next time `sendQueuedEvents` is called."); handleFailure(callback, new Exception("Network not connected.")); return; } KeenProject useProject = (project == null ? defaultProject : project); try { String projectId = useProject.getProjectId(); Map<String, List<Object>> eventHandles = eventStore.getHandles(projectId); Map<String, List<Map<String, Object>>> events = buildEventMap(eventHandles); String response = publishAll(useProject, events); if (response != null) { try { handleAddEventsResponse(eventHandles, response); } catch (Exception e) { KeenLogging.log("Error handling response to batch publish: " + e.getMessage()); } } handleSuccess(callback); } catch (Exception e) { handleFailure(callback, e); } }
Source:
private boolean isRemoveCommandAvailable(List<DiskImage> disks) { if (disks.stream().anyMatch(d -> d.getImageStatus() == ImageStatus.LOCKED || (d.isOvfStore() && d.getImageStatus() != ImageStatus.ILLEGAL))) { return false; } return true; }

Target:
private boolean isRemoveCommandAvailable(List<DiskImage> disks) { return disks.stream().noneMatch(d -> d.getImageStatus() == ImageStatus.LOCKED || (d.isOvfStore() && d.getImageStatus() != ImageStatus.ILLEGAL))); }
Source:
private EnvVars getEnvVars() throws IOException, InterruptedException { return new EnvVars(build.getEnvironment(listener)).overrideAll(dockerEnv.env()); }

Target:
private EnvVars getEnvVars() throws IOException, InterruptedException { if (envVars == null) { envVars = new EnvVars(build.getEnvironment(listener)).overrideAll(dockerEnv.env()); } return envVars; }
Source:
public String toString() { return Objects.toStringHelper(this).add("date", date).add("state", state).add("entityId", entityId) .add("appId", applicationId).add("entitlementContext", user).toString(); }

Target:
public String toString() { return Objects.toStringHelper(this) .add("date", date) .add("state", state) .add("entityId", entityId) .add("appId", applicationId) .add("user", user) .toString(); }
Source:
public static int get(final String key) {if(!map.containsKey(key)) android.util.Log.e("AssignmentString", key); return map.containsKey(key) ? map.get(key) : R.string.na; }

Target:
public static int get(final String key) { return map.containsKey(key) ? map.get(key) : R.string.na; }
Source:
public void close() { PrivilegedAction<Void> closeAction = () -> { this.executor.shutdown(); return null; }; if (System.getSecurityManager() == null) { closeAction.run(); } else { AccessController.doPrivileged(closeAction); } }

Target:
public void close() { WildFlySecurityManager.doUnchecked((PrivilegedAction<Void>) () -> { this.executor.shutdown(); return null; }); }
Source:
public Observable<Address> createAddress(final Address address) { if (customerService.getCustomerToken() == null) { throw new IllegalStateException("customer must be logged in"); } if (address == null) { throw new NullPointerException("address cannot be null"); } return retrofitService .createAddress(customerService.getCustomerToken().getCustomerId(), new AddressWrapper(address)) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<AddressWrapper, Address>()) .onErrorResumeNext(new BuyClientExceptionHandler<Address>()) .observeOn(callbackScheduler); }

Target:
public Observable<Address> createAddress(final Address address) { CustomerToken customerToken = customerService.getCustomerToken(); if (customerToken == null) { throw new IllegalStateException("customer must be logged in"); } if (address == null) { throw new NullPointerException("address cannot be null"); } return retrofitService .createAddress(customerToken.getCustomerId(), new AddressWrapper(address)) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<AddressWrapper, Address>()) .onErrorResumeNext(new BuyClientExceptionHandler<Address>()) .observeOn(callbackScheduler); }
Source:
public void setBuffers(@Nonnull ChromatographyInfo[] rtBuffer, @Nonnull float[] intensityBuffer, int newSize) { if (rtBuffer.length != intensityBuffer.length) { throw new IllegalArgumentException( "The length of the rt and intensity arrays must be equal"); } for (int pos = 1; pos < newSize; pos++) { if (rtBuffer[pos - 1].compareTo(rtBuffer[pos]) >= 0) throw (new MSDKRuntimeException( "The RT array is not properly sorted. It should be sorted from lowest to highest.")); } this.rtBuffer = rtBuffer; this.intensityBuffer = intensityBuffer; this.size = newSize; }

Target:
public void setBuffers(@Nonnull ChromatographyInfo[] rtBuffer, @Nonnull float[] intensityBuffer, int newSize) { if (rtBuffer.length != intensityBuffer.length) { throw new IllegalArgumentException( "The length of the rt and intensity arrays must be equal"); } for (int pos = 1; pos < newSize; pos++) { if (rtBuffer[pos - 1].compareTo(rtBuffer[pos]) > 0) throw (new MSDKRuntimeException( "The RT array is not properly sorted. It should be sorted from lowest to highest.")); } this.rtBuffer = rtBuffer; this.intensityBuffer = intensityBuffer; this.size = newSize; }
Source:
public Optional<Argument> find(String name, StatementContext ctx) { if (name.startsWith(prefix)) { String propertyName = name.substring(prefix.length()); for (PropertyDescriptor descriptor : info.getPropertyDescriptors()) { if (propertyName.equals(descriptor.getName())) { Method getter = descriptor.getReadMethod(); if (getter == null) { throw new UnableToCreateStatementException(String.format("No getter method found for " + "bean property [%s] on [%s]", propertyName, bean), ctx); } try { Type propertyType = getter.getGenericReturnType(); Object propertyValue = getter.invoke(bean); Argument argument = ctx.findArgumentFor(propertyType, propertyValue) .orElseThrow(() -> new UnableToCreateStatementException( String.format("No argument factory registered for type [%s] for bean property [%s] on [%s]", propertyType, propertyName, bean), ctx)); return Optional.of(argument); } catch (IllegalAccessException e) { throw new UnableToCreateStatementException(String.format("Access exception invoking getter for " + "bean property [%s] on [%s]", propertyName, bean), e, ctx); } catch (InvocationTargetException e) { throw new UnableToCreateStatementException(String.format("Invocation target exception invoking " + "getter for bean property [%s] on [%s]", propertyName, bean), e, ctx); } } } } return Optional.empty(); }

Target:
public Optional<Argument> find(String name, StatementContext ctx) { if (name.startsWith(prefix)) { String propertyName = name.substring(prefix.length()); for (PropertyDescriptor descriptor : info.getPropertyDescriptors()) { if (propertyName.equals(descriptor.getName())) { Method getter = descriptor.getReadMethod(); if (getter == null) { throw new UnableToCreateStatementException(String.format("No getter method found for " + "bean property [%s] on [%s]", propertyName, bean), ctx); } try { Type propertyType = getter.getGenericReturnType(); Object propertyValue = getter.invoke(bean); Optional<Argument> argument = ctx.findArgumentFor(propertyType, propertyValue); if (!argument.isPresent()) { throw new UnableToCreateStatementException( String.format("No argument factory registered for type [%s] for bean property [%s] on [%s]", propertyType, propertyName, bean), ctx); } return argument; } catch (IllegalAccessException e) { throw new UnableToCreateStatementException(String.format("Access exception invoking getter for " + "bean property [%s] on [%s]", propertyName, bean), e, ctx); } catch (InvocationTargetException e) { throw new UnableToCreateStatementException(String.format("Invocation target exception invoking " + "getter for bean property [%s] on [%s]", propertyName, bean), e, ctx); } } } } return Optional.empty(); }
Source:
public void insertLocator(Locator locator) throws IOException { Session session = DatastaxIO.getSession(); long shard = (long) Util.getShard(locator.toString()); BoundStatement bs = putValue.bind(shard, locator.toString(), ""); Timer.Context timer = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { session.execute(bs); } finally { timer.stop(); } }

Target:
public void insertLocator(Locator locator) throws IOException { Session session = DatastaxIO.getSession(); long shard = (long) Util.getShard(locator.toString()); Timer.Context timer = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { BoundStatement bs = putValue.bind(shard, locator.toString(), ""); session.execute(bs); } finally { timer.stop(); } }
Source:
public void setActiveEditor(IEditorPart editor) { ActionRegistry registry = editor.getAdapter(ActionRegistry.class); IActionBars bars = getActionBars(); for (String id : globalActionKeys) { setGlobalActionHandler(registry, bars, id); } super.setActiveEditor(editor); }

Target:
public void setActiveEditor(IEditorPart editor) { setGlobalActionHandler(editor.getAdapter(ActionRegistry.class)); super.setActiveEditor(editor); }
Source:
protected void handleResult(ImportKeyResult result) { String intentAction = getIntent().getAction(); if (ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_RESULT.equals(intentAction) || ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN.equals(intentAction)) { Intent intent = new Intent(); intent.putExtra(ImportKeyResult.EXTRA_RESULT, result); setResult(RESULT_OK, intent); finish(); return; } if (result.isOkNew() || result.isOkUpdated()) { Preferences prefs = Preferences.getPreferences(this); prefs.setFirstTime(false); Intent intent = new Intent(this, MainActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent); return; } result.createNotify(ImportKeysActivity.this) .show((ViewGroup) findViewById(R.id.import_snackbar)); }

Target:
protected void handleResult(ImportKeyResult result) { String intentAction = getIntent().getAction(); if (ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_RESULT.equals(intentAction) || ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN.equals(intentAction)) { Intent intent = new Intent(); intent.putExtra(ImportKeyResult.EXTRA_RESULT, result); setResult(RESULT_OK, intent); finish(); } else if (result.isOkNew() || result.isOkUpdated()) { Preferences.getPreferences(this).setFirstTime(false); Intent intent = new Intent(this, MainActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent); } else { result.createNotify(ImportKeysActivity.this) .show((ViewGroup) findViewById(R.id.import_snackbar)); } }
Source:
public void shouldFindAllConstraints() throws Exception { try ( org.neo4j.graphdb.Transaction tx = graphDb.beginTx() ) { graphDb.schema().constraintFor( Label.label( "FOO" ) ).assertPropertyIsUnique( "prop1" ).create(); graphDb.schema().constraintFor( Label.label( "BAR" ) ).assertPropertyIsUnique( "prop2" ).create(); graphDb.schema().constraintFor( Label.label( "BAZ" ) ).assertPropertyIsUnique( "prop3" ).create(); tx.success(); } try ( Transaction tx = session.beginTransaction() ) { List<ConstraintDescriptor> constraints = asList( tx.schemaRead().constraintsGetAll( ) ); assertThat( constraints, hasSize( 3 ) ); } }

Target:
public void shouldFindAllConstraints() throws Exception { addConstraints( "FOO", "prop1", "BAR", "prop2", "BAZ", "prop3" ); try ( Transaction tx = session.beginTransaction() ) { List<ConstraintDescriptor> constraints = asList( tx.schemaRead().constraintsGetAll() ); assertThat( constraints, hasSize( 3 ) ); } }
Source:
public void init(Map<String, String> propertyMap) { }

Target:
public void init(Map<String, String> propertyMap) throws TaskException { }