auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static GridCoverage2D createCoverageTypeDouble( final String coverageName, final double westLon, final double eastLon, final double southLat, final double northLat, final double[] minPerBand, final double[] maxPerBand, final String[] namePerBand, final WritableRaster raster, final String crsCode ) { final GridCoverageFactory gcf = CoverageFactoryFinder.getGridCoverageFactory(null); Envelope mapExtent; CoordinateReferenceSystem crs = null; if (crsCode.equals(GeometryUtils.DEFAULT_CRS_STR)) { crs = GeometryUtils.DEFAULT_CRS; } else { try { crs = CRS.decode(crsCode); } catch (FactoryException e) { LOGGER.error( "Unable to decode " + crsCode + " CRS", e); throw new RuntimeException( "Unable to initialize " + crsCode + " object", e); } } try { mapExtent = new ReferencedEnvelope( westLon, eastLon, southLat, northLat, crs); } catch (final IllegalArgumentException e) { LOGGER.warn( "Unable to use default CRS", e); mapExtent = new Envelope2D( new DirectPosition2D( westLon, southLat), new DirectPosition2D( eastLon, northLat)); } final GridSampleDimension[] bands = new GridSampleDimension[raster.getNumBands()]; create( namePerBand, raster.getSampleModel(), minPerBand, maxPerBand, bands); return gcf.create( coverageName, raster, mapExtent, bands); }

Target:
public static GridCoverage2D createCoverageTypeDouble( final String coverageName, final double westLon, final double eastLon, final double southLat, final double northLat, final double[] minPerBand, final double[] maxPerBand, final String[] namePerBand, final WritableRaster raster, final String crsCode ) { final GridCoverageFactory gcf = CoverageFactoryFinder.getGridCoverageFactory(null); Envelope mapExtent; CoordinateReferenceSystem crs = null; if (crsCode == null || crsCode.isEmpty() || crsCode.equals(GeometryUtils.DEFAULT_CRS_STR)) { crs = GeometryUtils.DEFAULT_CRS; } else { try { crs = CRS.decode(crsCode); } catch (FactoryException e) { LOGGER.error( "Unable to decode " + crsCode + " CRS", e); throw new RuntimeException( "Unable to initialize " + crsCode + " object", e); } } try { mapExtent = new ReferencedEnvelope( westLon, eastLon, southLat, northLat, crs); } catch (final IllegalArgumentException e) { LOGGER.warn( "Unable to use default CRS", e); mapExtent = new Envelope2D( new DirectPosition2D( westLon, southLat), new DirectPosition2D( eastLon, northLat)); } final GridSampleDimension[] bands = new GridSampleDimension[raster.getNumBands()]; create( namePerBand, raster.getSampleModel(), minPerBand, maxPerBand, bands); return gcf.create( coverageName, raster, mapExtent, bands); }
Source:
private Span getSpan(TransactionBase tx, final String childId, final VisibilityBindingSet childBindingSet, final String siblingId) { final VariableOrder childVarOrder = getVarOrder(tx, childId); final VariableOrder siblingVarOrder = getVarOrder(tx, siblingId); final List<String> commonVars = getCommonVars(childVarOrder, siblingVarOrder); Bytes scanPrefix = null; if(!commonVars.isEmpty()) { scanPrefix = getRowKey(siblingId, new VariableOrder(commonVars), childBindingSet); } else { scanPrefix = getRowKey(siblingId, siblingVarOrder, childBindingSet); } return Span.prefix(scanPrefix); }

Target:
private Span getSpan(TransactionBase tx, final String childId, final VisibilityBindingSet childBindingSet, final String siblingId) { final VariableOrder childVarOrder = getVarOrder(tx, childId); final VariableOrder siblingVarOrder = getVarOrder(tx, siblingId); final List<String> commonVars = getCommonVars(childVarOrder, siblingVarOrder); Bytes siblingScanPrefix = null; if(!commonVars.isEmpty()) { siblingScanPrefix = makeRowKey(siblingId, new VariableOrder(commonVars), childBindingSet); } else { siblingScanPrefix = makeRowKey(siblingId, siblingVarOrder, childBindingSet); } return Span.prefix(siblingScanPrefix); }
Source:
public void logPriorTest() { final double[] weights = MathUtils.normalizeFromRealSpace(new double[] {0.2, 0.2, 0.6, 0.1, 0.9, 0.1}); final double[] minorAlleleFractions = new double[] {0.1, 0.2, 0.3, 0.4, 0.5, 0.33}; final double memoryLength = 5e6; AlleleFractionHiddenMarkovModel model = new AlleleFractionHiddenMarkovModel(minorAlleleFractions, weights, memoryLength, AllelicPanelOfNormals.EMPTY_PON, NO_BIAS_OR_OUTLIERS_PARAMS); final SimpleInterval position1 = new SimpleInterval("chr1", 100, 100); final SimpleInterval position2 = new SimpleInterval("chr2", 20000, 20000); for (int n = 0; n < weights.length; n++) { Assert.assertEquals(model.logPriorProbability(n, position1), Math.log(weights[n])); Assert.assertEquals(model.logPriorProbability(n, position2), Math.log(weights[n])); } }

Target:
public void logPriorTest() { final double[] weights = MathUtils.normalizeFromRealSpace(new double[] {0.2, 0.2, 0.6, 0.1, 0.9, 0.1}); final double[] minorAlleleFractions = new double[] {0.1, 0.2, 0.3, 0.4, 0.5, 0.33}; final double memoryLength = 5e6; final AlleleFractionHiddenMarkovModel model = new AlleleFractionHiddenMarkovModel(minorAlleleFractions, weights, memoryLength, AllelicPanelOfNormals.EMPTY_PON, NO_BIAS_OR_OUTLIERS_PARAMS); final SimpleInterval position1 = new SimpleInterval("chr1", 100, 100); final SimpleInterval position2 = new SimpleInterval("chr2", 20000, 20000); for (int n = 0; n < weights.length; n++) { Assert.assertEquals(model.logPriorProbability(n, position1), Math.log(weights[n])); Assert.assertEquals(model.logPriorProbability(n, position2), Math.log(weights[n])); } }
Source:
public void handleDefaultDeviceResponse(final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleDefaultDeviceResponse for MessageType: {}", messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; OsgpException osgpException = exception; try { if (deviceResult == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; if (e instanceof OsgpException) { osgpException = (OsgpException) e; } else { osgpException = new TechnicalException(ComponentType.UNKNOWN, "An unknown error occurred", e); } } this.webServiceResponseMessageSender.send(new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, result, osgpException, null)); }

Target:
public void handleDefaultDeviceResponse(final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleDefaultDeviceResponse for MessageType: {}", messageType); ResponseMessageResultType result = deviceResult; OsgpException osgpException = exception; if (deviceResult == ResponseMessageResultType.NOT_OK && exception == null) { LOGGER.error("Incorrect response received, exception should not be null when result is not ok"); osgpException = new TechnicalException(ComponentType.DOMAIN_TARIFF_SWITCHING, "An unknown error occurred"); } if (deviceResult == ResponseMessageResultType.OK && exception != null) { LOGGER.error("Incorrect response received, result should be set to not ok when exception is not null"); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, result, osgpException, null)); }
Source:
public static void showMyProfileDialog(Context context, String title, String initialText, String hint, final Callback callback) { LayoutInflater layoutInflater = LayoutInflater.from(context); View promptView = layoutInflater.inflate(org.wordpress.android.R.layout.my_profile_dialog, null); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context); alertDialogBuilder.setView(promptView); final WPTextView textView = (WPTextView) promptView.findViewById(org.wordpress.android.R.id.my_profile_dialog_label); final OpenSansEditText editText = (OpenSansEditText) promptView.findViewById(org.wordpress.android.R.id.my_profile_dialog_input); final WPTextView hintView = (WPTextView) promptView.findViewById(org.wordpress.android.R.id.my_profile_dialog_hint); textView.setText(title); if (hint != null && !hint.isEmpty()) { hintView.setText(hint); } else { hintView.setVisibility(View.GONE); } if (initialText != null && !initialText.isEmpty()) { editText.setText(initialText); editText.setSelection(0, initialText.length()); } alertDialogBuilder.setCancelable(false) .setPositiveButton(org.wordpress.android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { callback.onSuccessfulInput(editText.getText().toString()); } }) .setNegativeButton(org.wordpress.android.R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = alertDialogBuilder.create(); alert.show(); }

Target:
public static void showMyProfileDialog(Context context, String title, String initialText, String hint, final Callback callback) { LayoutInflater layoutInflater = LayoutInflater.from(context); View promptView = layoutInflater.inflate(R.layout.my_profile_dialog, null); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context); alertDialogBuilder.setView(promptView); final WPTextView textView = (WPTextView) promptView.findViewById(R.id.my_profile_dialog_label); final OpenSansEditText editText = (OpenSansEditText) promptView.findViewById(R.id.my_profile_dialog_input); final WPTextView hintView = (WPTextView) promptView.findViewById(R.id.my_profile_dialog_hint); textView.setText(title); if (!TextUtils.isEmpty(hint)) { hintView.setText(hint); } else { hintView.setVisibility(View.GONE); } if (!TextUtils.isEmpty(initialText)) { editText.setText(initialText); editText.setSelection(0, initialText.length()); } alertDialogBuilder.setCancelable(true) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { callback.onSuccessfulInput(editText.getText().toString()); } }) .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = alertDialogBuilder.create(); alert.show(); }
Source:
public List<Unit> getOffensiveAa() { updateOffensiveAaUnits(); return offensiveAa; }

Target:
public List<Unit> getOffensiveAa() { return offensiveAa; }
Source:
public static Transition transitionOf(final char ref, final char call) { return transitionIndexMap[baseIndexOf(ref, () -> "ref")][baseIndexOf(call, () -> "call")]; }

Target:
public static Transition transitionOf(final char ref, final char call) { try { return transitionIndexMap[baseIndexMap[ref]][baseIndexMap[call]]; } catch (IndexOutOfBoundsException e) { throw new IllegalArgumentException(String.format("Base params should be one of {A, C, T, G} but ref=%s and call=%s", ref, call)); } }
Source:
protected Response registerForCallUpdates(final String accountSid, final String callSid, final MultivaluedMap<String, String> data, MediaType responseType) { secure(daos.getAccountsDao().getAccount(accountSid), "RestComm:Read:Calls"); allowOnlySuperAdmin(); final String url = data.getFirst("Url"); final String refresh = data.getFirst("Refresh"); MonitoringServiceResponse liveCalls; try { final Timeout expires = new Timeout(Duration.create(60, TimeUnit.SECONDS)); GetLiveCalls getLiveCalls = new GetLiveCalls(); Future<Object> future = (Future<Object>) ask(monitoringService, getLiveCalls, expires); liveCalls = (MonitoringServiceResponse) Await.result(future, Duration.create(10, TimeUnit.SECONDS)); } catch (Exception exception) { return status(BAD_REQUEST).entity(exception.getMessage()).build(); } if (liveCalls != null) { if (APPLICATION_XML_TYPE == responseType) { final RestCommResponse response = new RestCommResponse(liveCalls); return ok(xstream.toXML(response), APPLICATION_XML).build(); } else if (APPLICATION_JSON_TYPE == responseType) { Response response = ok(gson.toJson(liveCalls), APPLICATION_JSON).build(); return response; } else { return null; } } else { return null; } }

Target:
protected Response registerForCallUpdates(final String accountSid, final String callSid, final MultivaluedMap<String, String> data, MediaType responseType) { checkAuthenticatedAccount(); allowOnlySuperAdmin(); final String url = data.getFirst("Url"); final String refresh = data.getFirst("Refresh"); MonitoringServiceResponse liveCalls; try { final Timeout expires = new Timeout(Duration.create(60, TimeUnit.SECONDS)); GetLiveCalls getLiveCalls = new GetLiveCalls(); Future<Object> future = (Future<Object>) ask(monitoringService, getLiveCalls, expires); liveCalls = (MonitoringServiceResponse) Await.result(future, Duration.create(10, TimeUnit.SECONDS)); } catch (Exception exception) { return status(BAD_REQUEST).entity(exception.getMessage()).build(); } if (liveCalls != null) { if (APPLICATION_XML_TYPE == responseType) { final RestCommResponse response = new RestCommResponse(liveCalls); return ok(xstream.toXML(response), APPLICATION_XML).build(); } else if (APPLICATION_JSON_TYPE == responseType) { Response response = ok(gson.toJson(liveCalls), APPLICATION_JSON).build(); return response; } else { return null; } } else { return null; } }
Source:
public WorkerThread(final ConcurrentMap<K, PullFuture<V>> pendingPulls, final ServerResolver serverResolver, final InjectionFuture<WorkerMsgSender<K, P>> sender, final int queueSize, final long expireTimeout) { kvCache = CacheBuilder.newBuilder() .concurrencyLevel(1) .expireAfterWrite(expireTimeout, TimeUnit.MILLISECONDS) .build(new CacheLoader<EncodedKey<K>, Wrapped<V>>() { private static final long RETRY_INTERVAL_MS = 5000; @Override public Wrapped<V> load(final EncodedKey<K> encodedKey) { final PullFuture<V> future = new PullFuture<>(); pendingPulls.put(encodedKey.getKey(), future); V value = null; while (value == null) { final String serverId = serverResolver.resolveServer(encodedKey.getHash()); LOG.log(Level.FINEST, "Resolve server for encodedKey. key: {0}, hash: {1}", new Object[]{encodedKey.getKey(), encodedKey.getHash()}); try { sender.get().sendPullMsg(serverId, encodedKey); } catch (final NetworkException e) { LOG.log(Level.FINE, "NetworkException while sending pull msg. Do retry", e); continue; } value = future.getValue(RETRY_INTERVAL_MS); } pendingPulls.remove(encodedKey.getKey()); return new Wrapped<>(value); } }); queue = new ArrayBlockingQueue<>(queueSize); this.drainSize = queueSize / 10; this.localOps = new ArrayList<>(drainSize); }

Target:
public WorkerThread(final ConcurrentMap<K, PullFuture<V>> pendingPulls, final ServerResolver serverResolver, final InjectionFuture<WorkerMsgSender<K, P>> sender, final int queueSize, final long expireTimeout) { kvCache = CacheBuilder.newBuilder() .concurrencyLevel(1) .expireAfterWrite(expireTimeout, TimeUnit.MILLISECONDS) .build(new CacheLoader<EncodedKey<K>, Wrapped<V>>() { private static final long RETRY_INTERVAL_MS = 5000; @Override public Wrapped<V> load(final EncodedKey<K> encodedKey) { final PullFuture<V> future = new PullFuture<>(); pendingPulls.put(encodedKey.getKey(), future); V value = null; int retryCount = 0; while (value == null) { if (++retryCount > MAX_RETRY_COUNT) { throw new RuntimeException("Fail to load a value for pull"); } final String serverId = serverResolver.resolveServer(encodedKey.getHash()); LOG.log(Level.FINEST, "Resolve server for encodedKey. key: {0}, hash: {1}", new Object[]{encodedKey.getKey(), encodedKey.getHash()}); try { sender.get().sendPullMsg(serverId, encodedKey); } catch (final NetworkException e) { LOG.log(Level.FINE, "NetworkException while sending pull msg. Do retry", e); continue; } value = future.getValue(RETRY_INTERVAL_MS); } pendingPulls.remove(encodedKey.getKey()); return new Wrapped<>(value); } }); queue = new ArrayBlockingQueue<>(queueSize); this.drainSize = queueSize / 10; this.localOps = new ArrayList<>(drainSize); }
Source:
void generateComposite(JsonObject graphConfig, JsonObject graph, StringBuilder compBuilder) throws IOException { boolean isPublic = jboolean(graph, "public"); String kind = jstring(graph, KIND); kind = getSPLCompatibleName(kind); if (isPublic) compBuilder.append("public "); compBuilder.append("composite "); compBuilder.append(kind); if (kind.startsWith("Composite")) { JsonArray inputNames = array(graph, "inputNames"); JsonArray outputNames = array(graph, "outputNames"); compBuilder.append("("); if(inputNames!= null && inputNames.size() > 0){ compBuilder.append("input "); boolean first = true; for(JsonElement inputName : inputNames){ if(!first) compBuilder.append(","); String strInputName = getSPLCompatibleName(inputName.getAsString()); compBuilder.append(strInputName); first = false; } } if(outputNames!= null && outputNames.size() > 0){ if(inputNames!= null && inputNames.size() > 0) compBuilder.append(";"); compBuilder.append("output "); boolean first = true; for(JsonElement outputName : outputNames){ if(!first) compBuilder.append(","); String strOutputName = getSPLCompatibleName(outputName.getAsString()); compBuilder.append(strOutputName); first = false; } } compBuilder.append(")"); } compBuilder.append("\n{\n"); generateCompParams(graph, compBuilder); compBuilder.append("graph\n"); operators(graphConfig, graph, compBuilder); generateCompConfig(graph, graphConfig, compBuilder); compBuilder.append("}\n"); }

Target:
void generateComposite(JsonObject graphConfig, JsonObject graph, StringBuilder compBuilder) throws IOException { boolean isPublic = jboolean(graph, "public"); String kind = jstring(graph, KIND); kind = getSPLCompatibleName(kind); if (isPublic) compBuilder.append("public "); compBuilder.append("composite "); compBuilder.append(kind); if (jboolean(graph, "generated")) { JsonArray inputNames = array(graph, "inputNames"); JsonArray outputNames = array(graph, "outputNames"); compBuilder.append("("); if(inputNames!= null && inputNames.size() > 0){ compBuilder.append("input "); boolean first = true; for(JsonElement inputName : inputNames){ if(!first) compBuilder.append(","); String strInputName = getSPLCompatibleName(inputName.getAsString()); compBuilder.append(strInputName); first = false; } } if(outputNames!= null && outputNames.size() > 0){ if(inputNames!= null && inputNames.size() > 0) compBuilder.append(";"); compBuilder.append("output "); boolean first = true; for(JsonElement outputName : outputNames){ if(!first) compBuilder.append(","); String strOutputName = getSPLCompatibleName(outputName.getAsString()); compBuilder.append(strOutputName); first = false; } } compBuilder.append(")"); } compBuilder.append("\n{\n"); generateCompParams(graph, compBuilder); compBuilder.append("graph\n"); operators(graphConfig, graph, compBuilder); generateCompConfig(graph, graphConfig, compBuilder); compBuilder.append("}\n"); }
Source:
ResponseEntity<?> changeCaptain(@AuthenticationPrincipal User user, @PathVariable Long teamID, @RequestBody String newCaptainEmail) { Team team = teamService.getTeamById(teamID); if (team.getCaptain().getEmail().equals(newCaptainEmail)) { return createResponseEntity(HttpStatus.NOT_MODIFIED, "This person is already the captain of the team."); } if (!user.getRoles().contains(Role.ROLE_ADMIN) && !user.getEmail().equals(team.getCaptain().getEmail())) { return createResponseEntity(HttpStatus.UNAUTHORIZED, "Only the captain of the team can assign a new captain."); } TeamDTO teamDTO = new TeamDTO(); teamDTO.setTeamName(team.getTeamName()); teamDTO.setCaptainEmail(newCaptainEmail); teamService.update(team.getId(), teamDTO); return createResponseEntity(HttpStatus.OK, "Captain of team " + team.getTeamName() + " successfully changed!"); }

Target:
ResponseEntity<?> changeCaptain(@AuthenticationPrincipal User user, @PathVariable Long teamID, @RequestBody String newCaptainEmail) { Team team = teamService.getTeamById(teamID); if (team.getCaptain().getEmail().equals(newCaptainEmail)) { return createResponseEntity(HttpStatus.NOT_MODIFIED, "This person is already the captain of the team."); } teamService.update(team.getId(), null, newCaptainEmail); return createResponseEntity(HttpStatus.OK, "Captain of team " + team.getTeamName() + " successfully changed!"); }
Source:
public void setTimeStamp(String timeStamp) { if (timeStamp != null && !timeStamp.isEmpty()) { this.timeStamp = timeStamp; } else { DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); Calendar cal = Calendar.getInstance(); this.timeStamp = dateFormat.format(cal.getTime()); } }

Target:
public void setTimeStamp(String timeStamp) { if (StringUtils.isNotEmpty(timeStamp)) { this.timeStamp = timeStamp; } else { this.timeStamp = new SimpleDateFormat(TIMESTAMP_FORMAT).format(Calendar.getInstance().getTime()); } }
Source:
public void loadKeyDSAPassword() throws IOException, GeneralSecurityException { File file = new File(this.getClass().getResource("dsa-password").getFile()); String password = "password"; assertkeyPair(file, password); }

Target:
public void loadKeyDSAPassword() throws IOException, GeneralSecurityException { File file = new File(this.getClass().getResource("dsa-password").getFile()); String password = "password"; assertKeyPairNotNull(file, password); }
Source:
public void scheduleTask(TaskDefinition task) throws SchedulerException { boolean contains = false; for (String taskDef : scheduledTasks) { if (taskDef.equals(task.getName())) { contains = true; break; } } if (!contains) { scheduledTasks.add(task.getName()); } }

Target:
public void scheduleTask(TaskDefinition task) throws SchedulerException { if (!scheduledTasks.contains(task)) { scheduledTasks.add(task); } }
Source:
public void setOnLongClickListener(OnLongClickListener l) { if (isSensorAvailable) { binding.bearingButton.setOnLongClickListener(l); } binding.answerText.setOnLongClickListener(l); }

Target:
public void setOnLongClickListener(OnLongClickListener l) { binding.bearingButton.setOnLongClickListener(l); binding.answerText.setOnLongClickListener(l); }
Source:
public String readFile(String repositoryId, String fileName, String reference) { checkNotNull(fileName, "The fileName given is null."); GHRepository repo; try { repo = github.getRepository(repositoryId); } catch (IOException e) { LOG.error(gitUsername + ": IOException on readFile while trying to get the repository " + repositoryId + " " + e.getMessage()); throw new CustomWebApplicationException("Could not get repository " + repositoryId + " from GitHub.", HttpStatus.SC_BAD_REQUEST); } return readFileFromRepo(fileName, reference, repo); }

Target:
public String readFile(String repositoryId, String fileName, String reference) { checkNotNull(fileName, "The fileName given is null."); GHRepository repo; try { repo = github.getRepository(repositoryId); } catch (IOException e) { LOG.error(gitUsername + ": IOException on readFile while trying to get the repository " + repositoryId + " " + e.getMessage(), e); throw new CustomWebApplicationException("Could not get repository " + repositoryId + " from GitHub.", HttpStatus.SC_BAD_REQUEST); } return readFileFromRepo(fileName, reference, repo); }
Source:
private void resetOnPageChangeListener() { if (mOnPageChangeListener != null) { mViewPager.removeOnPageChangeListener(mOnPageChangeListener); } else { mOnPageChangeListener = new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_SWIPE_PAGE_CHANGED); AppPrefs.setNotificationsSwipeToNavigateShown(true); Note currentNote = mAdapter.getNoteAtPosition(position); if (currentNote != null) { setActionBarTitleForNote(currentNote); markNoteAsRead(currentNote); } } @Override public void onPageScrollStateChanged(int state) { } }; } mViewPager.addOnPageChangeListener(mOnPageChangeListener); }

Target:
private void resetOnPageChangeListener() { if (mOnPageChangeListener != null) { mViewPager.removeOnPageChangeListener(mOnPageChangeListener); } else { mOnPageChangeListener = new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_SWIPE_PAGE_CHANGED); if (!mIsReaderSwipeToNavigateShown) { AppPrefs.setNotificationsSwipeToNavigateShown(true); } Note currentNote = mAdapter.getNoteAtPosition(position); if (currentNote != null) { setActionBarTitleForNote(currentNote); markNoteAsRead(currentNote); } } @Override public void onPageScrollStateChanged(int state) { } }; } mViewPager.addOnPageChangeListener(mOnPageChangeListener); }
Source:
public Review fromDBObject(DBObject dbObject) { Review review = new Review(TranslatorUtils.toLocaleFromLanguageTag(dbObject, LOCALE_KEY), TranslatorUtils.toString(dbObject, REVIEW_KEY)); review.setType(TranslatorUtils.toString(dbObject, TYPE_KEY)); List<DBObject> crewMembers = TranslatorUtils.toDBObjectList(dbObject, PEOPLE_KEY); List<CrewMember> crewMemberList = new ArrayList<CrewMember>(); for (DBObject crewMember : crewMembers) { crewMemberList.add(crewMemberTranslator.fromDBObject(crewMember, new CrewMember())); } review.setPeople(crewMemberList); return review; }

Target:
public Review fromDBObject(DBObject dbObject) { Review review = new Review(TranslatorUtils.toLocaleFromLanguageTag(dbObject, LOCALE_KEY), TranslatorUtils.toString(dbObject, REVIEW_KEY)); review.setType(TranslatorUtils.toString(dbObject, TYPE_KEY)); review.setAuthor(authorTranslator.fromDBObject(dbObject)); return review; }
Source:
public void visit(View rootView) { if (mAlive) { super.getPathfinder().findTargetsInRoot(rootView, super.getPath(), this); } }

Target:
public void visit(View rootView) { if (mAlive) { getPathfinder().findTargetsInRoot(rootView, getPath(), this); } }
Source:
private boolean isRelevantService(Service service, String role, String name, String version) { return service.getRole().equalsIgnoreCase(role) && (service.getName() == null || service.getName().equalsIgnoreCase(name) && (service.getVersion() == null || service.getVersion().compareTo(new Version(version)) == 0)); }

Target:
private boolean isRelevantService(Service service, String role, String name, String version) { return service.getRole().equalsIgnoreCase(role) && (service.getName() == null || service.getName().equalsIgnoreCase(name) && (service.getVersion() == null || service.getVersion().equals(new Version(version)))); }
Source:
public void canGetTimestamps() { long ts1 = cluster.getFreshTimestamp(); long ts2 = cluster.timelockService().getFreshTimestamp(); assertThat(ts2).isGreaterThan(ts1); }

Target:
public void canGetTimestamps() { List<Long> timestamps = ImmutableList.of( cluster.getFreshTimestamp(), cluster.timelockService().getFreshTimestamp(), cluster.getFreshTimestamp(), cluster.timelockService().getFreshTimestamp()); long lastTs = -1; for (long ts : timestamps) { assertThat(ts).isGreaterThan(lastTs); lastTs = ts; } }
Source:
public static String getExchangeAlias(String exchangeName) { String alias = null; if (StringUtils.isNotBlank(exchangeName)) { List<ExchangeType> exchanges = ExchangeManager.getInstance().getAllExchanges(); if (CollectionUtils.isNotEmpty(exchanges)) { for (ExchangeType ex : exchanges) { if (exchangeName.equalsIgnoreCase(ex.getName())) { alias = ex.getCertificateAlias(); break; } } } } return alias; }

Target:
public static String getExchangeAlias(String exchangeName) { String alias = null; List<ExchangeType> exchanges = ExchangeManager.getInstance().getAllExchanges(); if (StringUtils.isNotBlank(exchangeName) && CollectionUtils.isNotEmpty(exchanges)) { for (ExchangeType ex : exchanges) { if (exchangeName.equalsIgnoreCase(ex.getName())) { alias = ex.getCertificateAlias(); break; } } } return alias; }
Source:
@Test public void testLargeNumberOfFilesYOUNGESTTrackerDir() throws IOException { templateTestForRecursiveDirs(ConsumeOrder.YOUNGEST, new Comparator<Long>() { @Override public int compare(Long o1, Long o2) { return o2.compareTo(o1); } }, 3, 3, 10, TrackingPolicy.TRACKER_DIR); }

Target:
@Test public void testLargeNumberOfFilesYOUNGESTTrackerDir() throws IOException { templateTestForRecursiveDirs(ConsumeOrder.YOUNGEST, Comparator.reverseOrder(), 3, 3, 10, TrackingPolicy.TRACKER_DIR); }
Source:
private boolean methodBindingsNeedFinder() { for (ViewBindings viewBindings : viewIdMap.values()) { for (Map<ListenerMethod, Set<MethodViewBinding>> listenerMethodSetMap : viewBindings.getMethodBindings().values()) { for (Set<MethodViewBinding> methodViewBindings : listenerMethodSetMap.values()) { for (MethodViewBinding methodViewBinding : methodViewBindings) { for (Parameter parameter : methodViewBinding.getParameters()) { if (!parameter.getType().toString().equals(VIEW.toString())) { return true; } } } } } } return false; }

Target:
private boolean methodBindingsNeedFinder() { for (ViewBindings viewBindings : viewIdMap.values()) { for (Map.Entry<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> entry : viewBindings.getMethodBindings().entrySet()) { Map<ListenerMethod, Set<MethodViewBinding>> methodBindings = entry.getValue(); for (ListenerMethod method : getListenerMethods(entry.getKey())) { if (methodBindings.containsKey(method)) { String[] parameterTypes = method.parameters(); for (MethodViewBinding methodViewBinding : methodBindings.get(method)) { for (Parameter parameter : methodViewBinding.getParameters()) { if (parameter.requiresCast(parameterTypes[parameter.getListenerPosition()])) { return true; } } } } } } } return false; }
Source:
public void setUp() { try { final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null); final File test = new File(FileLocator.toFileURL(location).toURI()); fTrace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null); TmfSignalManager.deregister(fTrace); fTrace.indexTrace(true); } catch (final TmfTraceException e) { fail("Exception setting up the trace: " + e.getMessage()); } catch (final URISyntaxException e) { fail("URI syntax exception: " + e.getMessage()); } catch (final IOException e) { fail("I/O exception while setting up the test: " + e.getMessage()); } }

Target:
public static void setUp() { try { final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null); final File test = new File(FileLocator.toFileURL(location).toURI()); fTrace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null); TmfSignalManager.deregister(fTrace); fTrace.indexTrace(true); } catch (final TmfTraceException | URISyntaxException | IOException e) { fail(e.toString()); } }
Source:
public V fetch(K key, Supplier<V> valueProvider) { final Supplier<V> userSuplier = valueProvider; try { return guavaCache.get(key, new Callable<V>() { @Override public V call() throws Exception { return userSuplier.get(); } }); } catch (ExecutionException e) { propagateIfPossible(e); return valueProvider.get(); } }

Target:
public V fetch(K key, Supplier<V> valueProvider) { final Supplier<V> userSuplier = valueProvider; try { return guavaCache.get(key, new Callable<V>() { @Override public V call() throws Exception { return userSuplier.get(); } }); } catch (ExecutionException e) { throw new CacheException("Error while trying to fetch key: " + key, e); } }
Source:
public Future<Void> report() { if (reporters.size() == 1) { return new ErrantRecordFuture(Collections.singletonList(reporters.iterator().next().report(this))); } List<Future<RecordMetadata>> futures = new LinkedList<>(); for (ErrorReporter reporter: reporters) { Future<RecordMetadata> future = reporter.report(this); if (!future.isDone()) { futures.add(future); } } if (futures.isEmpty()) { return CompletableFuture.completedFuture(null); } return new ErrantRecordFuture(futures); }

Target:
public Future<Void> report() { if (reporters.size() == 1) { return new ErrantRecordFuture(Collections.singletonList(reporters.iterator().next().report(this))); } List<Future<RecordMetadata>> futures = reporters.stream() .map(r -> r.report(this)) .filter(Future::isDone) .collect(Collectors.toCollection(LinkedList::new)); if (futures.isEmpty()) { return CompletableFuture.completedFuture(null); } return new ErrantRecordFuture(futures); }
Source:
public PdpFeedDetailEntry buildPdpFeedDetailEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedDetailEntry currentDetailEntry = new PdpFeedDetailEntry(); currentDetailEntry.setSourceDocNbr(buildSourceDocumentNumber(line.getReportId())); currentDetailEntry.setFsOriginCd(getConcurParameterValue(ConcurParameterConstants.CONCUR_AP_PDP_ORIGINATION_CODE)); currentDetailEntry.setFdocTypCd(getConcurParameterValue(ConcurParameterConstants.CONCUR_SAE_PDP_DOCUMENT_TYPE)); currentDetailEntry.setInvoiceNbr(StringUtils.EMPTY); currentDetailEntry.setPoNbr(StringUtils.EMPTY); currentDetailEntry.setInvoiceDate(formatDate(line.getBatchDate())); List<String> paymentTextStrings = new ArrayList<String>(); paymentTextStrings.add("Report ID: " + line.getReportId()); currentDetailEntry.setPaymentText(paymentTextStrings); return currentDetailEntry; }

Target:
public PdpFeedDetailEntry buildPdpFeedDetailEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedDetailEntry currentDetailEntry = new PdpFeedDetailEntry(); currentDetailEntry.setSourceDocNbr(buildSourceDocumentNumber(line.getReportId())); currentDetailEntry.setFsOriginCd(getConcurParameterValue(ConcurParameterConstants.CONCUR_AP_PDP_ORIGINATION_CODE)); currentDetailEntry.setFdocTypCd(getConcurParameterValue(ConcurParameterConstants.CONCUR_SAE_PDP_DOCUMENT_TYPE)); currentDetailEntry.setInvoiceNbr(StringUtils.EMPTY); currentDetailEntry.setPoNbr(StringUtils.EMPTY); currentDetailEntry.setInvoiceDate(formatDate(line.getBatchDate())); return currentDetailEntry; }
Source:
private void analyzeHaving(QuerySpecification node, Scope scope) { if (node.getHaving().isPresent()) { Expression predicate = node.getHaving().get(); ExpressionAnalysis expressionAnalysis = analyzeExpression(predicate, scope); expressionAnalysis.getWindowFunctions().stream() .findFirst() .ifPresent(function -> { throw new SemanticException(NESTED_WINDOW, function.getNode(), "HAVING clause cannot not contain window functions"); }); analysis.recordSubqueries(node, expressionAnalysis); Type predicateType = expressionAnalysis.getType(predicate); if (!predicateType.equals(BOOLEAN) && !predicateType.equals(UNKNOWN)) { throw new SemanticException(TYPE_MISMATCH, predicate, "HAVING clause must evaluate to a boolean: actual type %s", predicateType); } analysis.setHaving(node, predicate); } }

Target:
private void analyzeHaving(QuerySpecification node, Scope scope) { if (node.getHaving().isPresent()) { Expression predicate = node.getHaving().get(); ExpressionAnalysis expressionAnalysis = analyzeExpression(predicate, scope); expressionAnalysis.getWindowFunctions().stream() .findFirst() .ifPresent(function -> { throw new SemanticException(NESTED_WINDOW, function.getNode(), "HAVING clause cannot contain window functions"); }); analysis.recordSubqueries(node, expressionAnalysis); Type predicateType = expressionAnalysis.getType(predicate); if (!predicateType.equals(BOOLEAN) && !predicateType.equals(UNKNOWN)) { throw new SemanticException(TYPE_MISMATCH, predicate, "HAVING clause must evaluate to a boolean: actual type %s", predicateType); } analysis.setHaving(node, predicate); } }
Source:
public VdcActionParametersBase getParameters(VmPool incoming, org.ovirt.engine.core.common.businessentities.VmPool current) { final int currentVmCount = current.getAssignedVmsCount(); int size = 0; if (incoming.isSetSize()) { if (incoming.getSize() < currentVmCount) { final Fault f = new Fault(); final String faultString = "Requested VM pool size cannot be lower than the current capacity"; f.setReason(faultString); final Response response = Response.status(Response.Status.BAD_REQUEST).entity(f).build(); throw new WebApplicationException(response); } else { size = incoming.getSize() - currentVmCount; } } final org.ovirt.engine.core.common.businessentities.VmPool entity = map(incoming, current); final VM vm = mapToVM(map(entity)); if (incoming.isSetTemplate()) { vm.setVmtGuid(new Guid(incoming.getTemplate().getId())); } else { final VM existing = currentVmCount > 0 ? getEntity(VM.class, SearchType.VM, "Vms: pool=" + incoming.getName()) : null; if (existing != null) { vm.setVmtGuid(existing.getVmtGuid()); } } if (vm.getVmtGuid() != null) { final VmTemplate template = getEntity(VmTemplate.class, VdcQueryType.GetVmTemplate, new GetVmTemplateParameters(vm.getId()), vm.getId().toString()); vm.getStaticData().setMemSizeMb(template.getMemSizeMb()); } final AddVmPoolWithVmsParameters parameters = new AddVmPoolWithVmsParameters(entity, vm, size, -1); parameters.setStorageDomainId(getStorageDomainId(vm.getVmtGuid())); return parameters; }

Target:
public VdcActionParametersBase getParameters(VmPool incoming, org.ovirt.engine.core.common.businessentities.VmPool current) { final int currentVmCount = current.getAssignedVmsCount(); int size = 0; if (incoming.isSetSize()) { size = incoming.getSize() - currentVmCount; } final org.ovirt.engine.core.common.businessentities.VmPool entity = map(incoming, current); final VM vm = mapToVM(map(entity)); if (incoming.isSetTemplate()) { vm.setVmtGuid(new Guid(incoming.getTemplate().getId())); } else { final VM existing = currentVmCount > 0 ? getEntity(VM.class, SearchType.VM, "Vms: pool=" + incoming.getName()) : null; if (existing != null) { vm.setVmtGuid(existing.getVmtGuid()); } } if (vm.getVmtGuid() != null) { final VmTemplate template = getEntity(VmTemplate.class, VdcQueryType.GetVmTemplate, new GetVmTemplateParameters(vm.getId()), vm.getId().toString()); vm.getStaticData().setMemSizeMb(template.getMemSizeMb()); } final AddVmPoolWithVmsParameters parameters = new AddVmPoolWithVmsParameters(entity, vm, size, -1); parameters.setStorageDomainId(getStorageDomainId(vm.getVmtGuid())); return parameters; }
Source:
public <T extends LogicalSegment> List<T> filterSegments(SelectQuery query, List<T> segments) { PagingSpec pagingSpec = query.getPagingSpec(); Map<String, Integer> paging = pagingSpec.getPagingIdentifiers(); if (paging == null || paging.isEmpty()) { return segments; } List<Interval> intervals = Lists.newArrayList( Iterables.transform( paging.keySet(), SegmentDesc.INTERVAL_EXTRACTOR ) ); Collections.sort( intervals, new Comparator<Interval>() { @Override public int compare(Interval o1, Interval o2) { return Longs.compare(o1.getStartMillis(), o2.getStartMillis()); } } ); List<T> queryIntervals = Lists.newArrayList(segments); Iterator<T> it = queryIntervals.iterator(); if (query.isDescending()) { final long lastEnd = intervals.get(intervals.size() - 1).getEndMillis(); while (it.hasNext()) { T segment = it.next(); if (segment.getInterval().getStartMillis() > lastEnd) { it.remove(); } } } else { final long firstStart = intervals.get(0).getStartMillis(); while (it.hasNext()) { T segment = it.next(); if (segment.getInterval().getEndMillis() < firstStart) { it.remove(); } } } return queryIntervals; }

Target:
public <T extends LogicalSegment> List<T> filterSegments(SelectQuery query, List<T> segments) { PagingSpec pagingSpec = query.getPagingSpec(); Map<String, Integer> paging = pagingSpec.getPagingIdentifiers(); if (paging == null || paging.isEmpty()) { return segments; } final QueryGranularity granularity = query.getGranularity(); List<Interval> intervals = Lists.newArrayList( Iterables.transform(paging.keySet(), SegmentDesc.INTERVAL_EXTRACTOR) ); Collections.sort( intervals, query.isDescending() ? Comparators.intervalsByEndThenStart() : Comparators.intervalsByStartThenEnd() ); TreeMap<Long, Long> granularThresholds = Maps.newTreeMap(); for (Interval interval : intervals) { if (query.isDescending()) { long granularEnd = granularity.truncate(interval.getEndMillis()); Long currentEnd = granularThresholds.get(granularEnd); if (currentEnd == null || interval.getEndMillis() > currentEnd) { granularThresholds.put(granularEnd, interval.getEndMillis()); } } else { long granularStart = granularity.truncate(interval.getStartMillis()); Long currentStart = granularThresholds.get(granularStart); if (currentStart == null || interval.getStartMillis() < currentStart) { granularThresholds.put(granularStart, interval.getStartMillis()); } } } List<T> queryIntervals = Lists.newArrayList(segments); Iterator<T> it = queryIntervals.iterator(); if (query.isDescending()) { while (it.hasNext()) { Interval interval = it.next().getInterval(); Map.Entry<Long, Long> ceiling = granularThresholds.ceilingEntry(granularity.truncate(interval.getEndMillis())); if (ceiling == null || interval.getStartMillis() >= ceiling.getValue()) { it.remove(); } } } else { while (it.hasNext()) { Interval interval = it.next().getInterval(); Map.Entry<Long, Long> floor = granularThresholds.floorEntry(granularity.truncate(interval.getStartMillis())); if (floor == null || interval.getEndMillis() <= floor.getValue()) { it.remove(); } } } return queryIntervals; }
Source:
public void testAddIgnoredFolder() throws Exception { testRepository.connect(project.project); project.createFile(".gitignore", "ignore\n".getBytes("UTF-8")); project.createFolder("ignore"); project.createFolder("sub"); project.createFolder("sub/ignore"); project.createFile("ignore/file.txt", new byte[] {}); testRepository.addToIndex(project.project); testRepository.createInitialCommit("testAddFileInIgnoredFolder\n\nfirst commit\n"); prepareCacheEntry(); project.createFile("sub/ignorenot", new byte[] {}); IndexDiffData data3 = waitForListenerCalled(); assertThat(data3.getUntracked(), hasItem("Project-1/sub/ignorenot")); assertThat(data3.getIgnoredNotInIndex(), hasItem("Project-1/ignore")); assertThat(data3.getIgnoredNotInIndex(), hasItem("Project-1/sub/ignore")); }

Target:
public void testAddIgnoredFolder() throws Exception { testRepository.connect(project.project); project.createFile(".gitignore", "ignore\n".getBytes("UTF-8")); project.createFolder("ignore"); project.createFile("ignore/file.txt", new byte[] {}); project.createFolder("sub"); testRepository.addToIndex(project.project); testRepository.createInitialCommit("testAddFileInIgnoredFolder\n\nfirst commit\n"); prepareCacheEntry(); IndexDiffData data1 = waitForListenerCalled(); assertThat(data1.getIgnoredNotInIndex(), hasItem("Project-1/ignore")); project.createFolder("sub/ignore"); IndexDiffData data2 = waitForListenerCalled(); assertThat(data2.getIgnoredNotInIndex(), hasItem("Project-1/ignore")); assertThat(data2.getIgnoredNotInIndex(), hasItem("Project-1/sub/ignore")); project.createFile("sub/ignorenot", new byte[] {}); IndexDiffData data3 = waitForListenerCalled(); assertThat(data3.getUntracked(), hasItem("Project-1/sub/ignorenot")); assertThat(data3.getIgnoredNotInIndex(), hasItem("Project-1/ignore")); assertThat(data3.getIgnoredNotInIndex(), hasItem("Project-1/sub/ignore")); }
Source:
public ConnectionFactory buildConnectionFactory() { ConnectionFactory cf; try { cf = new org.apache.activemq.ActiveMQConnectionFactory(); BeanUtils.populate(cf, super.connectionFactoryProperties); logger.debug("creation successful."); return cf; } catch (Exception e) { throw new RuntimeException("Failed to create connection factory.", e); } }

Target:
public ConnectionFactory buildConnectionFactory() { ConnectionFactory cf; try { cf = new org.apache.activemq.ActiveMQConnectionFactory(); BeanUtils.populate(cf, connectionFactoryProperties); logger.debug("creation successful."); return cf; } catch (Exception e) { DTThrowable.rethrow(e); return null; } }
Source:
public StoreResource[] getAtomicFilesSnapshot() throws IOException { Stream<StoreFileMetadata> countStoreStream = neoStoreDataSource.listStoreFilesInclusively().includeNeoStoreFiles().build().stream().filter( isCountFile() ); Stream<StoreFileMetadata> explicitIndexStream = neoStoreDataSource.listStoreFilesInclusively().includeExplicitIndexStoreStoreFiles().includeAdditionalProviders().build().stream(); StoreFileMetadata[] metaDataStores = closeablesListener.sample( Stream.concat( countStoreStream, explicitIndexStream ) ).toArray( StoreFileMetadata[]::new ); StoreResource[] storeResources = new StoreResource[metaDataStores.length]; for ( int i = 0; i < metaDataStores.length; i++ ) { storeResources[i] = toStoreResource( metaDataStores[i] ); } return storeResources; }

Target:
StoreResource[] getAtomicFilesSnapshot() throws IOException { ResourceIterator<StoreFileMetadata> neoStoreFilesIterator = closeablesListener.add( neoStoreDataSource.getNeoStoreFileListing().builder().excludeAll().includeNeoStoreFiles().build() ); ResourceIterator<StoreFileMetadata> explicitIndexIterator = closeablesListener.add( neoStoreDataSource.getNeoStoreFileListing().builder().excludeAll().includeExplicitIndexStoreStoreFiles().includeAdditionalProviders().build() ); return Stream.concat( neoStoreFilesIterator.stream().filter( isCountFile() ), explicitIndexIterator.stream() ).map( mapToStoreResource() ).toArray( StoreResource[]::new ); }
Source:
protected Properties getSslConfig(final FilterConfig filterConfig) { Properties properties = new Properties(); final String fileName = getPropertyFromInitParams(filterConfig, "sslConfigFile", null); if(fileName != null) { try { FileInputStream fis = new FileInputStream(fileName); properties.load(fis); log.trace("Loaded " + properties.size() + " entries from " + fileName); } catch(java.io.IOException ioe) { log.warn(ioe, ioe); } } return properties; }

Target:
protected Properties getSslConfig(final FilterConfig filterConfig) { final Properties properties = new Properties(); final String fileName = getPropertyFromInitParams(filterConfig, "sslConfigFile", null); if(fileName != null) { try { FileInputStream fis = null; try { fis = new FileInputStream(fileName); properties.load(fis); log.trace("Loaded " + properties.size() + " entries from " + fileName); } finally { if(fis != null) { IOUtils.closeQuietly(fis); } } } catch(final IOException ioe) { log.warn(ioe, ioe); } } return properties; }
Source:
public static float convertRawToHumidity(final int humidRaw) { if (humidRaw < 0) { return CLIENT_SENTINEL_NULL_VALUE; } if (humidRaw > DataUtils.floatToDBInt(100.0f)) { return CLIENT_SENTINEL_NULL_VALUE; } return DataUtils.dbIntToFloat(humidRaw); }

Target:
public static float convertRawToHumidity(final int humidRaw) { if (humidRaw < 0 || humidRaw > DataUtils.floatToDBInt(100.0f)) { return CLIENT_SENTINEL_NULL_VALUE; } return DataUtils.dbIntToFloat(humidRaw); }
Source:
private static int getPositionOfArgument(@NotNull ErlangQAtom argument) { ErlangArgumentList argumentList = PsiTreeUtil.getParentOfType(argument, ErlangArgumentList.class); ErlangExpression expression = PsiTreeUtil.getParentOfType(argument, ErlangExpression.class, false); if (expression != null && expression.getParent() instanceof ErlangColonQualifiedExpression) { expression = (ErlangExpression) expression.getParent(); } return argumentList != null ? argumentList.getExpressionList().indexOf(expression) : -1; }

Target:
private static int getPositionOfArgument(@NotNull ErlangQAtom argument) { ErlangArgumentList argumentList = PsiTreeUtil.getParentOfType(argument, ErlangArgumentList.class); ErlangExpression expression = ObjectUtils.tryCast(argument.getParent(), ErlangExpression.class); return argumentList != null ? argumentList.getExpressionList().indexOf(expression) : -1; }
Source:
public FilterRegistrationBean<Filter30Dispatcher> resteasyServletRegistration(@Value("${ot.jaxrs.prefix:/}") String prefix) { if (StringUtils.isEmpty(prefix)) { prefix = "/"; } FilterRegistrationBean<Filter30Dispatcher> registrationBean = new FilterRegistrationBean<>(new Filter30Dispatcher()); registrationBean.addUrlPatterns("/*"); registrationBean.setInitParameters(Collections.singletonMap("resteasy.servlet.mapping.prefix", prefix)); return registrationBean; }

Target:
public FilterRegistrationBean<Filter30Dispatcher> resteasyServletRegistration( @Value("${ot.jaxrs.prefix:/}") String prefix) { if (StringUtils.isBlank(prefix)) { prefix = "/"; } else { prefix = prefix.trim(); } FilterRegistrationBean<Filter30Dispatcher> registrationBean = new FilterRegistrationBean<>(new Filter30Dispatcher()); registrationBean.addUrlPatterns("/*"); registrationBean.setInitParameters(Collections.singletonMap("resteasy.servlet.mapping.prefix", prefix)); return registrationBean; }