auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void showDefaultValues() { interestRatePerPeriod = mLoanTemplate.getInterestRatePerPeriod(); loanTermFrequency = mLoanTemplate.getInterestRateFrequencyType().getId(); termFrequency = mLoanTemplate.getTermFrequency(); etPrincipal.setText(String.valueOf(mLoanTemplate.getPrincipal().toString())); etNumberOfRepayments.setText(String.valueOf( mLoanTemplate.getNumberOfRepayments().toString())); tvNominalRatePerYearMonth .setText(mLoanTemplate.getInterestRateFrequencyType().getValue()); etNominalInterestRate.setText(String.valueOf( mLoanTemplate.getInterestRatePerPeriod().toString())); etLoanTerm.setText(String.valueOf(termFrequency.toString())); if (mLoanTemplate.getRepaymentEvery() != null) { repaymentEvery = mLoanTemplate.getRepaymentEvery(); etRepaidEvery.setText(String.valueOf(repaymentEvery.toString())); } if (mLoanTemplate.getFundId() != null) { fundId = mLoanTemplate.getFundId(); spFund.setSelection(mLoanTemplate.getFundNameFromId(fundId)); } spLinkingOptions.setSelection(mListAccountLinkingOptions.size()); }

Target:
private void showDefaultValues() { interestRatePerPeriod = mLoanTemplate.getInterestRatePerPeriod(); loanTermFrequency = mLoanTemplate.getTermPeriodFrequencyType().getId(); termFrequency = mLoanTemplate.getTermFrequency(); etPrincipal.setText(String.valueOf(mLoanTemplate.getPrincipal().toString())); etNumberOfRepayments.setText(String.valueOf( mLoanTemplate.getNumberOfRepayments().toString())); tvNominalRatePerYearMonth .setText(mLoanTemplate.getInterestRateFrequencyType().getValue()); etNominalInterestRate.setText(String.valueOf( mLoanTemplate.getInterestRatePerPeriod().toString())); etLoanTerm.setText(String.valueOf(termFrequency.toString())); if (mLoanTemplate.getRepaymentEvery() != null) { repaymentEvery = mLoanTemplate.getRepaymentEvery(); etRepaidEvery.setText(String.valueOf(repaymentEvery.toString())); } if (mLoanTemplate.getFundId() != null) { fundId = mLoanTemplate.getFundId(); spFund.setSelection(mLoanTemplate.getFundNameFromId(fundId)); } spLinkingOptions.setSelection(mListAccountLinkingOptions.size()); }
Source:
public void testAccessControl() { String[] params = new String[] { Const.ParamsNames.FEEDBACK_SESSION_NAME, "First feedback session", Const.ParamsNames.COURSE_ID, "idOfTypicalCourse1" }; verifyOnlyInstructorsOfTheSameCourseCanAccess(params); verifyUnaccessibleWithoutModifyCoursePrivilege(params); }

Target:
public void testAccessControl() { String[] params = new String[] { Const.ParamsNames.FEEDBACK_SESSION_NAME, "First feedback session", Const.ParamsNames.COURSE_ID, "idOfTypicalCourse1", Const.ParamsNames.FEEDBACK_QUESTION_TEMPLATE_NUMBER, "1" }; verifyOnlyInstructorsOfTheSameCourseCanAccess(params); verifyUnaccessibleWithoutModifyCoursePrivilege(params); }
Source:
public static LttngUst20EventLayout getInstance() { synchronized (INSTANCE) { return INSTANCE; } }

Target:
public static synchronized LttngUst20EventLayout getInstance() { return INSTANCE; }
Source:
SortedSet<Integer> findPortsToUse(Offer offer, int maxCount) { SortedSet<Integer> portsToUse = new TreeSet<Integer>(); List<Value.Range> portRangesList = null; for (Resource resource : offer.getResourcesList()) { if (resource.getName().equals(PORT_RESOURCE_NAME)) { portRangesList = resource.getRanges().getRangeList(); break; } } LOGGER.fine("portRangesList=" + portRangesList); for (Value.Range currentPortRange : portRangesList) { int begin = (int) currentPortRange.getBegin(); long end = currentPortRange.getEnd(); for (int candidatePort = begin; candidatePort <= end && portsToUse.size() < maxCount; candidatePort++) { portsToUse.add(candidatePort); } } return portsToUse; }

Target:
SortedSet<Long> findPortsToUse(Offer offer, int maxCount) { SortedSet<Long> portsToUse = new TreeSet<Long>(); List<Value.Range> portRangesList = null; for (Resource resource : offer.getResourcesList()) { if (resource.getName().equals(PORT_RESOURCE_NAME)) { portRangesList = resource.getRanges().getRangeList(); break; } } LOGGER.fine("portRangesList=" + portRangesList); for (Value.Range currentPortRange : portRangesList) { long begin = currentPortRange.getBegin(); long end = currentPortRange.getEnd(); for (long candidatePort = begin; candidatePort <= end && portsToUse.size() < maxCount; candidatePort++) { portsToUse.add(candidatePort); } } return portsToUse; }
Source:
protected void executeCommand() { setReturnValue( getBackend().logoff( new VdcActionParametersBase(terminatedSessionId))); }

Target:
protected void executeCommand() { String terminatedSessionId = SessionDataContainer.getInstance().getSessionIdBySeqId( getParameters().getTerminatedSessionDbId()); if (terminatedSessionId == null) { log.info( "Cannot terminate session with database id '{}', it doesn't exist anymore.", getParameters().getTerminatedSessionDbId()); setSucceeded(false); return; } DbUser terminatedUser = SessionDataContainer.getInstance().getUser(terminatedSessionId, false); if (terminatedUser != null) { addCustomValue( "TerminatedSessionUsername", String.format("%s@%s", terminatedUser.getLoginName(), terminatedUser.getDomain())); } setReturnValue( getBackend().logoff( new VdcActionParametersBase(terminatedSessionId))); }
Source:
private static String currenciesToJSON(final ArrayList<String> currencies) { HashMap map = new HashMap<>(); for (String e : currencies) map.put("currencies", e); System.out.println("map : " + map); return new Gson().toJson(map); }

Target:
private static String currenciesToJSON(final ArrayList<String> currencies) { HashMap map = new HashMap<>(); for (String e : currencies) { map.put("currencies", e); } System.out.println("map : " + map); return new Gson().toJson(map); }
Source:
public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { Order order; if (orderType == OrderType.BUY) { if (price * volume > this.cashInHand) throw new StockMarketExpection("You don't have enough cash."); for(Order o: this.ordersPlaced) { if (o.getStockSymbol() == symbol) { throw new StockMarketExpection("You've already ordered this stock."); } } order = new BuyOrder(symbol, volume, price, this); ordersPlaced.add(order); } else { for(Order o: this.stocksOwned) { if (o.getStockSymbol() == symbol) { if (o.getSize() < volume) throw new StockMarketExpection("You don't have enough stocks."); } } order = new SellOrder(symbol, volume, price, this); ordersPlaced.add(order); } m.addOrder(order); }

Target:
public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { Order order; if (orderType == OrderType.BUY) { if (price * volume > this.cashInHand) throw new StockMarketExpection("You don't have enough cash."); for(Order o: this.ordersPlaced) { if (o.getStockSymbol() == symbol) { throw new StockMarketExpection("You've already ordered this stock."); } } order = new BuyOrder(symbol, volume, price, this); ordersPlaced.add(order); } else { for(Order o: this.stocksOwned) { if (o.getStockSymbol() == symbol && o.getSize() < volume) { throw new StockMarketExpection("You don't have enough stocks."); } } order = new SellOrder(symbol, volume, price, this); ordersPlaced.add(order); } m.addOrder(order); }
Source:
private void initRunVmCommand() { RunVmParams runVmParameters = getParameters(); if (getVm() != null) { refreshBootParameters(runVmParameters); getVm().setLastStartTime(new Date()); VmHandler.updateDisksForVm(getVm(), getDiskDao().getAllForVm(getVm().getId())); if (getVm().getStatus() != VMStatus.Suspended) { boolean archSupportSnapshot = FeatureSupported.isMemorySnapshotSupportedByArchitecture( getVm().getClusterArch(), getVm().getVdsGroupCompatibilityVersion()); memorySnapshotSupported = FeatureSupported.memorySnapshot(getVm().getVdsGroupCompatibilityVersion()) && archSupportSnapshot; memoryVolumeFromSnapshot = getActiveSnapshot().getMemoryVolume(); } } }

Target:
private void initRunVmCommand() { RunVmParams runVmParameters = getParameters(); if (getVm() != null) { refreshBootParameters(runVmParameters); getVm().setLastStartTime(new Date()); VmHandler.updateDisksForVm(getVm(), getDiskDao().getAllForVm(getVm().getId())); if (getVm().getStatus() != VMStatus.Suspended) { boolean archSupportSnapshot = FeatureSupported.isMemorySnapshotSupportedByArchitecture( getVm().getClusterArch(), getVm().getVdsGroupCompatibilityVersion()); memorySnapshotSupported = archSupportSnapshot && FeatureSupported.memorySnapshot(getVm().getVdsGroupCompatibilityVersion()); memoryVolumeFromSnapshot = getActiveSnapshot().getMemoryVolume(); } } }
Source:
private void buildInitialPackageStore() throws IOException { File nuxeoPackages = new File(nuxeoHome, "packages"); File nuxeoStrore = new File(nuxeoPackages, "store"); File uninstallFile = new File(testStore, "uninstall.xml"); FileUtils.iterateFiles(testStore, new String[] { "zip" }, false).forEachRemaining(pkgZip -> { try { File pkgDir = new File(nuxeoStrore, pkgZip.getName().replace(".zip", "")); ZipUtils.unzip(pkgZip, pkgDir); FileUtils.copyFileToDirectory(uninstallFile, pkgDir); } catch (IOException e) { e.printStackTrace(); } }); FileUtils.copyFileToDirectory(new File(testStore, ".packages"), nuxeoPackages); }

Target:
private void buildInitialPackageStore() throws IOException { File nuxeoPackages = new File(nuxeoHome, "packages"); File nuxeoStrore = new File(nuxeoPackages, "store"); File uninstallFile = new File(testStore, "uninstall.xml"); FileUtils.iterateFiles(testStore, new String[] { "zip" }, false).forEachRemaining(pkgZip -> { try { File pkgDir = new File(nuxeoStrore, pkgZip.getName().replace(".zip", "")); ZipUtils.unzip(pkgZip, pkgDir); FileUtils.copyFileToDirectory(uninstallFile, pkgDir); } catch (IOException e) { throw new RuntimeException(e); } }); FileUtils.copyFileToDirectory(new File(testStore, ".packages"), nuxeoPackages); }
Source:
public static int readInt32(final ByteBuffer buffer) { return (0xFF & (int) buffer.get()) | (0xFF & (int) buffer.get()) << 8 | (0xFF & (int) buffer.get()) << 16 | (0xFF & (int) buffer.get()) << 24; }

Target:
public static int readInt32(final ByteBuffer buffer) { return (0xFF & buffer.get()) | (0xFF & buffer.get()) << 8 | (0xFF & buffer.get()) << 16 | (0xFF & buffer.get()) << 24; }
Source:
public void onError(Throwable e) { e.printStackTrace(); try { FileLfsServlet.sendError(response, HttpStatus.SC_INTERNAL_SERVER_ERROR, e.getMessage()); context.complete(); in.close(); } catch (IOException ex) { LOG.log(Level.SEVERE, ex.getMessage(), ex); } }

Target:
public void onError(Throwable e) { try { FileLfsServlet.sendError(response, HttpStatus.SC_INTERNAL_SERVER_ERROR, e.getMessage()); context.complete(); in.close(); } catch (IOException ex) { LOG.log(Level.SEVERE, ex.getMessage(), ex); } }
Source:
public static byte[] getValue(Cell cell) { if(cell.getValueLength() >= cell.getValueArray().length) { return cell.getValueArray(); }else if(cell.getValueLength() < cell.getValueArray().length) { return Arrays.copyOfRange(cell.getValueArray(), 0, cell.getValueLength()); } return cell.getValueArray(); }

Target:
public static byte[] getValue(Cell cell) { if (cell.getValueLength() >= cell.getValueArray().length) { return cell.getValueArray(); } else { return Arrays.copyOfRange(cell.getValueArray(), 0, cell.getValueLength()); } }
Source:
public void resourceChanged(IResourceChangeEvent event) { IResourceDelta[] projectDeltas = event.getDelta().getAffectedChildren(); for (IResourceDelta delta : projectDeltas) { if(delta.getResource().getType() == IResource.PROJECT){ if((delta.getKind() == IResourceDelta.CHANGED || delta.getKind() == IResourceDelta.ADDED) && (delta.getFlags() & IResourceDelta.OPEN) != 0){ IProject project = delta.getResource().getProject(); if(project.isOpen()){ HybridProject hybridProject = HybridProject.getHybridProject(project); if(hybridProject != null ) { RestoreProjectJob job = new RestoreProjectJob(project); ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(project); job.setRule(rule); job.schedule(); } } } } } }

Target:
public void resourceChanged(IResourceChangeEvent event) { IResourceDelta[] projectDeltas = event.getDelta().getAffectedChildren(); for (IResourceDelta delta : projectDeltas) { if((delta.getResource().getType() == IResource.PROJECT) && (delta.getKind() == IResourceDelta.CHANGED || delta.getKind() == IResourceDelta.ADDED) && (delta.getFlags() & IResourceDelta.OPEN) != 0){ IProject project = delta.getResource().getProject(); if(project.isOpen()){ HybridProject hybridProject = HybridProject.getHybridProject(project); if(hybridProject != null ) { RestoreProjectJob job = new RestoreProjectJob(project); ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(project); job.setRule(rule); job.schedule(); } } } } }
Source:
protected String formatDate(Date date) { DateFormat df = new SimpleDateFormat(ConcurConstants.DATE_FORMAT); return df.format(date); }

Target:
protected String formatDate(Date date) { return getDateTimeService().toString(date, ConcurConstants.DATE_FORMAT); }
Source:
public OcflObjectSessionFactory getObject() { final var logicalPathMapper = SystemUtils.IS_OS_WINDOWS ? LogicalPathMappers.percentEncodingWindowsMapper() : LogicalPathMappers.percentEncodingLinuxMapper(); final var ocflRepo = new OcflRepositoryBuilder() .layoutConfig(new HashedTruncatedNTupleConfig()) .logicalPathMapper(logicalPathMapper) .storage(FileSystemOcflStorage.builder().repositoryRoot(ocflRoot).build()) .workDir(stagingDir) .buildMutable(); if (migrationType == MigrationType.F6_OCFL) { final var objectMapper = new ObjectMapper() .configure(WRITE_DATES_AS_TIMESTAMPS, false) .registerModule(new JavaTimeModule()) .setSerializationInclusion(JsonInclude.Include.NON_NULL); return new DefaultOcflObjectSessionFactory(ocflRepo, stagingDir, objectMapper, CommitType.NEW_VERSION, "Generated by Fedora 3 to Fedora 6 migration", user, userUri); } else { return new VanillaOcflObjectSessionFactory(ocflRepo, stagingDir, "Generated by Fedora 3 to Fedora 6 migration", user, userUri); } }

Target:
public OcflObjectSessionFactory getObject() { final var logicalPathMapper = SystemUtils.IS_OS_WINDOWS ? LogicalPathMappers.percentEncodingWindowsMapper() : LogicalPathMappers.percentEncodingLinuxMapper(); final var ocflRepo = new OcflRepositoryBuilder() .layoutConfig(new HashedTruncatedNTupleConfig()) .logicalPathMapper(logicalPathMapper) .storage(FileSystemOcflStorage.builder().repositoryRoot(ocflRoot).build()) .workDir(stagingDir) .buildMutable(); if (migrationType == MigrationType.FEDORA_OCFL) { final var objectMapper = new ObjectMapper() .configure(WRITE_DATES_AS_TIMESTAMPS, false) .registerModule(new JavaTimeModule()) .setSerializationInclusion(JsonInclude.Include.NON_NULL); return new DefaultOcflObjectSessionFactory(ocflRepo, stagingDir, objectMapper, CommitType.NEW_VERSION, "Generated by Fedora 3 to Fedora 6 migration", user, userUri); } else { return new PlainOcflObjectSessionFactory(ocflRepo, stagingDir, "Generated by Fedora 3 to Fedora 6 migration", user, userUri); } }
Source:
public FEELFnResult<TemporalAccessor> invoke(@ParameterName( "date" ) TemporalAccessor date, @ParameterName( "time" ) TemporalAccessor time) { if ( date == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "date", "cannot be null")); } if ( !(date instanceof LocalDate) ) { date = BuiltInFunctions.getFunction(DateFunction.class).invoke(date).getOrElse(null); if (!(date instanceof LocalDate)) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "date", "must be an instance of LocalDate (or must be possible to convert to a FEEL date using built-in date(date) )")); } } if ( time == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "time", "cannot be null")); } if ( !(time instanceof LocalTime || time instanceof OffsetTime) ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "time", "must be an instance of LocalTime or OffsetTime")); } try { if( date instanceof LocalDate && time instanceof LocalTime ) { return FEELFnResult.ofResult( LocalDateTime.of( (LocalDate) date, (LocalTime) time ) ); } else if( date instanceof LocalDate && time instanceof OffsetTime ) { return FEELFnResult.ofResult( ZonedDateTime.of( (LocalDate) date, LocalTime.from( time ), ZoneOffset.from( time ) ) ); } return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "cannot invoke function for the input parameters")); } catch (DateTimeException e) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "input parameters date-parsing exception", e)); } }

Target:
public FEELFnResult<TemporalAccessor> invoke(@ParameterName( "date" ) TemporalAccessor date, @ParameterName( "time" ) TemporalAccessor time) { if ( date == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "date", "cannot be null")); } if ( !(date instanceof LocalDate) ) { date = date.query(TemporalQueries.localDate()); if (date == null) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "date", "must be an instance of LocalDate (or must be possible to convert to a FEEL date using built-in date(date) )")); } } if ( time == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "time", "cannot be null")); } if ( !(time instanceof LocalTime || time instanceof OffsetTime) ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "time", "must be an instance of LocalTime or OffsetTime")); } try { if( date instanceof LocalDate && time instanceof LocalTime ) { return FEELFnResult.ofResult( LocalDateTime.of( (LocalDate) date, (LocalTime) time ) ); } else if( date instanceof LocalDate && time instanceof OffsetTime ) { return FEELFnResult.ofResult( ZonedDateTime.of( (LocalDate) date, LocalTime.from( time ), ZoneOffset.from( time ) ) ); } return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "cannot invoke function for the input parameters")); } catch (DateTimeException e) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "input parameters date-parsing exception", e)); } }
Source:
public static List<Long> getDishCategoryIds(final SQLiteDatabase db, final long dishId) { final Cursor c = db.rawQuery("SELECT " + CATEGORY_ID + " FROM " + TABLE_NAME + " WHERE " + DISH_ID + " =?", new String[] { String.valueOf(dishId) }); if (c != null) { List<Long> list = new ArrayList<Long>(); try { if (c.moveToFirst()) { list.add(c.getLong(c.getColumnIndex(CATEGORY_ID))); } } finally { c.close(); } return list; } return Collections.emptyList(); }

Target:
public static List<Long> getDishCategoryIds(final SQLiteDatabase db, final long dishId) { final Cursor c = db.rawQuery("SELECT " + CATEGORY_ID + " FROM " + TABLE_NAME + " WHERE " + DISH_ID + " =?", new String[] { String.valueOf(dishId) }); if (c != null) { List<Long> list = new ArrayList<Long>(); try { while (c.moveToNext()) { list.add(c.getLong(c.getColumnIndex(CATEGORY_ID))); } } finally { c.close(); } return list; } return Collections.emptyList(); }
Source:
private ExpansionRegionStructuredActivityNodeContentCompartmentEditPart createCompartmentEP(ExpansionRegionEditPart parentEP) { View decoratorView = NotationFactory.eINSTANCE.createDecorationNode(); decoratorView.setType("" + ExpansionRegionStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID); parentEP.getNotationView().insertChild(decoratorView); CustomExpansionRegionStructuredActivityNodeContentCompartmentEditPart compartment = new CustomExpansionRegionStructuredActivityNodeContentCompartmentEditPart(decoratorView); compartment.setParent(parentEP); return compartment; }

Target:
private MockCustomExpansionRegionCompartmentEditPart createCompartmentEP(ExpansionRegionEditPart parentEP) { View decoratorView = NotationFactory.eINSTANCE.createDecorationNode(); decoratorView.setType("" + ExpansionRegionStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID); parentEP.getNotationView().insertChild(decoratorView); MockCustomExpansionRegionCompartmentEditPart compartment = new MockCustomExpansionRegionCompartmentEditPart(decoratorView); compartment.setParent(parentEP); return compartment; }
Source:
public LruBlockCache(final LruBlockCacheConfiguration conf) { this.conf = conf; int mapInitialSize = (int) Math.ceil(1.2 * conf.getMaxSize() / conf.getBlockSize()); if (conf.getSingleFactor() + conf.getMultiFactor() + conf.getMemoryFactor() != 1) { throw new IllegalArgumentException("Single, multi, and memory factors " + " should total 1.0"); } if (conf.getMinFactor() >= conf.getAcceptableFactor()) { throw new IllegalArgumentException("minFactor must be smaller than acceptableFactor"); } if (conf.getMinFactor() >= 1.0f || conf.getAcceptableFactor() >= 1.0f) { throw new IllegalArgumentException("all factors must be < 1"); } map = new ConcurrentHashMap<>(mapInitialSize, conf.getMapLoadFactor(), conf.getMapConcurrencyLevel()); this.stats = new CacheStats(); this.count = new AtomicLong(0); this.elements = new AtomicLong(0); this.overhead = calculateOverhead(conf.getMaxSize(), conf.getBlockSize(), conf.getMapConcurrencyLevel()); this.size = new AtomicLong(this.overhead); if (conf.isUseEvictionThread()) { this.evictionThread = new EvictionThread(this); this.evictionThread.start(); while (!this.evictionThread.running()) { try { Thread.sleep(10); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } } else { this.evictionThread = null; } this.scheduleThreadPool.scheduleAtFixedRate(new StatisticsThread(this), statThreadPeriod, statThreadPeriod, TimeUnit.SECONDS); }

Target:
public LruBlockCache(final LruBlockCacheConfiguration conf) { this.conf = conf; int mapInitialSize = (int) Math.ceil(1.2 * conf.getMaxSize() / conf.getBlockSize()); map = new ConcurrentHashMap<>(mapInitialSize, conf.getMapLoadFactor(), conf.getMapConcurrencyLevel()); this.stats = new CacheStats(); this.count = new AtomicLong(0); this.elements = new AtomicLong(0); this.overhead = calculateOverhead(conf.getMaxSize(), conf.getBlockSize(), conf.getMapConcurrencyLevel()); this.size = new AtomicLong(this.overhead); if (conf.isUseEvictionThread()) { this.evictionThread = new EvictionThread(this); this.evictionThread.start(); while (!this.evictionThread.running()) { try { Thread.sleep(10); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } } else { this.evictionThread = null; } this.scheduleThreadPool.scheduleAtFixedRate(new StatisticsThread(this), statThreadPeriod, statThreadPeriod, TimeUnit.SECONDS); }
Source:
public Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result) { try { List<String> response = this.connection.select(this.spaceNo, 0, Arrays.asList(key), 0, 1, 0); tupleConvertFilter(response, fields, result); return Status.OK; } catch (Exception exc) { System.err.println("Can't select range elements"); exc.printStackTrace(); return Status.ERROR; } }

Target:
public Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result) { List<String> response = this.connection.select(this.spaceNo, 0, Arrays.asList(key), 0, 1, 0); tupleConvertFilter(response, fields, result); return Status.OK; }
Source:
public Set<EObject> getAllInstances(EClass type) { Preconditions.checkArgument(IndexingLevel.FULL == getIndexingLevel(type)); Set<EObject> retSet = new HashSet<EObject>(); Object typeKey = toKey(type); Set<Object> subTypes = metaStore.getSubTypeMap().get(typeKey); if (subTypes != null) { for (Object subTypeKey : subTypes) { final Set<EObject> instances = instanceStore.getInstanceSet(subTypeKey); if (instances != null) { retSet.addAll(instances); } } } final Set<EObject> instances = instanceStore.getInstanceSet(typeKey); if (instances != null) { retSet.addAll(instances); } return retSet; }

Target:
public Set<EObject> getAllInstances(EClass type) { Set<EObject> retSet = new HashSet<EObject>(); Object typeKey = toKey(type); Set<Object> subTypes = metaStore.getSubTypeMap().get(typeKey); if (subTypes != null) { for (Object subTypeKey : subTypes) { final Set<EObject> instances = instanceStore.getInstanceSet(subTypeKey); if (instances != null) { retSet.addAll(instances); } } } final Set<EObject> instances = instanceStore.getInstanceSet(typeKey); if (instances != null) { retSet.addAll(instances); } return retSet; }
Source:
public void testSearch() throws Exception { String[] searchTerms = { Constants.NEWS, "structuretype = 2", " And structure.inode='" + Constants.NEWS + "'" }; int totalCount = contentTypeFactory.searchCount(null); List<ContentType> types=contentTypeFactory.search(null, BaseContentType.ANY, "name", -1,0); assertThat("we have at least 40 content types", types.size() > 20); types = contentTypeFactory.search(null, BaseContentType.ANY, "name", -1, 0); assertThat("limit works and we have max five content types", types.size() < 6); for (int x = 0; x < totalCount; x = x + 5) { types = contentTypeFactory.search(null, BaseContentType.ANY, "name", -1, x); assertThat("we have max five content types", types.size() < 6); } for (int i = 0; i < BaseContentType.values().length; i++) { types = contentTypeFactory.search(null, BaseContentType.getBaseContentType(i), "name", -1, 0); assertThat("we have content types of" + BaseContentType.getBaseContentType(i), types.size() > 0); int count = contentTypeFactory.searchCount(null, BaseContentType.getBaseContentType(i)); assertThat("Count works as well", types.size() == count); } for (int i = 0; i < searchTerms.length; i++) { types = contentTypeFactory.search(searchTerms[i], BaseContentType.ANY, "mod_date desc", -1, 0); assertThat("we can search content types:" + searchTerms[i], types.size() > 0); int count = contentTypeFactory.searchCount(searchTerms[i], BaseContentType.ANY); assertThat("Count works as well", types.size() == count); } }

Target:
public void testSearch() throws Exception { String[] searchTerms = { Constants.NEWS, "structuretype = 2", " And structure.inode='" + Constants.NEWS + "'" }; int totalCount = contentTypeFactory.searchCount(null); List<ContentType> types=contentTypeFactory.search(null, BaseContentType.ANY, "name", -1,0); assertThat("we have at least 40 content types", types.size() > 20); types = contentTypeFactory.search(null, BaseContentType.ANY, "name", 5, 0); assertThat("limit works and we have max five content types", types.size() < 6); for (int x = 0; x < totalCount; x = x + 5) { types = contentTypeFactory.search(null, BaseContentType.ANY, "name", 5, x); assertThat("we have max five content types", types.size() < 6); } for (int i = 0; i < BaseContentType.values().length; i++) { types = contentTypeFactory.search(null, BaseContentType.getBaseContentType(i), "name", -1, 0); assertThat("we have content types of" + BaseContentType.getBaseContentType(i), types.size() > 0); int count = contentTypeFactory.searchCount(null, BaseContentType.getBaseContentType(i)); assertThat("Count works as well", types.size() == count); } for (int i = 0; i < searchTerms.length; i++) { types = contentTypeFactory.search(searchTerms[i], BaseContentType.ANY, "mod_date desc", -1, 0); assertThat("we can search content types:" + searchTerms[i], types.size() > 0); int count = contentTypeFactory.searchCount(searchTerms[i], BaseContentType.ANY); assertThat("Count works as well", types.size() == count); } }
Source:
public static void main(String[] args) throws Exception { String columnFile = "02.feats"; CoNLLColumnFormatReader reader = new CoNLLColumnFormatReader("PennTreebank-WSJ", "02", columnFile, ViewNames.SRL_VERB, new BasicTextAnnotationBuilder()); Counter<String> counter = new Counter<>(); List<String> predicates = new ArrayList<>(); for (TextAnnotation ta : reader) { counter.incrementCount("Sentences"); logger.info(ta.getTokenizedText()); if (!ta.hasView(ViewNames.SRL_VERB)) continue; PredicateArgumentView pav = (PredicateArgumentView) ta.getView(ViewNames.SRL_VERB); List<Constituent> predicates2 = pav.getPredicates(); counter.incrementCount("Predicates", predicates2.size()); for (Constituent c : predicates2) { predicates.add(c.getAttribute(PredicateArgumentView.LemmaIdentifier)); } } logger.info((int) counter.getCount("Sentences") + " sentences"); logger.info((int) counter.getCount("Predicates") + " predicates"); }

Target:
public static void main(String[] args) throws Exception { String columnFile = "02.feats"; CoNLLColumnFormatReader reader = new CoNLLColumnFormatReader("PennTreebank-WSJ", "02", columnFile, ViewNames.SRL_VERB, new BasicTextAnnotationBuilder()); Counter<String> counter = new Counter<>(); List<String> predicates = new ArrayList<>(); for (TextAnnotation ta : reader) { counter.incrementCount("Sentences"); System.out.println(ta.getTokenizedText()); if (!ta.hasView(ViewNames.SRL_VERB)) continue; PredicateArgumentView pav = (PredicateArgumentView) ta.getView(ViewNames.SRL_VERB); List<Constituent> predicates2 = pav.getPredicates(); counter.incrementCount("Predicates", predicates2.size()); for (Constituent c : predicates2) { predicates.add(c.getAttribute(PredicateArgumentView.LemmaIdentifier)); } } System.out.println((int) counter.getCount("Sentences") + " sentences"); System.out.println((int) counter.getCount("Predicates") + " predicates"); }
Source:
private void stopAutoMove() { isAutoMove = false; List<Input> inputs = bindsConfig.getBinds(new SimpleUri("engine:forwards")); Input forwardKey = inputs.get(0); inputSystem.cancelSimulatedKeyStroke(forwardKey); }

Target:
private void stopAutoMove() { List<Input> inputs = bindsConfig.getBinds(new SimpleUri("engine:forwards")); Input forwardKey = getValidKey(inputs); if(forwardKey != null) { inputSystem.cancelSimulatedKeyStroke(forwardKey); isAutoMove = false; } }
Source:
public Property<T> setDefaultValue(T value) { storedDefaultValue = value; return this; }

Target:
protected Property<T> setDefaultValue(T value) { storedDefaultValue = value; return this; }
Source:
private void createEncounterTestData() throws ParseException, ConceptNameAlreadyInUseException { createdProvider = prepareProvider(); createdEncounterType = prepareEncounterType(); Location location = locationService.getLocations(DEFAULT_CONFIG_NAME, DEFAULT_LOCATION_NAME).get(0); Encounter encounter = new Encounter(location, createdEncounterType, new DateTime("2001-01-16T00:00:00Z").toDate(), createdPatient, null, Collections.singletonList(createdProvider.getPerson()), null); createdEncounter = encounterService.createEncounter(DEFAULT_CONFIG_NAME, encounter); }

Target:
private void createEncounterTestData() throws ParseException, ConceptNameAlreadyInUseException { createdProvider = prepareProvider(); createdEncounterType = prepareEncounterType(); Visit createdVisit = prepareVisit(); Location location = locationService.getLocations(DEFAULT_CONFIG_NAME, DEFAULT_LOCATION_NAME).get(0); Encounter encounter = new Encounter(location, createdEncounterType, encounterDateTime.toDate(), createdPatient, createdVisit, Collections.singletonList(createdProvider.getPerson()), null); createdEncounter = encounterService.createEncounter(DEFAULT_CONFIG_NAME, encounter); }
Source:
public void testWriteQueryResult() throws UnsupportedEncodingException { Resource resource = new ClasspathResource("classpath:jmxtrans-config-console-test.xml"); JmxTransConfigurationLoader loader = new JmxTransConfigurationXmlLoader(resource); JmxTransExporter exporter = new JmxTransExporter(loader); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream prev = System.out; System.setOut(ps); try { exporter.collectAndExport(); try { Thread current = Thread.currentThread(); synchronized(current) { current.wait(2005); } } catch (InterruptedException e) { } exporter.collectAndExport(); } finally { System.setOut(prev); } String[] splitted = baos.toString().split(System.lineSeparator()); assertThat(splitted.length, is(2)); assertThat(splitted[0], startsWith("jvm.thread ")); assertThat(splitted[1], startsWith("jvm.thread ")); }

Target:
public void testWriteQueryResult() throws UnsupportedEncodingException { Resource resource = new ClasspathResource("classpath:jmxtrans-config-console-test.xml"); JmxTransConfigurationLoader loader = new JmxTransConfigurationXmlLoader(resource); JmxTransExporter exporter = new JmxTransExporter(loader); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream prev = System.out; System.setOut(ps); try { exporter.collectAndExport(); try { Thread.sleep(2005); } catch (InterruptedException e) { } exporter.collectAndExport(); } finally { System.setOut(prev); } String[] splitted = baos.toString().split(System.lineSeparator()); assertThat(splitted, arrayContaining(startsWith("jvm.thread "), startsWith("jvm.thread "))); }
Source:
private static void renamePackagesInDirectory(@NotNull final Project project, @NotNull final PsiDirectory dir, @NotNull final String newName) { WriteCommandAction.runWriteCommandAction(project, new Runnable() { @Override public void run() { for (PsiFile file : dir.getFiles()) { if (GoUtil.allowed(file)) { GoPackageClause packageClause = ((GoFile)file).getPackage(); String name = ((GoFile)file).getPackageName(); if (packageClause != null && name != null && name.equals(GoConstants.DOCUMENTATION)) { String fullName = GoTestFinder.isTestFile(file) ? newName + GoConstants.TEST_SUFFIX : newName; packageClause.replace(GoElementFactory.createPackageClause(project, fullName)); } } } } }); }

Target:
private static void renamePackagesInDirectory(@NotNull final Project project, @NotNull final PsiDirectory dir, @NotNull final String newName) { WriteCommandAction.runWriteCommandAction(project, new Runnable() { @Override public void run() { for (PsiFile file : dir.getFiles()) { if (file instanceof GoFile && !GoUtil.libraryDirectoryToIgnore(file.getName())) { GoPackageClause packageClause = ((GoFile)file).getPackage(); String name = ((GoFile)file).getPackageName(); if (packageClause != null && name != null && !name.equals(GoConstants.DOCUMENTATION)) { String fullName = GoTestFinder.isTestFile(file) ? newName + GoConstants.TEST_SUFFIX : newName; packageClause.replace(GoElementFactory.createPackageClause(project, fullName)); } } } } }); }
Source:
public static GelfDynamicMdcFieldType createField(@PluginConfiguration final Configuration config, @PluginAttribute("regex") String regex, @PluginAttribute("type") String type) { if (Strings.isEmpty(regex) || Strings.isEmpty(type)) { LOGGER.error(String.format("regex=%s or type=%s is empty or null", regex, type)); return null; } else { try { Pattern.compile(regex); } catch (Exception e) { LOGGER.error(String.format("Regex ix invalid: regex=%s", regex)); return null; } } return new GelfDynamicMdcFieldType(regex, type); }

Target:
public static GelfDynamicMdcFieldType createField(@PluginConfiguration final Configuration config, @PluginAttribute("regex") String regex, @PluginAttribute("type") String type) { Pattern pattern; if (Strings.isEmpty(regex) || Strings.isEmpty(type)) { throw new IllegalArgumentException(String.format("regex=%s or type=%s is empty or null", regex, type)); } try { pattern = Pattern.compile(regex); } catch (Exception e) { throw new IllegalArgumentException(String.format("Regex is invalid: regex=%s", regex), e); } return new GelfDynamicMdcFieldType(pattern, type); }
Source:
private void simulateSessionExpiration(ZkClientInterceptingAdapter adapter) { ZkConnection zkConnection = null; try { Field privateField = ZkClient.class.getSuperclass().getDeclaredField("_connection"); privateField.setAccessible(true); zkConnection = (ZkConnection) privateField.get(adapter.getZkClient()); } catch (NoSuchFieldException | IllegalAccessException e) { Assert.fail(e.toString()); } ZooKeeper zookeeper = zkConnection.getZookeeper(); long sessionId = zookeeper.getSessionId(); LOG.info("Closing/expiring session:" + sessionId); ZooKeeperServer zkServer = _embeddedZookeeper.getZooKeeperServer(); zkServer.closeSession(sessionId); }

Target:
private void simulateSessionExpiration(ZkClientInterceptingAdapter adapter) { long sessionId = adapter.getSessionId(); LOG.info("Closing/expiring session: " + sessionId); _embeddedZookeeper.closeSession(sessionId); }
Source:
public void testTableWriter() { ImmutableList<VariableReferenceExpression> variableReferenceExpressions = ImmutableList.of(variableReferenceExpression); ImmutableList<String> strs = ImmutableList.of(""); TableWriterNode tableWriterNode = builder.tableWriter( variableReferenceExpressions, strs, valuesNode); testValidation(tableWriterNode); }

Target:
public void testTableWriter() { ImmutableList<VariableReferenceExpression> variableReferenceExpressions = ImmutableList.of(VARIABLE_REFERENCE_EXPRESSION); TableWriterNode tableWriterNode = builder.tableWriter( variableReferenceExpressions, ImmutableList.of(""), valuesNode); testValidation(tableWriterNode); }
Source:
public void setChmodOctal(String chmod) { Assert.notNull(chmod, "'chmod' cannot be null"); this.chmod = Integer.parseInt(chmod, 8); }

Target:
public void setChmodOctal(String chmod) { Assert.notNull(chmod, "'chmod' cannot be null"); setChmod(Integer.parseInt(chmod, 8)); }
Source:
public double computeForOperation(MetricKey<O> key, O node, MetricOptions options) { Objects.requireNonNull(key, "The metric key must not be null"); if (!key.supports(node)) { return Double.NaN; } MetricOptions safeOptions = options == null ? MetricOptions.emptyOptions() : options; MetricMemoizer<O> memoizer = getLanguageSpecificProjectMemoizer().getOperationMemoizer(node.getQualifiedName()); return memoizer == null ? Double.NaN : getLanguageSpecificComputer().computeForOperation(key, node, false, safeOptions, memoizer); }

Target:
public double computeForOperation(MetricKey<O> key, O node, MetricOptions options) { Objects.requireNonNull(key, NULL_KEY_MESSAGE); Objects.requireNonNull(options, NULL_OPTIONS_MESSAGE); Objects.requireNonNull(node, NULL_NODE_MESSAGE); if (!key.supports(node)) { return Double.NaN; } MetricMemoizer<O> memoizer = getLanguageSpecificProjectMemoizer().getOperationMemoizer(node.getQualifiedName()); return memoizer == null ? Double.NaN : getLanguageSpecificComputer().computeForOperation(key, node, false, options, memoizer); }
Source:
public Result apply(SemiJoinNode semiJoinNode, Captures captures, Context context) { JoinDistributionType joinDistributionType = getJoinDistributionType(context.getSession()); if (joinDistributionType == AUTOMATIC) { return Result.ofPlanNode(getCostBasedDistributionType(semiJoinNode, context)); } else if (joinDistributionType.canPartition()) { return Result.ofPlanNode(semiJoinNode.withDistributionType(PARTITIONED)); } return Result.ofPlanNode(semiJoinNode.withDistributionType(REPLICATED)); }

Target:
public Result apply(SemiJoinNode semiJoinNode, Captures captures, Context context) { JoinDistributionType joinDistributionType = getJoinDistributionType(context.getSession()); switch (joinDistributionType) { case AUTOMATIC: return Result.ofPlanNode(getCostBasedDistributionType(semiJoinNode, context)); case PARTITIONED: return Result.ofPlanNode(semiJoinNode.withDistributionType(PARTITIONED)); case BROADCAST: return Result.ofPlanNode(semiJoinNode.withDistributionType(REPLICATED)); default: throw new IllegalArgumentException("Unknown join_distribution_type: " + joinDistributionType); } }
Source:
public List getBuilds() { Item item = Stapler.getCurrentRequest().findAncestorObject(Item.class); return getBuilds(item); }

Target:
public List getBuilds() { final StaplerRequest currentRequest = Stapler.getCurrentRequest(); final Item item = currentRequest != null ? currentRequest.findAncestorObject(Item.class) : null; return getRuns(item); }
Source:
public Flux<FeedResponse<T>> byPage() { CosmosPagedFluxOptions cosmosPagedFluxOptions = new CosmosPagedFluxOptions(); return FluxUtil.fluxContext(context -> byPage(cosmosPagedFluxOptions, context)).subscriberContext(TracerProvider.callDepthAttributeFunc); }

Target:
public Flux<FeedResponse<T>> byPage() { CosmosPagedFluxOptions cosmosPagedFluxOptions = new CosmosPagedFluxOptions(); if (!this.isTracerEnabled) { return this.optionsFluxFunction.apply(cosmosPagedFluxOptions); } return FluxUtil.fluxContext(context -> byPage(cosmosPagedFluxOptions, context)); }
Source:
public void testGetCssIdentifier() { for (int pass = 0; pass < 5; pass++) { String input, expected, result; switch (pass) { case 0: input = "-_perfectlyfine"; expected = input; break; case 1: input = "--verybad"; expected = "_-verybad"; break; case 2: input = "-2badagain?"; expected = "_2badagain_"; break; case 3: input = "great342_-↲"; expected = input; break; case 4: input = "4abc_bad"; expected = "_abc_bad"; break; default: input = expected = ""; } result = StringUtil.getCssIdentifier(input); assertTrue(StringUtil.equals(expected, result)); } }

Target:
public void testGetCssIdentifier() { List<Pair<String, String>> testList = new ArrayList<>(); testList.add(new Pair<>("4abc_bad", "_abc_bad")); testList.add(new Pair<>("--verybad", "_-verybad")); testList.add(new Pair<>("-2badagain?", "_2badagain_")); testList.add(new Pair<>("great342_-↲", "great342_-↲")); testList.add(new Pair<>("-_perfectlyfine", "-_perfectlyfine")); for (Pair<String, String> td : testList) { String result = StringUtil.getCssIdentifier(td.first); assertTrue(StringUtil.equals(td.second, result)); } }
Source:
protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { final Collection<BorderedStyle> allBorderedStylesToUpdate = Sets.newLinkedHashSet(); for (DView dView : dAnalysis.getOwnedViews()) { for (DDiagram dDiagram : Iterables.filter(dView.getOwnedRepresentations(), DDiagram.class)) { for (DDiagramElement diagramElement : dDiagram.getOwnedDiagramElements()) { if (diagramElement.getStyle() instanceof BorderedStyle) { allBorderedStylesToUpdate.add((BorderedStyle) diagramElement.getStyle()); } } } } Integer zero = new Integer(0); Integer one = new Integer(1); for (BorderedStyle borderedStyleToUpdate : allBorderedStylesToUpdate) { if (zero.equals(borderedStyleToUpdate.getBorderSize()) && "1".equals(borderedStyleToUpdate.getBorderSizeComputationExpression())) { borderedStyleToUpdate.setBorderSize(one); } } } }

Target:
protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { final Collection<BorderedStyle> allBorderedStylesToUpdate = Sets.newLinkedHashSet(); for (DView dView : dAnalysis.getOwnedViews()) { for (DDiagram dDiagram : Iterables.filter(dView.getOwnedRepresentations(), DDiagram.class)) { for (DDiagramElement diagramElement : new DDiagramInternalQuery(dDiagram).getDiagramElements()) { if (diagramElement.getStyle() instanceof BorderedStyle) { allBorderedStylesToUpdate.add((BorderedStyle) diagramElement.getStyle()); } } } } Integer zero = new Integer(0); Integer one = new Integer(1); for (BorderedStyle borderedStyleToUpdate : allBorderedStylesToUpdate) { if (zero.equals(borderedStyleToUpdate.getBorderSize()) && "1".equals(borderedStyleToUpdate.getBorderSizeComputationExpression())) { borderedStyleToUpdate.setBorderSize(one); } else { System.out.println("here"); } } } }
Source:
public void addSampleToWorkspace(String sampleName) { waitAddOrImportFormOpened(); if (!isSampleCheckboxEnabled(sampleName)) ; { clickOnSampleCheckbox(sampleName); } waitSampleCheckboxEnabled(sampleName); clickOnAddButton(); waitProjectTabAppearance(sampleName); }

Target:
public void addSampleToWorkspace(String sampleName) { waitAddOrImportFormOpened(); if (!isSampleCheckboxEnabled(sampleName)) { clickOnSampleCheckbox(sampleName); } waitSampleCheckboxEnabled(sampleName); clickOnAddButton(); waitProjectTabAppearance(sampleName); }
Source:
public File getPidFile() { return new File(temporaryFolder.getRoot(), "__tmp.pid.file.swarm__"); }

Target:
private static File getPidFile() throws IOException { File pidFile = File.createTempFile("swarm-client", ".pid", temporaryFolder.getRoot()); pidFile.delete(); return pidFile; }
Source:
public Response register() throws Exception { ResteasyProviderFactory factory = ResteasyProviderFactory.newInstance(); factory.registerProviderInstance(paramConvertrProvider); factory.registerProviderInstance(exceptionMapper); return Response.ok("ok").build(); }

Target:
public Response register() throws Exception { ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); factory.registerProviderInstance(paramConvertrProvider); factory.registerProviderInstance(exceptionMapper); return Response.ok("ok").build(); }
Source:
private Uri welcomeDeepLinkFromUser(User user) { return Uri.parse(deepLinkBaseUrl) .buildUpon() .appendPath("welcome") .appendQueryParameter("sender", user.getName()) .build(); }

Target:
private Uri welcomeDeepLinkFromUser(User user) { return Uri.parse(deepLinkBaseUrl) .buildUpon() .appendPath("welcome") .appendQueryParameter(SENDER, user.getName()) .build(); }
Source:
public void addSteps(MigrationStepRegistry registry) { registry .add(1800, "Add incremental column to snapshots table", AddIncrementalColumnToSnapshotsTable.class) .add(1801, "Create table CE task characteristics", CreateTableCeTaskCharacteristics.class) .add(1802, "Delete leak settings on views", DeleteLeakSettingsOnViews.class) .add(1803, "Fix empty USERS.EXTERNAL_IDENTITY and USERS.EXTERNAL_IDENTITY_PROVIDER", FixEmptyIdentityProviderInUsers.class) .add(1804, "Add rules.plugin_key", AddPluginKeyToRules.class) .add(1805, "Create table plugins", CreateTablePlugins.class) .add(1806, "Create table project_branches", CreateTableProjectBranches.class) .add(1807, "Add on project_branches key", AddIndexOnProjectBranchesKey.class) .add(1808, "Add branch column to projects table", AddBranchColumnToProjectsTable.class) .add(1809, "Populate project_branches with existing main branches", PopulateMainProjectBranches.class) .add(1810, "Add ANALYSIS_UUID in WEBHOOK_DELIVERIES", AddAnalysisUuidToWebhookDeliveries.class) .add(1811, "Make column CE_TASK_UUID nullable", UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries.class) .add(1812, "Populate ANALYSIS_UUID of WEBHOOK_DELIVERIES", PopulateAnalysisUuidColumnOnWebhookDeliveries.class) .add(1813, "Make ANALYSIS_UUID not null in WEBHOOK_DELIVERIES", UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries.class) ; }

Target:
public void addSteps(MigrationStepRegistry registry) { registry .add(1800, "Add incremental column to snapshots table", AddIncrementalColumnToSnapshotsTable.class) .add(1801, "Create table CE task characteristics", CreateTableCeTaskCharacteristics.class) .add(1802, "Delete leak settings on views", DeleteLeakSettingsOnViews.class) .add(1803, "Fix empty USERS.EXTERNAL_IDENTITY and USERS.EXTERNAL_IDENTITY_PROVIDER", FixEmptyIdentityProviderInUsers.class) .add(1804, "Add rules.plugin_key", AddPluginKeyToRules.class) .add(1805, "Create table plugins", CreateTablePlugins.class) .add(1806, "Create table project_branches", CreateTableProjectBranches.class) .add(1807, "Add on project_branches key", AddIndexOnProjectBranchesKey.class) .add(1808, "Add branch column to projects table", AddBranchColumnToProjectsTable.class) .add(1809, "Populate project_branches with existing main branches", PopulateMainProjectBranches.class) .add(1810, "Add ANALYSIS_UUID in WEBHOOK_DELIVERIES", AddAnalysisUuidToWebhookDeliveries.class) .add(1811, "Make column CE_TASK_UUID nullable", UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries.class) .add(1812, "Populate ANALYSIS_UUID of WEBHOOK_DELIVERIES", PopulateAnalysisUuidColumnOnWebhookDeliveries.class) ; }
Source:
public Properties getStatistics() throws GitAPIException { try { GC gc = new GC((FileRepository) repo); gc.setPackConfig(pconfig); return toProperties(gc.getStatistics()); } catch (IOException e) { throw new JGitInternalException( JGitText.get().couldNotGetRepoStatistics, e); } }

Target:
public Properties getStatistics() throws GitAPIException { try { GC gc = new GC((FileRepository) repo); return toProperties(gc.getStatistics()); } catch (IOException e) { throw new JGitInternalException( JGitText.get().couldNotGetRepoStatistics, e); } }
Source:
public void testDoPipe() throws Exception { pipe.setLCharacters("abcd"); pipe.setNumbers("12342"); pipe.setUCharacters("ASDF"); pipe.setSigns("!@#@"); pipe.setNumOfDigits(3); pipe.setNumOfLCharacters(4); pipe.setNumOfUCharacters(2); pipe.setNumOfSigns(2); pipe.setUseSecureRandom(false); pipe.configure(); PipeRunResult res = doPipe(pipe, "pipey", session); assertEquals(res.getResult().toString().length(), 19); }

Target:
public void testDoPipe() throws Exception { pipe.setLCharacters("abcd"); pipe.setNumbers("12342"); pipe.setUCharacters("ASDF"); pipe.setSigns("!@#@"); pipe.setNumOfDigits(3); pipe.setNumOfLCharacters(4); pipe.setNumOfUCharacters(2); pipe.setNumOfSigns(2); pipe.setUseSecureRandom(false); pipe.configure(); PipeRunResult res = doPipe(pipe, "pipey", session); assertEquals(res.getResult().asString().length(), 11); }