auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>HttpRequest replaceAuthorizationHeader(HttpRequest request, String signature) { <START> if (request.getEndpoint().toString().contains("Signature")) { <END> return request; } request = request.toBuilder() .replaceHeader(HttpHeaders.AUTHORIZATION, authTag + " " + creds.get().identity + ":" + signature).build(); return request; }</code><technical_language>Safer call: getFirstHeaderOrNull("Signature") == null</technical_language>

Target:
HttpRequest replaceAuthorizationHeader(HttpRequest request, String signature) { if (Queries.queryParser().apply(request.getEndpoint().getQuery()).containsKey("Signature")) { return request; } request = request.toBuilder() .replaceHeader(HttpHeaders.AUTHORIZATION, authTag + " " + creds.get().identity + ":" + signature).build(); return request; }
Source:
<code>private synchronized void checkForUpdates() { if (!forceReload && (reloadCheckIntervalInMs < 0 || System.currentTimeMillis() < (lastReloadCheck + reloadCheckIntervalInMs))) { return; } lastReloadCheck = System.currentTimeMillis(); if (providers.size() < 1) { return; } <START> boolean shouldReload = forceReload; <END> for (ConfigurationProviderState provider : providers) { if (provider.shouldReload()) { shouldReload = true; } } if (!shouldReload) { return; } reload(); }</code><technical_language>simplify lines 217 230 with: if (forceReload || providers.stream().anyMatch(ConfigurationProviderState::shouldReload)) { reload(); }</technical_language>

Target:
private synchronized void checkForUpdates() { if (!forceReload && (reloadCheckIntervalInMs < 0 || System.currentTimeMillis() < (lastReloadCheck + reloadCheckIntervalInMs))) { return; } lastReloadCheck = System.currentTimeMillis(); if (providers.size() < 1) { return; } if (forceReload || providers.stream().anyMatch(ConfigurationProviderState::shouldReload)) { reload(); } }
Source:
<code>private void rotate() { if ( rotating.getAndSet( true ) ) { return; } Runnable runnable = () -> { <START> synchronized ( outRef ) <END> { OutputStream oldStream = outRef.get(); try { oldStream.flush(); oldStream.close(); } catch ( Exception e ) { rotationListener.rotationError( e, outRef.get() ); rotating.set( false ); return; } OutputStream newStream; try { if ( fileSystem.fileExists( outputFile ) ) { shiftArchivedOutputFiles(); fileSystem.renameFile( outputFile, archivedOutputFile( 1 ) ); } newStream = openOutputFile(); } catch ( Exception e ) { rotationListener.rotationError( e, outRef.get() ); rotating.set( false ); return; } rotationListener.outputFileCreated( newStream, oldStream ); if ( !closed.get() ) { outRef.set( newStream ); removeCollectedReferences( archivedStreams ); archivedStreams.add( new WeakReference<>( oldStream ) ); } if ( rotationDelay > 0 ) { earliestRotationTimeRef.set( currentTimeSupplier.getAsLong() + rotationDelay ); } rotationListener.rotationCompleted( newStream, oldStream ); rotating.set( false ); } }; try { rotationExecutor.execute( runnable ); } catch ( Exception e ) { rotationListener.rotationError( e, outRef.get() ); rotating.set( false ); } }</code><technical_language>ReadWriteLock instead of synchronized, write lock in #close() read lock in other places</technical_language>

Target:
private void rotate() { if ( rotating.getAndSet( true ) ) { return; } Runnable runnable = () -> { logFileLock.writeLock().lock(); try { try { try { outRef.flush(); outRef.close(); outRef = nullStream; } catch ( Exception e ) { rotationListener.rotationError( e, streamWrapper ); return; } try { if ( fileSystem.fileExists( outputFile ) ) { shiftArchivedOutputFiles(); fileSystem.renameFile( outputFile, archivedOutputFile( 1 ) ); } } catch ( Exception e ) { rotationListener.rotationError( e, streamWrapper ); return; } } finally { try { if ( !closed.get() && outRef.equals( nullStream ) ) { outRef = openOutputFile(); rotationListener.outputFileCreated( streamWrapper ); } } catch ( IOException e ) { System.err.println( "Failed to open log file after log rotation: " + e.getMessage() ); rotationListener.rotationError( e, streamWrapper ); } } if ( rotationDelay > 0 ) { earliestRotationTimeRef.set( currentTimeSupplier.getAsLong() + rotationDelay ); } rotationListener.rotationCompleted( streamWrapper ); } finally { rotating.set( false ); logFileLock.writeLock().unlock(); } }; try { rotationExecutor.execute( runnable ); } catch ( Exception e ) { rotationListener.rotationError( e, streamWrapper ); rotating.set( false ); } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_location_customize_user); LocationEngine locationEngine = LocationSource.getLocationEngine(this); <START> locationEngine.requestLocationUpdates(); <END> mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(MapboxMap mapboxMap) { map = mapboxMap; permissionsManager = new PermissionsManager(CustomizeUserLocationActivity.this); if (!PermissionsManager.areLocationPermissionsGranted(CustomizeUserLocationActivity.this)) { permissionsManager.requestLocationPermissions(CustomizeUserLocationActivity.this); } else { enableGps(); } map.getMyLocationViewSettings().setPadding(0, 500, 0, 0); map.getMyLocationViewSettings().setForegroundTintColor(Color.parseColor("#56B881")); map.getMyLocationViewSettings().setAccuracyTintColor(Color.parseColor("#FBB03B")); } }); }</code><technical_language>this line removed</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_location_customize_user); locationEngine = LocationSource.getLocationEngine(this); mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(MapboxMap mapboxMap) { map = mapboxMap; permissionsManager = new PermissionsManager(CustomizeUserLocationActivity.this); if (!PermissionsManager.areLocationPermissionsGranted(CustomizeUserLocationActivity.this)) { permissionsManager.requestLocationPermissions(CustomizeUserLocationActivity.this); } else { enableLocation(); } map.getMyLocationViewSettings().setPadding(0, 500, 0, 0); map.getMyLocationViewSettings().setForegroundTintColor(Color.parseColor("#56B881")); map.getMyLocationViewSettings().setAccuracyTintColor(Color.parseColor("#FBB03B")); } }); }
Source:
<code><START> public static void setBoundSlotPosition(Bound bound, List<List<KeyRange>> slots, int[] position) { <END> int idx; for (idx = 0; idx < slots.size(); idx++) { if (!slots.get(idx).get(position[idx]).isSingleKey()) { break; } } if (idx < slots.size() - 1) { if (bound == Bound.LOWER) { for (int i = idx + 1; i < slots.size(); i++) { position[i] = 0; } } else { for (int i = idx + 1; i < slots.size(); i++) { position[i] = slots.get(i).size() - 1; } } } }</code><technical_language>this need public</technical_language>

Target:
private static void setBoundSlotPosition(Bound bound, List<List<KeyRange>> slots, int[] position) { int idx; for (idx = 0; idx < slots.size(); idx++) { if (!slots.get(idx).get(position[idx]).isSingleKey()) { break; } } if (idx < slots.size() - 1) { if (bound == Bound.LOWER) { for (int i = idx + 1; i < slots.size(); i++) { position[i] = 0; } } else { for (int i = idx + 1; i < slots.size(); i++) { position[i] = slots.get(i).size() - 1; } } } }
Source:
<code>protected final boolean useOnModifyDatabinding() { EObject viewCandidate = getVElement().eContainer(); while (viewCandidate != null && !VView.class.isInstance(viewCandidate)) { viewCandidate = viewCandidate.eContainer(); } if (!VView.class.isInstance(viewCandidate)) { return false; <START> } <END> final VViewModelProperties properties = VView.class.cast(viewCandidate).getLoadingProperties(); if (properties == null) { return false; } return USE_ON_MODIFY_DATABINDING_VALUE .equalsIgnoreCase((String) properties.get(USE_ON_MODIFY_DATABINDING_KEY)); }</code><technical_language>viewmodelcontext if</technical_language>

Target:
protected final boolean useOnModifyDatabinding() { final VElement viewCandidate = getViewModelContext().getViewModel(); if (!VView.class.isInstance(viewCandidate)) { return false; } final VViewModelProperties properties = VView.class.cast(viewCandidate).getLoadingProperties(); if (properties == null) { return false; } return EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_VALUE .equalsIgnoreCase((String) properties.get(EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_KEY)); }
Source:
<code>public void add(final RevCommit c) { sinceLastIndex++; <START> if (++inQueue > REBUILD_INDEX_COUNT <END> && sinceLastIndex > REBUILD_INDEX_COUNT) { sinceLastIndex = 0; buildIndex(); } Entry q = head; final long when = c.commitTime; if (index != null && index[first] != null && index[first].commit.commitTime > when) { int low = first, high = last; while (low <= high) { int mid = (low + high) >>> 1; int t = index[mid].commit.commitTime; if (t < when) high = mid - 1; else if (t > when) { low = mid + 1; } else { low = mid - 1; break; } } low = Math.min(low, high); while (low >= first && when == index[low].commit.commitTime) --low; q = index[low]; } final Entry n = newEntry(c); if (q == null || (q == head && when > q.commit.commitTime)) { n.next = q; head = n; } else { Entry p = q.next; while (p != null && p.commit.commitTime > when) { q = p; p = q.next; } n.next = q.next; q.next = n; } }</code><technical_language>I rewrite this: if (++sinceLastIndex > REBUILD_INDEX_COUNT) buildIndex(); inQueue++; move sinceLastIndex reset buildIndex method. This rewrite is a shorter in this long method, avoids extra compare. get benefit attempt create index added 1000 items, avoid extra branch for inQueue</technical_language>

Target:
public void add(final RevCommit c) { sinceLastIndex++; if (++inQueue > REBUILD_INDEX_COUNT && sinceLastIndex > REBUILD_INDEX_COUNT) buildIndex(); Entry q = head; final long when = c.commitTime; if (first <= last && index[first].commit.commitTime > when) { int low = first, high = last; while (low <= high) { int mid = (low + high) >>> 1; int t = index[mid].commit.commitTime; if (t < when) high = mid - 1; else if (t > when) low = mid + 1; else { low = mid - 1; break; } } low = Math.min(low, high); while (low >= first && when == index[low].commit.commitTime) --low; q = index[low]; } final Entry n = newEntry(c); if (q == null || (q == head && when > q.commit.commitTime)) { n.next = q; head = n; } else { Entry p = q.next; while (p != null && p.commit.commitTime > when) { q = p; p = q.next; } n.next = q.next; q.next = n; } }
Source:
<code>public void requestPasswordReset(@RequestBody Map<String, String> body) { User user = null; String usernameOrEmail = body.get("usernameOrEmail"); <START> if ((user = userService.getUserByEmail(usernameOrEmail)) == null) { <END> user = userService.getUserByUsername(usernameOrEmail); } if (user != null) { userService.setUserActivationKey(user); } }</code><technical_language>This code vague, assign user in if clause, I do assignment if clause</technical_language>

Target:
public void requestPasswordReset(@RequestBody Map<String, String> body) { String usernameOrEmail = body.get("usernameOrEmail"); User user = userService.getUserByUsernameOrEmail(usernameOrEmail); if (user != null) { userService.setUserActivationKey(user); } }
Source:
<code>private void shutdownAndAwaitTermination(final ExecutorService executorService, Instant start, final String logMessageOnSuccess) { executorService.shutdown(); try { executorService.awaitTermination(awaitTerminationTime.toMillis(), TimeUnit.MILLISECONDS); <START> logger.log(Level.INFO, logMessageOnSuccess + " (took {0})", <END> DurationFormatUtils.formatDurationWords(Duration.between(start, Instant.now()).toMillis(), true, true)); } catch (InterruptedException e) { logger.log(Level.SEVERE, "Interrupted while building suggesters", e); Thread.currentThread().interrupt(); } }</code><technical_language>rewrite avoid another concatenation? logger.log(Level.INFO, "{0} (took {1})", new Object[] {logMessageOnSuccess, DurationFormatUtils...)</technical_language>

Target:
private void shutdownAndAwaitTermination(final ExecutorService executorService, Instant start, final String logMessageOnSuccess) { executorService.shutdown(); try { executorService.awaitTermination(awaitTerminationTime.toMillis(), TimeUnit.MILLISECONDS); logger.log(Level.INFO, "{0} (took {1})", new Object[]{logMessageOnSuccess, DurationFormatUtils.formatDurationWords(Duration.between(start, Instant.now()).toMillis(), true, true)}); } catch (InterruptedException e) { logger.log(Level.SEVERE, "Interrupted while building suggesters", e); Thread.currentThread().interrupt(); } }
Source:
<code>public void prepareTest() { driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS); widgets = new ArrayList<>(); widgets.add(new PollsnackWidgetPageObject(driver)); widgets.add(new SoundCloudWidgetPageObject(driver)); widgets.add(new SpotifyWidgetPageObject(driver)); widgets.add(new TwitterWidgetPageObject(driver)); widgets.add(new VKWidgetPageObject(driver)); widgets.add(new WeiboWidgetPageObject(driver)); <START> <END> String content = ""; for (WidgetPageObject widget : widgets) { content += widget.getTag(); } ArticleContent articleContent = new ArticleContent(); articleContent.clear(ARTICLE_NAME); articleContent.push(content, ARTICLE_NAME); }</code><technical_language>remove this whitespace</technical_language>

Target:
public void prepareTest() { driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS); widgets = new ArrayList<>(); widgets.add(new PollsnackWidgetPageObject(driver)); widgets.add(new SoundCloudWidgetPageObject(driver)); widgets.add(new SpotifyWidgetPageObject(driver)); widgets.add(new TwitterWidgetPageObject(driver)); widgets.add(new VKWidgetPageObject(driver)); widgets.add(new WeiboWidgetPageObject(driver)); widgets.add(new GoogleFormWidgetPageObject(driver)); widgets.add(new PolldaddyWidgetPageObject(driver)); String content = ""; for (WidgetPageObject widget : widgets) { content += widget.getTag(); } ArticleContent articleContent = new ArticleContent(); articleContent.clear(ARTICLE_NAME); articleContent.push(content, ARTICLE_NAME); }
Source:
<code>private void submitPayload(String url, String jsonPayloadObject, String pushApplicationId, String masterSecret, MessageResponseCallback callback) { String credentials = pushApplicationId + ":" + masterSecret; int statusCode = 0; HttpURLConnection httpURLConnection = null; try { String encoded = Base64.encodeBytes(credentials.getBytes(UTF_8)); httpURLConnection = post(url, encoded, jsonPayloadObject); statusCode = httpURLConnection.getResponseCode(); logger.info(String.format("HTTP Response code form UnifiedPush Server: %s", statusCode)); <START> logger.info("To: " + url); <END> if (isRedirect(statusCode)) { String redirectURL = httpURLConnection.getHeaderField("Location"); logger.info(String.format("Performing redirect to '%s'", redirectURL)); this.submitPayload(redirectURL, jsonPayloadObject, pushApplicationId, masterSecret, callback); } else { if (isSuccess(statusCode)) { callback.success(statusCode); } callback.complete(statusCode); } } catch (Exception e) { logger.severe("Send did not succeed: " + e.getMessage()); callback.failure(e); } finally { if (httpURLConnection != null) { httpURLConnection.disconnect(); } } }</code><technical_language>I guess logger.info("To: " + url); added accident</technical_language>

Target:
private void submitPayload(String url, String jsonPayloadObject, String pushApplicationId, String masterSecret, MessageResponseCallback callback) { String credentials = pushApplicationId + ":" + masterSecret; int statusCode = 0; HttpURLConnection httpURLConnection = null; try { String encoded = Base64.encodeBytes(credentials.getBytes(UTF_8)); httpURLConnection = post(url, encoded, jsonPayloadObject); statusCode = httpURLConnection.getResponseCode(); logger.info(String.format("HTTP Response code form UnifiedPush Server: %s", statusCode)); if (isRedirect(statusCode)) { String redirectURL = httpURLConnection.getHeaderField("Location"); logger.info(String.format("Performing redirect to '%s'", redirectURL)); this.submitPayload(redirectURL, jsonPayloadObject, pushApplicationId, masterSecret, callback); } else { if(callback != null){ callback.onComplete(statusCode); } } } catch (Exception e) { logger.severe("Send did not succeed: " + e.getMessage()); if(callback != null){ callback.onError(e); } } finally { if (httpURLConnection != null) { httpURLConnection.disconnect(); } } }
Source:
<code>protected void recordLineage(LineageRecorder lineageRecorder, List<String> outputFields) { <START> lineageRecorder.recordRead("Read", "Read from files.", outputFields); <END> }</code><technical_language>"Read %s files." %s config.format</technical_language>

Target:
protected void recordLineage(LineageRecorder lineageRecorder, List<String> outputFields) { lineageRecorder.recordWrite("Write", String.format("Wrote to %s files.", config.getFormat().name().toLowerCase()), outputFields); }
Source:
<code>public void write(final ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (closeSent != null) { ReferenceCountUtil.release(msg); promise.setFailure(new ClosedChannelException()); } else if (msg instanceof CloseWebSocketFrame) { <START> closeSent = promise; <END> ctx.write(msg).addListener(new ChannelPromiseNotifier(false, promise)); } else { ctx.write(msg, promise); } }</code><technical_language>do need unvoid..</technical_language>

Target:
public void write(final ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (closeSent != null) { ReferenceCountUtil.release(msg); promise.setFailure(new ClosedChannelException()); } else if (msg instanceof CloseWebSocketFrame) { closeSent = promise.unvoid(); ctx.write(msg).addListener(new ChannelPromiseNotifier(false, closeSent)); } else { ctx.write(msg, promise); } }
Source:
<code>public @Nullable String getSelectedItemValue() { String ret = null; RegistrationOption selected = (RegistrationOption)getSelectedItem(); if (selected != null) { ret = selected.getValue(); } <START> return ret; <END> }</code><technical_language>@mdinino more descriptive variable names? <LINK_0></technical_language>

Target:
public @Nullable String getSelectedItemValue() { String value = null; RegistrationOption selected = (RegistrationOption)getSelectedItem(); if (selected != null) { value = selected.getValue(); } return value; }
Source:
<code>public SimpleClusteredVersion readFrom(ProtoStreamReader reader) throws IOException { <START> return new SimpleClusteredVersion(reader.readInt("topology"), reader.readLong("version")); <END> }</code><technical_language>read of line</technical_language>

Target:
public SimpleClusteredVersion readFrom(ProtoStreamReader reader) throws IOException { int topology = reader.readInt("topology"); long version = reader.readLong("version"); return new SimpleClusteredVersion(topology, version); }
Source:
<code>public Map<String, ConnectionProfile> loadConnectionProfiles() { IConnectionProfile[] connectionProfiles = ProfileManager.getInstance() .getProfiles(); Map<String, ConnectionProfile> result = new LinkedHashMap<String, ConnectionProfile>(); for (IConnectionProfile currentProfile : connectionProfiles) { ConnectionProfile profile = new ConnectionProfile(); profile.setName(currentProfile.getName()); Properties props = currentProfile.getBaseProperties(); String driverClass = props.getProperty(DRIVER_CLASS); <START> if (driverClass == null) continue; <END> profile.setDriver(driverClass); String driverLocation = props.getProperty(DRIVER_LOCATION); if (driverLocation == null) continue; profile.setPath(driverLocation); profile.setUser(props.getProperty(USER_NAME)); profile.setPassword(props.getProperty(PASSWORD)); profile.setUrl(props.getProperty(URL)); profile.setDialect(props.getProperty(HIBERNATE_DIALECT)); profile.setSavePassword(Boolean.parseBoolean(props .getProperty(SAVE_PWD))); result.put(profile.getName(), profile); } return result; }</code><technical_language>log is akipped</technical_language>

Target:
public Map<String, ConnectionProfile> loadConnectionProfiles() { IConnectionProfile[] connectionProfiles = ProfileManager.getInstance() .getProfiles(); Map<String, ConnectionProfile> result = new LinkedHashMap<String, ConnectionProfile>(); for (IConnectionProfile currentProfile : connectionProfiles) { ConnectionProfile profile = new ConnectionProfile(); profile.setName(currentProfile.getName()); Properties props = currentProfile.getBaseProperties(); String driverClass = props.getProperty(DRIVER_CLASS); if (driverClass == null) { logInfo( "Value for " + DRIVER_CLASS + " in connection profile " + currentProfile.getName() + "was null. Ignoring this connection profile."); continue; } profile.setDriver(driverClass); String driverLocation = props.getProperty(DRIVER_LOCATION); if (driverLocation == null) { logInfo( "Value for " + DRIVER_LOCATION + " in connection profile " + currentProfile.getName() + "was null. Ignoring this connection profile."); continue; } profile.setPath(driverLocation); profile.setUser(props.getProperty(USER_NAME)); profile.setPassword(props.getProperty(PASSWORD)); profile.setUrl(props.getProperty(URL)); profile.setDialect(props.getProperty(HIBERNATE_DIALECT)); profile.setSavePassword(Boolean.parseBoolean(props .getProperty(SAVE_PWD))); result.put(profile.getName(), profile); } return result; }
Source:
<code>public int getIntMetric(String metric) { Object metricValue = event.get(metric); if (metricValue == null) { return 0; } if (metricValue instanceof Number) { return ((Number) metricValue).intValue(); } else if (metricValue instanceof String) { try { <START> return Integer.valueOf(((String) metricValue).replace(",", "")); <END> } catch (Exception e) { throw new ParseException(e, "Unable to parse metrics[%s], value[%s]", metric, metricValue); } } else { throw new ParseException("Unknown type[%s]", metricValue.getClass()); } }</code><technical_language>Trivial wrapping this if (((String) metricValue).indexOf(',') >=0)</technical_language>

Target:
public int getIntMetric(String metric) { Object metricValue = event.get(metric); if (metricValue == null) { return 0; } if (metricValue instanceof Number) { return ((Number) metricValue).intValue(); } else if (metricValue instanceof String) { try { String s = ((String) metricValue).replace(",", ""); return LONG_PAT.matcher(s).matches() ? Integer.valueOf(s) : Double.valueOf(s).intValue(); } catch (Exception e) { throw new ParseException(e, "Unable to parse metrics[%s], value[%s]", metric, metricValue); } } else { throw new ParseException("Unknown type[%s]", metricValue.getClass()); } }
Source:
<code>public GhciEvaluator() throws HaskellException { try { this.ghci = new ProcessBuilder(GHCIPATH) .redirectErrorStream(true) .start(); this.in = this.ghci.getInputStream(); this.out = this.ghci.getOutputStream(); } catch (IOException e) { throw new HaskellException(e); } this.NL = System.getProperty("line.separator"); this.eval(":set prompt " + SENTINEL); this.eval("import Prelude"); this.eval("import Data.List"); this.eval("import Data.Maybe"); <START> this.eval("import Data.Either"); <END> this.eval(":set +r"); }</code><technical_language>This replaced a single _":m Prelude Data.List Data.Maybe Data.Either"_. better, literals, concatenating a(n observable) list of required modules</technical_language>

Target:
public GhciEvaluator() throws HaskellException { try { this.ghci = new ProcessBuilder(GHCIPATH) .redirectErrorStream(true) .start(); this.in = this.ghci.getInputStream(); this.out = this.ghci.getOutputStream(); } catch (IOException e) { throw new HaskellException(e); } this.NL = System.getProperty("line.separator"); this.eval(":set prompt " + SENTINEL); this.eval(":module " + Joiner.on(" ").join(MODULES)); this.eval(":set +r"); }
Source:
<code>public void addReviewData(ITask review, String description) { TaskData reviewData = new TaskData(new TaskAttributeMapper(new TaskRepository("", "")), "", review.getUrl(), review.getTaskId()); reviewData.getRoot().createMappedAttribute(TaskAttribute.DESCRIPTION).setValue(description); try { when(taskDataManager.getTaskData(review)).thenReturn(reviewData); } catch (CoreException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>throw (don't catch) exception test fails</technical_language>

Target:
public void addReviewData(ITask review, String description) throws CoreException { TaskData reviewData = new TaskData(new TaskAttributeMapper(new TaskRepository("", "")), "", review.getUrl(), review.getTaskId()); reviewData.getRoot().createMappedAttribute(TaskAttribute.DESCRIPTION).setValue(description); when(taskDataManager.getTaskData(review)).thenReturn(reviewData); }
Source:
<code>public static byte[] castToBinary(Object x, int targetSqlType) throws SQLException { if (x instanceof byte[]) { return (byte[]) x; } try { if (x instanceof String) { <START> return x.toString().getBytes(UTF_8); <END> } } catch (RuntimeException e) { throw invalidConversion(x, targetSqlType, e); } throw invalidConversion(x, targetSqlType); }</code><technical_language>s/x.toString()/((String) x)/</technical_language>

Target:
public static byte[] castToBinary(Object x, int targetSqlType) throws SQLException { if (x instanceof byte[]) { return (byte[]) x; } if (x instanceof String) { return ((String) x).getBytes(UTF_8); } throw invalidConversion(x, targetSqlType); }
Source:
<code>AsyncRequestAndCallback(Position position) { String formattedUrl; try { formattedUrl = json ? url : formatRequest(position); } catch (UnsupportedEncodingException | JsonProcessingException e) { throw new RuntimeException("Forwarding formatting error", e); } requestBuilder = client.target(formattedUrl).request(); if (header != null && !header.isEmpty()) { for (String line: header.split("\\r?\\n")) { String[] values = line.split(":", 2); String headerName = values[0].trim(); String headerValue = values[1].trim(); <START> requestBuilder.header(headerName, headerValue); <END> if (headerName.equals(HttpHeaders.CONTENT_TYPE)) { mediaType = MediaType.valueOf(headerValue); } } } if (json) { payload = prepareJsonPayload(position); } deliveryPending.incrementAndGet(); }</code><technical_language>This in else statement</technical_language>

Target:
AsyncRequestAndCallback(Position position) { String formattedUrl; try { formattedUrl = (json && !urlVariables) ? url : formatRequest(position); } catch (UnsupportedEncodingException | JsonProcessingException e) { throw new RuntimeException("Forwarding formatting error", e); } requestBuilder = client.target(formattedUrl).request(); if (header != null && !header.isEmpty()) { for (String line: header.split("\\r?\\n")) { String[] values = line.split(":", 2); String headerName = values[0].trim(); String headerValue = values[1].trim(); if (headerName.equals(HttpHeaders.CONTENT_TYPE)) { mediaType = MediaType.valueOf(headerValue); } else { requestBuilder.header(headerName, headerValue); } } } if (json) { payload = prepareJsonPayload(position); } deliveryPending.incrementAndGet(); }
Source:
<code>protected void checkAllowWritesOnUiThread() { if (getSharedRealm().capabilities.isMainThread()) { if (!getConfiguration().isAllowWritesOnUiThread()) { <START> throw new RealmException("Running transactions on the UI thread is disabled by default. You can opt in by using 'RealmConfiguration.allowWritesOnUiThread' or avoid it by using 'Realm.executeTransactionAsync'."); <END> } } }</code><technical_language>suggestion throw new RealmException("Running transactions UI thread disabled. enabled setting 'RealmConfiguration.Builder.allowQueriesOnUiThread(true)'.");</technical_language>

Target:
protected void checkAllowWritesOnUiThread() { if (getSharedRealm().capabilities.isMainThread()) { if (!getConfiguration().isAllowWritesOnUiThread()) { throw new RealmException("Running transactions on the UI thread has been disabled. It can be enabled by setting 'RealmConfiguration.Builder.allowWritesOnUiThread(true)'."); } } }
Source:
<code>protected boolean validate() { Guid vdsId = getVdsId(); VDS vds = vdsDao.get(vdsId); if (vds.getStatus() != VDSStatus.Maintenance && vds.getStatus() != VDSStatus.NonResponsive && vds.getStatus() != VDSStatus.Up && vds.getStatus() != VDSStatus.Error && vds.getStatus() != VDSStatus.PreparingForMaintenance && vds.getStatus() != VDSStatus.Down && vds.getStatus() != VDSStatus.InstallFailed) { return failValidation(EngineMessage.VDS_CANNOT_MAINTENANCE_VDS_IS_NOT_OPERATIONAL); } orderListOfRunningVmsOnVds(vdsId); for (VM vm : vms) { if (vm.isHostedEngine()) { if (!HostedEngineHelper.haveHostsAvailableforHE( vdsDao.getAllForClusterWithStatus(vds.getClusterId(), VDSStatus.Up), Collections.singletonList(vdsId))) { return failValidation(EngineMessage.VDS_CANNOT_MAINTENANCE_NO_ALTERNATE_HOST_FOR_HOSTED_ENGINE); } continue; } if ((getParameters().isInternal() && vm.getMigrationSupport() == MigrationSupport.IMPLICITLY_NON_MIGRATABLE) || vm.getMigrationSupport() == MigrationSupport.PINNED_TO_HOST) { return failValidation(EngineMessage.VDS_CANNOT_MAINTENANCE_IT_INCLUDES_NON_MIGRATABLE_VM); } } ActionReturnValue returnValue = getReturnValue(); <START> if (returnValue != null) { <END> if (!returnValue.getValidationMessages().isEmpty()) { addMaintenanceFailedReason(returnValue.getValidationMessages()); } } return true; }</code><technical_language>check this. getReturnValue() returns null</technical_language>

Target:
protected boolean validate() { final boolean result = validateImpl(); if (!result) { addValidationMessageVariables(); addMaintenanceFailedReason( backend.getErrorsTranslator().translateErrorText(getReturnValue().getValidationMessages())); } return result; }
Source:
<code>public List<QualifiedPatientIdentifier> retrievePatientCorrelation( QualifiedPatientIdentifier qualifiedPatientIdentifier, List<String> includeOnlyAssigningAuthorities) { Retriever retriever = new Retriever(); <START> return retriever.retrievePatientCorrelation(qualifiedPatientIdentifier, includeOnlyAssigningAuthorities); <END> }</code><technical_language>this call inline. new Retriever().retrievePatientCorrelation(qualifiedPatientIdentifier, includeOnlyAssigningAuthorities);</technical_language>

Target:
public List<QualifiedPatientIdentifier> retrievePatientCorrelation( QualifiedPatientIdentifier qualifiedPatientIdentifier, List<String> includeOnlyAssigningAuthorities) { return Retriever.retrievePatientCorrelation(qualifiedPatientIdentifier, includeOnlyAssigningAuthorities); }
Source:
<code>private void initializeAnnouncementView() { User user = mBaseInterface.getUser(); <START> if (user != null) { <END> mUser.setText(user.getName()); user.loadUserImage(getActivity(), mPicture); mTime.setText(getString(R.string.pause_semester_today)); mTitle.setText(getString(R.string.pause_semester_announcement_title)); mBody.setText(getString(R.string.pause_semester_announcement_body)); mSchool.setVisibility(View.GONE); } }</code><technical_language>return if user is null reduce indentation. throw log if happens</technical_language>

Target:
private void initializeAnnouncementView() { User user = mBaseInterface.getUser(); if (user == null) { Log.e("User Null", "Base Interface user is null"); return; } mUser.setText(user.getName()); user.loadUserImage(getActivity(), mPicture); mTime.setText(getString(R.string.pause_semester_today)); mTitle.setText(getString(R.string.pause_semester_announcement_title)); mBody.setText(getString(R.string.pause_semester_announcement_body)); mSchool.setVisibility(View.GONE); }
Source:
<code>public void testGetCrashLogContents() { AbstractDevice device = mock(AbstractDevice.class); when(device.getExternalStoragePath()).thenReturn("/storage"); when(device.getCrashLog()).thenCallRealMethod(); when( device.executeCommandQuietly(argThat(matchesCmdLine("adb shell ls /storage/")))) .thenReturn(String.format("some_file%nappcrash.log%nanother_file")); when( <START> device.executeCommandQuietly(argThat(matchesCmdLine("adb.exe shell ls C:\\storage/")))) END> .thenReturn(String.format("some_file%nappcrash.log%nanother_file")); when( device.executeCommandQuietly(argThat(matchesCmdLine("adb shell cat /storage/appcrash.log")))) .thenReturn("crash log contents"); when( device.executeCommandQuietly(argThat(matchesCmdLine("adb.exe shell cat C:\\storage\\appcrash.log")))) .thenReturn("crash log contents"); assertEquals("crash log contents", device.getCrashLog()); }</code><technical_language>file paths for adb shell commands remain in unix style, run android device file system is in format</technical_language>

Target:
public void testGetCrashLogContents() { AbstractDevice device = mock(AbstractDevice.class); when(device.getExternalStoragePath()).thenReturn("/storage"); when(device.getCrashLog()).thenCallRealMethod(); when( device.executeCommandQuietly(argThat(matchesCmdLine(".*adb(\\.exe)? shell ls /storage/$")))) .thenReturn(String.format("some_file%nappcrash.log%nanother_file")); when( device.executeCommandQuietly(argThat(matchesCmdLine(".*adb(\\.exe)? shell cat /storage/appcrash\\.log$")))) .thenReturn("crash log contents"); assertEquals("crash log contents", device.getCrashLog()); }
Source:
<code>public void run() { Set<Subscription> subscriptions = Util.newSet(); for (Product product : products) { List<Subscription> subs = subAdapter.getSubscriptions(product.toDTO()); log.debug("Will refresh subscriptions in all orgs using product: ", subs.size(), product.getId()); if (log.isDebugEnabled()) { for (Subscription s : subs) { Owner so = s.getOwner(); if (so == null || so.getKey() == null) { log.debug(" Received a subscription without a well-defined owner: {}", s.getId()); continue; } if (!this.owners.containsKey(so.getKey())) { log.debug(" {}", s); } } } subscriptions.addAll(subs); } for (Subscription subscription : subscriptions) { Owner so = subscription.getOwner(); if (so == null || so.getKey() == null) { log.error("Received a subscription without a well-defined owner: {}", subscription.getId()); continue; } if (this.owners.containsKey(so.getKey())) { log.debug("Skipping subscription \"{}\" for owner: {}", subscription.getId(), so); continue; } Pool masterPool = poolManager.convertToMasterPool(subscription); poolManager.refreshPoolsForMasterPool(masterPool, true, lazy, new HashSet<Product>()); } for (Owner owner : this.owners.values()) { poolManager.refreshPoolsWithRegeneration(subAdapter, owner, lazy); try { ownerManager.refreshOwnerForContentAccess(owner); } catch (Exception e) { <START> log.error("Unable to handle content access certificates", e.getStackTrace().toString()); <END> } } }</code><technical_language>end user get notified of this error if log files</technical_language>

Target:
public void run() { Set<Subscription> subscriptions = Util.newSet(); for (Product product : products) { List<Subscription> subs = subAdapter.getSubscriptions(product.toDTO()); log.debug("Will refresh subscriptions in all orgs using product: ", subs.size(), product.getId()); if (log.isDebugEnabled()) { for (Subscription s : subs) { Owner so = s.getOwner(); if (so == null || so.getKey() == null) { log.debug(" Received a subscription without a well-defined owner: {}", s.getId()); continue; } if (!this.owners.containsKey(so.getKey())) { log.debug(" {}", s); } } } subscriptions.addAll(subs); } for (Subscription subscription : subscriptions) { Owner so = subscription.getOwner(); if (so == null || so.getKey() == null) { log.error("Received a subscription without a well-defined owner: {}", subscription.getId()); continue; } if (this.owners.containsKey(so.getKey())) { log.debug("Skipping subscription \"{}\" for owner: {}", subscription.getId(), so); continue; } Pool masterPool = poolManager.convertToMasterPool(subscription); poolManager.refreshPoolsForMasterPool(masterPool, true, lazy, new HashSet<Product>()); } for (Owner owner : this.owners.values()) { poolManager.refreshPoolsWithRegeneration(subAdapter, owner, lazy); ownerManager.refreshOwnerForContentAccess(owner); } }
Source:
<code>private void switchForceField() { <START> if (this.state == ForceFieldState.ACTIVE) <END> this.state = ForceFieldState.INACTIVE; else this.state = ForceFieldState.ACTIVE; }</code><technical_language>a function in enum for this, this if case</technical_language>

Target:
private void switchForceField() { this.state = state.switchState(); }
Source:
<code>private void outputEventLog() { try { ShaftEscape.LOGGER.writeToFile(); final String log = new String(Files.readAllBytes( Paths.get(Logger.OUTFILE)), StandardCharsets.UTF_8); System.out.println("\n== EVENT_LOG =="); System.out.println(log); System.out.println("== END_EVENT_LOG ==\n"); } catch (IOException e) { <START> fail(); <END> } }</code><technical_language>E2E fail log printed console? print "log printed" that, including Exception message. <review, testing, logic</technical_language>

Target:
private void outputEventLog() { try { ShaftEscape.LOGGER.writeToFile(); final String log = new String(Files.readAllBytes( Paths.get(Logger.OUTFILE)), StandardCharsets.UTF_8); System.out.println("\n== EVENT_LOG =="); System.out.println(log); System.out.println("== END_EVENT_LOG ==\n"); } catch (IOException e) { fail("IOException thrown: " + e.getMessage()); } }
Source:
<code>public void shouldReceiveUpgradeStatusCode() throws Exception { ServerConnectionEstablisher establisher = new ServerConnectionEstablisher(); <START> HttpMessage handshakeRequest = new HttpMessage(HttpHandshakeBuilder.getHttpHandshakeRequestHeader(new URI("http://" + HOST_NAME + ":" + WEBSOCKET_PORT,true))); <END> NanoWebSocketTestServer webSocketServer = super.getWebSocketTestServer(); System.out.println(handshakeRequest.getRequestHeader().toString()); establisher.send(new HandshakeConfig(handshakeRequest,false,false)); assertEquals(101,handshakeRequest.getResponseHeader().getStatusCode()); assertEquals(webSocketServer.getLastConnection() .getHandshakeResponse().getHeader(HttpHandshakeBuilder.SEC_WEB_SOCKET_ACCEPT) , WebSocketUtils.encodeWebSocketKey(handshakeRequest.getRequestHeader().getHeader(HttpHandshakeBuilder.SEC_WEB_SOCKET_KEY))); }</code><technical_language>creation of string for server moved base class (it getHostname() getListeningPort() of webSocketTestServer create it), pretty needed tests</technical_language>

Target:
public void shouldReceiveUpgradeStatusCode() throws Exception { ServerConnectionEstablisher establisher = new ServerConnectionEstablisher(); NanoWebSocketTestServer webSocketServer = super.getWebSocketTestServer(); HttpMessage handshakeRequest = new HttpMessage(HttpHandshakeBuilder.getHttpHandshakeRequestHeader(super.getServertUrl())); establisher.send(new HandshakeConfig(handshakeRequest,false,false)); assertEquals(101,handshakeRequest.getResponseHeader().getStatusCode()); assertEquals(webSocketServer.getLastConnection() .getHandshakeResponse().getHeader(HttpHandshakeBuilder.SEC_WEB_SOCKET_ACCEPT) , WebSocketUtils.encodeWebSocketKey(handshakeRequest.getRequestHeader().getHeader(HttpHandshakeBuilder.SEC_WEB_SOCKET_KEY))); }
Source:
<code>public void promptForDbCredentialsIfMissing(Server server) { String defaultUser = "root"; String user = promptForValueIfMissingWithDefault( "Please specify database username (-D%s)", server.getDbUser(), "dbUser", defaultUser); server.setDbUser(user); String dbPassword = promptForPasswordIfMissingWithDefault( "Please specify database password (-D%s)", server.getDbPassword(), "dbPassword", ""); <START> server.setDbPassword(dbPassword); <END> }</code><technical_language>I suggest doing: suggestion server.setDbPassword(dbPassword.trim()); In order ensure password leading trailing blank spaces a authentication issue on</technical_language>

Target:
public void promptForDbCredentialsIfMissing(Server server) { String defaultUser = "root"; String user = promptForValueIfMissingWithDefault( "Please specify database username (-D%s)", server.getDbUser(), "dbUser", defaultUser); server.setDbUser(user); String dbPassword = promptForPasswordIfMissingWithDefault( "Note: whitespace-only passwords will be left blank and trailing/leading whitespace will be removed.\nPlease specify database password (-D%s)", server.getDbPassword(), "dbPassword", ""); server.setDbPassword(dbPassword.trim()); }
Source:
<code>public ServiceCreationConfiguration ehcache3CacheManagerConfiguration() { val ehcacheProperties = casProperties.getTicket().getRegistry().getEhcache3(); val terracottaClusterUri = ehcacheProperties.getTerracottaClusterUri(); if (StringUtils.isNotBlank(terracottaClusterUri)) { var clusterConfigBuilder = ClusteringServiceConfigurationBuilder.cluster(URI.create(terracottaClusterUri)) .timeouts(TimeoutsBuilder.timeouts() .connection(Duration.ofSeconds(ehcacheProperties.getClusterConnectionTimeout())) .read(Duration.ofSeconds(ehcacheProperties.getClusterReadWriteTimeout())) .write(Duration.ofSeconds(ehcacheProperties.getClusterReadWriteTimeout())).build()) .autoCreate(s -> s.defaultServerResource(ehcacheProperties.getDefaultServerResource()) .resourcePool(ehcacheProperties.getResourcePoolName(), ehcacheProperties.getResourcePoolSize(), MemoryUnit.valueOf(ehcacheProperties.getResourcePoolUnits()))); return clusterConfigBuilder.build(); <START> } else { <END> val rootDirectory = ehcacheProperties.getRootDirectory(); val rootDirectoryFile = new File(rootDirectory); if (!rootDirectoryFile.exists()) { LOGGER.debug("Creating folder for ehcache ticket registry disk cache [{}]", rootDirectory); val mkdirResult = rootDirectoryFile.mkdirs(); if (!mkdirResult) { LOGGER.warn("Unable to create folder for ehcache ticket registry disk cache [{}]", rootDirectory); } } return new DefaultPersistenceConfiguration(rootDirectoryFile); } }</code><technical_language>Else clause necessary, returning above</technical_language>

Target:
public ServiceCreationConfiguration ehcache3CacheManagerConfiguration() { val ehcacheProperties = casProperties.getTicket().getRegistry().getEhcache3(); val terracottaClusterUri = ehcacheProperties.getTerracottaClusterUri(); if (StringUtils.isNotBlank(terracottaClusterUri)) { var clusterConfigBuilder = ClusteringServiceConfigurationBuilder.cluster(URI.create(terracottaClusterUri)) .timeouts(TimeoutsBuilder.timeouts() .connection(Duration.ofSeconds(ehcacheProperties.getClusterConnectionTimeout())) .read(Duration.ofSeconds(ehcacheProperties.getClusterReadWriteTimeout())) .write(Duration.ofSeconds(ehcacheProperties.getClusterReadWriteTimeout())).build()) .autoCreate(s -> s.defaultServerResource(ehcacheProperties.getDefaultServerResource()) .resourcePool(ehcacheProperties.getResourcePoolName(), ehcacheProperties.getResourcePoolSize(), MemoryUnit.valueOf(ehcacheProperties.getResourcePoolUnits()))); return clusterConfigBuilder.build(); } val rootDirectory = ehcacheProperties.getRootDirectory(); val rootDirectoryFile = new File(rootDirectory); if (!rootDirectoryFile.exists()) { LOGGER.debug("Creating folder for ehcache ticket registry disk cache [{}]", rootDirectory); val mkdirResult = rootDirectoryFile.mkdirs(); if (!mkdirResult) { LOGGER.warn("Unable to create folder for ehcache ticket registry disk cache [{}]", rootDirectory); } } return new DefaultPersistenceConfiguration(rootDirectoryFile); }
Source:
<code>public boolean isDefaultValue() { if(this.equals(FRIEND_TRUST.NORMAL)) return true; else return false; <START> } <END></code><technical_language>this reduced return equals(FRIEND_TRUST.NORMAL)</technical_language>

Target:
public boolean isDefaultValue() { return this.equals(FRIEND_TRUST.NORMAL); }
Source:
<code><START> public void testDisableErrorLogByDefault() throws Exception { <END> StatusUpdateUtil _statusUpdateUtil = new StatusUpdateUtil(); int n = 1; Exception e = new RuntimeException("test exception"); TestHelper.setupCluster(clusterName, ZK_ADDR, 12918, "localhost", "TestDB", 1, 1, n, 1, "MasterSlave", true); MockParticipantManager[] participants = new MockParticipantManager[n]; for (int i = 0; i < n; i++) { String instanceName = "localhost_" + (12918 + i); participants[i] = new MockParticipantManager(ZK_ADDR, clusterName, instanceName); participants[i].syncStart(); } Message message = new Message(Message.MessageType.STATE_TRANSITION, "Some unique id"); message.setSrcName("cm-instance-0"); message.setTgtSessionId(participants[0].getSessionId()); message.setFromState("Offline"); message.setToState("Slave"); message.setPartitionName("TestDB_0"); message.setMsgId("Some unique message id"); message.setResourceName("TestDB"); message.setTgtName("localhost_12918"); message.setStateModelDef("MasterSlave"); message.setStateModelFactoryName(HelixConstants.DEFAULT_STATE_MODEL_FACTORY); _statusUpdateUtil.logError(message, HelixStateTransitionHandler.class, e, "test status update", participants[0]); String errPath = PropertyPathBuilder.instanceError(clusterName, "localhost_12918", participants[0].getSessionId(), "TestDB", "TestDB_0"); try { ZNRecord error = _gZkClient.readData(errPath); Assert.fail("not expecting being able to send error logs to ZK by default."); } catch (ZkException zke) { Assert.assertTrue(true); } for (int i = 0; i < n; i++) { participants[i].syncStop(); } }</code><technical_language>test enable new config</technical_language>

Target:
public void testDisableErrorLogByDefault() throws Exception { StatusUpdateUtil statusUpdateUtil = new StatusUpdateUtil(); setFinalStatic(StatusUpdateUtil.class.getField("ERROR_LOG_TO_ZK_ENABLED"), false); Exception e = new RuntimeException("test exception"); statusUpdateUtil.logError(message, HelixStateTransitionHandler.class, e, "test status update", participants[0]); String errPath = PropertyPathBuilder .instanceError(clusterName, "localhost_12918", participants[0].getSessionId(), "TestDB", "TestDB_0"); try { ZNRecord error = _gZkClient.readData(errPath); Assert.fail("not expecting being able to send error logs to ZK by default."); } catch (ZkException zke) { } }
Source:
<code>public List<String> getJournalKeysFromDois(List<String> dois, Site site) throws IOException { <START> if (dois.size() == 0) { <END> return new ArrayList<String>(); } List<String> quoted = dois.stream().map(doi -> { return "\"" + QueryParser.escape(doi) + "\""; }).collect(Collectors.toList()); ArticleSearchQuery explicitDoiSearchQuery = ArticleSearchQuery.builder() .setSimple(false) .setRows(dois.size()) .setQuery("id:(" + String.join(" OR ", quoted) + ")") .setIsJournalSearch(true) .build(); Map<String, ?> results = solrSearchApi.search(explicitDoiSearchQuery, site); List<Map<String, ?>> docs = (List<Map<String, ?>>) results.get("docs"); List<String> journalKeys = null; if (docs.size() == dois.size()) { journalKeys = docs.stream().map(data -> { return (String) data.get("journal_key"); }).collect(Collectors.toList()); } else { log.warn("incorrect solr result count " + docs.size() + " != " + dois.size() + " for query=" + explicitDoiSearchQuery.getQuery()); } return journalKeys; }</code><technical_language>nit: replace dois.size() == 0 dois.isEmpty()</technical_language>

Target:
public List<String> getJournalKeysFromDois(List<String> dois, Site site) throws IOException { if (dois.isEmpty()) { return new ArrayList<String>(); } List<String> quoted = dois.stream().map(doi -> { return "\"" + QueryParser.escape(doi) + "\""; }).collect(Collectors.toList()); ArticleSearchQuery explicitDoiSearchQuery = ArticleSearchQuery.builder() .setSimple(false) .setRows(dois.size()) .setQuery("id:(" + String.join(" OR ", quoted) + ")") .setIsJournalSearch(true) .build(); Map<String, ?> results = solrSearchApi.search(explicitDoiSearchQuery, site); List<Map<String, ?>> docs = (List<Map<String, ?>>) results.get("docs"); List<String> journalKeys = null; if (docs.size() == dois.size()) { journalKeys = docs.stream().map(data -> { return (String) data.get("journal_key"); }).collect(Collectors.toList()); } else { log.warn("incorrect solr result count " + docs.size() + " != " + dois.size() + " for query=" + explicitDoiSearchQuery.getQuery()); } return journalKeys; }