auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public AdBrokerBenchmark(AdBrokerConfig config) { this.m_config = config; ClientConfig clientConfig = new ClientConfig(config.user, config.password, new StatusListener()); clientConfig.setMaxTransactionsPerSecond(config.ratelimit); m_client = ClientFactory.createClient(clientConfig); m_rand = new Random(777); m_periodicStatsContext = m_client.createStatsContext(); m_fullStatsContext = m_client.createStatsContext(); System.out.print(HORIZONTAL_RULE); System.out.println(" Command Line Configuration"); System.out.println(HORIZONTAL_RULE); System.out.println(config.getConfigDumpString()); if (config.latencyreport && config.ratelimit == Integer.MAX_VALUE) { System.out.println("WARNING: Option latencyreport is ON, and no rate limit is set. " + "Expect high latencies to be reported.\n"); } }

Target:
public AdBrokerBenchmark(AdBrokerConfig config) { m_config = config; ClientConfig clientConfig = new ClientConfig(config.user, config.password, new StatusListener()); clientConfig.setMaxTransactionsPerSecond(config.ratelimit); m_client = ClientFactory.createClient(clientConfig); m_rand = new Random(777); m_periodicStatsContext = m_client.createStatsContext(); m_fullStatsContext = m_client.createStatsContext(); System.out.print(HORIZONTAL_RULE); System.out.println(" Command Line Configuration"); System.out.println(HORIZONTAL_RULE); System.out.println(config.getConfigDumpString()); if (config.latencyreport && config.ratelimit == Integer.MAX_VALUE) { System.out.println("WARNING: Option latencyreport is ON, and no rate limit is set. " + "Expect high latencies to be reported.\n"); } }
Source:
private void checkAndRethrow() { try { this.currentTask.get(); } catch (CancellationException | InterruptedException | ExecutionException e) { this.isClosed = true; throw new RuntimeException("Exception while writing records asynchronously", e); } finally { this.currentTask = null; } }

Target:
private void checkAndRethrow() { try { this.currentTask.get(); } catch (CancellationException | InterruptedException | ExecutionException e) { this.isClosed = true; final Throwable t = e instanceof ExecutionException ? e.getCause() : e; throw new RuntimeException("Exception while writing records asynchronously", t); } finally { this.currentTask = null; } }
Source:
private void discoverRegistryPressed(Shell shell) { IConnection tmp = pageModel.createConnection(); IStatus ret = RegistryProviderModel.getDefault().getRegistryURL(tmp); String oldVal = (String)registryURLObservable.getValue(); String newVal = ret.getMessage(); if( ret != null && ret.isOK()) { if( !eq(oldVal, newVal) ) { String title = "Overwrite registry URL?"; String msg = "Are you sure you want to change the registry URL from " + oldVal + " to " + newVal + "?"; MessageDialog dialog = new MessageDialog(shell, title, null, msg, MessageDialog.CONFIRM, new String[] {"Cancel", "OK"} , 0); String old = registryURLObservable.getValue().toString().trim(); if(old.isEmpty() || dialog.open() == 1 ) { registryURLObservable.setValue(ret.getMessage()); } } } else { String title = "Registry URL not found"; String msg = "No registry provider found for the given connection. If your Openshift connection is backed by a CDK or minishift installation, please ensure the CDK is running."; ErrorDialog ed = new ErrorDialog(shell, title, msg, ret, IStatus.ERROR | IStatus.WARNING | IStatus.INFO | IStatus.CANCEL); ed.open(); } }

Target:
private void discoverRegistryPressed(Shell shell) { IConnection tmp = pageModel.createConnection(); IStatus ret = RegistryProviderModel.getDefault().getRegistryURL(tmp); String oldVal = (String)registryURLObservable.getValue(); String newVal = ret.getMessage(); if( ret != null && ret.isOK()) { if( !eq(oldVal, newVal) ) { String title = "Overwrite registry URL?"; String msg = "Are you sure you want to change the registry URL from " + oldVal + " to " + newVal + "?"; MessageDialog dialog = new MessageDialog(shell, title, null, msg, MessageDialog.CONFIRM, new String[] {"OK", "Cancel"}, 0); String old = registryURLObservable.getValue().toString().trim(); if(old.isEmpty() || dialog.open() == IDialogConstants.OK_ID ) { registryURLObservable.setValue(ret.getMessage()); } } } else { String title = "Registry URL not found"; String msg = "No registry provider found for the given connection. If your Openshift connection is backed by a CDK or minishift installation, please ensure the CDK is running."; ErrorDialog ed = new ErrorDialog(shell, title, msg, ret, IStatus.ERROR | IStatus.WARNING | IStatus.INFO | IStatus.CANCEL); ed.open(); } }
Source:
public void should_checkMethodAccessibility_warn_user_when_method_is_deprecated() throws Throwable { final Method callMe = MyObjectImpl.class.getDeclaredMethod("callMe"); serverAPIImpl.checkMethodAccessibility(new MyObjectImpl(), MyObject.class.getName(), callMe, null, true); verify(technicalLoggerService).log( ServerAPIImpl.class, TechnicalLogSeverity.WARNING, "The API method " + this.getClass().getName() + "$MyObject.callMe is deprecated. It will no longer exists in future major release. Check the javadoc to know how to replace it."); }

Target:
public void should_checkMethodAccessibility_warn_user_when_method_is_deprecated() throws Throwable { final Method callMe = MyObjectImpl.class.getDeclaredMethod("callMeOld"); serverAPIImpl.checkMethodAccessibility(new MyObjectImpl(), MyObject.class.getName(), callMe, null, true); verify(technicalLoggerService).log( ServerAPIImpl.class, TechnicalLogSeverity.WARNING, "The API method " + this.getClass().getName() + "$MyObject.callMeOld is deprecated. It will be deleted in a future release. Please plan to update your code to use the replacement method instead. Check the Javadoc for more details."); }
Source:
protected String inferUrl() { return inferUrl(); }

Target:
protected String inferUrl() { return inferUrl(false); }
Source:
public void run() { if (isTimedOut()) { reportFuture.completeExceptionally( new InfrastructureException( String.format("Server '%s' in '%s' is not available.", serverRef, machineName))); } else if (isAvailable()) { currentNumberOfSequentialSuccessfulPings++; if (currentNumberOfSequentialSuccessfulPings == successThreshold) { reportFuture.complete(serverRef); } else { timer.schedule(new ServerCheckingTask(currentNumberOfSequentialSuccessfulPings), period); } } else { timer.schedule(new ServerCheckingTask(0), period); } }

Target:
public void run() { if (isTimedOut()) { reportFuture.completeExceptionally( new InfrastructureException( String.format( "Server '%s' in container '%s' not available.", serverRef, machineName))); } else if (isAvailable()) { currentNumberOfSequentialSuccessfulPings++; if (currentNumberOfSequentialSuccessfulPings == successThreshold) { reportFuture.complete(serverRef); } else { timer.schedule(new ServerCheckingTask(currentNumberOfSequentialSuccessfulPings), period); } } else { timer.schedule(new ServerCheckingTask(0), period); } }
Source:
public SanctumOfShatteredHeights(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SHRINE); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter)), new ManaCostsImpl("{1}")); ability.addCost(new DiscardTargetCost(new TargetCardInHand(filter1))); this.addAbility(ability); }

Target:
public SanctumOfShatteredHeights(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SHRINE); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledPermanent(SubType.SHRINE))) .setText("Sanctum of Shattered Heights deals X damage to target creature or planeswalker, where X is the number of Shrines you control"), new ManaCostsImpl("{1}")); ability.addCost(new DiscardTargetCost(new TargetCardInHand(filter))); this.addAbility(ability); }
Source:
public GroupingSetDescriptor( @JsonProperty("groupingKeys") List<VariableReferenceExpression> groupingKeys, @JsonProperty("groupingSetCount") int groupingSetCount, @JsonProperty("globalGroupingSets") Set<Integer> globalGroupingSets) { requireNonNull(globalGroupingSets, "globalGroupingSets is null"); checkArgument(globalGroupingSets.size() <= groupingSetCount, "list of empty global grouping sets must be no larger than grouping set count"); requireNonNull(groupingKeys, "groupingKeys is null"); if (groupingKeys.isEmpty()) { checkArgument(!globalGroupingSets.isEmpty(), "no grouping keys implies at least one global grouping set, but none provided"); } this.groupingKeys = unmodifiableList(new ArrayList<>(groupingKeys)); this.groupingSetCount = groupingSetCount; this.globalGroupingSets = unmodifiableSet(new HashSet<>(globalGroupingSets)); }

Target:
public GroupingSetDescriptor( @JsonProperty("groupingKeys") List<VariableReferenceExpression> groupingKeys, @JsonProperty("groupingSetCount") int groupingSetCount, @JsonProperty("globalGroupingSets") Set<Integer> globalGroupingSets) { requireNonNull(globalGroupingSets, "globalGroupingSets is null"); checkArgument(globalGroupingSets.size() <= groupingSetCount, "list of empty global grouping sets must be no larger than grouping set count"); requireNonNull(groupingKeys, "groupingKeys is null"); if (groupingKeys.isEmpty()) { checkArgument(!globalGroupingSets.isEmpty(), "no grouping keys implies at least one global grouping set, but none provided"); } this.groupingKeys = unmodifiableList(new ArrayList<>(groupingKeys)); this.groupingSetCount = groupingSetCount; this.globalGroupingSets = unmodifiableSet(new LinkedHashSet<>(globalGroupingSets)); }
Source:
public CorfuTablePerformanceTest() { seed = Long.parseLong(PROPERTIES.getProperty("tableSeed", "1024")); randomBoundary = Integer.parseInt(PROPERTIES.getProperty("tableRandomBoundary","10")); time = Long.parseLong(PROPERTIES.getProperty("tableTime", "100")); keyNum = Integer.parseInt(PROPERTIES.getProperty("keyNum", "10")); valueSize = Integer.parseInt(PROPERTIES.getProperty("valueSize", "1024")); random = new Random(seed); keyValueManager = new org.corfudb.performancetest.KeyValueManager(keyNum, valueSize); }

Target:
public CorfuTablePerformanceTest() { final long seed = Long.parseLong(PROPERTIES.getProperty("tableSeed", "1024")); randomBoundary = Integer.parseInt(PROPERTIES.getProperty("tableRandomBoundary","10")); time = Long.parseLong(PROPERTIES.getProperty("tableTime", "100")); final int keyNum = Integer.parseInt(PROPERTIES.getProperty("keyNum", "10")); final int valueSize = Integer.parseInt(PROPERTIES.getProperty("valueSize", "1024")); random = new Random(seed); keyValueManager = new KeyValueManager(keyNum, valueSize); }
Source:
public static void setOverrideFileName(String... path) { fOverridePath = (path == null) ? null : path; fOverride = true; }

Target:
public static void setOverrideFileName(String... path) { fOverridePath = path; fOverride = true; }
Source:
public String getAnswerHtml(FeedbackQuestionDetails questionDetails) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) questionDetails; StringBuilder html = new StringBuilder(); for (int i = 0; i < answer.size(); i++) { int chosenIndex = answer.get(i); String chosenChoice = ""; if (chosenIndex == -1) { chosenChoice = "<span class=\"color_neutral\"><i>" + Const.INSTRUCTOR_FEEDBACK_RESULTS_MISSING_RESPONSE + "</i></span>"; html.append(StringHelper.integerToLowerCaseAlphabeticalIndex(i + 1)).append(") ") .append(chosenChoice).append("<br>"); } else { chosenChoice = Sanitizer.sanitizeForHtml(fqd.rubricChoices.get(answer.get(i))); html.append(StringHelper.integerToLowerCaseAlphabeticalIndex(i + 1)).append(") ").append(chosenChoice) .append(" <span class=\"color_neutral\"><i>(Choice ").append(chosenIndex + 1) .append(")</i></span><br>"); } } return html.toString(); }

Target:
public String getAnswerHtml(FeedbackQuestionDetails questionDetails) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) questionDetails; StringBuilder html = new StringBuilder(100); for (int i = 0; i < answer.size(); i++) { int chosenIndex = answer.get(i); String chosenChoice = ""; if (chosenIndex == -1) { chosenChoice = "<span class=\"color_neutral\"><i>" + Const.INSTRUCTOR_FEEDBACK_RESULTS_MISSING_RESPONSE + "</i></span>"; html.append(StringHelper.integerToLowerCaseAlphabeticalIndex(i + 1) + ") " + chosenChoice + "<br>"); } else { chosenChoice = Sanitizer.sanitizeForHtml(fqd.rubricChoices.get(answer.get(i))); html.append(StringHelper.integerToLowerCaseAlphabeticalIndex(i + 1) + ") " + chosenChoice + " <span class=\"color_neutral\"><i>(Choice " + (chosenIndex + 1) + ")</i></span><br>"); } } return html.toString(); }
Source:
public DocumentModel run(DocumentModel doc) throws OperationException { Property property = doc.getProperty(xpath); if (!property.isList()) { throw new OperationException("Property type is not supported by this operation"); } ListType listType = (ListType) property.getType(); if (listType.isArray()) { removeItemFromArrayProperty(doc, property); } else { removeItemFromListProperty(property); } doc = session.saveDocument(doc); if (save) { session.save(); } return doc; }

Target:
public DocumentModel run(DocumentModel doc) throws OperationException { Property property = doc.getProperty(xpath); if (!property.isList()) { throw new OperationException(String.format("Property: %s of type: %s is not supported by this operation", xpath, property.getType().getName())); } ListType listType = (ListType) property.getType(); if (listType.isArray()) { removeItemFromArrayProperty(doc, property); } else { removeItemFromListProperty(property); } doc = session.saveDocument(doc); if (save) { session.save(); } return doc; }
Source:
public Document getSelectedRecord(String opac, String identifier) throws IOException, NotFoundException, SAXException, ParserConfigurationException { importModule = initializeImportModule(); DataRecord dataRecord = importModule.getFullRecordById(opac, identifier); if (Objects.isNull(dataRecord)) { throw new NotFoundException("Record with ID '" + identifier + "' not found in OPAC '" + opac + "'!"); } List<SchemaConverterInterface> converters = getSchemaConverters(dataRecord); if (converters.isEmpty()) { throw new UnsupportedFormatException("No SchemaConverter found that supports '" + dataRecord.getMetadataFormat() + "' and '" + dataRecord.getFileFormat() + "'!"); } DataRecord resultRecord = converters.get(0).convert(dataRecord, MetadataFormat.KITODO, FileFormat.XML); if (resultRecord.getOriginalData() instanceof String) { return XMLUtils.parseXMLString((String) resultRecord.getOriginalData()); } else { throw new UnknownFormatConversionException("Result data is not a String!"); } }

Target:
public Document getSelectedRecord(String opac, String identifier) throws IOException, SAXException, ParserConfigurationException, URISyntaxException, NoRecordFoundException, UnsupportedFormatException { importModule = initializeImportModule(); DataRecord dataRecord = importModule.getFullRecordById(opac, identifier); SchemaConverterInterface converter = getSchemaConverter(dataRecord); URI xsltFile = Paths.get(ConfigCore.getParameter(ParameterCore.DIR_XSLT)).toUri() .resolve(new URI(OPACConfig.getXsltMappingFile(opac))); DataRecord resultRecord = converter.convert(dataRecord, MetadataFormat.KITODO, FileFormat.XML, ServiceManager.getFileService().getFile(xsltFile)); if (resultRecord.getOriginalData() instanceof String) { return XMLUtils.parseXMLString((String) resultRecord.getOriginalData()); } else { throw new UnknownFormatConversionException("Result data is not a String!"); } }
Source:
public void visitBinaryExpression(BinaryExpressionTree tree) { if (tree.is(CONDITIONAL_AND, CONDITIONAL_OR)) { ExpressionTree leftChild = removeParenthesis(tree.leftOperand()); ExpressionTree rightChild = removeParenthesis(tree.rightOperand()); boolean leftChildOfSameKind = leftChild.is(tree.getKind()); boolean rightChildOfSameKind = rightChild.is(tree.getKind()); if (rightChildOfSameKind) { logicalOperationsToIgnore.add(rightChild); } if (!logicalOperationsToIgnore.contains(tree) && !leftChildOfSameKind) { complexity.addComplexityWithoutNesting(tree.operator()); } } super.visitBinaryExpression(tree); }

Target:
public void visitBinaryExpression(BinaryExpressionTree tree) { if (tree.is(CONDITIONAL_AND, CONDITIONAL_OR) && !nestedLogicalExpressions.contains(tree)) { List<SyntaxToken> flatOperators = new ArrayList<>(); flattenLogicalExpression(0, flatOperators, tree); complexity.addComplexityWithoutNesting(flatOperators.get(0)); for (int i = 1; i < flatOperators.size(); i++) { if (!flatOperators.get(i).text().equals(flatOperators.get(i - 1).text())) { complexity.addComplexityWithoutNesting(flatOperators.get(i)); } } } super.visitBinaryExpression(tree); }
Source:
public boolean nextKeyValue() throws IOException, InterruptedException { while (true) { if (pos_ > end_) { reader_.markNoMoreNewBlocks(); } value_.set(null); errorTracker.incRecords(); Throwable decodeException = null; try { if (!reader_.readNext(value_)) { return false; } } catch (IOException e) { throw e; } catch (Throwable e) { decodeException = e; } recordsReadCounter.increment(1); key_.set(pos_); pos_ = getLzoFilePos(); if (value_.get() != null) { return true; } errorTracker.incErrors(decodeException); recordErrorsCounter.increment(1); } }

Target:
public boolean nextKeyValue() throws IOException, InterruptedException { while (true) { if (pos_ > end_) { reader_.markNoMoreNewBlocks(); } value_.set(null); errorTracker.incRecords(); Throwable decodeException = null; try { if (!reader_.readNext(value_)) { return false; } } catch (IOException e) { throw e; } catch (Throwable e) { decodeException = e; } key_.set(pos_); pos_ = getLzoFilePos(); if (value_.get() != null) { recordsReadCounter.increment(1); return true; } errorTracker.incErrors(decodeException); recordErrorsCounter.increment(1); } }
Source:
public PatientData<Object> readJSON(JSONObject json) { Map<String, Object> result = new LinkedHashMap<>(); List<String> allergiesList = new LinkedList<>(); Boolean nkda = Boolean.FALSE; if (json.has(ALLERGIES)) { Object allergiesValue = json.get(ALLERGIES); if (allergiesValue instanceof JSONArray) { JSONArray allergiesJsonArray = (JSONArray) allergiesValue; @SuppressWarnings("unchecked") Iterator<String> iterator = allergiesJsonArray.iterator(); while (iterator.hasNext()) { allergiesList.add(iterator.next()); } nkda = Boolean.FALSE; } else if (allergiesValue instanceof String) { String allergiesString = (String) allergiesValue; if (NKDA.equals(allergiesString)) { nkda = Boolean.TRUE; } } } result.put(NKDA, nkda); result.put(ALLERGIES, allergiesList); return new DictionaryPatientData<>(DATA_NAME, result); }

Target:
public PatientData<Object> readJSON(JSONObject json) { Map<String, Object> result = new LinkedHashMap<>(); List<String> allergiesList = new LinkedList<>(); boolean nkda = false; if (json.has(ALLERGIES)) { Object allergiesValue = json.get(ALLERGIES); if (allergiesValue instanceof JSONArray) { JSONArray allergiesJsonArray = (JSONArray) allergiesValue; for (Object o : allergiesJsonArray) { String allergy = (String) o; if (NKDA.equalsIgnoreCase(allergy)) { nkda = true; } else { allergiesList.add(allergy); } } } } result.put(NKDA, nkda); result.put(ALLERGIES, allergiesList); return new DictionaryPatientData<>(DATA_NAME, result); }
Source:
public List<InsightCard> getInsights(@Scope(OAuthScope.INSIGHTS_READ) final AccessToken accessToken) { LOGGER.debug("Returning list of insights for account id = {}", accessToken.accountId); final Boolean chronological = false; final DateTime queryDate = DateTime.now(DateTimeZone.UTC).plusDays(1); final ImmutableList<InsightCard> cards = insightsDAODynamoDB.getInsightsByDate(accessToken.accountId, queryDate, chronological, MAX_INSIGHTS_NUM); if (cards.size() == 0) { final Optional<Account> optionalAccount = accountDAO.getById(accessToken.accountId); int userAgeInYears = 0; if (optionalAccount.isPresent()) { userAgeInYears = DateTimeUtil.getDateDiffFromNowInDays(optionalAccount.get().DOB) / 365; } final List<InsightCard> introCards = IntroductionInsights.getIntroCards(accessToken.accountId, userAgeInYears); this.insightsDAODynamoDB.insertListOfInsights(introCards); return introCards; } else { final List<InsightCard> cardsWithPreview = new ArrayList<>(); for (InsightCard card : cards) { cardsWithPreview.add(card.withInfoPreview(insightProcessor.getInsightPreviewForCategory(card.category).orNull())); } return cardsWithPreview; } }

Target:
public List<InsightCard> getInsights(@Scope(OAuthScope.INSIGHTS_READ) final AccessToken accessToken) { LOGGER.debug("Returning list of insights for account id = {}", accessToken.accountId); final Boolean chronological = false; final DateTime queryDate = DateTime.now(DateTimeZone.UTC).plusDays(1); final ImmutableList<InsightCard> cards = insightsDAODynamoDB.getInsightsByDate(accessToken.accountId, queryDate, chronological, MAX_INSIGHTS_NUM); if (cards.size() == 0) { final Optional<Account> optionalAccount = accountDAO.getById(accessToken.accountId); int userAgeInYears = 0; if (optionalAccount.isPresent()) { userAgeInYears = DateTimeUtil.getDateDiffFromNowInDays(optionalAccount.get().DOB) / 365; } final List<InsightCard> introCards = IntroductionInsights.getIntroCards(accessToken.accountId, userAgeInYears); this.insightsDAODynamoDB.insertListOfInsights(introCards); return introCards; } else { final List<InsightCard> cardsWithPreview = new ArrayList<>(); for (InsightCard card : cards) { cardsWithPreview.add(card.withInfoPreview(insightProcessor.getInsightPreviewForCategory(card.category))); } return cardsWithPreview; } }
Source:
public static String getSpectralType(Integer spectralClass, Double subtype, String luminosity) { if( null == spectralClass || null == subtype ) { return null; } if(spectralClass == PlanetarySystem.SPECTRAL_Q) { return (null != luminosity) ? "Q" + luminosity : "Q"; } int subtypeValue = (int)Math.round(subtype * 100); if( subtypeValue < 0 ) { subtypeValue = 0; } if( subtypeValue > 999 ) { subtypeValue = 999; } String subtypeFormat = "%.2f"; if( subtypeValue % 100 == 0 ) { subtypeFormat = "%.0f"; } else if( subtypeValue % 10 == 0 ) { subtypeFormat = "%.1f"; } if( luminosity.equals(PlanetarySystem.LUM_VI) ) { return "sd" + getSpectralClassName(spectralClass) + String.format(subtypeFormat, subtypeValue / 100.0); } else if( luminosity.equals(PlanetarySystem.LUM_VI_PLUS) ) { return "esd" + getSpectralClassName(spectralClass) + String.format(subtypeFormat, subtypeValue / 100.0); } else if( luminosity.equals(PlanetarySystem.LUM_VII) ) { return String.format(Locale.ROOT, "D" + subtypeFormat, subtypeValue / 100.0); } else { return String.format(Locale.ROOT, "%s" + subtypeFormat + "%s", getSpectralClassName(spectralClass), subtypeValue / 100.0, (null != luminosity ? luminosity : PlanetarySystem.LUM_V)); } }

Target:
public static String getSpectralType(Integer spectralClass, Double subtype, String luminosity) { if( null == spectralClass || null == subtype ) { return null; } if(spectralClass == PlanetarySystem.SPECTRAL_Q) { return (null != luminosity) ? "Q" + luminosity : "Q"; } int subtypeValue = (int)Math.round(subtype * 100); if( subtypeValue < 0 ) { subtypeValue = 0; } if( subtypeValue > 999 ) { subtypeValue = 999; } String subtypeFormat = "%.2f"; if( subtypeValue % 100 == 0 ) { subtypeFormat = "%.0f"; } else if( subtypeValue % 10 == 0 ) { subtypeFormat = "%.1f"; } if( null != luminosity && luminosity.equals(PlanetarySystem.LUM_VI) ) { return "sd" + getSpectralClassName(spectralClass) + String.format(subtypeFormat, subtypeValue / 100.0); } else if( null != luminosity && luminosity.equals(PlanetarySystem.LUM_VI_PLUS) ) { return "esd" + getSpectralClassName(spectralClass) + String.format(subtypeFormat, subtypeValue / 100.0); } else if( null != luminosity && luminosity.equals(PlanetarySystem.LUM_VII) ) { return String.format(Locale.ROOT, "D" + subtypeFormat, subtypeValue / 100.0); } else { return String.format(Locale.ROOT, "%s" + subtypeFormat + "%s", getSpectralClassName(spectralClass), subtypeValue / 100.0, (null != luminosity ? luminosity : PlanetarySystem.LUM_V)); } }
Source:
private Packet rewritePacket(final Packet packetIn) { Packet packetOut = packetIn; if (packetIn instanceof S38PacketPlayerListItem) { ((SpongeTabList) ((Player) this.playerEntity).getTabList()).updateEntriesOnSend((S38PacketPlayerListItem) packetIn); } else if (packetIn instanceof IMixinPacketResourcePackSend) { IMixinPacketResourcePackSend packet = (IMixinPacketResourcePackSend) packetIn; this.sentResourcePacks.put(packet.setFakeHash(), packet.getResourcePack()); } return packetOut; }

Target:
private Packet rewritePacket(final Packet packetIn) { if (packetIn instanceof S38PacketPlayerListItem) { ((SpongeTabList) ((Player) this.playerEntity).getTabList()).updateEntriesOnSend((S38PacketPlayerListItem) packetIn); } else if (packetIn instanceof IMixinPacketResourcePackSend) { IMixinPacketResourcePackSend packet = (IMixinPacketResourcePackSend) packetIn; this.sentResourcePacks.put(packet.setFakeHash(), packet.getResourcePack()); } return packetIn; }
Source:
public Subscriber<? super T> call(final Subscriber<? super T> child) { final Subscriber<T> parent = new Subscriber<T>() { int count = 0; boolean completed = false; @Override public void onCompleted() { if (!completed) { child.onCompleted(); } } @Override public void onError(Throwable e) { if (!completed) { child.onError(e); } } @Override public void onNext(T i) { if (!isUnsubscribed()) { if (++count >= limit) { completed = true; } child.onNext(i); if (completed) { child.onCompleted(); unsubscribe(); } } } @Override public void setProducer(final Producer producer) { child.setProducer(new Producer() { final AtomicLong requested = new AtomicLong(0); @Override public void request(long n) { if (n >0 && !completed) { while (true) { long r = requested.get(); long c = Math.min(n, limit - requested.get()); if (requested.compareAndSet(r, r + c)) { producer.request(c); break; } } } } }); } }; if (limit == 0) { child.onCompleted(); parent.unsubscribe(); } child.add(parent); return parent; }

Target:
public Subscriber<? super T> call(final Subscriber<? super T> child) { final Subscriber<T> parent = new Subscriber<T>() { int count = 0; boolean completed = false; @Override public void onCompleted() { if (!completed) { child.onCompleted(); } } @Override public void onError(Throwable e) { if (!completed) { child.onError(e); } } @Override public void onNext(T i) { if (!isUnsubscribed()) { if (++count >= limit) { completed = true; } child.onNext(i); if (completed) { child.onCompleted(); unsubscribe(); } } } @Override public void setProducer(final Producer producer) { child.setProducer(new Producer() { final AtomicLong requested = new AtomicLong(0); @Override public void request(long n) { if (n >0 && !completed) { while (true) { long r = requested.get(); long c = Math.min(n, limit - r); if (c == 0) break; else if (requested.compareAndSet(r, r + c)) { producer.request(c); break; } } } } }); } }; if (limit == 0) { child.onCompleted(); parent.unsubscribe(); } child.add(parent); return parent; }
Source:
public void prepareRun(BatchJoinerContext context) { if (conf.getNumPartitions() != null) { context.setNumPartitions(conf.getNumPartitions()); } FailureCollector collector = context.getFailureCollector(); Map<String, Schema> inputSchemas = context.getInputSchemas(); if (!inputSchemas.isEmpty()) { init(inputSchemas, collector); collector.getOrThrowException(); Collection<OutputFieldInfo> outputFieldInfos = createOutputFieldInfos(inputSchemas, collector); collector.getOrThrowException(); context.record(createFieldOperations(outputFieldInfos, perStageJoinKeys)); } }

Target:
public void prepareRun(BatchJoinerContext context) { if (conf.getNumPartitions() != null) { context.setNumPartitions(conf.getNumPartitions()); } FailureCollector collector = context.getFailureCollector(); Map<String, Schema> inputSchemas = context.getInputSchemas(); if (!conf.inputSchemasAvailable(inputSchemas)) { return; } init(inputSchemas, collector); collector.getOrThrowException(); Collection<OutputFieldInfo> outputFieldInfos = createOutputFieldInfos(inputSchemas, collector); collector.getOrThrowException(); context.record(createFieldOperations(outputFieldInfos, perStageJoinKeys)); }
Source:
public void setUp() throws Throwable { server = createServer(); server.init(); assertFalse( canConnect( server.address(), clientGroup ) ); }

Target:
public void setUp() throws Throwable { server = createServer(); server.init(); assertFalse( canConnect() ); }
Source:
public void handleChildChange(String parentPath, List<String> currentChildren) { if (skip("ZkBarrierChangeHandler")) { return; } if (currentChildren == null) { LOG.info("Got ZkBarrierChangeHandler handleChildChange with null currentChildren"); return; } LOG.info("list of children in the barrier = " + parentPath + ":" + Arrays.toString(currentChildren.toArray())); LOG.info("list of children to compare against = " + parentPath + ":" + Arrays.toString(names.toArray())); if (currentChildren.size() == names.size() && CollectionUtils.containsAll(currentChildren, names)) { String barrierDonePath = keyBuilder.getBarrierStatePath(barrierVersion); LOG.info("Writing BARRIER DONE to " + barrierDonePath); zkUtils.writeData(barrierDonePath, State.DONE); zkUtils.unsubscribeChildChanges(barrierDonePath, this); } }

Target:
public void handleChildChange(String parentPath, List<String> currentChildren) { if (notAValidEvent()) { return; } if (currentChildren == null) { LOG.info("Got ZkBarrierChangeHandler handleChildChange with null currentChildren"); return; } LOG.info("list of children in the barrier = " + parentPath + ":" + Arrays.toString(currentChildren.toArray())); LOG.info("list of children to compare against = " + parentPath + ":" + Arrays.toString(names.toArray())); if (currentChildren.size() == names.size() && CollectionUtils.containsAll(currentChildren, names)) { String barrierDonePath = keyBuilder.getBarrierStatePath(barrierVersion); LOG.info("Writing BARRIER DONE to " + barrierDonePath); zkUtils.writeData(barrierDonePath, State.DONE); zkUtils.unsubscribeChildChanges(barrierDonePath, this); } }
Source:
private static SSLFactory getSSLFactoryIfRequired(VerifiableProperties verifiableProperties) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { boolean sslRequired = new NettyConfig(verifiableProperties).nettyServerEnableSSL || new ClusterMapConfig(verifiableProperties).clusterMapSslEnabledDatacenters.length() > 0; return sslRequired? SSLFactory.getNewInstance(new SSLConfig(verifiableProperties)) : null; }

Target:
private static SSLFactory getSSLFactoryIfRequired(VerifiableProperties verifiableProperties) throws Exception { boolean sslRequired = new NettyConfig(verifiableProperties).nettyServerEnableSSL || new ClusterMapConfig(verifiableProperties).clusterMapSslEnabledDatacenters.length() > 0; return sslRequired ? SSLFactory.getNewInstance(new SSLConfig(verifiableProperties)) : null; }
Source:
public void run() { StreamBuildListener listener; try { listener = new StreamBuildListener(new FileOutputStream(getLogFile()), Charsets.UTF_8); } catch (IOException x) { LOGGER.log(Level.WARNING, null, x); result = Result.FAILURE; return; } timestamp = System.currentTimeMillis(); listener.started(getCauses()); Result _result = Result.NOT_BUILT; try { folder.updateChildren(listener); _result = Result.SUCCESS; } catch (InterruptedException x) { listener.getLogger().println("Aborted"); _result = Result.ABORTED; } catch (Exception x) { String message = "Failed to recompute children of " + folder.getFullDisplayName(); if (x instanceof AbortException) { listener.fatalError(message + ": " + x.getMessage()); } else { x.printStackTrace(listener.fatalError(message)); } _result = Result.FAILURE; } finally { duration = System.currentTimeMillis() - timestamp; if (durations == null) { durations = new ArrayList<Long>(); } while (durations.size() > 32) { durations.remove(0); } durations.add(duration); listener.finished(_result); listener.closeQuietly(); result = _result; try { save(); } catch (IOException x) { LOGGER.log(Level.WARNING, null, x); } } }

Target:
public void run() { StreamBuildListener listener; try { listener = new StreamBuildListener(new FileOutputStream(getLogFile()), Charsets.UTF_8); } catch (IOException x) { LOGGER.log(Level.WARNING, null, x); result = Result.FAILURE; return; } timestamp = System.currentTimeMillis(); listener.started(getCauses()); Result _result = Result.NOT_BUILT; try { folder.updateChildren(listener); _result = Result.SUCCESS; } catch (InterruptedException x) { LOGGER.log(Level.FINE, "recomputation of " + folder.getFullName() + " was aborted", x); listener.getLogger().println("Aborted"); _result = Result.ABORTED; } catch (Exception x) { LOGGER.log(Level.FINE, "recomputation of " + folder.getFullName() + " failed", x); if (x instanceof AbortException) { listener.fatalError(x.getMessage()); } else { x.printStackTrace(listener.fatalError("Failed to recompute children of " + folder.getFullDisplayName())); } _result = Result.FAILURE; } finally { duration = System.currentTimeMillis() - timestamp; if (durations == null) { durations = new ArrayList<Long>(); } while (durations.size() > 32) { durations.remove(0); } durations.add(duration); listener.finished(_result); listener.closeQuietly(); result = _result; try { save(); } catch (IOException x) { LOGGER.log(Level.WARNING, null, x); } } }
Source:
protected abstract long getCurrentValue() throws IOException; protected abstract boolean atomicIncrement(long nextValue) throws IOException; public abstract void close() throws IOException; private void allocateBlock(boolean peek) throws StandardException{ boolean success=false; long absIncrement = incrementSteps < 0 ? -incrementSteps : incrementSteps; long blockBoundary = incrementSteps < 0 ? -blockAllocationSize : blockAllocationSize; while(!success){ updateLock.lock(); try{ if(remaining.getAndDecrement()>0) return; currPosition.set(getCurrentValue()); long remainingCount = blockAllocationSize/absIncrement; success=atomicIncrement(currPosition.get()+ (absIncrement>blockAllocationSize?incrementSteps: incrementSteps*remainingCount)); if(success){ long v = remainingCount; remaining.set(peek?v:v-1); } }catch(IOException e){ throw Exceptions.parseException(e); }finally{ updateLock.unlock(); } } }

Target:
protected abstract long getCurrentValue() throws IOException; protected abstract boolean atomicIncrement(long nextValue) throws IOException; public abstract void close() throws IOException; private void allocateBlock(boolean peek) throws StandardException{ boolean success=false; long absIncrement = incrementSteps < 0 ? -incrementSteps : incrementSteps; while(!success){ updateLock.lock(); try{ if(remaining.getAndDecrement()>0) return; currPosition.set(getCurrentValue()); long remainingCount = blockAllocationSize/absIncrement; success=atomicIncrement(currPosition.get()+ (absIncrement>blockAllocationSize?incrementSteps: incrementSteps*remainingCount)); if(success){ long v = remainingCount; remaining.set(peek?v:v-1); } }catch(IOException e){ throw Exceptions.parseException(e); }finally{ updateLock.unlock(); } } }
Source:
public Tuple next() throws IOException { if (finished) { return null; } while (!context.isStopped()) { Tuple tuple = child.next(); if (tuple == null) { finished = true; if (prevTuple == null) { return null; } if (prevSeq == 0 && nonDistinctAggrFunctions != null) { terminatedNonDistinctAggr(prevTuple); } outTuple.put(prevTuple.getValues()); return outTuple; } int distinctSeq = tuple.getInt2(0); Tuple keyTuple = getKeyTuple(distinctSeq, tuple); if (prevKeyTuple == null) { if (distinctSeq == 0 && nonDistinctAggrFunctions != null) { initNonDistinctAggrContext(); mergeNonDistinctAggr(tuple); } prevKeyTuple = getKeyTuple(prevKeyTupleMap, keyTuple.getValues()); prevTuple = new VTuple(tuple.getValues()); prevSeq = distinctSeq; continue; } if (!prevKeyTuple.equals(keyTuple)) { if (prevSeq == 0 && nonDistinctAggrFunctions != null) { terminatedNonDistinctAggr(prevTuple); } outTuple.put(prevTuple.getValues()); prevKeyTuple = getKeyTuple(prevKeyTupleMap, keyTuple.getValues()); prevTuple.put(tuple.getValues()); prevTuple.put(tuple.getValues()); prevSeq = distinctSeq; if (distinctSeq == 0 && nonDistinctAggrFunctions != null) { initNonDistinctAggrContext(); mergeNonDistinctAggr(tuple); } return outTuple; } else { prevKeyTuple = getKeyTuple(prevKeyTupleMap, keyTuple.getValues()); prevTuple.put(tuple.getValues()); prevSeq = distinctSeq; if (distinctSeq == 0 && nonDistinctAggrFunctions != null) { mergeNonDistinctAggr(tuple); } } } return null; }

Target:
public Tuple next() throws IOException { if (finished) { return null; } while (!context.isStopped()) { Tuple tuple = child.next(); if (tuple == null) { finished = true; if (prevTuple == null) { return null; } if (prevSeq == 0 && nonDistinctAggrFunctions != null) { terminatedNonDistinctAggr(prevTuple); } outTuple.put(prevTuple.getValues()); return outTuple; } int distinctSeq = tuple.getInt2(0); Tuple keyTuple = getKeyTuple(distinctSeq, tuple); if (prevKeyTuple == null) { if (distinctSeq == 0 && nonDistinctAggrFunctions != null) { initNonDistinctAggrContext(); mergeNonDistinctAggr(tuple); } prevKeyTuple = getKeyTuple(prevKeyTupleMap, keyTuple.getValues()); prevTuple = new VTuple(tuple.getValues()); prevSeq = distinctSeq; continue; } if (!prevKeyTuple.equals(keyTuple)) { if (prevSeq == 0 && nonDistinctAggrFunctions != null) { terminatedNonDistinctAggr(prevTuple); } outTuple.put(prevTuple.getValues()); prevKeyTuple = getKeyTuple(prevKeyTupleMap, keyTuple.getValues()); prevTuple.put(tuple.getValues()); prevSeq = distinctSeq; if (distinctSeq == 0 && nonDistinctAggrFunctions != null) { initNonDistinctAggrContext(); mergeNonDistinctAggr(tuple); } return outTuple; } else { prevKeyTuple = getKeyTuple(prevKeyTupleMap, keyTuple.getValues()); prevTuple.put(tuple.getValues()); prevSeq = distinctSeq; if (distinctSeq == 0 && nonDistinctAggrFunctions != null) { mergeNonDistinctAggr(tuple); } } } return null; }
Source:
private void handleFinalizingCleanup(final StateContext context) { log.info("Cleaning up after cancelled transfer. {}", getTransferDescription()); stopImageTransferSession(context.entity); if (!Guid.isNullOrEmpty(getParameters().getImageGroupID())) { setImageStatus(getParameters().getTransferType() == TransferType.Upload ? ImageStatus.ILLEGAL : ImageStatus.OK); } Guid vdsId = context.entity.getVdsId() != null ? context.entity.getVdsId() : getVdsId(); tearDownImage(vdsId, context.entity.getImagedTicketId(), context.entity.getBackupId()); updateEntityPhase(ImageTransferPhase.FINISHED_CLEANUP); setAuditLogTypeFromPhase(ImageTransferPhase.FINISHED_CLEANUP); }

Target:
private void handleFinalizingCleanup(final StateContext context) { cleanup(context, false); }
Source:
protected void selectExternalProvider() { final Network network = getNetwork(); if (network.isExternal()) { getExternalProviders().setSelectedItem(Linq.firstOrDefault((Iterable<Provider>) getExternalProviders().getItems(), new Linq.IPredicate<Provider>() { @Override public boolean match(Provider provider) { return provider.getId().equals(network.getProvidedBy().getProviderId()); } })); } }

Target:
protected void selectExternalProvider() { final Network network = getNetwork(); getExternalProviders().setSelectedItem(Linq.firstOrDefault((Iterable<Provider>) getExternalProviders().getItems(), new Linq.NetworkSameProviderPredicate(network))); }
Source:
public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack) { }

Target:
public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack) { player.addStat(StatList.getBlockStats(this)); player.addExhaustion(0.005F); }
Source:
private void validateTag(Annotation webAnnotation) throws ParamValidationException, PropertyValidationException { Body body = webAnnotation.getBody(); if (body.getType() != null && body.getType().contains(WebAnnotationFields.SPECIFIC_RESOURCE)) { validateTagWithSpecificResource(body); } else if (body.getType() != null && body.getType().contains(WebAnnotationFields.FULL_TEXT_RESOURCE)) { validateTagWithFullTextResource(body); } else if (BodyInternalTypes.isSemanticTagBody(body.getInternalType())) { validateSemanticTagUrl(body); } else if (BodyInternalTypes.isAgentBodyTag(body.getInternalType())) { validateAgentBody(body); } else if (BodyInternalTypes.isGeoTagBody(body.getInternalType())) { validateGeoTag(body); } else if (BodyInternalTypes.isVcardAddressTagBody(body.getInternalType())) { validateVcardAddressBody(body); } else { validateTagWithValue(body); } }

Target:
private void validateTag(Annotation webAnnotation) throws ParamValidationException, PropertyValidationException { Body body = webAnnotation.getBody(); if (body.getType() != null && body.getType().contains(WebAnnotationFields.SPECIFIC_RESOURCE)) { validateTagWithSpecificResource(body); } else if (BodyInternalTypes.isSemanticTagBody(body.getInternalType())) { validateSemanticTagUrl(body); } else if (BodyInternalTypes.isAgentBodyTag(body.getInternalType())) { validateAgentBody(body); } else if (BodyInternalTypes.isGeoTagBody(body.getInternalType())) { validateGeoTag(body); } else if (BodyInternalTypes.isVcardAddressTagBody(body.getInternalType())) { validateVcardAddressBody(body); } else { validateTagWithValue(body); } }
Source:
public void sendRequest(final ITmfEventRequest request) { synchronized (fLock) { if (TmfCoreTracer.isRequestTraced()) { TmfCoreTracer.traceRequest(request.getRequestId(), "SENT to provider " + getName()); } if (request.getProviderFilter() == null) { request.setProviderFilter(this); } if (sendWithParent(request)) { return; } if (request.getExecType() == ExecutionType.FOREGROUND) { if ((fSignalDepth > 0) || (fRequestPendingCounter > 0)) { coalesceEventRequest(request); } else { queueRequest(request); } return; } if ((fTimer == null)) { queueRequest(request); return; } coalesceEventRequest(request); if (fIsTimerEnabled) { fCurrentTask.cancel(); fCurrentTask = new TimerTask() { @Override public void run() { synchronized (fLock) { fireRequest(true); } } }; fTimer.schedule(fCurrentTask, DELAY); } } }

Target:
public void sendRequest(final ITmfEventRequest request) { synchronized (fLock) { if (TmfCoreTracer.isRequestTraced()) { TmfCoreTracer.traceRequest(request.getRequestId(), "SENT to provider " + getName()); } if (request.getProviderFilter() == null) { request.setProviderFilter(this); } if (sendWithParent(request)) { return; } if (request.getExecType() == ExecutionType.FOREGROUND) { if ((fSignalDepth > 0) || (fRequestPendingCounter > 0)) { coalesceEventRequest(request); } else { queueRequest(request); } return; } if (fTimer == null) { queueRequest(request); return; } coalesceEventRequest(request); if (fIsTimerEnabled) { fCurrentTask.cancel(); fCurrentTask = new TimerTask() { @Override public void run() { synchronized (fLock) { fireRequest(true); } } }; fTimer.schedule(fCurrentTask, DELAY); } } }
Source:
public void testRootOfElementNode() throws Exception { final String xpath = " final List<Item> nodes = getXpathItems(xpath, rootNode); assertEquals("Invalid number of nodes", 1, nodes.size()); final AbstractNode root = (AbstractNode) ((NodeInfo) nodes.get(0)).getRoot(); assertEquals("Invalid number of nodes", TokenTypes.EOF, root.getTokenType()); assertTrue("Should return true, because selected node is RootNode", root instanceof RootNode); }

Target:
public void testRootOfElementNode() throws Exception { final String xpath = " final List<Item> nodes = getXpathItems(xpath, rootNode); assertEquals("Invalid number of nodes", 1, nodes.size()); final AbstractNode root = (AbstractNode) ((NodeInfo) nodes.get(0)).getRoot(); assertEquals("Invalid token type", TokenTypes.EOF, root.getTokenType()); assertTrue("Should return true, because selected node is RootNode", root instanceof RootNode); }
Source:
public void readBatch( int total, ColumnVector column, TypeInfo columnType) throws IOException { StructColumnVector structColumnVector = (StructColumnVector) column; StructTypeInfo structTypeInfo = (StructTypeInfo) columnType; ColumnVector[] vectors = structColumnVector.fields; for (int i = 0; i < vectors.length; i++) { fieldReaders.get(i) .readBatch(total, vectors[i], structTypeInfo.getAllStructFieldTypeInfos().get(i)); structColumnVector.isRepeating = structColumnVector.isRepeating && vectors[i].isRepeating; for (int j = 0; j < vectors[i].isNull.length; j++) { structColumnVector.isNull[j] = (i == 0) ? vectors[i].isNull[j] : structColumnVector.isNull[j] && vectors[i].isNull[j]; structColumnVector.noNulls = (i == 0) ? structColumnVector.isNull[j] : structColumnVector.noNulls && vectors[i].isNull[j]; } } }

Target:
public void readBatch( int total, ColumnVector column, TypeInfo columnType) throws IOException { StructColumnVector structColumnVector = (StructColumnVector) column; StructTypeInfo structTypeInfo = (StructTypeInfo) columnType; ColumnVector[] vectors = structColumnVector.fields; for (int i = 0; i < vectors.length; i++) { fieldReaders.get(i) .readBatch(total, vectors[i], structTypeInfo.getAllStructFieldTypeInfos().get(i)); structColumnVector.isRepeating = structColumnVector.isRepeating && vectors[i].isRepeating; for (int j = 0; j < vectors[i].isNull.length; j++) { structColumnVector.isNull[j] = (i == 0) ? vectors[i].isNull[j] : structColumnVector.isNull[j] && vectors[i].isNull[j]; } structColumnVector.noNulls = (i == 0) ? vectors[i].noNulls : structColumnVector.noNulls && vectors[i].noNulls; } }
Source:
protected Locale resolveLocale(Locale locale) { if (codeListTable.containsRow(locale)) { if (logger.isDebugEnabled()) { logger.debug("Found codelist for specified locale '{}'.", locale); } return locale; } String lang = locale.getLanguage(); if (StringUtils.hasLength(lang) && !lang.equals(locale.toString())) { Locale langOnlyLocale = new Locale(lang); if (codeListTable.containsRow(langOnlyLocale)) { if (logger.isDebugEnabled()) { logger.debug( "Found codelist for specified locale '{}' (language only).", locale); } return langOnlyLocale; } } if (logger.isDebugEnabled()) { logger.debug( "There is no codelist for specified locale '{}'. Use '{}' as fallback.", locale, fallbackTo); } return fallbackTo; }

Target:
protected Locale resolveLocale(Locale locale) { if (codeListTable.containsRow(locale)) { logger.debug("Found codelist for specified locale '{}'.", locale); return locale; } String lang = locale.getLanguage(); if (StringUtils.hasLength(lang) && !lang.equals(locale.toString())) { Locale langOnlyLocale = new Locale(lang); if (codeListTable.containsRow(langOnlyLocale)) { logger.debug( "Found codelist for specified locale '{}' (language only).", locale); return langOnlyLocale; } } logger.debug( "There is no codelist for specified locale '{}'. Use '{}' as fallback.", locale, fallbackTo); return fallbackTo; }
Source:
public Object getDefaultValue() { if (Boolean.class.isAssignableFrom(this.getType())) { return false; } else return null; }

Target:
public Object getDefaultValue() { if (Boolean.class.isAssignableFrom(this.getType()) || boolean.class.isAssignableFrom(this.getType()) ) { return false; } else return null; }