auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<CertificateEvent> createEventsFromArende(String certificateId, LocalDateTime afterTimestamp) { List<CertificateEvent> events = new ArrayList<>(); List<Arende> messages = new ArrayList<>(); if (afterTimestamp != null) { messages = arendeService.getArendenInternal(certificateId).stream().filter(m -> m.getTimestamp().isAfter(afterTimestamp)) .collect(Collectors.toList()); } else { messages = arendeService.getArendenInternal(certificateId); } if (!messages.isEmpty()) { for (Arende message : messages) { String sentBy = message.getSkickatAv() != null ? message.getSkickatAv() : UNKNOWN_USER; if (message.getSvarPaId() != null || message.getSvarPaReferens() != null) { events.add(save(certificateId, sentBy, EventCode.NYSVFM, message.getTimestamp(), getTitleForMessage(message, EventCode.NYSVFM))); } else { if (message.getPaminnelseMeddelandeId() != null) { events.add(save(certificateId, sentBy, EventCode.PAMINNELSE, message.getTimestamp())); } else if (message.getAmne() == ArendeAmne.KOMPLT) { events.add(save(certificateId, sentBy, EventCode.KOMPLBEGARAN, message.getTimestamp())); } else { events.add(save(certificateId, sentBy, EventCode.NYFRFM, message.getTimestamp(), getTitleForMessage(message, EventCode.NYFRFM))); } } } } return events; }

Target:
private List<CertificateEvent> createEventsFromArende(String certificateId, LocalDateTime afterTimestamp) { List<CertificateEvent> events = new ArrayList<>(); List<Arende> messages = new ArrayList<>(); if (afterTimestamp != null) { messages = arendeService.getArendenInternal(certificateId).stream().filter(m -> m.getTimestamp().isAfter(afterTimestamp)) .collect(Collectors.toList()); } else { messages = arendeService.getArendenInternal(certificateId); } if (!messages.isEmpty()) { for (Arende message : messages) { String sentBy = message.getSkickatAv() != null ? message.getSkickatAv() : UNKNOWN_USER; if (message.getSvarPaId() != null || message.getSvarPaReferens() != null) { events.add(save(certificateId, sentBy, EventCode.NYSVFM, message.getTimestamp(), getTitleForMessage(message, EventCode.NYSVFM))); } else { if (message.getPaminnelseMeddelandeId() != null) { events.add(save(certificateId, sentBy, EventCode.PAMINNELSE, message.getTimestamp())); } else if (message.getAmne() == ArendeAmne.KOMPLT) { events.add(save(certificateId, sentBy, EventCode.KOMPLBEGARAN, message.getTimestamp())); } else { events.add(save(certificateId, sentBy, EventCode.NYFRFM, message.getTimestamp(), getTitleForMessage(message, EventCode.NYFRFM))); } } } } return events; }
Source:
public LoadData<String> buildLoadData(String s, int width, int height, Options options) { return new LoadData(new ObjectKey(System.currentTimeMillis()), new CloudIconDataFetcher(context, s)); }

Target:
public LoadData<Bitmap> buildLoadData(String s, int width, int height, Options options) { return new LoadData<>(new ObjectKey(System.currentTimeMillis()), new CloudIconDataFetcher(context, s, width, height)); }
Source:
public String read(ByteBuffer binary) throws IOException, ClassNotFoundException { byte[] bytes = new byte[binary.remaining()]; binary.get(bytes); String s = new String(bytes, CHARSET); LOG.info("deserialized {}", s); return s; }

Target:
public String read(ByteBuffer binary) throws IOException, ClassNotFoundException { byte[] bytes = new byte[binary.remaining()]; binary.get(bytes); return new String(bytes, CHARSET); }
Source:
public static <D, T, S> Result<D, T, S> apply(final List<D> data, final List<T> positions, final HiddenMarkovModel<D, T, S> model) { Utils.nonNull(data); Utils.nonNull(positions); Utils.nonNull(model); final List<D> dataList = Collections.unmodifiableList(new ArrayList<>(data)); final List<T> positionList = Collections.unmodifiableList(new ArrayList<>(positions)); if (dataList.size() != positionList.size()) { throw new IllegalArgumentException("the data sequence and position sequence must have the same number of elements"); } final List<S> states = model.hiddenStates(); Utils.nonNull(states, "the model hidden state list cannot be null"); if (states.size() == 0) { throw new IllegalArgumentException("the model hidden state list must contain at least one element"); } final double[] forwardProbabilities = calculateLogForwardProbabilities(model, dataList, positionList); final double[] backwardProbabilities = calculateLogBackwardProbabilities(model, dataList, positionList); return new ArrayResult<>(dataList, positionList, model, forwardProbabilities, backwardProbabilities); }

Target:
public static <D, T, S> Result<D, T, S> apply(final List<D> data, final List<T> positions, final HiddenMarkovModel<D, T, S> model) { Utils.nonNull(data, "the input data sequence cannot be null."); Utils.nonNull(positions, "the input position sequence cannot be null."); Utils.nonNull(model, "the input model cannot be null"); final List<D> dataList = Collections.unmodifiableList(new ArrayList<>(data)); final List<T> positionList = Collections.unmodifiableList(new ArrayList<>(positions)); if (dataList.size() != positionList.size()) { throw new IllegalArgumentException("the data sequence and position sequence must have the same number of elements"); } final double[][] forwardProbabilities = calculateLogForwardProbabilities(model, dataList, positionList); final double[][] backwardProbabilities = calculateLogBackwardProbabilities(model, dataList, positionList); return new ArrayResult<>(dataList, positionList, model, forwardProbabilities, backwardProbabilities); }
Source:
public String setValue(String value) throws GeneralSecurityException { String returnedValue = null; String password = null; try { if (StringUtils.isNotBlank(value) && value.equals(INTERACTIVE_MODE)) { password = EngineConfigLogic.startPasswordDialog(null); } else { password = EngineConfigLogic.getPassFromFile((StringUtils.isNotBlank(value)) ? value : parser.getAdminPassFile()); } returnedValue = encrypt(password); } catch (Exception e) { String msg = "Failed to encrypt the current value"; Logger.getLogger(EngineConfig.class).debug(msg, e); throw new GeneralSecurityException(msg); } return returnedValue; }

Target:
public String setValue(String value) throws GeneralSecurityException { String returnedValue = null; String password = null; try { if (StringUtils.isNotBlank(value) && value.equalsIgnoreCase(INTERACTIVE_MODE)) { password = EngineConfigLogic.startPasswordDialog(null); } else { password = EngineConfigLogic.getPassFromFile((StringUtils.isNotBlank(value)) ? value : parser.getAdminPassFile()); } returnedValue = encrypt(password); } catch (Exception e) { String msg = "Failed to encrypt the current value"; Logger.getLogger(EngineConfig.class).debug(msg, e); throw new GeneralSecurityException(msg); } return returnedValue; }
Source:
private int showErrorOnField(List<RegisterResponseFieldError> errors, IRegistrationFieldView fieldView) { int errorCount = 0; if (errors != null && !errors.isEmpty()) { StringBuffer buffer = new StringBuffer(); for (RegisterResponseFieldError e : errors) { buffer.append(e.getUserMessage() + " "); errorCount ++; } fieldView.handleError(buffer.toString()); } return errorCount; }

Target:
private void showErrorOnField(List<RegisterResponseFieldError> errors, IRegistrationFieldView fieldView) { if (errors != null && !errors.isEmpty()) { StringBuffer buffer = new StringBuffer(); for (RegisterResponseFieldError e : errors) { buffer.append(e.getUserMessage() + " "); } fieldView.handleError(buffer.toString()); } }
Source:
public Boolean getCanViewEvalReleaseSig() { boolean canView = evaluation != null && !evaluation.equals("") && !status.equals(Appraisal.STATUS_APPRAISAL_DUE) && !status.equals(Appraisal.STATUS_EMPLOYEE_REVIEW_DUE); return canView; }

Target:
public Boolean getCanViewEvalReleaseSig() { boolean canView = evaluation != null && !evaluation.equals("") && !status.equals(Appraisal.STATUS_APPRAISAL_DUE) && !status.equals(Appraisal.STATUS_EMPLOYEE_REVIEW_DUE) && !status.equals(Appraisal.STATUS_REVIEW_DUE); return canView; }
Source:
public @NonNull List<@NonNull String> getMarkerCategories() { ITmfTrace activeTrace = TmfTraceManager.getInstance().getActiveTrace(); if (activeTrace == null) { return Collections.emptyList(); } UUID uuid = activeTrace.getUUID(); Collection<String> collection = fCategories.get(uuid); if (collection.isEmpty()) { ContextDataSource dataProvider = DataProviderManager.getInstance().getDataProvider(activeTrace, ContextDataSource.ID, ContextDataSource.class); if (dataProvider == null) { return Collections.emptyList(); } TmfModelResponse<@NonNull List<@NonNull TmfTreeDataModel>> tree = dataProvider.fetchTree(new TimeQueryFilter(Collections.emptyList()), new NullProgressMonitor()); List<@NonNull TmfTreeDataModel> model = tree.getModel(); if (model == null) { return Collections.emptyList(); } Set<String> data = new HashSet<>(); for (TmfTreeDataModel elem : model) { data.add(elem.getName()); } fCategories.putAll(uuid, data); collection = data; } List<String> retVal = new ArrayList<>(collection); retVal.sort(null); return retVal; }

Target:
public @NonNull List<@NonNull String> getMarkerCategories() { ITmfTrace activeTrace = TmfTraceManager.getInstance().getActiveTrace(); if (activeTrace == null) { return Collections.emptyList(); } UUID uuid = activeTrace.getUUID(); Collection<String> collection = fCategories.computeIfAbsent(uuid, new Function<Object, Collection<String>>() { @Override public Collection<String> apply(Object t) { ContextDataSource dataProvider = DataProviderManager.getInstance().getDataProvider(activeTrace, ContextDataSource.ID, ContextDataSource.class); if (dataProvider == null) { return Collections.emptyList(); } TmfModelResponse<@NonNull List<@NonNull TmfTreeDataModel>> tree = dataProvider.fetchTree(new TimeQueryFilter(Collections.emptyList()), new NullProgressMonitor()); List<@NonNull TmfTreeDataModel> model = tree.getModel(); if (model == null) { return Collections.emptyList(); } Set<String> data = new HashSet<>(); for (TmfTreeDataModel elem : model) { data.add(elem.getName()); } return data; } }); List<String> retVal = new ArrayList<>(collection); retVal.sort(null); return retVal; }
Source:
public String getName() { return super.getName(); }

Target:
public String getName() { return this.name; }
Source:
@SuppressWarnings("unchecked") HistoryDetailFragmentAdapter(FragmentManager fragmentManager, ArrayList<Revision> revisions) { super(fragmentManager); mRevisions = (ArrayList<Revision>) revisions.clone(); }

Target:
HistoryDetailFragmentAdapter(FragmentManager fragmentManager, ArrayList<Revision> revisions) { super(fragmentManager); mRevisions = (ArrayList<Revision>) revisions.clone(); }
Source:
public void deleteAttribute(PerunSession sess, AttributeDefinition attribute) throws InternalErrorException { try { jdbc.update("DELETE FROM "+ attributeToTablePrefix(attribute)+"_attr_values WHERE attr_id=?", attribute.getId()); jdbc.update("DELETE FROM attr_names WHERE id=?", attribute.getId()); log.debug("Attribute deleted [{}]", attribute); } catch (RuntimeException e) { throw new InternalErrorException(e); } }

Target:
public void deleteAttribute(PerunSession sess, AttributeDefinition attribute) throws InternalErrorException { try { jdbc.update("DELETE FROM "+ attributeToTablePrefix(attribute)+"_attr_values WHERE attr_id=?", attribute.getId()); jdbc.update("DELETE FROM attr_names WHERE id=?", attribute.getId()); log.debug("Attribute deleted: {}.", attribute); } catch (RuntimeException e) { throw new InternalErrorException(e); } }
Source:
public void obtainsCreationDate() throws Exception { final String alias = "brown"; final Aliases aliases = new DyBase().user(new URN("urn:test:89637")).aliases(); aliases.add(alias); final Inbox inbox = aliases.iterate().iterator().next().inbox(); final Bout bout = inbox.bout(inbox.start()); final Attachments attachments = bout.attachments(); final long before = System.currentTimeMillis(); final String name = "attach-name"; attachments.create(name); final Attachment attachment = attachments.get(name); MatcherAssert.assertThat( attachment.date().getTime(), Matchers.greaterThan(before) ); final long after = System.currentTimeMillis(); MatcherAssert.assertThat( attachment.date().getTime(), Matchers.lessThan(after) ); attachments.delete(name); }

Target:
public void obtainsCreationDate() throws Exception { final Aliases aliases = new DyBase().user(new URN("urn:test:89637")).aliases(); aliases.add("brown"); final Inbox inbox = aliases.iterate().iterator().next().inbox(); final Attachments attachments = inbox.bout(inbox.start()).attachments(); final long before = System.currentTimeMillis(); final String name = "attach-name"; attachments.create(name); final Attachment attachment = attachments.get(name); MatcherAssert.assertThat( attachment.date().getTime(), Matchers.greaterThanOrEqualTo(before) ); final long after = System.currentTimeMillis(); MatcherAssert.assertThat( attachment.date().getTime(), Matchers.lessThanOrEqualTo(after) ); attachments.delete(name); }
Source:
public void testTimeDimensionSetAfterAutoModel() throws Exception { ModelerWorkspace wspace = new ModelerWorkspace( new ModelerWorkspaceHelper( "en_US" ) ); DatabaseMeta dbMeta = ModelITHelper.newH2Db( "CreateAttributeIT-H2-DB", "DROP TABLE if exists datetable;", "CREATE TABLE datetable ( \"date\" TIMESTAMP );" ); TableModelerSource source = new TableModelerSource( dbMeta, "datetable", "" ); Domain domain = source.generateDomain(); wspace.setModelSource( source ); wspace.setDomain( domain ); wspace.setModelName( "DateModel" ); wspace.getWorkspaceHelper().autoModelFlat( wspace ); wspace.getWorkspaceHelper().populateDomain( wspace ); CreateAttribute createAttr = new CreateAttribute(); createAttr.setName( "Date" ); createAttr.setTimeType( TimeType.TimeDays ); createAttr.setDimension( "Date" ); createAttr.setHierarchy( "Date" ); createAttr.setField( "date" ); createAttr.apply( wspace, new MemoryMetaStore() ); OlapDimension dateDim = getCubes( wspace ).get( 0 ).getOlapDimensionUsages().get( 0 ).getOlapDimension(); assertEquals( "Date", dateDim.getName() ); assertTrue( "time dimension not set", dateDim.isTimeDimension() ); }

Target:
public void testTimeDimensionSetAfterAutoModel() throws Exception { ModelerWorkspace wspace = new ModelerWorkspace( new ModelerWorkspaceHelper( "en_US" ) ); DatabaseMeta dbMeta = ModelITHelper.newH2Db( dbName, "DROP TABLE if exists datetable;", "CREATE TABLE datetable ( \"date\" TIMESTAMP );" ); TableModelerSource source = new TableModelerSource( dbMeta, "datetable", "" ); Domain domain = source.generateDomain(); wspace.setModelSource( source ); wspace.setDomain( domain ); wspace.setModelName( "DateModel" ); wspace.getWorkspaceHelper().autoModelFlat( wspace ); wspace.getWorkspaceHelper().populateDomain( wspace ); CreateAttribute createAttr = new CreateAttribute(); createAttr.setName( "Date" ); createAttr.setTimeType( TimeType.TimeDays ); createAttr.setDimension( "Date" ); createAttr.setHierarchy( "Date" ); createAttr.setField( "date" ); createAttr.apply( wspace, new MemoryMetaStore() ); OlapDimension dateDim = getCubes( wspace ).get( 0 ).getOlapDimensionUsages().get( 0 ).getOlapDimension(); assertEquals( "Date", dateDim.getName() ); assertTrue( "time dimension not set", dateDim.isTimeDimension() ); }
Source:
public DoubleSummaryStatistics readObject(ObjectInput input) throws IOException, ClassNotFoundException { verifySerialization(); final DoubleSummaryStatistics summaryStatistics; if (constructor != null) { final long count = input.readLong(); final double sum = input.readDouble(); final double sumCompensation = input.readDouble(); final double simpleSum = input.readDouble(); final double min = input.readDouble(); final double max = input.readDouble(); try { summaryStatistics = constructor.newInstance(count, min, max, sum); } catch (ReflectiveOperationException e) { throw new IOException(String.format(CONSTRUCTOR_CALL_ERROR_MSG, DoubleSummaryStatistics.class, constructor.toString(), count, min, max, sum), e); } } else { summaryStatistics = new DoubleSummaryStatistics(); try { countField.setLong(summaryStatistics, input.readLong()); sumField.setDouble(summaryStatistics, input.readDouble()); sumCompensationField.setDouble(summaryStatistics, input.readDouble()); simpleSumField.setDouble(summaryStatistics, input.readDouble()); minField.setDouble(summaryStatistics, input.readDouble()); maxField.setDouble(summaryStatistics, input.readDouble()); } catch (IllegalAccessException e) { throw new IOException(e); } } return summaryStatistics; }

Target:
public DoubleSummaryStatistics readObject(ObjectInput input) throws IOException, ClassNotFoundException { verifySerialization(); final DoubleSummaryStatistics summaryStatistics; final long count = input.readLong(); final double sum = input.readDouble(); final double sumCompensation = input.readDouble(); final double simpleSum = input.readDouble(); final double min = input.readDouble(); final double max = input.readDouble(); if (constructor != null) { try { summaryStatistics = constructor.newInstance(count, min, max, sum); } catch (ReflectiveOperationException e) { throw new IOException(String.format(CONSTRUCTOR_CALL_ERROR_MSG, DoubleSummaryStatistics.class, constructor.toString(), count, min, max, sum), e); } } else { summaryStatistics = new DoubleSummaryStatistics(); try { countField.setLong(summaryStatistics, count); sumField.setDouble(summaryStatistics, sum); minField.setDouble(summaryStatistics, min); maxField.setDouble(summaryStatistics, max); } catch (IllegalAccessException e) { throw new IOException(e); } } return summaryStatistics; }
Source:
public int get() { return (int) encoder.getPosition(); }

Target:
public int get() { try { return getSafely(); } catch (InvalidSensorException e) { LogKitten.e(e); return 0; } }
Source:
private static void checkValidPath(CanonicalTreeParser t) throws InvalidPathException { ObjectChecker chk = new ObjectChecker() .setSafeForWindows(SystemReader.getInstance().isWindows()); for (CanonicalTreeParser i = t; i != null; i = i.getParent()) checkValidPathSegment(chk, i); }

Target:
private static void checkValidPath(CanonicalTreeParser t) throws InvalidPathException { ObjectChecker chk = new ObjectChecker() .setSafeForWindows(SystemReader.getInstance().isWindows()) .setSafeForMacOS(SystemReader.getInstance().isMacOS()); for (CanonicalTreeParser i = t; i != null; i = i.getParent()) checkValidPathSegment(chk, i); }
Source:
public void commitToFile() throws Exception { afw.write(expectedContent, 0, expectedContent.length()); afw.commit(); assertTrue(Files.size(af.toPath()) == expectedContent.length()); }

Target:
public void commitToFile() throws Exception { afw.write(expectedContent, 0, expectedContent.length()); afw.commit(); assertEquals(expectedContent.length(), Files.size(af.toPath())); }
Source:
private boolean isContainedWildcard( AnnotatedTypeMirror inside, AnnotatedTypeMirror outside, AnnotatedTypeMirror outsideUpperBound, AnnotatedTypeMirror outsideLowerBound, boolean canBeCovariant) { if (inside.getKind() == TypeKind.WILDCARD && outside.getKind() == TypeKind.WILDCARD && inside.equals(outside)) { return true; } if (inside.getKind() == TypeKind.WILDCARD) { outsideUpperBound = checker.getTypeFactory() .widenToUpperBound(outsideUpperBound, (AnnotatedWildcardType) inside); } while (outsideUpperBound.getKind() == TypeKind.WILDCARD) { if (ignoreUninferredTypeArgument(outsideUpperBound)) { return true; } outsideUpperBound = ((AnnotatedWildcardType) outsideUpperBound).getExtendsBound(); } AnnotatedTypeMirror castedInside = AnnotatedTypes.castedAsSuper(inside.atypeFactory, inside, outsideUpperBound); if (!checkAndSubtype(castedInside, outsideUpperBound)) { return false; } if (outside.getKind() == TypeKind.WILDCARD && outsideLowerBound.getKind() == TypeKind.TYPEVAR) { return true; } return canBeCovariant || checkAndSubtype(outsideLowerBound, inside); }

Target:
private boolean isContainedWildcard( AnnotatedTypeMirror inside, AnnotatedTypeMirror outside, AnnotatedTypeMirror outsideUpperBound, AnnotatedTypeMirror outsideLowerBound, boolean canBeCovariant) { if (inside.equals(outside)) { return true; } if (inside.getKind() == TypeKind.WILDCARD) { outsideUpperBound = checker.getTypeFactory() .widenToUpperBound(outsideUpperBound, (AnnotatedWildcardType) inside); } while (outsideUpperBound.getKind() == TypeKind.WILDCARD) { if (ignoreUninferredTypeArgument(outsideUpperBound)) { return true; } outsideUpperBound = ((AnnotatedWildcardType) outsideUpperBound).getExtendsBound(); } AnnotatedTypeMirror castedInside = AnnotatedTypes.castedAsSuper(inside.atypeFactory, inside, outsideUpperBound); if (!checkAndSubtype(castedInside, outsideUpperBound)) { return false; } if (outside.getKind() == TypeKind.WILDCARD && outsideLowerBound.getKind() == TypeKind.TYPEVAR) { return true; } return canBeCovariant || checkAndSubtype(outsideLowerBound, inside); }
Source:
public int compareTo(Alert alert2) { if (risk < alert2.risk) { return -1; } else if (risk > alert2.risk) { return 1; } if (confidence < alert2.confidence) { return -1; } else if (confidence > alert2.confidence) { return 1; } if (pluginId < alert2.pluginId) { return -1; } else if (pluginId > alert2.pluginId) { return 1; } int result = name.compareToIgnoreCase(alert2.name); if (result != 0) { return result; } result = uri.compareToIgnoreCase(alert2.uri); if (result != 0) { return result; } result = param.compareToIgnoreCase(alert2.param); if (result != 0) { return result; } result = otherInfo.compareToIgnoreCase(alert2.otherInfo); if (result != 0) { return result; } if (evidence == null) { if (alert2.evidence == null) { return 0; } return -1; } else if (alert2.evidence == null) { return 1; } result = evidence.compareTo(alert2.evidence); if (result != 0) { return result; } if (attack == null) { if (alert2.attack == null) { return 0; } return -1; } else if (alert2.attack == null) { return 1; } return attack.compareTo(alert2.attack); }

Target:
public int compareTo(Alert alert2) { if (risk < alert2.risk) { return -1; } else if (risk > alert2.risk) { return 1; } if (confidence < alert2.confidence) { return -1; } else if (confidence > alert2.confidence) { return 1; } if (pluginId < alert2.pluginId) { return -1; } else if (pluginId > alert2.pluginId) { return 1; } int result = name.compareToIgnoreCase(alert2.name); if (result != 0) { return result; } result = uri.compareToIgnoreCase(alert2.uri); if (result != 0) { return result; } result = param.compareToIgnoreCase(alert2.param); if (result != 0) { return result; } result = otherInfo.compareToIgnoreCase(alert2.otherInfo); if (result != 0) { return result; } result = compareStrings(evidence, alert2.evidence); if (result != 0) { return result; } return compareStrings(attack, alert2.attack); }
Source:
public DeviceId(final Optional<Long> internalDeviceId, final Optional<String> externalDeviceId) { this.internalDeviceId = internalDeviceId; this.externalDeviceId = externalDeviceId; }

Target:
private DeviceId(final Optional<Long> internalDeviceId, final Optional<String> externalDeviceId) { this.internalDeviceId = internalDeviceId; this.externalDeviceId = externalDeviceId; }
Source:
public void testRunMigrationWithCustomSchema() throws Exception { String schemaName = "customschema"; try (Handle handle = new DBI(databaseUrl, "sa", "").open()) { handle.execute("create schema " + schemaName); } Namespace namespace = new Namespace(ImmutableMap.of("schema", schemaName)); migrateCommand.run(null, namespace, conf); try (Handle handle = new DBI(databaseUrl, "sa", "").open()) { final List<Map<String, Object>> rows = handle.select("select * from " + schemaName + ".persons"); assertThat(rows).hasSize(1); assertThat(rows.get(0)).isEqualTo( ImmutableMap.of("id", 1, "name", "Bill Smith", "email", "bill@smith.me")); } }

Target:
public void testRunMigrationWithCustomSchema() throws Exception { String schemaName = "customschema"; DBI dbi = new DBI(databaseUrl, "sa", ""); dbi.useHandle(h -> h.execute("create schema " + schemaName)); Namespace namespace = new Namespace(ImmutableMap.of("schema", schemaName, "catalog", "public")); migrateCommand.run(null, namespace, conf); dbi.useHandle(handle -> { assertThat(handle .select("select * from " + schemaName + ".persons")) .hasSize(1) .contains(ImmutableMap.of("id", 1, "name", "Bill Smith", "email", "bill@smith.me"), Index.atIndex(0)); }); }
Source:
private FUNCTION_TYPE ensureSameType(final Collection<IndexingExpr> filters) { FUNCTION_TYPE type = null; for(final IndexingExpr filter : filters) { if(type == null) { type = IndexingFunctionRegistry.getFunctionType(filter.getFunction()); } else { if(IndexingFunctionRegistry.getFunctionType(filter.getFunction()) != type) { return null; } } } return type; }

Target:
private static FUNCTION_TYPE ensureSameType(final Collection<IndexingExpr> filters) { FUNCTION_TYPE type = null; for(final IndexingExpr filter : filters) { if(type == null) { type = IndexingFunctionRegistry.getFunctionType(filter.getFunction()); } else { if(IndexingFunctionRegistry.getFunctionType(filter.getFunction()) != type) { return null; } } } return type; }
Source:
public Optional<Duration> calculateLastLeaderElectionDuration() { Map<UUID, Instant> lowerBounds = ImmutableMap.copyOf(leadershipLowerBound.entrySet()); Map<UUID, Instant> upperBounds = ImmutableMap.copyOf(leadershipUpperBound.entrySet()); Set<UUID> leaders = leadersWithBothBounds(lowerBounds, upperBounds); List<UUID> sortedLongTermLeaders = orderedLongTermLeaders(lowerBounds, upperBounds, leaders); clearOldLongTermLeaders(sortedLongTermLeaders); if (sortedLongTermLeaders.isEmpty()) { return Optional.empty(); } UUID lastLongTermLeader = sortedLongTermLeaders.get(sortedLongTermLeaders.size() - 1); Optional<Duration> result = durationToNextLeader(lowerBounds, upperBounds, leaders, lastLongTermLeader); if (result.isPresent()) { return result; } if (sortedLongTermLeaders.size() == 1) { return Optional.empty(); } UUID secondToLastLongTermLeader = sortedLongTermLeaders.get(sortedLongTermLeaders.size() - 2); return durationToNextLeader(lowerBounds, upperBounds, leaders, secondToLastLongTermLeader); }

Target:
public Optional<Duration> calculateLastLeaderElectionDuration() { Map<UUID, Instant> lowerBounds = ImmutableMap.copyOf(leadershipLowerBound.entrySet()); Map<UUID, Instant> upperBounds = ImmutableMap.copyOf(leadershipUpperBound.entrySet()); Set<UUID> leaders = leadersWithBothBounds(lowerBounds, upperBounds); List<UUID> sortedLongTermLeaders = orderedLongTermLeaders(lowerBounds, upperBounds, leaders); clearOldLongTermLeaders(sortedLongTermLeaders); if (sortedLongTermLeaders.isEmpty()) { return Optional.empty(); } UUID lastLongTermLeader = sortedLongTermLeaders.get(sortedLongTermLeaders.size() - 1); Optional<Duration> result = durationToNextLeader(lowerBounds, upperBounds, leaders, lastLongTermLeader); if (result.isPresent() || sortedLongTermLeaders.size() == 1) { return result; } UUID secondToLastLongTermLeader = sortedLongTermLeaders.get(sortedLongTermLeaders.size() - 2); return durationToNextLeader(lowerBounds, upperBounds, leaders, secondToLastLongTermLeader); }
Source:
public static int partitions(Path basePath) { Path metadataPath = basePath.resolve(METADATA_FILE); if (metadataPath.toFile().exists()) { return Integer.valueOf(readMetadata(metadataPath).getProperty(PARTITIONS_KEY)); } return discoverPartitions(basePath); }

Target:
public static int partitions(Path basePath) { Path metadataPath = basePath.resolve(METADATA_FILE); if (metadataPath.toFile().exists()) { return Integer.parseInt(readMetadata(metadataPath).getProperty(PARTITIONS_KEY)); } return discoverPartitions(basePath); }
Source:
public OutputDataStream[] getOutputDataStreams() { final OutputDataStreamBuilder builder = OutputDataStreams.pushDataStream(OUTPUT_DATA_STREAM_NAME); boolean foundOutputDataStream = false; for (final CoalesceUnit _unit : _units) { final InputColumn<?>[] updatedInputColumns = _unit.getUpdatedInputColumns(_inputs, false); if(_unit.getInputColumns().length == updatedInputColumns.length){ foundOutputDataStream = true; final CoalesceUnit unit = _unit.getUpdatedCoalesceUnit(updatedInputColumns); final Class<?> dataType = unit.getOutputDataType(); final String columnName = unit.getSuggestedOutputColumnName(); final ColumnType columnType = ColumnTypeImpl.convertColumnType(dataType); builder.withColumn(columnName, columnType); } else { logger.info("Missing columns detected, skipping coalesce unit"); } } if(!foundOutputDataStream) { return new OutputDataStream[0]; } return new OutputDataStream[] { builder.toOutputDataStream() }; }

Target:
public OutputDataStream[] getOutputDataStreams() { final OutputDataStreamBuilder builder = OutputDataStreams.pushDataStream(OUTPUT_DATA_STREAM_NAME); boolean foundOutputDataStream = false; for (final CoalesceUnit _unit : _units) { final InputColumn<?>[] updatedInputColumns = _unit.getUpdatedInputColumns(_inputs, false); if (_unit.getInputColumnNames().length == updatedInputColumns.length) { foundOutputDataStream = true; final CoalesceUnit unit = _unit.getUpdatedCoalesceUnit(updatedInputColumns); final Class<?> dataType = unit.getOutputDataType(); final String columnName = unit.getSuggestedOutputColumnName(); final ColumnType columnType = ColumnTypeImpl.convertColumnType(dataType); builder.withColumn(columnName, columnType); } else { logger.info("Missing columns detected, skipping coalesce unit"); } } if (!foundOutputDataStream) { return new OutputDataStream[0]; } return new OutputDataStream[] { builder.toOutputDataStream() }; }
Source:
private boolean isEmpty() { for (JDKFamily f : data) { if (f.releases.length>0) return false; } return true; }

Target:
public boolean isEmpty() { for (JDKFamily f : data) { if (f.releases.length>0) return false; } return true; }
Source:
private void configure(B builder) { OAuth2AuthorizationRequestRedirectFilter authorizationRequestRedirectFilter = createAuthorizationRequestRedirectFilter(builder); builder.addFilter(postProcess(authorizationRequestRedirectFilter)); OAuth2AuthorizationCodeGrantFilter authorizationCodeGrantFilter = createAuthorizationCodeGrantFilter(builder); RequestCache requestCache = builder.getSharedObject(RequestCache.class); if (requestCache != null) { authorizationCodeGrantFilter.setRequestCache(requestCache); } builder.addFilter(postProcess(authorizationCodeGrantFilter)); }

Target:
private void configure(B builder) { OAuth2AuthorizationRequestRedirectFilter authorizationRequestRedirectFilter = createAuthorizationRequestRedirectFilter(builder); builder.addFilter(postProcess(authorizationRequestRedirectFilter)); OAuth2AuthorizationCodeGrantFilter authorizationCodeGrantFilter = createAuthorizationCodeGrantFilter(builder); builder.addFilter(postProcess(authorizationCodeGrantFilter)); }
Source:
public boolean lock(Session session, boolean exclusive, boolean forceLockEvenInMvcc) { int lockMode = database.getLockMode(); if (lockMode == Constants.LOCK_MODE_OFF) { session.registerTable(this); return false; } if (!forceLockEvenInMvcc) { if (exclusive) { exclusive = false; } else { if (lockExclusiveSession == null) { return false; } } } if (lockExclusiveSession == session) { return true; } if (!exclusive && lockSharedSessions.containsKey(session)) { return true; } synchronized (getLockSyncObject()) { if (!exclusive && lockSharedSessions.containsKey(session)) { return true; } session.setWaitForLock(this, Thread.currentThread()); if (SysProperties.THREAD_DEADLOCK_DETECTOR) { WAITING_FOR_LOCK.set(getName()); } waitingSessions.addLast(session); try { doLock1(session, lockMode, exclusive); } finally { session.setWaitForLock(null, null); if (SysProperties.THREAD_DEADLOCK_DETECTOR) { WAITING_FOR_LOCK.remove(); } waitingSessions.remove(session); } } return false; }

Target:
public boolean lock(Session session, boolean exclusive, boolean forceLockEvenInMvcc) { int lockMode = database.getLockMode(); if (lockMode == Constants.LOCK_MODE_OFF) { session.registerTableAsUpdated(this); return false; } if (!forceLockEvenInMvcc) { if (exclusive) { exclusive = false; } else { if (lockExclusiveSession == null) { return false; } } } if (lockExclusiveSession == session) { return true; } if (!exclusive && lockSharedSessions.containsKey(session)) { return true; } synchronized (getLockSyncObject()) { if (!exclusive && lockSharedSessions.containsKey(session)) { return true; } session.setWaitForLock(this, Thread.currentThread()); if (SysProperties.THREAD_DEADLOCK_DETECTOR) { WAITING_FOR_LOCK.set(getName()); } waitingSessions.addLast(session); try { doLock1(session, lockMode, exclusive); } finally { session.setWaitForLock(null, null); if (SysProperties.THREAD_DEADLOCK_DETECTOR) { WAITING_FOR_LOCK.remove(); } waitingSessions.remove(session); } } return false; }
Source:
public void testRefresh() { final CommonTestUtilities.TestingPostgres testingPostgres = getTestingPostgres(); final long startToolCount = testingPostgres.runSelectStatement("select count(*) from tool", new ScalarHandler<>()); Client.main(new String[] { "--config", ResourceHelpers.resourceFilePath("config_file.txt"), "tool", "refresh", "--script" }); final long secondToolCount = testingPostgres.runSelectStatement("select count(*) from tool", new ScalarHandler<>()); testingPostgres.runUpdateStatement("delete from token where tokensource = 'quay.io'"); systemExit.expectSystemExit(); Client.main(new String[] { "--config", ResourceHelpers.resourceFilePath("config_file.txt"), "tool", "refresh", "--script" }); final long thirdToolCount = testingPostgres.runSelectStatement("select count(*) from tool", new ScalarHandler<>()); Assert.assertTrue("there should be no change in count of tools", secondToolCount == thirdToolCount); }

Target:
public void testRefresh() { final CommonTestUtilities.TestingPostgres testingPostgres = getTestingPostgres(); final long startToolCount = testingPostgres.runSelectStatement("select count(*) from tool", new ScalarHandler<>()); Client.main(new String[] { "--config", ResourceHelpers.resourceFilePath("config_file.txt"), "tool", "refresh", "--script" }); final long secondToolCount = testingPostgres.runSelectStatement("select count(*) from tool", new ScalarHandler<>()); testingPostgres.runUpdateStatement("delete from token where tokensource = 'quay.io'"); systemExit.expectSystemExitWithStatus(6); Client.main(new String[] { "--config", ResourceHelpers.resourceFilePath("config_file.txt"), "tool", "refresh", "--script" }); final long thirdToolCount = testingPostgres.runSelectStatement("select count(*) from tool", new ScalarHandler<>()); Assert.assertTrue("there should be no change in count of tools", secondToolCount == thirdToolCount); }
Source:
public void testAddExistingSingleFileInSubDir() throws IOException, NoFilepatternException { assertTrue(new File(db.getWorkTree(), "sub").mkdir()); File file = new File(db.getWorkTree(), "sub/a.txt"); FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); Git git = new Git(db); git.add().addFilepattern("sub/a.txt").call(); assertEquals( "[sub/a.txt, mode:100644, content:content]", indexState(CONTENT)); }

Target:
public void testAddExistingSingleFileInSubDir() throws IOException, NoFilepatternException { FileUtils.mkdir(new File(db.getWorkTree(), "sub")); File file = new File(db.getWorkTree(), "sub/a.txt"); FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); Git git = new Git(db); git.add().addFilepattern("sub/a.txt").call(); assertEquals( "[sub/a.txt, mode:100644, content:content]", indexState(CONTENT)); }
Source:
public static List<String> getTestPrototypeFactoryClasses() { if (factoryClassNames.isEmpty()) { String baseODK = BuildConfig.BUILD_DIR + "/intermediates/classes/commcare/debug/"; String baseJR = BuildConfig.PROJECT_DIR + "/../javarosa/build/classes/main/"; String baseCC = BuildConfig.PROJECT_DIR + "/../commcare/build/classes/main/"; addExternalizableClassesFromDir(baseODK, factoryClassNames); addExternalizableClassesFromDir(baseCC, factoryClassNames); addExternalizableClassesFromDir(baseJR, factoryClassNames); } return factoryClassNames; }

Target:
public static List<String> getTestPrototypeFactoryClasses() { initFactoryClassList(); return factoryClassNames; }
Source:
public static int adjustPropertyModifiersForMethod(PropertyNode propNode) { int propNodeModifiers = propNode.getModifiers(); if ((propNodeModifiers & Modifier.VOLATILE) != 0) { propNodeModifiers -= Modifier.VOLATILE; } if ((propNodeModifiers & Modifier.TRANSIENT) != 0) { propNodeModifiers -= Modifier.TRANSIENT; } return propNodeModifiers; }

Target:
public static int adjustPropertyModifiersForMethod(PropertyNode propNode) { return ~(Modifier.TRANSIENT | Modifier.VOLATILE) & propNode.getModifiers(); }
Source:
public String refundsURIWithParams(Account account, Map<String, String> queryParams) { String path = format("/v1/accounts/%s/refunds", account.getAccountId()); return buildConnectorUri(account, path, queryParams); }

Target:
public String refundsURIWithParams(Account account, Map<String, String> queryParams) { String path = format("/v1/api/accounts/%s/refunds", account.getAccountId()); return buildConnectorUri(account, path, queryParams); }
Source:
public SeekPoints getSeekPoints(long timeUs) { long[] result = decoderJni.getSeekPosition(timeUs); if (result.length == 4) { return new SeekPoints(new SeekPoint(result[0], result[1]), new SeekPoint(result[2], result[3])); } else { return new SeekPoints(new SeekPoint(timeUs, decoderJni.getDecodePosition())); } }

Target:
public SeekPoints getSeekPoints(long timeUs) { @Nullable SeekPoints seekPoints = decoderJni.getSeekPoints(timeUs); return seekPoints == null ? new SeekPoints(SeekPoint.START) : seekPoints; }
Source:
public final void readFully(long position, byte[] buffer, int bufferOffset, int bufferLength) { readBytes += bufferLength; long readStart = System.nanoTime(); readInternal(position, buffer, bufferOffset, bufferLength); long currentReadTimeNanos = System.nanoTime() - readStart; readTimeNanos += currentReadTimeNanos; stats.readDataBytesPerSecond(bufferLength, currentReadTimeNanos); }

Target:
public final void readFully(long position, byte[] buffer, int bufferOffset, int bufferLength) { readBytes += bufferLength; long start = System.nanoTime(); readInternal(position, buffer, bufferOffset, bufferLength); long currentReadTimeNanos = System.nanoTime() - start; readTimeNanos += currentReadTimeNanos; stats.readDataBytesPerSecond(bufferLength, currentReadTimeNanos); }
Source:
protected void drawStepContent() { super.drawStepContent(); listViewWidget.setItems(FXCollections.observableArrayList(menuItems)); if (defaultValue != null) { int idx = menuItems.indexOf(defaultValue); if (idx != -1) { listViewWidget.getSelectionModel().select(idx); listViewWidget.getFocusModel().focus(idx); listViewWidget.scrollTo(idx); } if (defaultValue.isEmpty()) { setNextButtonEnabled(false); listViewWidget.getSelectionModel().selectedItemProperty() .addListener((observable, oldValue, newValue) -> { if (newValue.trim().equals("")) { setNextButtonEnabled(false); } else { setNextButtonEnabled(true); } }); } } this.addToContentPane(listViewWidget); }

Target:
protected void drawStepContent() { super.drawStepContent(); listViewWidget.setItems(FXCollections.observableArrayList(menuItems)); if (defaultValue != null) { int idx = menuItems.indexOf(defaultValue); if (idx != -1) { listViewWidget.getSelectionModel().select(idx); listViewWidget.getFocusModel().focus(idx); listViewWidget.scrollTo(idx); } if (StringUtils.isBlank(defaultValue)) { setNextButtonEnabled(false); listViewWidget.getSelectionModel().selectedItemProperty() .addListener((observable, oldValue, newValue) -> { if (StringUtils.isBlank(newValue)) { setNextButtonEnabled(false); } else { setNextButtonEnabled(true); } }); } } this.addToContentPane(listViewWidget); }
Source:
public void rewrite_records_in_bulk() { final RecordStorage<I> storage = getStorage(); final I id1 = newId(); final I id2 = newId(); final I id3 = newId(); final EntityRecord record1 = newStorageRecord(id1); final EntityRecord record2 = newStorageRecord(id2); final EntityRecord record3 = newStorageRecord(id3); final EntityRecord record1Modified = newStorageRecord(id1); final EntityRecord record3Modified = newStorageRecord(id3); final Map<I, EntityRecord> v1Records = new HashMap<>(3); v1Records.put(id1, record1); v1Records.put(id2, record2); v1Records.put(id3, record3); final Map<I, EntityRecord> v2Records = new HashMap<>(3); v2Records.put(id1, record1Modified); v2Records.put(id2, record2); v2Records.put(id3, record3Modified); storage.write(v1Records); final Map<I, EntityRecord> firstRevision = storage.readAll(); assertMapsEqual(v1Records, firstRevision, "First revision EntityRecord-s"); storage.write(v2Records); final Map<I, EntityRecord> secondRevision = storage.readAll(); assertMapsEqual(v2Records, secondRevision, "Second revision EntityRecord-s"); }

Target:
public void rewrite_records_in_bulk() { final int recordCount = 3; final RecordStorage<I> storage = getStorage(); final Map<I, EntityRecord> v1Records = new HashMap<>(recordCount); final Map<I, EntityRecord> v2Records = new HashMap<>(recordCount); for (int i = 0; i < recordCount; i++) { final I id = newId(); final EntityRecord record = newStorageRecord(id); final EntityRecord alternateRecord = (i % 2 == 0) ? record : newStorageRecord(id); v1Records.put(id, record); v2Records.put(id, alternateRecord); } storage.write(v1Records); final Map<I, EntityRecord> firstRevision = storage.readAll(); assertMapsEqual(v1Records, firstRevision, "First revision EntityRecord-s"); storage.write(v2Records); final Map<I, EntityRecord> secondRevision = storage.readAll(); assertMapsEqual(v2Records, secondRevision, "Second revision EntityRecord-s"); }
Source:
public String getTitleFontFamily() { return null; }

Target:
public String getTitleFontFamily() { return label.isPresent() ? label.get().getText().getFontFamily() : null; }
Source:
public Response setDynamicConfigs(final CoordinatorDynamicConfig dynamicConfig, @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author, @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment, @Context HttpServletRequest req ) { return manager.set( CoordinatorDynamicConfig.CONFIG_KEY, dynamicConfig, new AuditInfo(author, comment, req.getRemoteAddr()) ) ? Response.ok().build() : Response.status(Response.Status.BAD_REQUEST).build(); }

Target:
public Response setDynamicConfigs(final CoordinatorDynamicConfig dynamicConfig, @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author, @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment, @Context HttpServletRequest req ) { return manager.set( CoordinatorDynamicConfig.CONFIG_KEY, dynamicConfig, new AuditInfo(author, comment, req.getRemoteAddr()) ) ? Response.ok().build() : Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); }
Source:
public SinglePassSamProgram makeInstance(final String outbase, final String outext, final File input, final File reference, final Set<MetricAccumulationLevel> metricAccumulationLevel, final File dbSnp, final File intervals, final File refflat, final Set<String> ignoreSequence) { final CollectQualityYieldMetrics program = new CollectQualityYieldMetrics(); program.OUTPUT = new File(outbase + ".quality_yield_metrics" + outext); program.INPUT = input; program.setReferenceSequence(reference); return program; }

Target:
public SinglePassSamProgram makeInstance(final String outbase, final String outext, final File input, final File reference, final Set<MetricAccumulationLevel> metricAccumulationLevel, final File dbSnp, final File intervals, final File refflat, final Set<String> ignoreSequence) { final CollectAlignmentSummaryMetrics program = new CollectAlignmentSummaryMetrics(); program.OUTPUT = new File(outbase + ".alignment_summary_metrics" + outext); program.METRIC_ACCUMULATION_LEVEL = metricAccumulationLevel; program.INPUT = input; program.setReferenceSequence(reference); return program; }
Source:
private synchronized void tryReleaseWorkers() { if (blockedWorkerIds.size() == numWorkersToSync) { LOG.log(Level.INFO, "Try releasing {0} blocked workers: {1}", new Object[]{numWorkersToSync, blockedWorkerIds}); if (globalStateMachine.getCurrentState().equals(STATE_INIT)) { initLatch.countDown(); } else if (globalStateMachine.getCurrentState().equals(STATE_RUN)) { try { final int numWorkersToRelease = numWorkersToSync; LOG.log(Level.INFO, "Wait for driver to allow workers to enter cleanup state"); allowCleanupLatch.await(); if (numWorkersToRelease < numWorkersToSync) { LOG.log(Level.FINE, "{0} more workers are added while waiting for driver to allow cleanup", numWorkersToSync - numWorkersToRelease); if (blockedWorkerIds.size() < numWorkersToSync) { LOG.log(Level.INFO, "Cancel releasing workers," + " because there are {0} workers that do not reach the cleanup barrier", numWorkersToSync - blockedWorkerIds.size()); return; } } } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while waiting for the optimization to be done", e); } } transitState(globalStateMachine); LOG.log(Level.INFO, "Send response message to {0} blocked workers", numWorkersToSync); for (final String workerId : blockedWorkerIds) { sendResponseMessage(workerId, EMPTY_DATA); } blockedWorkerIds.clear(); } }

Target:
private synchronized void tryReleaseWorkers() { if (blockedWorkerIds.size() == numWorkers) { LOG.log(Level.INFO, "Try releasing {0} blocked workers: {1}", new Object[]{numWorkers, blockedWorkerIds}); if (globalStateMachine.getCurrentState().equals(STATE_INIT)) { initLatch.countDown(); } else if (globalStateMachine.getCurrentState().equals(STATE_RUN)) { try { final int numWorkersBeforeSleep = numWorkers; LOG.log(Level.INFO, "Wait for driver to allow workers to enter cleanup state"); allowCleanupLatch.await(); final int numAddedWorkers = numWorkers - numWorkersBeforeSleep; if (numAddedWorkers > 0) { LOG.log(Level.FINE, "{0} more workers were added while waiting for driver to allow cleanup", numAddedWorkers); if (blockedWorkerIds.size() < numWorkers) { LOG.log(Level.INFO, "Cancel releasing workers" + " because we have {0} more workers that have not requested their cleanup barrier.", numWorkers - blockedWorkerIds.size()); return; } } } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while waiting for the optimization to be done", e); } } transitState(globalStateMachine); LOG.log(Level.INFO, "Send response message to {0} blocked workers: {1}", new Object[]{numWorkers, blockedWorkerIds}); for (final String workerId : blockedWorkerIds) { sendResponseMessage(workerId, EMPTY_DATA); } blockedWorkerIds.clear(); } }
Source:
protected final boolean canHandleFileExtension(@Nullable String fileExtension) { return "zip".equalsIgnoreCase(fileExtension); }

Target:
protected final boolean canHandleFileExtension(@Nullable String fileExtension) { return FILE_EXTENSION_ZIP.equalsIgnoreCase(fileExtension); }
Source:
public static Coder getCoder(CoderType type) { switch (type) { case RESULT: return new HBaseResultCoder(); case RESULT_ARRAY: return new HBaseResultArrayCoder(); default: throw new IllegalArgumentException("Can't get a coder for type: " + type.name()); } }

Target:
public static Coder getCoder(CoderType type) { switch (type) { case RESULT: return HBaseResultCoder.getInstance(); case RESULT_ARRAY: return HBaseResultArrayCoder.getInstance(); default: throw new IllegalArgumentException("Can't get a coder for type: " + type.name()); } }
Source:
private void fillReplacerProperties(Node node, Properties properties) { YamlMapping propertiesMapping = asMapping(((ElementAdapter) node).getYamlNode()); for (YamlNameNodePair childNodePair : propertiesMapping.childrenPairs()) { String childName = childNodePair.nodeName(); YamlNode child = childNodePair.childNode(); if (child != null) { Object nodeValue = asScalar(child).nodeValue(); properties.put(childName, nodeValue != null ? nodeValue.toString() : ""); } else { properties.put(childName, ""); } } }

Target:
private void fillReplacerProperties(Node node, Properties properties) { YamlMapping propertiesMapping = getWrappedYamlMapping(node); for (YamlNameNodePair childNodePair : propertiesMapping.childrenPairs()) { String childName = childNodePair.nodeName(); YamlNode child = childNodePair.childNode(); Object nodeValue = asScalar(child).nodeValue(); properties.put(childName, nodeValue != null ? nodeValue.toString() : ""); } }