auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Override public boolean apply(BinaryObject bo) { <START> System.out.println("CompositePredicate on " + ignite.configuration().getIgniteInstanceName()); <END> for (BinaryPredicate predicate : predicates) { predicate.ignite = ignite; if (!predicate.apply(bo)) return false; } return true; }</code><technical_language>is "System.out.println" need</technical_language>

Target:
@Override public boolean apply(BinaryObject bo) { log.info("CompositePredicate on " + ignite.configuration().getIgniteInstanceName()); for (BinaryPredicate predicate : predicates) { predicate.ignite = ignite; if (!predicate.apply(bo)) return false; } return true; }
Source:
<code>private void addSkyNodes(RenderGraph renderGraph) { Node backdropNode = new BackdropNode(context); renderGraph.addNode(backdropNode, "backdropNode"); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); FBOConfig hazeIntermediateConfig = new FBOConfig(HazeNode.INTERMEDIATE_HAZE_FBO_URI, ONE_16TH_SCALE, FBO.Type.DEFAULT); FBO hazeIntermediateFbo = displayResolutionDependentFBOs.request(hazeIntermediateConfig); HazeNode hazeIntermediateNode = new HazeNode(context, displayResolutionDependentFBOs.getGBufferPair().getLastUpdatedFbo(), hazeIntermediateFbo); renderGraph.addNode(hazeIntermediateNode, "hazeIntermediateNode"); FBOConfig hazeFinalConfig = new FBOConfig(HazeNode.FINAL_HAZE_FBO_URI, ONE_32TH_SCALE, FBO.Type.DEFAULT); FBO hazeFinalFbo = displayResolutionDependentFBOs.request(hazeFinalConfig); HazeNode hazeFinalNode = new HazeNode(context, hazeIntermediateFbo, hazeFinalFbo); renderGraph.addNode(hazeFinalNode, "hazeFinalNode"); <START> Node lastUpdatedGBufferClearingNode = renderGraph.findNode(new SimpleUri("engine:lastUpdatedGBufferClearingNode")); <END> renderGraph.connect(lastUpdatedGBufferClearingNode, backdropNode); renderGraph.connect(backdropNode, hazeIntermediateNode); renderGraph.connect(hazeIntermediateNode, hazeFinalNode); }</code><technical_language>wondering if additional findNode method simply takes a string. Internally convert string a SimpleUri call existing method. do think</technical_language>

Target:
private void addSkyNodes(RenderGraph renderGraph) { Node backdropNode = new BackdropNode(context); renderGraph.addNode(backdropNode, "backdropNode"); FBOConfig hazeIntermediateConfig = new FBOConfig(HazeNode.INTERMEDIATE_HAZE_FBO_URI, ONE_16TH_SCALE, FBO.Type.DEFAULT); FBO hazeIntermediateFbo = displayResolutionDependentFBOs.request(hazeIntermediateConfig); HazeNode hazeIntermediateNode = new HazeNode(context, displayResolutionDependentFBOs.getGBufferPair().getLastUpdatedFbo(), hazeIntermediateFbo); renderGraph.addNode(hazeIntermediateNode, "hazeIntermediateNode"); FBOConfig hazeFinalConfig = new FBOConfig(HazeNode.FINAL_HAZE_FBO_URI, ONE_32TH_SCALE, FBO.Type.DEFAULT); FBO hazeFinalFbo = displayResolutionDependentFBOs.request(hazeFinalConfig); HazeNode hazeFinalNode = new HazeNode(context, hazeIntermediateFbo, hazeFinalFbo); renderGraph.addNode(hazeFinalNode, "hazeFinalNode"); Node lastUpdatedGBufferClearingNode = renderGraph.findNode("engine:lastUpdatedGBufferClearingNode"); renderGraph.connect(lastUpdatedGBufferClearingNode, backdropNode, hazeIntermediateNode, hazeFinalNode); }
Source:
<code>public void insert(Realm realm, Collection<? extends RealmModel> objects) { <START> if (objects.isEmpty()) { <END> return; } RealmProxyMediator mediator = getMediator(Util.getOriginalModelClass(Util.getOriginalModelClass(objects.iterator().next().getClass()))); mediator.insert(realm, objects); }</code><technical_language>IMO move checks Realm class instead is null check is. I avoid spreading out multiple classes</technical_language>

Target:
public void insert(Realm realm, Collection<? extends RealmModel> objects) { RealmProxyMediator mediator = getMediator(Util.getOriginalModelClass(Util.getOriginalModelClass(objects.iterator().next().getClass()))); mediator.insert(realm, objects); }
Source:
<code>public static Map<String, Object> visitParameters(Visit visit) { Map<String, Object> visitParameters = new HashMap<>(); visitParameters.put(EventKeys.VISIT_ID, visit.getUuid()); visitParameters.put(EventKeys.VISIT_START_DATETIME, visit.getStartDatetime()); visitParameters.put(EventKeys.VISIT_END_DATETIME, visit.getEndDatetime()); visitParameters.put(EventKeys.VISIT_TYPE, visit.getVisitType().getUuid()); <START> visitParameters.put(EventKeys.VISIT_TYPE, null); <END> if (visit.getLocation() != null) { visitParameters.put(EventKeys.LOCATION_ID, visit.getLocation().getUuid()); } else { visitParameters.put(EventKeys.LOCATION_ID, null); } return visitParameters; }</code><technical_language>do null in event parameter</technical_language>

Target:
public static Map<String, Object> visitParameters(Visit visit) { Map<String, Object> visitParameters = new HashMap<>(); visitParameters.put(EventKeys.VISIT_ID, visit.getUuid()); visitParameters.put(EventKeys.VISIT_START_DATETIME, visit.getStartDatetime()); visitParameters.put(EventKeys.VISIT_STOP_DATETIME, visit.getStopDatetime()); visitParameters.put(EventKeys.VISIT_TYPE, visit.getVisitType().getUuid()); if (visit.getLocation() != null) { visitParameters.put(EventKeys.LOCATION_ID, visit.getLocation().getUuid()); } return visitParameters; }
Source:
<code>private <L, M extends MeasurementType<L>> Metric buildMetric(MeasurementInstance<L, M> m, MeasurementUnit metricUnits) { Metric.Builder mb = Metric.builder() .name(m.getName().getNameString()) .type(m.getType().getName().getNameString()); if (metricUnits != null) { mb.unit(MetricUnit.valueOf(metricUnits.name())); } m.getProperties().forEach((k, v) -> mb.property(k, v.toString())); mb.property("hawkular.metric.type", m.getType().getMetricType().name()); <START> mb.property("hawkular.metric.typeId", m.getType().getID().getIDString()); <END> return mb.build(); }</code><technical_language>I wanted check irc: want typeId here, metric Id (the string MT~feed~resource~etc. I remember pattern)</technical_language>

Target:
private <L, M extends MeasurementType<L>> Metric buildMetric(MeasurementInstance<L, M> m, MeasurementUnit metricUnits) { Metric.Builder mb = Metric.builder() .name(m.getName().getNameString()) .type(m.getType().getName().getNameString()); if (metricUnits != null) { mb.unit(MetricUnit.valueOf(metricUnits.name())); } m.getProperties().forEach((k, v) -> mb.property(k, v.toString())); mb.property("hawkular.metric.type", m.getType().getMetricType().name()); mb.property("hawkular.metric.typeId", m.getType().getID().getIDString()); mb.property("hawkular.metric.id", m.getID().getIDString()); return mb.build(); }
Source:
<code>public Result visit(Project e) { Result x = visitChild(0, e.getInput()); parseCorrelTable(e, x); if (isStar(e.getChildExps(), e.getInput().getRowType(), e.getRowType())) { return x; } final Builder builder = x.builder(e, Clause.SELECT); final List<SqlNode> selectList = new ArrayList<>(); <START> boolean checkNull = isCastNullNeeded(stack); <END> for (RexNode ref : e.getChildExps()) { SqlNode sqlExpr = builder.context.toSql(null, ref); if (checkNull && SqlUtil.isNullLiteral(sqlExpr, false)) { sqlExpr = castNullType(sqlExpr, e.getRowType().getFieldList().get(selectList.size())); } addSelect(selectList, sqlExpr, e.getRowType()); } builder.setSelect(new SqlNodeList(selectList, POS)); return builder.result(); }</code><technical_language>consistent, please declare checkNull variable final</technical_language>

Target:
public Result visit(Project e) { Result x = visitChild(0, e.getInput()); parseCorrelTable(e, x); if (isStar(e.getChildExps(), e.getInput().getRowType(), e.getRowType())) { return x; } final Builder builder = x.builder(e, Clause.SELECT); final List<SqlNode> selectList = new ArrayList<>(); for (RexNode ref : e.getChildExps()) { SqlNode sqlExpr = builder.context.toSql(null, ref); if (SqlUtil.isNullLiteral(sqlExpr, false)) { sqlExpr = castNullType(sqlExpr, e.getRowType().getFieldList().get(selectList.size())); } addSelect(selectList, sqlExpr, e.getRowType()); } builder.setSelect(new SqlNodeList(selectList, POS)); return builder.result(); }
Source:
<code>public void refresh() throws IOException { <START> synchronized (this) { <END> long now = System.currentTimeMillis(); if ((now - lastRefreshTime) > TimeUnit.SECONDS.toMillis(1)) { lastRefreshTime = now; credentials.refresh(); } } }</code><technical_language>Upstream is thread-safe, this needed</technical_language>

Target:
public void refresh() throws IOException { synchronized (this) { if (refreshStopwatch.elapsed().compareTo(Duration.ofSeconds(1)) > 0) { credentials.refresh(); refreshStopwatch.reset().start(); } } }
Source:
<code>public static void beforeClass() throws Exception { sLocalAlluxioJobCluster = new LocalAlluxioJobCluster(); sLocalAlluxioJobCluster.setProperty(PropertyKey.JOB_MASTER_WORKER_HEARTBEAT_INTERVAL, "25ms"); sLocalAlluxioJobCluster.start(); <START> sFileSystem = sLocalAlluxioClusterResource.get().getClient(); <END> }</code><technical_language>do this in before(). non-static remove here</technical_language>

Target:
public static void beforeClass() throws Exception { sLocalAlluxioJobCluster = new LocalAlluxioJobCluster(); sLocalAlluxioJobCluster.setProperty(PropertyKey.JOB_MASTER_WORKER_HEARTBEAT_INTERVAL, "25ms"); sLocalAlluxioJobCluster.start(); }
Source:
<code><START> public void testIsDrawable_InvalidUserTask() throws Exception { <END> testIsDrawable(CaseManagementDiagram.class, UserTask.class, false); }</code><technical_language>Exception is thrown</technical_language>

Target:
public void testIsDrawable_InvalidUserTask() { testIsDrawable(CaseManagementDiagram.class, UserTask.class, false); }
Source:
<code>public int getSize() throws IOException { File file = directory(); if (file == null) { return 0; } String files[] = file.list(); int keycount = 0; if (files != null) { for (String file1 : files) { if (file1.endsWith (FILE_EXT)) { <START> keycount++; <END> } } } return keycount; }</code><technical_language>file1 odd here. change file dir file for consistency other for loops</technical_language>

Target:
public int getSize() throws IOException { File dir = directory(); if (dir == null) { return 0; } String files[] = dir.list(); int keycount = 0; if (files != null) { for (String file : files) { if (file.endsWith(FILE_EXT)) { keycount++; } } } return keycount; }
Source:
<code>public Song loadSongData(SongMetadata metadata) throws SongNotFoundException { <START> String[] proj = { MediaStore.Audio.Media._ID, <END> MediaStore.Audio.Media.DATA, MediaStore.Video.Media.SIZE }; String selection = MediaStore.Audio.Media._ID + "=" + Long.toString(metadata.getId()); Cursor cursor = this.activity.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, proj, selection, null, null); Song song = null; if (cursor.moveToFirst()) { song = new Song(metadata); song.setFilePath(cursor.getString(1)); song.setSize(cursor.getLong(2)); } cursor.close(); if (song == null) { throw new SongNotFoundException("Song not found: " + metadata.getArtist() + " - " + metadata.getTitle()); } return song; }</code><technical_language>clean</technical_language>

Target:
public Song loadSongData(SongMetadata metadata) throws SongNotFoundException { String[] proj = {ID, PATH, SIZE}; String selection = ID + "=" + Long.toString(metadata.getId()); Cursor cursor = this.activity.getContentResolver().query(EC_URI, proj, selection, null, null); try { Song song = null; if (cursor.moveToFirst()) { song = new Song(metadata); song.setFilePath(cursor.getString(cursor.getColumnIndex(PATH))); song.setSize(cursor.getLong(cursor.getColumnIndex(SIZE))); } if (song == null) { throw new SongNotFoundException("Song not found: " + metadata.getArtist() + " - " + metadata.getTitle()); } return song; } finally { if (cursor != null) { cursor.close(); } } }
Source:
<code>private void verifyTimes() { assertEquals((long) (task1.getDuration() + task2.getDuration()), (long) task3.getStartTime()); assertEquals((long) (task1.getDuration() + task2.getDuration() + task3.getDuration()), (long) task3.getEndTime()); assertEquals((long) (task1.getDuration() + task2.getDuration() + task3.getDuration()), (long) task4.getStartTime()); assertEquals((long) (task1.getDuration() + task2.getDuration() + task3.getDuration() + task4.getDuration()), (long) task4.getEndTime()); assertEquals((long) (task1.getDuration() + task2.getDuration()) + task3.getDuration() + task4.getDuration(), (long) task5.getStartTime()); assertEquals((long) (task1.getDuration() + task2.getDuration()) + task3.getDuration() + task4.getDuration() + task5.getDuration(), (long) task5.getEndTime()); Stream.of(task3, task4, task5).forEach(task -> { <START> verify(scoreDirector).beforeVariableChanged(task, "startTime"); verify(scoreDirector).afterVariableChanged(task, "startTime"); verify(scoreDirector).beforeVariableChanged(task, "endTime"); verify(scoreDirector).afterVariableChanged(task, "endTime"); <END> }); }</code><technical_language>If this fails, I difficult figure out task (task3, task4, task5) failed verification. (Line number that, exception message useful.)</technical_language>

Target:
private void verifyTimes() { assertEquals((long) (task1.getDurationInMinutes() + task2.getDurationInMinutes()), (long) task3.getStartTimeInMinutes()); assertEquals((long) (task1.getDurationInMinutes() + task2.getDurationInMinutes() + task3.getDurationInMinutes()), (long) task3.getEndTimeInMinutes()); assertEquals((long) (task1.getDurationInMinutes() + task2.getDurationInMinutes() + task3.getDurationInMinutes()), (long) task4.getStartTimeInMinutes()); assertEquals((long) (task1.getDurationInMinutes() + task2.getDurationInMinutes() + task3.getDurationInMinutes() + task4.getDurationInMinutes()), (long) task4.getEndTimeInMinutes()); assertEquals((long) (task1.getDurationInMinutes() + task2.getDurationInMinutes()) + task3.getDurationInMinutes() + task4.getDurationInMinutes(), (long) task5.getStartTimeInMinutes()); assertEquals((long) (task1.getDurationInMinutes() + task2.getDurationInMinutes()) + task3.getDurationInMinutes() + task4.getDurationInMinutes() + task5.getDurationInMinutes(), (long) task5.getEndTimeInMinutes()); Stream.of(task3, task4, task5).forEach(task -> { verify(scoreDirector).beforeVariableChanged(task, Task.START_TIME_IN_MINUTES); verify(scoreDirector).afterVariableChanged(task, Task.START_TIME_IN_MINUTES); verify(scoreDirector).beforeVariableChanged(task, Task.END_TIME_IN_MINUTES); verify(scoreDirector).afterVariableChanged(task, Task.END_TIME_IN_MINUTES); }); }
Source:
<code>private static ArrayList<String> readSeverityReason(JsonReader reader) throws IOException { reader.beginObject(); String type = null; String attributeValue = null; while (reader.hasNext()) { String name = reader.nextName(); <START> switch (name) { <END> case "type": type = reader.nextString(); break; case "attributes": reader.beginObject(); reader.nextName(); attributeValue = reader.nextString(); reader.endObject(); break; default: reader.skipValue(); break; } } reader.endObject(); ArrayList<String> values = new ArrayList<>(); if (type != null) { values.add(type); } else { throw new IOException("Severity Reason type is required"); } if (attributeValue != null) { values.add(attributeValue); } return values; }</code><technical_language>do switch (reader.nextName()) { name variable is</technical_language>

Target:
private static ArrayList<String> readSeverityReason(JsonReader reader) throws IOException { reader.beginObject(); String type = null; String attributeValue = null; while (reader.hasNext()) { switch (reader.nextName()) { case "type": type = reader.nextString(); break; case "attributes": reader.beginObject(); reader.nextName(); attributeValue = reader.nextString(); reader.endObject(); break; default: reader.skipValue(); break; } } reader.endObject(); ArrayList<String> values = new ArrayList<>(); if (type != null) { values.add(type); } else { throw new IOException("Severity Reason type is required"); } if (attributeValue != null) { values.add(attributeValue); } return values; }
Source:
<code>private List<RepresentationDescriptionItemImpl> getRepresentationDescriptionsItems() { List<RepresentationDescriptionItemImpl> representationItemList = new ArrayList<>(); Collection<Viewpoint> availableViewpoints = ViewpointHelper.getAvailableViewpoints(session); for (Viewpoint viewpoint : availableViewpoints) { EList<RepresentationDescription> ownedRepresentations = viewpoint.getOwnedRepresentations(); for (RepresentationDescription representationDescription : ownedRepresentations) { <START> IFile airdFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(session.getSessionResource().getURI().toPlatformString(true))); <END> representationItemList.add(new RepresentationDescriptionItemImpl(session, representationDescription, new ViewpointItemImpl(session, viewpoint, airdFile), viewpoint)); } } return representationItemList; }</code><technical_language>"for" avoid call this code times</technical_language>

Target:
private List<RepresentationDescriptionItemImpl> getRepresentationDescriptionsItems() { List<RepresentationDescriptionItemImpl> representationItemList = new ArrayList<>(); Collection<Viewpoint> availableViewpoints = ViewpointHelper.getAvailableViewpoints(session); for (Viewpoint viewpoint : availableViewpoints) { EList<RepresentationDescription> ownedRepresentations = viewpoint.getOwnedRepresentations(); IFile airdFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(session.getSessionResource().getURI().toPlatformString(true))); for (RepresentationDescription representationDescription : ownedRepresentations) { representationItemList.add(new RepresentationDescriptionItemImpl(session, representationDescription, new ViewpointItemImpl(session, viewpoint, airdFile), viewpoint)); } } return representationItemList; }
Source:
<code>private static boolean doesConfigMethodPassGroupFilters(ConfigurationMethod cm, ITestNGMethod tm) { String[] groupFilters = cm.getGroupFilters(); if (groupFilters == null || groupFilters.length == 0) { return true; } String[] groups = tm.getGroups(); if (groups == null || groups.length == 0) { return false; } <START> HashSet<String> groupSet = new HashSet<>(Arrays.asList(groups)); <END> groupSet.retainAll(new HashSet<>(Arrays.asList(groupFilters))); return !groupSet.isEmpty(); }</code><technical_language>a builder method TestNG Collections</technical_language>

Target:
private static boolean doesConfigMethodPassGroupFilters(ConfigurationMethod cm, ITestNGMethod tm) { String[] groupFilters = cm.getGroupFilters(); if (groupFilters.length == 0) { return true; } String[] groups = tm.getGroups(); if (groups.length == 0) { return false; } return !Collections.disjoint(Sets.newHashSet(groups), Sets.newHashSet(groupFilters)); }
Source:
<code>private String findLongestSuffix(String name, String[] suffixes) { String usedPrefix= ""; int bestLen= 0; <START> for (String suffixe : suffixes) { <END> if (name.endsWith(suffixe)) { if (suffixe.length() > bestLen) { bestLen= suffixe.length(); usedPrefix= suffixe; } } } return usedPrefix; }</code><technical_language>rename suffix</technical_language>

Target:
private String findLongestSuffix(String name, String[] suffixes) { String usedPrefix= ""; int bestLen= 0; for (String suffix : suffixes) { if (name.endsWith(suffix)) { if (suffix.length() > bestLen) { bestLen= suffix.length(); usedPrefix= suffix; } } } return usedPrefix; }
Source:
<code>public RepositoryConfig getConfig() { <START> synchronized (configLock) { <END> if (userConfig.isOutdated() || config.isOutdated()) try { loadConfig(); } catch (IOException e) { throw new RuntimeException(e); } return config; } }</code><technical_language>Locking configuration necessary. FileBasedConfig extends Config, Config is thread-safe atomic references. need determine if file needs refreshed, if so, run load() method pull in disk</technical_language>

Target:
public RepositoryConfig getConfig() { if (userConfig.isOutdated()) { try { loadUserConfig(); } catch (IOException e) { throw new RuntimeException(e); } } if (config.isOutdated()) { try { loadConfig(); } catch (IOException e) { throw new RuntimeException(e); } } return config; }
Source:
<code>@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_overhaul, container, false); unbinder = ButterKnife.bind(this, view); viewPager.setAdapter(new NavTabViewPagerAdapter(getFragmentManager())); tabLayout.setupWithViewPager(viewPager); viewPager.addOnPageChangeListener(pagerChangeListener); <START> viewPager.post(new <END> Runnable() { @Override public void run() { setToolbarForCurrentFragment(); } }); return view; }</code><technical_language>Is avoid this initial kickoff setting listener set adapter</technical_language>

Target:
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_overhaul, container, false); unbinder = ButterKnife.bind(this, view); viewPager.addOnPageChangeListener(pagerChangeListener); viewPager.setAdapter(new NavTabViewPagerAdapter(getChildFragmentManager())); tabLayout.setupWithViewPager(viewPager); return view; }
Source:
<code>public LlapManagementProtocolClientImpl create(LlapServiceInstance serviceInstance) { <START> LlapManagementProtocolClientImpl client = new LlapManagementProtocolClientImpl(conf, serviceInstance.getHost(), <END> serviceInstance.getManagementPort(), retryPolicy, socketFactory); return client; }</code><technical_language>storing in client instead of returning (which consistent basicInstance)</technical_language>

Target:
public LlapManagementProtocolClientImpl create(LlapServiceInstance serviceInstance) { return new LlapManagementProtocolClientImpl(conf, serviceInstance.getHost(), serviceInstance.getManagementPort(), retryPolicy, socketFactory); }
Source:
<code>public void log(Log logger, String message, Throwable t) { if (t instanceof ShutdownSignalException) { ShutdownSignalException cause = (ShutdownSignalException) t; if (RabbitUtils.isExclusiveUseChannelClose(cause)) { if (logger.isWarnEnabled()) { logger.warn(message + ": " + cause.toString()); } } else if (!RabbitUtils.isNormalChannelClose(cause)) { logger.error(message + ": " + cause.getMessage()); } } else { <START> logger.error("Unexpected invocation of " + this.getClass() + ", with message: " + message, t); <END> } }</code><technical_language>is...Enable() patter for error()? if logger config for FATAL? (Yes, this is existing code, still...)</technical_language>

Target:
public void log(Log logger, String message, Throwable t) { if (t instanceof ShutdownSignalException) { ShutdownSignalException cause = (ShutdownSignalException) t; if (RabbitUtils.isExclusiveUseChannelClose(cause)) { if (logger.isWarnEnabled()) { logger.warn(message + ": " + cause.toString()); } } else if (!RabbitUtils.isNormalChannelClose(cause)) { logger.error(message + ": " + cause.getMessage()); } } else { if (logger.isErrorEnabled()) { logger.error("Unexpected invocation of " + this.getClass() + ", with message: " + message, t); } } }
Source:
<code>public AdminTokenCache() { CacheManager singletonManager; try { InputStream inputStream = this.getClass().getResourceAsStream("/ehcache.xml"); singletonManager = CacheManager.newInstance(inputStream); } catch (Exception e) { singletonManager = CacheManager.create(); singletonManager.addCache(CACHE_NAME); cache.getCacheConfiguration(); cache = singletonManager.getCache(CACHE_NAME); CacheConfiguration cacheConfiguration = cache.getCacheConfiguration(); <START> cacheConfiguration.setTimeToIdleSeconds(1200); <END> cacheConfiguration.setTimeToLiveSeconds(1200); } cache = singletonManager.getCache(CACHE_NAME); }</code><technical_language>Magic number</technical_language>

Target:
public AdminTokenCache() { CacheManager singletonManager; try { InputStream inputStream = this.getClass().getResourceAsStream("/ehcache.xml"); singletonManager = CacheManager.newInstance(inputStream); } catch (Exception e) { singletonManager = CacheManager.create(); singletonManager.addCache(CACHE_NAME); cache.getCacheConfiguration(); cache = singletonManager.getCache(CACHE_NAME); CacheConfiguration cacheConfiguration = cache.getCacheConfiguration(); cacheConfiguration.setTimeToIdleSeconds(TIME_TO_IDLE); cacheConfiguration.setTimeToLiveSeconds(TIME_TO_LIVE); } cache = singletonManager.getCache(CACHE_NAME); }
Source:
<code>public static int getDatePart(Value date, int field) { <START> java.util.Date d = date.getTimestamp(); <END> Calendar c = getCalendar(); c.setTime(d); if (field == Calendar.YEAR) { return getYear(c); } int value = c.get(field); if (field == Calendar.MONTH) { return value + 1; } return value; }</code><technical_language>getTimestamp->getDate</technical_language>

Target:
public static int getDatePart(Value date, int field) { Calendar c = valueToCalendar(date); if (field == Calendar.YEAR) { return getYear(c); } int value = c.get(field); if (field == Calendar.MONTH) { return value + 1; } return value; }
Source:
<code>public EditorNotificationPanel createNotificationPanel(@NotNull final VirtualFile file, FileEditor fileEditor) { if (!myShow || !StringResourceEditorProvider.canViewTranslations(myProject, file)) { return null; } final EditorNotificationPanel panel = new EditorNotificationPanel(); <START> panel.setText("View translations for all locales in the translations editor."); <END> panel.createActionLabel("Open editor", new Runnable() { @Override public void run() { StringResourceEditorProvider.openEditor(myProject, file); } }); panel.createActionLabel("Hide notification", new Runnable() { @Override public void run() { panel.setVisible(false); myShow = false; } }); return panel; }</code><technical_language>s/View/Edit</technical_language>

Target:
public EditorNotificationPanel createNotificationPanel(@NotNull final VirtualFile file, FileEditor fileEditor) { if (!myShow || !StringResourceEditorProvider.canViewTranslations(myProject, file)) { return null; } final EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText("Edit translations for all locales in the translations editor."); panel.createActionLabel("Open editor", new Runnable() { @Override public void run() { StringResourceEditorProvider.openEditor(myProject, file); } }); panel.createActionLabel("Hide notification", new Runnable() { @Override public void run() { panel.setVisible(false); myShow = false; } }); return panel; }
Source:
<code>public void setup() throws Exception { CommonTestUtilities.dropAndCreateWithTestData(SUPPORT, false, DROPWIZARD_CONFIGURATION_FILE_PATH); DockstoreWebserviceApplication application = SUPPORT.getApplication(); SessionFactory sessionFactory = application.getHibernate().getSessionFactory(); this.tokenDAO = new TokenDAO(sessionFactory); testingPostgres.runUpdateStatement("alter sequence enduser_id_seq increment by 50 restart with 100"); testingPostgres.runUpdateStatement("alter sequence token_id_seq increment by 50 restart with 100"); Session session = application.getHibernate().getSessionFactory().openSession(); ManagedSessionContext.bind(session); final Transaction transaction = session.beginTransaction(); tokenDAO.create(createToken(SUFFIX1, GITHUB_ACCOUNT_USERNAME_1, GITHHUB_USER1_ID)); <START> tokenDAO.create(createToken(SUFFIX2, GITHUB_ACCOUNT_USERNAME_2, GITHHUB_USER2_ID)); <END> transaction.commit(); }</code><technical_language>tokenDAO is of setup. local scope better, close transaction session properly</technical_language>

Target:
public void setup() throws Exception { CommonTestUtilities.dropAndCreateWithTestData(SUPPORT, false, DROPWIZARD_CONFIGURATION_FILE_PATH); DockstoreWebserviceApplication application = SUPPORT.getApplication(); SessionFactory sessionFactory = application.getHibernate().getSessionFactory(); TokenDAO tokenDAO = new TokenDAO(sessionFactory); testingPostgres.runUpdateStatement("alter sequence enduser_id_seq increment by 50 restart with 100"); testingPostgres.runUpdateStatement("alter sequence token_id_seq increment by 50 restart with 100"); Session session = application.getHibernate().getSessionFactory().openSession(); ManagedSessionContext.bind(session); final Transaction transaction = session.beginTransaction(); tokenDAO.create(createToken(SUFFIX1, GITHUB_ACCOUNT_USERNAME_1, GITHUB_USER1_ID)); tokenDAO.create(createToken(SUFFIX2, GITHUB_ACCOUNT_USERNAME_2, GITHUB_USER2_ID)); transaction.commit(); session.close(); }
Source:
<code>private void assertNoCrLfHelper(String expect, String input) throws IOException { byte[] inbytes = input.getBytes(); byte[] expectBytes = expect.getBytes(); for (int i = 1; i < 5; ++i) { byte[] buf = new byte[i]; ByteArrayInputStream bis = new ByteArrayInputStream(inbytes); InputStream in = new AutoCRLFInputStream(bis, true); ByteArrayOutputStream out = new ByteArrayOutputStream(); if (i > 0) { int n; while ((n = in.read(buf)) >= 0) { out.write(buf, 0, n); } <START> } else { <END> int c; while ((c = in.read()) != -1) out.write(c); } out.flush(); in.close(); out.close(); byte[] actualBytes = out.toByteArray(); Assert.assertEquals("bufsize=" + i, encode(expectBytes), encode(actualBytes)); } }</code><technical_language>I this block is unreachable for loop i=1 4</technical_language>

Target:
private void assertNoCrLfHelper(String expect, String input) throws IOException { byte[] inbytes = input.getBytes(); byte[] expectBytes = expect.getBytes(); for (int i = 0; i < 5; ++i) { byte[] buf = new byte[i]; ByteArrayInputStream bis = new ByteArrayInputStream(inbytes); InputStream in = new AutoCRLFInputStream(bis, true); ByteArrayOutputStream out = new ByteArrayOutputStream(); if (i > 0) { int n; while ((n = in.read(buf)) >= 0) { out.write(buf, 0, n); } } else { int c; while ((c = in.read()) != -1) out.write(c); } out.flush(); in.close(); out.close(); byte[] actualBytes = out.toByteArray(); Assert.assertEquals("bufsize=" + i, encode(expectBytes), encode(actualBytes)); } }
Source:
<code>public void shouldNotRaiseAlertGivenIntegrityAttributeIsPresentInLinkElement() throws HttpMalformedHeaderException { HttpMessage msg = buildMessage( <START> "<html><head><link rel=\"stylesheet\" href=\"<LINK_0>\"\n" <END> + " integrity=\"sha384-+/M6kredJcxdsqkczBUjMLvqyHb1K/JThDXWsBVxMEeZHEaMKEOEct339VItX1zB\"\n" + " crossorigin=\"anonymous\"></head><body></body></html>"); rule.scanHttpResponseReceive(msg, -1, createSource(msg)); assertThat(alertsRaised.size(), equalTo(0)); }</code><technical_language>rel/crossorigin attributes removed, matter</technical_language>

Target:
public void shouldNotRaiseAlertGivenIntegrityAttributeIsPresentInLinkElement() throws HttpMalformedHeaderException { HttpMessage msg = buildMessage( "<html><head><link href=\"<LINK_0>\"\n" + " integrity=\"sha384-+/M6kredJcxdsqkczBUjMLvqyHb1K/JThDXWsBVxMEeZHEaMKEOEct339VItX1zB\"\n" + " ></head><body></body></html>"); rule.scanHttpResponseReceive(msg, -1, createSource(msg)); assertThat(alertsRaised.size(), equalTo(0)); }
Source:
<code><START> boolean isTransportLoad() { <END> return this.unitsToTransports != null; }</code><technical_language>nit: if possible, please mark methods/variables restrictive scope, eg: private in this case. helps readers, I where/how this of this class realize internal only. nit, represent unloaded transport empty collection null</technical_language>

Target:
private boolean isTransportLoad() { return this.unitsToTransports != null; }
Source:
<code>public void run(IProject project, IAbstractArtifact artifact, IProgressMonitor monitor) { for (IArtifactAuditor auditor : auditors) { auditor.run(project, artifact, monitor); if (monitor.isCanceled()) { <START> return; <END> } } }</code><technical_language>out of scope, I if SubMonitor outer loop, subMonitor.split(...) call auditor run method, instead of explicit cancellation check. .split periodically enters UI thread convenient check for cancellation, instead of blocking enter UI thread perform check</technical_language>

Target:
public void run(IProject project, IAbstractArtifact artifact, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, String.format("Executing auditors on artifact '%s'", artifact.getName()), auditors.size() * 10); auditors.forEach(auditor -> auditor.run(project, artifact, subMonitor.split(10))); }
Source:
<code>protected void reportPendingClientLine(ConcurStandardAccountingExtractDetailLine saeLine) { ConcurBatchReportMissingObjectCodeItem pendingClientItem = new ConcurBatchReportMissingObjectCodeItem( saeLine.getReportId(), saeLine.getEmployeeId(), saeLine.getEmployeeLastName(), saeLine.getEmployeeFirstName(), saeLine.getEmployeeMiddleInitital(), <START> "Line has the \"Pending Client\" object code", <END> saeLine.getPolicy(), saeLine.getExpenseType()); reportData.addPendingClientObjectCodeLine(pendingClientItem); }</code><technical_language>This message hard coded</technical_language>

Target:
protected void reportPendingClientLine(ConcurStandardAccountingExtractDetailLine saeLine) { ConcurBatchReportMissingObjectCodeItem pendingClientItem = new ConcurBatchReportMissingObjectCodeItem( saeLine.getReportId(), saeLine.getEmployeeId(), saeLine.getEmployeeLastName(), saeLine.getEmployeeFirstName(), saeLine.getEmployeeMiddleInitital(), PENDING_CLIENT_MESSAGE, saeLine.getPolicy(), saeLine.getExpenseType()); reportData.addPendingClientObjectCodeLine(pendingClientItem); }
Source:
<code>public static double calculateSpeedIfSpeedTag(double maxSpeed) { <START> double urbanSpeedFactor = maxSpeed < 51 / 3.6 ? DEFAULT_FREESPEED_FACTOR : 1.0; <END> return maxSpeed * urbanSpeedFactor; }</code><technical_language>if urbanSpeed factor is supposed applied in afterLinkCreated applied here</technical_language>

Target:
public static double calculateSpeedIfSpeedTag(double maxSpeed) { return calculateSpeedIfSpeedTag(maxSpeed, DEFAULT_FREESPEED_FACTOR); }
Source:
<code><START> public String getWikiCode() { return String.format("[[File:%s|%s]]", filename, filename); } <END></code><technical_language>Alternatively, concerned usage of image in a Wiki article, I sense copy wikicode for "thumbnail" image wikicode for full image. I agree thumbnail approach, pictures displayed thumbnails in wiki articles AFAIK</technical_language>

Target:
public String getWikiCode() { return String.format("[[%s|thumb|%s]]", filename, thumbnailTitle); }
Source:
<code>public void testSubscribeUnsubscribe() throws Exception { startAndCompleteSpan(); Traces.subscribe(subscriber1); Traces.subscribe(subscriber2); Span span = startAndCompleteSpan(); verify(subscriber1).consume(span); verify(subscriber2).consume(span); <START> Mockito.verifyNoMoreInteractions(subscriber1, subscriber2); <END> Traces.unsubscribe(subscriber1); span = startAndCompleteSpan(); verify(subscriber2).consume(span); Mockito.verifyNoMoreInteractions(subscriber1, subscriber2); Traces.unsubscribe(subscriber2); startAndCompleteSpan(); Mockito.verifyNoMoreInteractions(subscriber1, subscriber2); }</code><technical_language>static import method match rest of test</technical_language>

Target:
public void testSubscribeUnsubscribe() throws Exception { startAndCompleteSpan(); Traces.subscribe(subscriber1); Traces.subscribe(subscriber2); Span span = startAndCompleteSpan(); verify(subscriber1).consume(span); verify(subscriber2).consume(span); verifyNoMoreInteractions(subscriber1, subscriber2); Traces.unsubscribe(subscriber1); span = startAndCompleteSpan(); verify(subscriber2).consume(span); verifyNoMoreInteractions(subscriber1, subscriber2); Traces.unsubscribe(subscriber2); startAndCompleteSpan(); verifyNoMoreInteractions(subscriber1, subscriber2); }
Source:
<code>protected void killEntityBehindBack(Entity tokill) throws Exception { ManagementContext newManagementContext = null; File tempDir = Os.newTempDir(getClass()); try { ManagementContext managementContext = ((EntityInternal)tokill).getManagementContext(); BrooklynMemento brooklynMemento = MementosGenerators.newBrooklynMemento(managementContext); BrooklynMementoPersisterToMultiFile oldPersister = new BrooklynMementoPersisterToMultiFile(tempDir , getClass().getClassLoader()); oldPersister.checkpoint(brooklynMemento, PersistenceExceptionHandlerImpl.builder().build()); oldPersister.waitForWritesCompleted(30*1000, TimeUnit.MILLISECONDS); BrooklynMementoPersisterToMultiFile newPersister = new BrooklynMementoPersisterToMultiFile(tempDir , getClass().getClassLoader()); newManagementContext = new LocalManagementContextForTests(); newManagementContext.getRebindManager().setPersister(newPersister, PersistenceExceptionHandlerImpl.builder().build()); newManagementContext.getRebindManager().rebind(getClass().getClassLoader(), null, ManagementNodeState.MASTER); newManagementContext.getRebindManager().startPersistence(); SoftwareProcess entity2 = (SoftwareProcess) newManagementContext.getEntityManager().getEntity(tokill.getId()); entity2.stop(); } finally { if (newManagementContext != null) ((ManagementContextInternal)newManagementContext).terminate(); Os.deleteRecursively(tempDir.getAbsolutePath()); } <START> log.info("called to stop in parallel mgmt universe", entity); <END> }</code><technical_language>elaborate; reason simply kill process, method name suggests</technical_language>

Target:
protected void killEntityBehindBack(Entity tokill) throws Exception { ManagementContext newManagementContext = null; File tempDir = Os.newTempDir(getClass()); try { ManagementContext managementContext = ((EntityInternal)tokill).getManagementContext(); BrooklynMemento brooklynMemento = MementosGenerators.newBrooklynMemento(managementContext); BrooklynMementoPersisterToMultiFile oldPersister = new BrooklynMementoPersisterToMultiFile(tempDir , getClass().getClassLoader()); oldPersister.checkpoint(brooklynMemento, PersistenceExceptionHandlerImpl.builder().build()); oldPersister.waitForWritesCompleted(30*1000, TimeUnit.MILLISECONDS); BrooklynMementoPersisterToMultiFile newPersister = new BrooklynMementoPersisterToMultiFile(tempDir , getClass().getClassLoader()); newManagementContext = new LocalManagementContextForTests(); newManagementContext.getRebindManager().setPersister(newPersister, PersistenceExceptionHandlerImpl.builder().build()); newManagementContext.getRebindManager().rebind(getClass().getClassLoader(), null, ManagementNodeState.MASTER); newManagementContext.getRebindManager().startPersistence(); SoftwareProcess entity2 = (SoftwareProcess) newManagementContext.getEntityManager().getEntity(tokill.getId()); entity2.stop(); } finally { if (newManagementContext != null) ((ManagementContextInternal)newManagementContext).terminate(); Os.deleteRecursively(tempDir.getAbsolutePath()); } LOG.info("called to stop in parallel mgmt universe", entity); }
Source:
<code>public void testRetrieveMODSFromWork() throws Exception { doNothing().when(aclService).assertHasAccess(anyString(), any(PID.class), any(AccessGroupSet.class), eq(viewMetadata)); PID workPid = makePid(); File modsFile = setupWorkWithMODS(workPid); MvcResult result = mvc.perform(get("/description/" + workPid.getUUID())) .andExpect(status().is2xxSuccessful()) .andReturn(); String responseBody = result.getResponse().getContentAsString(); <START> String expectedResponseBody = IOUtils.toString(new FileInputStream(modsFile)); <END> assertEquals(expectedResponseBody, responseBody); }</code><technical_language>FileUtils.readFileToString read file</technical_language>

Target:
public void testRetrieveMODSFromWork() throws Exception { doNothing().when(aclService).assertHasAccess(anyString(), any(PID.class), any(AccessGroupSet.class), eq(viewMetadata)); PID workPid = makePid(); File modsFile = setupWorkWithMODS(workPid); MvcResult result = mvc.perform(get("/description/" + workPid.getUUID())) .andExpect(status().is2xxSuccessful()) .andReturn(); String responseBody = result.getResponse().getContentAsString(); String expectedResponseBody = FileUtils.readFileToString(modsFile, StandardCharsets.UTF_8); assertEquals(expectedResponseBody, responseBody); }
Source:
<code><START> public List<String> getAliases() { <END> return aliases; }</code><technical_language>afaik return null collection is used, is _docker-api_ library design part smth</technical_language>

Target:
public String[] getAliases() { return aliases; }
Source:
<code>public void handleConfigUpdateFailure(StackView stackView, Exception exception) { try { if (stackView.getClusterView() != null) { String errorMessage = clusterCreationService .getErrorMessageFromException(exception); transactionService.required(() -> { clusterService .updateClusterStatusByStackId(stackView.getId(), UPDATE_FAILED, errorMessage); stackUpdater .updateStackStatus(stackView.getId(), DetailedStackStatus.AVAILABLE); }); flowMessageService.fireEventAndLog(stackView.getId(), UPDATE_FAILED.name(), CLUSTER_PILLAR_CONFIG_UPDATE_FAILED, errorMessage); } else { LOGGER.info("Cluster was null. Flow action was not required."); } } catch (TransactionExecutionException e) { <START> throw new TransactionRuntimeExecutionException(e); <END> } }</code><technical_language>ideal throw exception in failure handling part</technical_language>

Target:
public void handleConfigUpdateFailure(StackView stackView, Exception exception) { try { if (stackView.getClusterView() != null) { String errorMessage = clusterCreationService .getErrorMessageFromException(exception); transactionService.required(() -> { clusterService .updateClusterStatusByStackId(stackView.getId(), UPDATE_FAILED, errorMessage); stackUpdater .updateStackStatus(stackView.getId(), DetailedStackStatus.AVAILABLE); }); flowMessageService.fireEventAndLog(stackView.getId(), UPDATE_FAILED.name(), CLUSTER_PILLAR_CONFIG_UPDATE_FAILED, errorMessage); } else { LOGGER.info("Cluster was null. Flow action was not required."); } } catch (TransactionExecutionException e) { LOGGER.warn("Error setting status for Pillar configuration update failure", e); } }
Source:
<code>private void setUpSendEventPage() { WorkflowService eventService = mock(WorkflowService.class); context.putBean("eventService", eventService); context.putBean("ruleManager", mock(RuleManager.class)); context.putBean("auditing", mock(AuditingDomain.class)); <START> List<Class<? extends Event>> eventClasses = Arrays.<Class<? extends Event>> asList(NullEvent.class); <END> tester.startPage(new SendEventPage(eventClasses)); tester.startPage(Index.class); }</code><technical_language>sure, enough set generic "Event" instead of "? extends Event"</technical_language>

Target:
private void setUpSendEventPage() { WorkflowService eventService = mock(WorkflowService.class); context.putBean("eventService", eventService); List<Class<? extends Event>> eventClasses = Arrays.<Class<? extends Event>> asList(NullEvent.class); tester.startPage(new SendEventPage(eventClasses)); tester.startPage(Index.class); }
Source:
<code>private void releaseIfNoOp(@NonNull final ContentProviderOperation operation, @NonNull final Uri uri) { if (!isValidOperation(operation)) { try { <START> locker.release(uri); <END> } catch (NullPointerException e) { } } }</code><technical_language>a checked exception for this case</technical_language>

Target:
private void releaseIfNoOp(@NonNull final ContentProviderOperation operation, @NonNull final Uri uri) { if (!isValidOperation(operation)) { try { locker.release(uri); } catch (IllegalStateException e) { Log.w(TAG, "Couldn't release lock!", e); } } }
Source:
<code>private void configureTimeSetting(Preferences preferences) { timeComboBox.setItems(FXCollections.observableArrayList(options)); timeComboBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { newTimeFormatSelected(event); } } <START> ); <END> timeComboBox.setDisable(false); timeComboBox.setFocusTraversable(true); int index; index= getIndexNumberOfFormat(preferences.getChat().getUkTime()); timeComboBox.getSelectionModel().select(index); }</code><technical_language>lambda expressions, in this case; method references</technical_language>

Target:
private void configureTimeSetting(Preferences preferences) { timeComboBox.setButtonCell(new StringListCell<>(timeInfo -> i18n.get(timeInfo.getDisplayNameKey()))); timeComboBox.setCellFactory(param -> new StringListCell<>(timeInfo -> i18n.get(timeInfo.getDisplayNameKey()))); timeComboBox.setItems(FXCollections.observableArrayList(TimeInfo.values())); timeComboBox.setDisable(false); timeComboBox.setFocusTraversable(true); timeComboBox.getSelectionModel().select(preferences.getChat().getTimeFormat()); }
Source:
<code>public void validateField(String name, Object o) { if (o == null) { return; } SimpleTypeValidator.validateField(name, String.class, o); String className = (String) o; try { Class<?> objectClass = Class.forName(className); if (!this.classImplements.isAssignableFrom(objectClass)) { throw new IllegalArgumentException("Field " + name + " with value " + o + " does not implement " + this.classImplements.getName()); } } catch (ClassNotFoundException e) { if (className.startsWith("backtype.storm")) { LOG.error("ClassNotFoundException: {}", className); LOG.warn("Replace backtype.storm with org.apache.storm and try to validate again"); LOG.warn("We loosen some constraints here to support topologies of older version running on the current version"); <START> validateField(name, className.replaceAll("backtype.storm", "org.apache.storm")); <END> } else { throw new RuntimeException(e); } } }</code><technical_language>replaceAll takes regex, escaping . replace sense</technical_language>

Target:
public void validateField(String name, Object o) { if (o == null) { return; } SimpleTypeValidator.validateField(name, String.class, o); String className = (String) o; try { Class<?> objectClass = Class.forName(className); if (!this.classImplements.isAssignableFrom(objectClass)) { throw new IllegalArgumentException("Field " + name + " with value " + o + " does not implement " + this.classImplements.getName()); } } catch (ClassNotFoundException e) { if (className.startsWith("backtype.storm")) { LOG.error("ClassNotFoundException: {}", className); LOG.warn("Replace backtype.storm with org.apache.storm and try to validate again"); LOG.warn("We loosen some constraints here to support topologies of older version running on the current version"); validateField(name, className.replace("backtype.storm", "org.apache.storm")); } else { throw new RuntimeException(e); } } }
Source:
<code>public void disconnect() { <START> commandProcessor.unsubscribeAndRemoveAll(); <END> commandProcessor.disconnect(); }</code><technical_language>I suppose this is unsubscribe happen, disconnecting remote source, leaving internal state intact. actual "removal" (=local unsubscription) wait next phase (OUTBOUND_COMMAND_OR_QUERY_CONNECTORS in this case). This allow for commands in transit processed, cutting off</technical_language>

Target:
public void disconnect() { commandProcessor.unsubscribeAll(); commandProcessor.disconnect(); }
Source:
<code>protected void runVm() { setActionReturnValue(VMStatus.Down); if (getVdsToRunOn()) { VMStatus status = null; try { if (connectLunDisks(getVdsId())) { status = createVm(); ExecutionHandler.setAsyncJob(getExecutionContext(), true); } } catch(VdcBLLException e) { VdcBllErrors errorCode = e.getErrorCode(); switch (errorCode) { case Done: case exist: case VDS_NETWORK_ERROR: case PROVIDER_FAILURE: throw e; default: log.warnFormat("Failed to run VM {0}: {1}", getVmName(), e.getMessage()); } } finally { freeLock(); } setActionReturnValue(status); if (status != null && (status.isRunning() || status == VMStatus.RestoringState)) { getVm().setStopReason(null); <START> getVmDynamicDao().clearStopReason(this.getVm().getId()); <END> setSucceeded(true); } else { log.infoFormat("Trying to rerun VM {0}", getVm().getName()); setCommandShouldBeLogged(false); setSucceeded(true); rerun(); } } else { runningFailed(); } }</code><technical_language>Separate a patch please</technical_language>

Target:
protected void runVm() { setActionReturnValue(VMStatus.Down); if (getVdsToRunOn()) { VMStatus status = null; try { if (connectLunDisks(getVdsId())) { status = createVm(); ExecutionHandler.setAsyncJob(getExecutionContext(), true); } } catch(VdcBLLException e) { VdcBllErrors errorCode = e.getErrorCode(); switch (errorCode) { case Done: case exist: case VDS_NETWORK_ERROR: case PROVIDER_FAILURE: throw e; default: log.warnFormat("Failed to run VM {0}: {1}", getVmName(), e.getMessage()); } } finally { freeLock(); } setActionReturnValue(status); if (status != null && (status.isRunning() || status == VMStatus.RestoringState)) { setSucceeded(true); } else { log.infoFormat("Trying to rerun VM {0}", getVm().getName()); setCommandShouldBeLogged(false); setSucceeded(true); rerun(); } } else { runningFailed(); } }