auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void setError(Throwable error) { <START> Preconditions.checkNotNull(error); <END> Throwable old = commandErrors.get().peek(); if (old == null) { throw new IllegalStateException(); } if (old == noError) { commandErrors.get().pop(); commandErrors.get().push(error); } }</code><technical_language>static import this method</technical_language>

Target:
public static void setError(Throwable error) { checkNotNull(error); Throwable old = commandErrors.get().peek(); if (old == null) { throw new IllegalStateException(); } if (old == noError) { commandErrors.get().pop(); commandErrors.get().push(error); } }
Source:
<code>public static void setResponseCachedTime(Map<String, String> headers, CachableResponse response) throws ParseException { long responseFetchedTime; String fetchedTime; if (headers != null && (fetchedTime = headers.get(HttpHeaders.DATE)) != null) { SimpleDateFormat format = new SimpleDateFormat(CachingConstants.DATE_PATTERN); <START> Date d = format.parse(fetchedTime); <END> responseFetchedTime = d.getTime(); } else { responseFetchedTime = System.currentTimeMillis(); } response.setResponseFetchedTime(responseFetchedTime); }</code><technical_language>a meaningful name</technical_language>

Target:
public static void setResponseCachedTime(Map<String, String> headers, CachableResponse response) throws ParseException { long responseFetchedTime; String dateHeaderValue; if (headers != null && (dateHeaderValue = headers.get(HttpHeaders.DATE)) != null) { SimpleDateFormat format = new SimpleDateFormat(CachingConstants.DATE_PATTERN); Date d = format.parse(dateHeaderValue); responseFetchedTime = d.getTime(); } else { responseFetchedTime = System.currentTimeMillis(); } response.setResponseFetchedTime(responseFetchedTime); }
Source:
<code>public Object intercept(InvocationContext ctx) throws Exception { try { beanManager.getContext(RequestScoped.class).isActive(); <START> isRequestContextActive.set(true); <END> return ctx.proceed(); } catch (ContextNotActiveException e) { } return ctx.proceed(); }</code><technical_language>I merge lines one: isRequestContextActive.set(beanManager.getContext(RequestScoped.class).isActive()); for other interceptor (AfterActivationInterceptor). preference I guess :)</technical_language>

Target:
public Object intercept(InvocationContext ctx) throws Exception { try { isRequestContextActive.set(beanManager.getContext(RequestScoped.class).isActive()); return ctx.proceed(); } catch (ContextNotActiveException e) { } return ctx.proceed(); }
Source:
<code>private void showNotification(int downloadedConcepts) { Intent notificationIntent = new Intent(this, SettingsActivity.class); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); notificationIntent.putExtra(ApplicationConstants.BroadcastActions.CONCEPT_DOWNLOAD_BROADCAST_INTENT_KEY_COUNT, downloadedConcepts); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_openmrs); Notification notification = new NotificationCompat.Builder(this) .setContentTitle(getString(R.string.downloading_concepts_notification_message)) <START> .setTicker(getString(R.string.accessibility_services_app_name_message)) <END> .setContentText(String.valueOf(downloadedConcepts)) .setSmallIcon(R.drawable.ic_stat_notify_download) .setLargeIcon( Bitmap.createScaledBitmap(icon, 128, 128, false)) .setContentIntent(pendingIntent) .setOngoing(true) .build(); startForeground(ApplicationConstants.ServiceNotificationId.CONCEPT_DOWNLOADFOREGROUND_SERVICE, notification); }</code><technical_language>this app name</technical_language>

Target:
private void showNotification(int downloadedConcepts) { Intent notificationIntent = new Intent(this, SettingsActivity.class); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); notificationIntent.putExtra(ApplicationConstants.BroadcastActions.CONCEPT_DOWNLOAD_BROADCAST_INTENT_KEY_COUNT, downloadedConcepts); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_openmrs); Notification notification = new NotificationCompat.Builder(this) .setContentTitle(getString(R.string.downloading_concepts_notification_message)) .setTicker(getString(R.string.app_name)) .setContentText(String.valueOf(downloadedConcepts)) .setSmallIcon(R.drawable.ic_stat_notify_download) .setLargeIcon( Bitmap.createScaledBitmap(icon, 128, 128, false)) .setContentIntent(pendingIntent) .setOngoing(true) .build(); startForeground(ApplicationConstants.ServiceNotificationId.CONCEPT_DOWNLOADFOREGROUND_SERVICE, notification); }
Source:
<code>public void subscribe(String topic, int qos) throws MqttException { <START> client.subscribe(topic, qos, "Subscribe sample context", this); <END> subscriptions.add(topic); broadcastState(); }</code><technical_language>"Subscribe sample context" a weird hardcoded value</technical_language>

Target:
public void subscribe(String topic, int qos) throws MqttException { client.subscribe(topic, qos, userContext, this); subscriptions.add(topic); broadcastState(); }
Source:
<code>public void setRecipients(List<Recipient> recipients) { Assert.notEmpty(recipients, "'recipients' must not be empty"); ConcurrentLinkedQueue<Recipient> originalRecipients = this.recipients; this.recipients.clear(); <START> this.recipients.addAll(recipients); <END> if (getBeanFactory() != null) { this.recipients.forEach(recipient -> recipient.setChannelResolver(getChannelResolver())); } if (logger.isDebugEnabled()) { logger.debug("Channel Recipients: " + originalRecipients + " replaced with: " + this.recipients); } }</code><technical_language>This atomic - broken INT-2856. is a small timing hole recipients, incomplete list</technical_language>

Target:
public void setRecipients(List<Recipient> recipients) { Assert.notEmpty(recipients, "'recipients' must not be empty"); Queue<Recipient> newRecipients = new ConcurrentLinkedQueue<>(recipients); if (getBeanFactory() != null) { newRecipients.forEach(recipient -> recipient.setChannelResolver(getChannelResolver())); } if (logger.isDebugEnabled()) { logger.debug("Channel Recipients: " + this.recipients + " replaced with: " + newRecipients); } this.recipients = newRecipients; }
Source:
<code>protected void executeCommand() { getParameters().setEntityInfo(getEntityInfo()); setSucceeded(true); if <START> (!images.isEmpty()) <END> { List<DiskImage> imageToRemove = new ArrayList<>(); for (DiskImage image : images) { if (image.getStorageIds().get(0).equals(getParameters().getStorageDomainId())) { image.setStorageIds(Collections.singletonList(getParameters().getStorageDomainId())); image.setStoragePoolId(getParameters().getStoragePoolId()); imageToRemove.add(image); } } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(getVmId(), imageToRemove); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } vmAndTemplatesGenerationsDao.deleteOvfGenerations(Collections.singletonList(ovfEntityData.getEntityId())); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }</code><technical_language>"images" "null" if "setUnregisteredEntityAndImages()" fail "readVmTemplateFromOvf()". I wrong</technical_language>

Target:
protected void executeCommand() { getParameters().setEntityInfo(getEntityInfo()); setSucceeded(true); if (images != null && !images.isEmpty()) { List<DiskImage> imageToRemove = new ArrayList<>(); for (DiskImage image : images) { if (image.getStorageIds().get(0).equals(getParameters().getStorageDomainId())) { image.setStorageIds(Collections.singletonList(getParameters().getStorageDomainId())); image.setStoragePoolId(getParameters().getStoragePoolId()); imageToRemove.add(image); } } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(getVmId(), imageToRemove); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } vmAndTemplatesGenerationsDao.deleteOvfGenerations(Collections.singletonList(ovfEntityData.getEntityId())); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }
Source:
<code>private void assertFailureOnUntrustedInterface(ClientMessage clientMessage) throws Exception { ClientInvocation invocation = new ClientInvocation(((HazelcastClientProxy) client).client, clientMessage, null); ClientInvocationFuture future = invocation.invoke(); try { future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS); <START> fail("AuthenticationException was expected."); <END> } catch (ExecutionException e) { assertThat(e.getCause(), is(instanceOf(AccessControlException.class))); } }</code><technical_language>nit: change AccessControlException expected</technical_language>

Target:
private void assertFailureOnUntrustedInterface(ClientMessage clientMessage) throws Exception { ClientInvocation invocation = new ClientInvocation(((HazelcastClientProxy) client).client, clientMessage, null); ClientInvocationFuture future = invocation.invoke(); try { future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS); fail("AccessControlException was expected."); } catch (ExecutionException e) { assertThat(e.getCause(), is(instanceOf(AccessControlException.class))); } }
Source:
<code>protected void ExecuteVmCommand() { AddCustomValue("InterfaceType", (VmInterfaceType.forValue(getParameters().getInterface().getType()).getInterfaceTranslation()).toString()); this.setVmName(DbFacade.getInstance().getVmStaticDAO().get(getParameters().getVmId()).getvm_name()); if (StringHelper.isNullOrEmpty(getParameters().getInterface().getMacAddress())) { String mac = null; RefObject<String> tempRefObject = new RefObject<String>(mac); MacPoolManager.getInstance().allocateNewMac(tempRefObject); mac = tempRefObject.argvalue; getParameters().getInterface().setMacAddress(mac); } getParameters().getInterface().setSpeed( VmInterfaceType.forValue( getParameters().getInterface().getType()).getSpeed()); getParameters().getInterface().setId(Guid.NewGuid()); getParameters().getInterface().setVmId(getParameters().getVmId()); DbFacade.getInstance() .getVmNetworkInterfaceDAO() .save(getParameters().getInterface()); DbFacade.getInstance() .getVmNetworkStatisticsDAO() .save(getParameters().getInterface().getStatistics()); VmDevice iface = new VmDevice(new VmDeviceId(getParameters().getInterface().getId(), getParameters().getVmId()), VmDeviceCommonUtils.INTERFACE, VmDeviceCommonUtils.BRIDGE, "", 0, "", true, false, false, false); <START> DbFacade.getInstance().getVmDeviceDAO().save(iface); <END> setSucceeded(true); }</code><technical_language>If command is DbFacade.getInstance(), reuse it</technical_language>

Target:
protected void ExecuteVmCommand() { AddCustomValue("InterfaceType", (VmInterfaceType.forValue(getParameters().getInterface().getType()).getInterfaceTranslation()).toString()); this.setVmName(DbFacade.getInstance().getVmStaticDAO().get(getParameters().getVmId()).getvm_name()); if (StringHelper.isNullOrEmpty(getParameters().getInterface().getMacAddress())) { String mac = null; RefObject<String> tempRefObject = new RefObject<String>(mac); MacPoolManager.getInstance().allocateNewMac(tempRefObject); mac = tempRefObject.argvalue; getParameters().getInterface().setMacAddress(mac); } getParameters().getInterface().setSpeed( VmInterfaceType.forValue( getParameters().getInterface().getType()).getSpeed()); getParameters().getInterface().setId(Guid.NewGuid()); getParameters().getInterface().setVmId(getParameters().getVmId()); DbFacade dbFacade = DbFacade.getInstance(); dbFacade .getVmNetworkInterfaceDAO() .save(getParameters().getInterface()); dbFacade .getVmNetworkStatisticsDAO() .save(getParameters().getInterface().getStatistics()); VmDevice iface = new VmDevice(new VmDeviceId(getParameters().getInterface().getId(), getParameters().getVmId()), VmDeviceCommonUtils.INTERFACE, VmDeviceCommonUtils.BRIDGE, "", 0, "", true, false, false, false); dbFacade.getVmDeviceDAO().save(iface); setSucceeded(true); }
Source:
<code>public void run() { int numRetries = 0; InetSocketAddress addr; Socket client = null; while((!shutdown) && (numRetries < 3)){ try { ss = new ServerSocket(); ss.setReuseAddress(true); if (self.getQuorumListenOnAllIPs()) { int port = self.getElectionAddress().getPort(); addr = new InetSocketAddress(port); } else { self.recreateSocketAddresses(self.getId()); addr = self.getElectionAddress(); } LOG.info("My election bind port: " + addr.toString()); setName(addr.toString()); ss.bind(addr); while (!shutdown) { client = ss.accept(); setSockOpts(client); LOG.info("Received connection request " + client.getRemoteSocketAddress()); receiveConnection(client); numRetries = 0; } <START> } catch (IOException e) { <END> LOG.error("Exception while listening", e); if (!(e instanceof SocketTimeoutException)) { numRetries++; } try { ss.close(); Thread.sleep(1000); } catch (IOException ie) { LOG.error("Error closing server socket", ie); } catch (InterruptedException ie) { LOG.error("Interrupted while sleeping. " + "Ignoring exception", ie); } closeSocket(client); if (shutdown) { break; } } } LOG.info("Leaving listener"); if (!shutdown) { LOG.error("As I'm leaving the listener thread, " + "I won't be able to participate in leader " + "election any longer: " + self.getElectionAddress()); } else if (ss != null) { try { ss.close(); } catch (IOException ie) { LOG.debug("Error closing server socket", ie); } } }</code><technical_language>need move code block **Line650-Line652** code block **Line665-Line667**</technical_language>

Target:
public void run() { int numRetries = 0; InetSocketAddress addr; Socket client = null; while((!shutdown) && (numRetries < 3)){ try { ss = new ServerSocket(); ss.setReuseAddress(true); if (self.getQuorumListenOnAllIPs()) { int port = self.getElectionAddress().getPort(); addr = new InetSocketAddress(port); } else { self.recreateSocketAddresses(self.getId()); addr = self.getElectionAddress(); } LOG.info("My election bind port: " + addr.toString()); setName(addr.toString()); ss.bind(addr); while (!shutdown) { try { client = ss.accept(); setSockOpts(client); LOG.info("Received connection request " + client.getRemoteSocketAddress()); receiveConnection(client); numRetries = 0; } catch (SocketTimeoutException e) { LOG.warn("The socket is listening for the election accepted " + "and it timed out unexpectedly, but will retry." + "see ZOOKEEPER-2836"); } } } catch (IOException e) { if (shutdown) { break; } LOG.error("Exception while listening", e); numRetries++; try { ss.close(); Thread.sleep(1000); } catch (IOException ie) { LOG.error("Error closing server socket", ie); } catch (InterruptedException ie) { LOG.error("Interrupted while sleeping. " + "Ignoring exception", ie); } closeSocket(client); } } LOG.info("Leaving listener"); if (!shutdown) { LOG.error("As I'm leaving the listener thread, " + "I won't be able to participate in leader " + "election any longer: " + self.getElectionAddress()); } else if (ss != null) { try { ss.close(); } catch (IOException ie) { LOG.debug("Error closing server socket", ie); } } }
Source:
<code>public BridgeFactory(ServiceManager serviceManager) { annotationBasedProviders = new HashSet<BridgeProvider>(5); annotationBasedProviders.add( new CalendarBridgeProvider() ); annotationBasedProviders.add( new DateBridgeProvider() ); annotationBasedProviders.add( new NumericBridgeProvider() ); annotationBasedProviders.add( new SpatialBridgeProvider() ); annotationBasedProviders.add( new TikaBridgeProvider() ); <START> ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class ); <END> regularProviders = classLoaderService.loadJavaServices( BridgeProvider.class ); regularProviders.add( new EnumBridgeProvider() ); regularProviders.add( new DefaultBridgeProvider(serviceManager) ); }</code><technical_language>a bit of a shame. bite a bit OSGi. I making _BridgeProvider_ a _Service_ is approach. Hopefully, able move a service w/o affecting user code. _Service_ is a marker interface, able add w/o affecting existing code</technical_language>

Target:
public BridgeFactory(ServiceManager serviceManager) { annotationBasedProviders = new HashSet<BridgeProvider>(5); annotationBasedProviders.add( new CalendarBridgeProvider() ); annotationBasedProviders.add( new DateBridgeProvider() ); annotationBasedProviders.add( new NumericBridgeProvider() ); annotationBasedProviders.add( new SpatialBridgeProvider() ); annotationBasedProviders.add( new TikaBridgeProvider() ); ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class ); try { regularProviders = classLoaderService.loadJavaServices( BridgeProvider.class ); regularProviders.add( new EnumBridgeProvider() ); regularProviders.add( new BasicJDKTypesBridgeProvider( serviceManager ) ); } finally { serviceManager.releaseService( ClassLoaderService.class ); } }
Source:
<code>private static void assignTagsFromJson(ReaderPost post, JSONObject jsonTags) { if (jsonTags == null) { return; } Iterator<String> it = jsonTags.keys(); if (!it.hasNext()) { return; } String mostPopularTag = null; String nextMostPopularTag = null; int popularCount = 0; while (it.hasNext()) { JSONObject jsonThisTag = jsonTags.optJSONObject(it.next()); int postCount = jsonThisTag.optInt("post_count"); if (postCount > popularCount) { nextMostPopularTag = mostPopularTag; <START> mostPopularTag = JSONUtils.getStringDecoded(jsonThisTag, "display_name"); <END> popularCount = postCount; } } if (!post.hasPrimaryTag()) { post.setPrimaryTag(mostPopularTag); } post.setSecondaryTag(nextMostPopularTag); }</code><technical_language>Wondering if this slug. in places getTagForDisplay string passed slug for current tag</technical_language>

Target:
private static void assignTagsFromJson(ReaderPost post, JSONObject jsonTags) { if (jsonTags == null) { return; } Iterator<String> it = jsonTags.keys(); if (!it.hasNext()) { return; } String mostPopularTag = null; String nextMostPopularTag = null; int popularCount = 0; while (it.hasNext()) { JSONObject jsonThisTag = jsonTags.optJSONObject(it.next()); int postCount = jsonThisTag.optInt("post_count"); if (postCount > popularCount) { nextMostPopularTag = mostPopularTag; mostPopularTag = JSONUtils.getStringDecoded(jsonThisTag, "slug"); popularCount = postCount; } } if (!post.hasPrimaryTag()) { post.setPrimaryTag(mostPopularTag); } post.setSecondaryTag(nextMostPopularTag); }
Source:
<code>public Map<String, String> getTags() { <START> return tags; <END> }</code><technical_language>suggestion return Collections.unmodifiableMap(tags);</technical_language>

Target:
public Map<String, String> getTags() { return Collections.unmodifiableMap(tags); }
Source:
<code>public static <T> Predicate<Location> isDescendantOf(final Location ancestor) { return new Predicate<Location>() { @Override public boolean apply(@Nullable Location input) { Location contender = input; while (contender != null) { <START> if (Objects.equal(contender, ancestor)) { <END> return true; } contender = contender.getParent(); } return false; } }; }</code><technical_language>Objects.equal(contender.getParent(), ancestor) here, a proper descendant check</technical_language>

Target:
public static <T> Predicate<Location> isDescendantOf(final Location ancestor) { return new Predicate<Location>() { @Override public boolean apply(@Nullable Location input) { Location contenderAncestor = (input == null) ? input : input.getParent(); while (contenderAncestor != null) { if (Objects.equal(contenderAncestor, ancestor)) { return true; } contenderAncestor = contenderAncestor.getParent(); } return false; } }; }
Source:
<code>public <T extends Annotation> T getConfig(Class<T> type) { List<T> configs = new ArrayList<>(); T annotation = scanner.getAnnotation(getTargetTestClass(), type); if (annotation != null) { configs.add(annotation); } <START> apply("getAnnontation", BACKWARD, holder -> { <END> T hAnnotation = scanner.getAnnotation(holder.type, type); if (hAnnotation != null) { configs.add(hAnnotation); } }); return Defaults.of(type, configs); }</code><technical_language>Typo</technical_language>

Target:
public <T extends Annotation> T getConfig(Class<T> type) { List<T> configs = new ArrayList<>(); T annotation = scanner.getAnnotation(getTargetTestClass(), type); if (annotation != null) { configs.add(annotation); } apply("getAnnotation", BACKWARD, holder -> { T hAnnotation = scanner.getAnnotation(holder.type, type); if (hAnnotation != null) { configs.add(hAnnotation); } }); return Defaults.of(type, configs); }
Source:
<code>public void preProcessModule(Module module) { module.addListener(new ApplicationListener<ApplicationPreparedEvent>() { @Override public void onApplicationEvent(ApplicationPreparedEvent event) { ZooKeeperConnection bean = getApplicationContext().getBean(ZooKeeperConnection.class); ConfigurableListableBeanFactory moduleBeanFactory = event.getApplicationContext().getBeanFactory(); <START> moduleBeanFactory.registerSingleton(XD_ZOOKEEPER_CONNECTION, bean.getClient()); <END> } }); }</code><technical_language>call xd.zookeeper.connection, ask bean.getClient(). So, xd.zookeeper.client</technical_language>

Target:
public void preProcessModule(Module module) { module.addListener(new ApplicationListener<ApplicationPreparedEvent>() { @Override public void onApplicationEvent(ApplicationPreparedEvent event) { ZooKeeperConnection bean = getApplicationContext().getBean(ZooKeeperConnection.class); ConfigurableListableBeanFactory moduleBeanFactory = event.getApplicationContext().getBeanFactory(); moduleBeanFactory.registerSingleton(XD_ZOOKEEPER_CLIENT, bean.getClient()); } }); }
Source:
<code>E parseEntry(Row<GenericTableSchema> row, Class<E> clazz) throws IllegalArgumentException { <START> if (!clazz.isAssignableFrom(LogicalSwitch.class)) throw new IllegalArgumentException("wrong entry type " + clazz + " for table " + this.getClass()); <END> return (E)LogicalSwitch.apply(parseUuid(row), parseName(row), parseTunnelKey(row), parseDescription(row)); }</code><technical_language>worth moving this parent class super.parseEntry(this.getClass()) spare rewriting this place. alternative is provide ensureClass(this.getClass())</technical_language>

Target:
E parseEntry(Row<GenericTableSchema> row, Class<E> clazz) throws IllegalArgumentException { ensureOutputClass(clazz); return (E)LogicalSwitch.apply(parseUuid(row), parseName(row), parseTunnelKey(row), parseDescription(row)); }
Source:
<code>public void testSessionTokenIdentifierRoundTrip() throws Throwable { <START> Text renewer = new Text("yarn"); <END> SessionTokenIdentifier id = new SessionTokenIdentifier( SESSION_TOKEN_KIND, new Text(), renewer, landsatUri, new MarshalledCredentials("a", "b", "c"), new EncryptionSecrets(), ""); SessionTokenIdentifier result = S3ATestUtils.roundTrip(id, null); String ids = id.toString(); assertEquals("URI in " + ids, id.getUri(), result.getUri()); assertEquals("credentials in " + ids, id.getMarshalledCredentials(), result.getMarshalledCredentials()); assertEquals(renewer, id.getRenewer()); }</code><technical_language>yarn@EXAMPLE.COM</technical_language>

Target:
public void testSessionTokenIdentifierRoundTrip() throws Throwable { Text renewer = new Text("yarn"); SessionTokenIdentifier id = new SessionTokenIdentifier( SESSION_TOKEN_KIND, new Text(), renewer, landsatUri, new MarshalledCredentials("a", "b", "c"), new EncryptionSecrets(), ""); SessionTokenIdentifier result = S3ATestUtils.roundTrip(id, null); String ids = id.toString(); assertEquals("URI in " + ids, id.getUri(), result.getUri()); assertEquals("credentials in " + ids, id.getMarshalledCredentials(), result.getMarshalledCredentials()); assertEquals("renewer in " + ids, renewer, id.getRenewer()); }
Source:
<code>public void testCompareToOfTagClass() { final SuppressionCommentFilter filter1 = new SuppressionCommentFilter(); final List<Comparable<Object>> tags1 = <START> getTagsAfterExecution(filter1, "filename", " END> final Comparable<Object> tag1 = tags1.get(0); final Comparable<Object> tag2 = tags1.get(1); final SuppressionCommentFilter filter2 = new SuppressionCommentFilter(); final List<Comparable<Object>> tags2 = getTagsAfterExecution(filter2, "filename", " final Comparable<Object> tag3 = tags2.get(0); final SuppressionCommentFilter filter3 = new SuppressionCommentFilter(); final List<Comparable<Object>> tags3 = getTagsAfterExecution(filter3, "filename", " final Comparable<Object> tag4 = tags3.get(0); assertTrue("Invalid comparing result", tag1.compareTo(tag2) < 0); assertTrue("Invalid comparing result", tag2.compareTo(tag1) > 0); assertTrue("Invalid comparing result", tag1.compareTo(tag3) < 0); assertTrue("Invalid comparing result", tag3.compareTo(tag1) > 0); assertEquals("Invalid comparing result", 0, tag1.compareTo(tag4)); }</code><technical_language>Please add overload getTagsAfterExecution lines only, get rid of unnecessary details</technical_language>

Target:
public void testCompareToOfTagClass() { final List<Comparable<Object>> tags1 = getTagsAfterExecutionOnDefaultFilter(" final Comparable<Object> tag1 = tags1.get(0); final Comparable<Object> tag2 = tags1.get(1); final List<Comparable<Object>> tags2 = getTagsAfterExecutionOnDefaultFilter(" final Comparable<Object> tag3 = tags2.get(0); final List<Comparable<Object>> tags3 = getTagsAfterExecutionOnDefaultFilter(" final Comparable<Object> tag4 = tags3.get(0); assertTrue("Invalid comparing result", tag1.compareTo(tag2) < 0); assertTrue("Invalid comparing result", tag2.compareTo(tag1) > 0); assertTrue("Invalid comparing result", tag1.compareTo(tag3) < 0); assertTrue("Invalid comparing result", tag3.compareTo(tag1) > 0); assertEquals("Invalid comparing result", 0, tag1.compareTo(tag4)); }
Source:
<code>protected void populateRoles(List<Role> roles){ Role selectedRole = null; for (Role role : roles) { if (role.getId() != null) { if (role.getId().equals(ApplicationGuids.quotaConsumer.asGuid())) { roles.remove(role); } if (role.getId().equals(ApplicationGuids.engineUser.asGuid())) { selectedRole = role; } } } <START> Collections.sort(roles, new Comparator<Role>() { <END> @Override public int compare(Role left, Role right) { return left.getname().compareTo(right.getname()); } }); getRole().setItems(roles); if (selectedRole != null) { getRole().setSelectedItem(selectedRole); } else if (roles.size() > 0){ getRole().setSelectedItem(roles.get(0)); } }</code><technical_language>RoleNameComparer</technical_language>

Target:
protected void populateRoles(List<Role> roles){ Role selectedRole = null; for (Role role : roles) { if (role.getId() != null) { if (role.getId().equals(ApplicationGuids.quotaConsumer.asGuid())) { roles.remove(role); } if (role.getId().equals(ApplicationGuids.engineUser.asGuid())) { selectedRole = role; } } } Collections.sort(roles, new Linq.RoleNameComparer()); getRole().setItems(roles); if (selectedRole != null) { getRole().setSelectedItem(selectedRole); } else if (roles.size() > 0){ getRole().setSelectedItem(roles.get(0)); } }
Source:
<code>public Optional<DateTime> getQuestionsLastViewed(Long accountId) { final GetItemRequest getRequest = new GetItemRequest(); getRequest.addKeyEntry(ACCOUNT_ID_ATTRIBUTE_NAME, new AttributeValue().withN(accountId.toString())); getRequest.setAttributesToGet(Lists.newArrayList(QUESTIONS_LAST_VIEWED_ATTRIBUTE_NAME)); getRequest.setTableName(tableName); final GetItemResult result = dynamoDB.getItem(getRequest); final Map<String, AttributeValue> attributes = result.getItem(); if (attributes != null && attributes.containsKey(QUESTIONS_LAST_VIEWED_ATTRIBUTE_NAME)) { final AttributeValue attribute = attributes.get(QUESTIONS_LAST_VIEWED_ATTRIBUTE_NAME); final String value = attribute.getN(); final long lastViewedMillis = Long.parseLong(value, 10); return Optional.of(new DateTime(lastViewedMillis, DateTimeZone.UTC)); <START> } else { <END> return Optional.absent(); } }</code><technical_language>else needed</technical_language>

Target:
public Optional<DateTime> getQuestionsLastViewed(Long accountId) { final GetItemRequest getRequest = new GetItemRequest(); getRequest.addKeyEntry(ACCOUNT_ID_ATTRIBUTE_NAME, new AttributeValue().withN(accountId.toString())); getRequest.setAttributesToGet(Lists.newArrayList(QUESTIONS_LAST_VIEWED_ATTRIBUTE_NAME)); getRequest.setTableName(tableName); final GetItemResult result = dynamoDB.getItem(getRequest); final Map<String, AttributeValue> attributes = result.getItem(); if (attributes != null && attributes.containsKey(QUESTIONS_LAST_VIEWED_ATTRIBUTE_NAME)) { final AttributeValue attribute = attributes.get(QUESTIONS_LAST_VIEWED_ATTRIBUTE_NAME); final String value = attribute.getN(); final long lastViewedMillis = Long.parseLong(value, 10); return Optional.of(new DateTime(lastViewedMillis, DateTimeZone.UTC)); } return Optional.absent(); }
Source:
<code>public void testSubsystem() throws OperationFailedException { PathAddress address = PathAddress.pathAddress(SUBSYSTEM, TEST_SUBSYSTEM); ModelNode result = readFeature(address); ModelNode feature = result.require(FEATURE); Assert.assertEquals(serializeAddress(address), feature.require(NAME).asString()); Map<String, ModelNode> params = extractParamsToMap(feature); Assert.assertEquals(2, params.size()); assertFeatureIdParam(SUBSYSTEM, TEST_SUBSYSTEM, params); assertParamWithDefault(EXTENSION, TEST_EXTENSION, params); <START> ModelNode provides = feature.require("provides"); <END> Assert.assertEquals(1, provides.asList().size()); Assert.assertEquals("subsystem-capability", provides.get(0).asString()); Assert.assertEquals(1, feature.require("refs").asList().size()); Assert.assertEquals("extension", feature.require("refs").require(0).require(FEATURE).asString()); Assert.assertTrue(feature.require("refs").require(0).require(INCLUDE).asBoolean()); ModelNode packages = feature.require("packages"); Assert.assertEquals(1, packages.asList().size()); Assert.assertEquals(TEST_EXTENSION + ".main", packages.get(0).require("package").asString()); }</code><technical_language>if some constants missing in model of read-feature operation, introduced in org.jboss.as.controller.descriptions.ModelDescriptionConstants in org.jboss.as.controller.operations.global.ReadFeatureDescriptionHandler</technical_language>

Target:
public void testSubsystem() throws OperationFailedException { PathAddress address = PathAddress.pathAddress(SUBSYSTEM, TEST_SUBSYSTEM); ModelNode result = readFeatureDescription(address); ModelNode feature = result.require(FEATURE); Assert.assertEquals(serializeAddress(address), feature.require(NAME).asString()); Map<String, ModelNode> params = extractParamsToMap(feature); Assert.assertEquals(2, params.size()); assertFeatureIdParam(SUBSYSTEM, TEST_SUBSYSTEM, params); assertParamWithDefault(EXTENSION, TEST_EXTENSION, params); ModelNode provides = feature.require(PROVIDES); Assert.assertEquals(1, provides.asList().size()); Assert.assertEquals("subsystem-capability", provides.get(0).asString()); ModelNode refs = feature.require(REFS); Assert.assertEquals(1, refs.asList().size()); Assert.assertEquals("extension", refs.require(0).require(FEATURE).asString()); Assert.assertTrue(refs.require(0).require(INCLUDE).asBoolean()); ModelNode packages = feature.require(PACKAGES); Assert.assertEquals(1, packages.asList().size()); Assert.assertEquals(TEST_EXTENSION + ".main", packages.get(0).require(PACKAGE).asString()); }
Source:
<code>public int getSize(){ int debugSize = getDebugInfo().getSize(); <START> Iterator<? extends Instruction> iter = getInstructions().iterator(); <END> while (iter.hasNext()){ iter.next(); } int lastOffset = ((VariableSizeLookaheadIterator)iter).getReaderOffset(); for (DexBackedTryBlock tryBlock: getTryBlocks()){ Iterator<? extends DexBackedExceptionHandler> tryHandlerIter = tryBlock.getExceptionHandlers().iterator(); while (tryHandlerIter.hasNext()){ tryHandlerIter.next(); } lastOffset = ((VariableSizeListIterator)tryHandlerIter).getReaderOffset(); } return debugSize + (lastOffset - codeOffset); }</code><technical_language>able skip instructions, code_item.insns_size field, instead of iterating them</technical_language>

Target:
public int getSize() { int debugSize = getDebugInfo().getSize(); int lastOffset = dexFile.readSmallUint(codeOffset + CodeItem.INSTRUCTION_COUNT_OFFSET) * 2; for (DexBackedTryBlock tryBlock: getTryBlocks()) { Iterator<? extends DexBackedExceptionHandler> tryHandlerIter = tryBlock.getExceptionHandlers().iterator(); while (tryHandlerIter.hasNext()) { tryHandlerIter.next(); } lastOffset = ((VariableSizeListIterator)tryHandlerIter).getReaderOffset(); } return debugSize + (lastOffset - codeOffset); }
Source:
<code>protected int insertDbDataInQueue(PreparedStatement preparedStatement) throws SQLException, InterruptedException { int resultCount = 0; preparedStatement.setFetchSize(getFetchSize()); ResultSet result = preparedStatement.executeQuery(); if (result.next()) { do { T obj = getTuple(result); <START> while (execute && !emitQueue.offer(obj)) { <END> Thread.sleep(DEFAULT_SLEEP_TIME); } if (isPollerPartition && rebaseOffset) { if (prevKey == null) { prevKey = extractKey(result); } else if (this.fetchedKeyAndOffset.get() == null) { Object nextKey = extractKey(result); if (!nextKey.equals(prevKey)) { fetchedKeyAndOffset.set(new MutablePair<>(prevKey, lastOffset + resultCount)); } } } resultCount++; } while (execute && result.next()); result.close(); } preparedStatement.close(); return resultCount; }</code><technical_language>part of this PR emitQueue need a LinkedBlockingDeque deque feature of adding ends removing both</technical_language>

Target:
protected int insertDbDataInQueue(PreparedStatement preparedStatement) throws SQLException, InterruptedException { int resultCount = 0; preparedStatement.setFetchSize(getFetchSize()); ResultSet result = preparedStatement.executeQuery(); while (execute && result.next()) { T obj = getTuple(result); if (obj == null) { continue; } while (execute && !emitQueue.offer(obj)) { Thread.sleep(DEFAULT_SLEEP_TIME); } if (isPollerPartition && rebaseOffset) { if (prevKey == null) { prevKey = extractKey(result); } else if (this.fetchedKeyAndOffset.get() == null) { Object nextKey = extractKey(result); if (!nextKey.equals(prevKey)) { fetchedKeyAndOffset.set(new MutablePair<>(prevKey, lastOffset + resultCount)); } } } resultCount++; } result.close(); preparedStatement.close(); return resultCount; }
Source:
<code>public String getSemanticObjectLabel(Object object) { <START> ResourceAttachmentChange resourceAttachmentChange = (ResourceAttachmentChange)object; <END> final Match match = resourceAttachmentChange.getMatch(); String value = itemDelegator.getText(match.getLeft()); if (isNullOrEmpty(value)) { value = itemDelegator.getText(match.getRight()); } if (isNullOrEmpty(value)) { value = itemDelegator.getText(match.getOrigin()); } if (isNullOrEmpty(value)) { value = super.getText(object); } return value; }</code><technical_language>resourceAttachmentChange final</technical_language>

Target:
public String getSemanticObjectLabel(Object object) { final ResourceAttachmentChange resourceAttachmentChange = (ResourceAttachmentChange)object; return doGetSemanticObjectLabel(resourceAttachmentChange, object); }
Source:
<code>public static String getFileMimeType(final File file) throws IOException { <START> if (file != null) { <END> final Tika tika = new Tika(); return tika.detect(file.getInputStream()); } return null; }</code><technical_language>This is OK this is a public method safer throw illegal argument exception if a file? all, MIME type of null is null</technical_language>

Target:
public static String getFileMimeType(final File file) { if (file != null) { try { final Tika tika = new Tika(); return tika.detect(file.getInputStream()); } catch (IOException ex) { LOG.error("Invalid file, name " + file.getName(), ex); } } return null; }
Source:
<code><START> public static void main(String[] args) { <END> junit.textui.TestRunner.run(GDI32Test.class); }</code><technical_language>In general I recommend Junit 4.x annotations - e.g., _@Test_ for newly written tests. this end, consider extending _AbstractWin32TestSupport_ attaching _@Test_ annotations</technical_language>

Target:
public static void main(String[] args) { JUnitCore jUnitCore = new JUnitCore(); jUnitCore.run(GDI32UtilTest.class); }
Source:
<code>public static void setEnv(Map<String, String> newVariables) { Map<String, String> newenv = new HashMap<>(); newenv.putAll(System.getenv()); newenv.putAll(newVariables); try { Class<?> processEnvironmentClass = Class.forName(PROCESS_ENVIRONMENT); Field theEnvironmentField = processEnvironmentClass.getDeclaredField(THE_ENVIRONMENT_FILED); theEnvironmentField.setAccessible(true); Map<String, String> env = (Map<String, String>) theEnvironmentField.get(null); env.putAll(newenv); Field theCaseInsensitiveEnvironmentField = processEnvironmentClass .getDeclaredField(THE_CASE_INSENSITIVE_ENVIRONMENT); theCaseInsensitiveEnvironmentField.setAccessible(true); Map<String, String> cienv = (Map<String, String>) theCaseInsensitiveEnvironmentField.get(null); cienv.putAll(newenv); } catch (NoSuchFieldException e) { Class[] classes = Collections.class.getDeclaredClasses(); Map<String, String> env = System.getenv(); Arrays.asList(classes).stream().filter(cl -> COLLECTIONS_UNMODIFIABLE_MAP.equals(cl.getName())).forEach( (cl) -> { try { Field field = cl.getDeclaredField(FIELD_M); field.setAccessible(true); <START> Object obj = field.get(env); <END> Map<String, String> map = (Map<String, String>) obj; map.clear(); map.putAll(newenv); } catch (IllegalAccessException | NoSuchFieldException ex) { logger.error("Unable to set environment variable via unmodifiable map", ex); } } ); } catch (ClassNotFoundException | IllegalAccessException e) { logger.error("Unable to set environment variable", e); } }</code><technical_language>cast this a map</technical_language>

Target:
public static void setEnv(Map<String, String> newVariables) { Map<String, String> newenv = new HashMap<>(); newenv.putAll(System.getenv()); newenv.putAll(newVariables); try { Class<?> processEnvironmentClass = Class.forName(PROCESS_ENVIRONMENT); Field theEnvironmentField = processEnvironmentClass.getDeclaredField(THE_ENVIRONMENT_FILED); theEnvironmentField.setAccessible(true); Map<String, String> env = (Map<String, String>) theEnvironmentField.get(null); env.putAll(newenv); Field theCaseInsensitiveEnvironmentField = processEnvironmentClass .getDeclaredField(THE_CASE_INSENSITIVE_ENVIRONMENT); theCaseInsensitiveEnvironmentField.setAccessible(true); Map<String, String> cienv = (Map<String, String>) theCaseInsensitiveEnvironmentField.get(null); cienv.putAll(newenv); } catch (NoSuchFieldException e) { Class[] classes = Collections.class.getDeclaredClasses(); Map<String, String> env = System.getenv(); Arrays.asList(classes).stream().filter(cl -> COLLECTIONS_UNMODIFIABLE_MAP.equals(cl.getName())).forEach( (cl) -> { try { Field field = cl.getDeclaredField(FIELD_M); field.setAccessible(true); Map<String, String> map = (Map<String, String>) field.get(env); map.clear(); map.putAll(newenv); } catch (IllegalAccessException | NoSuchFieldException ex) { logger.error("Unable to set environment variable via unmodifiable map", ex); } } ); } catch (ClassNotFoundException | IllegalAccessException e) { logger.error("Unable to set environment variable", e); } }
Source:
<code>public boolean forgetPortMapping(String publicIpId, int publicPort) { PortMapping old; synchronized (mutex) { old = mappings.remove(makeKey(publicIpId, publicPort)); <START> emitAssociationDeletedEvent(associationMetadataFromPortMapping(old)); <END> log.debug("cleared port mapping for "+publicIpId+":"+publicPort+" - "+old); } if (old != null) onChanged(); return (old != null); }</code><technical_language>Guard this if (old != null) - i.e. removed</technical_language>

Target:
public boolean forgetPortMapping(String publicIpId, int publicPort) { PortMapping old; synchronized (mutex) { old = mappings.remove(makeKey(publicIpId, publicPort)); if (old != null) { emitAssociationDeletedEvent(associationMetadataFromPortMapping(old)); } log.debug("cleared port mapping for "+publicIpId+":"+publicPort+" - "+old); } if (old != null) onChanged(); return (old != null); }
Source:
<code><START> public List<String> getAvailableCatalogs() throws IllegalArgumentException { <END> try { return OPACConfig.getCatalogs(); } catch (IllegalArgumentException e) { logger.error(e.getLocalizedMessage()); throw new IllegalArgumentException("Error: no supported OPACs found in configuration file!"); } }</code><technical_language>need define "throws IllegalArgumentException" in function. extends RuntimeException. public List<String> getAvailableSearchFields(String opac) {</technical_language>

Target:
public List<String> getAvailableCatalogs() { try { return OPACConfig.getCatalogs(); } catch (IllegalArgumentException e) { logger.error(e.getLocalizedMessage()); throw new IllegalArgumentException("Error: no supported OPACs found in configuration file!"); } }
Source:
<code>private boolean isValid(Schema schema, IndexingConfig indexingConfig) { List<String> sortedColumns = indexingConfig.getSortedColumn(); boolean isValid = true; if (CollectionUtils.isNotEmpty(sortedColumns)) { final String sortedColumn = sortedColumns.get(0); if (sortedColumns.size() > 1) { _logger.warn("More than one sorted column configured. Using {}", sortedColumn); } FieldSpec fieldSpec = schema.getFieldSpecFor(sortedColumn); if (!fieldSpec.isSingleValueField()) { _logger.error("Cannot configure multi-valued column as sorted column", sortedColumn); isValid = false; } } try { SchemaUtils.validate(schema); } catch (Exception e) { <START> isValid = false; <END> } return isValid; }</code><technical_language>Log exception</technical_language>

Target:
private boolean isValid(Schema schema, IndexingConfig indexingConfig) { List<String> sortedColumns = indexingConfig.getSortedColumn(); boolean isValid = true; if (CollectionUtils.isNotEmpty(sortedColumns)) { final String sortedColumn = sortedColumns.get(0); if (sortedColumns.size() > 1) { _logger.warn("More than one sorted column configured. Using {}", sortedColumn); } FieldSpec fieldSpec = schema.getFieldSpecFor(sortedColumn); if (!fieldSpec.isSingleValueField()) { _logger.error("Cannot configure multi-valued column as sorted column", sortedColumn); isValid = false; } } try { SchemaUtils.validate(schema); } catch (Exception e) { _logger.error("Caught exception while validating schema: {}", schema.getSchemaName(), e); isValid = false; } return isValid; }
Source:
<code>private void parseHeader(ParsableByteArray data) { String currentLine; while ((currentLine = data.readLine()) != null) { if (currentLine.startsWith("PlayResX:")) { <START> playResX = Integer.valueOf(currentLine.substring(9).trim()); <END> } if (currentLine.startsWith("PlayResY:")) { playResY = Integer.valueOf(currentLine.substring(9).trim()); } if (currentLine.startsWith("[Events]")) { return; } } }</code><technical_language>I a *tiny* bit clearer string literal instead of a 'magic' length (saves a future reader manually counting number of characters in "PlayResX:" :)) playResX = Integer.valueOf(currentLine.substring("PlayResX:".length()).trim());</technical_language>

Target:
private void parseHeader(ParsableByteArray data) { String currentLine; while ((currentLine = data.readLine()) != null) { if (currentLine.startsWith("PlayResX:")) { playResX = Integer.valueOf(currentLine.substring("PlayResX:".length()).trim()); } if (currentLine.startsWith("PlayResY:")) { playResY = Integer.valueOf(currentLine.substring("PlayResY:".length()).trim()); } if (currentLine.startsWith("[Events]")) { return; } } }
Source:
<code>public void closeMoreInfoAboutEqualShareModal() { WebElement closeButton = browser.driver.findElement(By <START> .xpath(" END> waitForElementToBeClickable(closeButton); click(closeButton); waitForElementToDisappear(By.id("more-info-equal-share-modal")); }</code><technical_language>line wrappings more readable (i.e. prefer line break higher levels) java WebElement closeButton = browser.driver.findElement( By.xpath("//div[@id='more-info-equal-share-modal']//button[@class='close']")); java WebElement closeButton = browser.driver .findElement(By.xpath("//div[@id='more-info-equal-share-modal']//button[@class='close']")); extract a local variable java String closeButtonPath = "//div[@id='more-info-equal-share-modal']//button[@class='close']"; WebElement closeButton = browser.driver. findElement(By.xpath(closeButtonPath)); I 3rd option, I feel extracted a utility method getElementFromPath(String):WebElement. exists somewhere, in parent class</technical_language>

Target:
private void closeMoreInfoAboutEqualShareModal() { WebElement closeButton = browser.driver .findElement(By.xpath(" waitForElementToBeClickable(closeButton); click(closeButton); waitForElementToDisappear(By.id("more-info-equal-share-modal")); }
Source:
<code>protected VDSReturnValue getAllVmStats() { VDSReturnValue returnValue = new VDSReturnValue(); try { V1VirtualMachineInstanceList result = listVMIs(vdsManager.getVdsName()); log.debug("got:\n{}", result); List<V1VirtualMachineInstance> vmis = result.getItems(); List<VdsmVm> vms = vmis.stream() .map(this::toVdsmVm) .filter(Objects::nonNull) .collect(Collectors.toList()); returnValue.setReturnValue(vms); returnValue.setSucceeded(true); } catch (Exception e) { if (ApiException.class.isInstance(e)) { <START> KubevirtUtils.auditAuthorizationIssues((ApiException) e, auditLogDirector, providerDao.get(vdsManager.getClusterId())); <END> } log.error("failed to retrieve kubevirt VMs for node {}: {}", vdsManager.getVdsName(), ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception", e); } return returnValue; }</code><technical_language>pls formatter</technical_language>

Target:
protected VDSReturnValue getAllVmStats() { VDSReturnValue returnValue = new VDSReturnValue(); try { V1VirtualMachineInstanceList result = listVMIs(vdsManager.getVdsName()); log.debug("got:\n{}", result); List<V1VirtualMachineInstance> vmis = result.getItems(); List<VdsmVm> vms = vmis.stream() .map(this::toVdsmVm) .filter(Objects::nonNull) .collect(Collectors.toList()); returnValue.setReturnValue(vms); returnValue.setSucceeded(true); } catch (Exception e) { if (ApiException.class.isInstance(e)) { KubevirtAuditUtils.auditAuthorizationIssues((ApiException) e, auditLogDirector, providerDao.get(vdsManager.getClusterId())); } log.error("failed to retrieve kubevirt VMs for node {}: {}", vdsManager.getVdsName(), ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception", e); } return returnValue; }
Source:
<code>public boolean validateKeyStore(KeyStore store) { try { Enumeration<String> aliases = store.aliases(); boolean res = true; while(aliases.hasMoreElements()) { String alias = aliases.nextElement(); logger.debug("Alias : " + alias); res = res && validateKeyFromKeyStore(store, alias); } logger.debug("KeyStore is valid: " + res); return res; } catch (KeyStoreException e) { <START> logger.error("The KeyStore is not initialized", e); <END> return false; } }</code><technical_language>in form of a Messages.getString(...) message for i18n</technical_language>

Target:
public void validateKeyStore(KeyStore store) throws KeyStoreException, CertificateExpiredException, CertificateNotYetValidException { Enumeration<String> aliases = store.aliases(); while(aliases.hasMoreElements()) { String alias = aliases.nextElement(); validateKeyFromKeyStore(store, alias); } }