auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ChangeTable() { keysNavigation.add(new PrevKeyCommand(0, 'k', Util.C.changeTablePrev())); keysNavigation.add(new NextKeyCommand(0, 'j', Util.C.changeTableNext())); keysNavigation.add(new OpenKeyCommand(0, 'o', Util.C.changeTableOpen())); keysNavigation.add(new OpenKeyCommand(0, KeyCodes.KEY_ENTER, Util.C .changeTableOpen())); if (Gerrit.isSignedIn()) { keysAction.add(new StarKeyCommand(0, 's', Util.C.changeTableStar())); } sections = new ArrayList<Section>(); table.setText(0, C_STAR, ""); table.setText(0, C_ID, Util.C.changeTableColumnID()); table.setText(0, C_SUBJECT, Util.C.changeTableColumnSubject()); table.setText(0, C_OWNER, Util.C.changeTableColumnOwner()); table.setText(0, C_PROJECT, Util.C.changeTableColumnProject()); <START> table.setText(0, C_BRANCH, "Branch"); <END> table.setText(0, C_LAST_UPDATE, Util.C.changeTableColumnLastUpdate()); final FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.addStyleName(0, C_STAR, S_ICON_HEADER); fmt.addStyleName(0, C_ID, S_C_ID); for (int i = C_ID; i < COLUMNS; i++) { fmt.addStyleName(0, i, S_DATA_HEADER); } table.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { final Cell cell = table.getCellForEvent(event); if (cell == null) { return; } if (cell.getCellIndex() == C_STAR) { onStarClick(cell.getRowIndex()); } else if (cell.getCellIndex() == C_OWNER) { } else if (getRowItem(cell.getRowIndex()) != null) { movePointerTo(cell.getRowIndex()); } } }); }</code><technical_language>Please add Constants.java/.properties in this package instead of a string literal here</technical_language>

Target:
public ChangeTable() { keysNavigation.add(new PrevKeyCommand(0, 'k', Util.C.changeTablePrev())); keysNavigation.add(new NextKeyCommand(0, 'j', Util.C.changeTableNext())); keysNavigation.add(new OpenKeyCommand(0, 'o', Util.C.changeTableOpen())); keysNavigation.add(new OpenKeyCommand(0, KeyCodes.KEY_ENTER, Util.C .changeTableOpen())); if (Gerrit.isSignedIn()) { keysAction.add(new StarKeyCommand(0, 's', Util.C.changeTableStar())); } sections = new ArrayList<Section>(); table.setText(0, C_STAR, ""); table.setText(0, C_ID, Util.C.changeTableColumnID()); table.setText(0, C_SUBJECT, Util.C.changeTableColumnSubject()); table.setText(0, C_OWNER, Util.C.changeTableColumnOwner()); table.setText(0, C_PROJECT, Util.C.changeTableColumnProject()); table.setText(0, C_BRANCH, Util.C.changeTableColumnBranch()); table.setText(0, C_LAST_UPDATE, Util.C.changeTableColumnLastUpdate()); final FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.addStyleName(0, C_STAR, S_ICON_HEADER); fmt.addStyleName(0, C_ID, S_C_ID); for (int i = C_ID; i < COLUMNS; i++) { fmt.addStyleName(0, i, S_DATA_HEADER); } table.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { final Cell cell = table.getCellForEvent(event); if (cell == null) { return; } if (cell.getCellIndex() == C_STAR) { onStarClick(cell.getRowIndex()); } else if (cell.getCellIndex() == C_OWNER) { } else if (getRowItem(cell.getRowIndex()) != null) { movePointerTo(cell.getRowIndex()); } } }); }
Source:
<code>public void test_should_not_analyze_if_project_is_disposed() throws IOException, JDOMException { String projectFilePath = myProject.getProjectFilePath(); PlatformTestUtil.forceCloseProjectWithoutSaving(myProject); assertThat(exclusions.canAnalyze(testFile, getModule()).isExcluded()).isTrue(); <START> myProject = ProjectManager.getInstance().loadAndOpenProject(projectFilePath); <END> }</code><technical_language>in a finally block</technical_language>

Target:
public void test_should_not_analyze_if_project_is_disposed() throws IOException, JDOMException { PlatformTestUtil.forceCloseProjectWithoutSaving(myProject); assertThat(exclusions.canAnalyze(testFile, getModule()).isExcluded()).isTrue(); }
Source:
<code>public void once() { <START> CompletableSubject ms = CompletableSubject.create(); <END> TestObserver<Void> to = ms.test(); ms.onComplete(); List<Throwable> errors = TestHelper.trackPluginErrors(); try { ms.onError(new IOException()); TestHelper.assertError(errors, 0, IOException.class); } finally { RxJavaPlugins.reset(); } ms.onComplete(); to.assertResult(); }</code><technical_language>of cs instead of ms for MaybeSubject</technical_language>

Target:
public void once() { CompletableSubject cs = CompletableSubject.create(); TestObserver<Void> to = cs.test(); cs.onComplete(); List<Throwable> errors = TestHelper.trackPluginErrors(); try { cs.onError(new IOException()); TestHelper.assertError(errors, 0, IOException.class); } finally { RxJavaPlugins.reset(); } cs.onComplete(); to.assertResult(); }
Source:
<code>protected Builder() { super(NeutronApi.class); id("openstack-neutron") .name("OpenStack Neutron API") .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant") .credentialName("${password}") <START> .endpointName("KeyStone base url ending in /v2.0/") <END> .documentation(URI.create("<LINK_0>")) .version("2.0") .defaultEndpoint("http://localhost:5000/v2.0/") .defaultProperties(NeutronApiMetadata.defaultProperties()) .defaultModules(ImmutableSet.<Class<? extends Module>>builder() .add(AuthenticationApiModule.class) .add(KeystoneAuthenticationModule.class) .add(ZoneModule.class) .add(NeutronHttpApiModule.class).build()); }</code><technical_language>"Keystone"</technical_language>

Target:
protected Builder() { super(NeutronApi.class); id("openstack-neutron") .name("OpenStack Neutron API") .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant") .credentialName("${password}") .endpointName("Neutron base url ending in /v2.0/") .documentation(URI.create("<LINK_0>")) .version("2.0") .defaultEndpoint("http://localhost:5000/v2.0/") .defaultProperties(NeutronApiMetadata.defaultProperties()) .defaultModules(ImmutableSet.<Class<? extends Module>>builder() .add(AuthenticationApiModule.class) .add(KeystoneAuthenticationModule.class) .add(ZoneModule.class) .add(NeutronHttpApiModule.class).build()); }
Source:
<code>private static void appendBodyColorsRule(StringBuilder buffer, RGB fgRGB, RGB bgRGB) { StringBuilder fg= new StringBuilder(); appendColor(fg, fgRGB); StringBuilder bg= new StringBuilder(); <START> appendColor(bg, bgRGB); <END> buffer.append("body {color:"); appendColor(buffer, fgRGB); buffer.append("; background-color:"); appendColor(buffer, bgRGB); buffer.append(";}"); }</code><technical_language>4 lines deleted</technical_language>

Target:
private static void appendBodyColorsRule(StringBuilder buffer, RGB fgRGB, RGB bgRGB) { buffer.append("body {color:"); appendColor(buffer, fgRGB); buffer.append("; background-color:"); appendColor(buffer, bgRGB); buffer.append(";}"); }
Source:
<code>public void execute(JobExecutionContext context) throws JobExecutionException { try { MDC.put("requestType", "job"); MDC.put("requestUuid", context.getJobDetail().getKey().getName()); } catch (NullPointerException npe) { } boolean startedUow = startUnitOfWork(); try { toExecute(context); } catch (PersistenceException e) { int maxRefires = getMaxRetries(); boolean refire = maxRefires < 0 || context.getRefireCount() < maxRefires; <START> log.error("Persistence exception caught running pinsetter task. Refire: " + refire, e); <END> throw new JobExecutionException(e, refire); } finally { if (startedUow) { endUnitOfWork(); } } }</code><technical_language>Yes, log</technical_language>

Target:
public void execute(JobExecutionContext context) throws JobExecutionException { try { MDC.put("requestType", "job"); MDC.put("requestUuid", context.getJobDetail().getKey().getName()); } catch (NullPointerException npe) { } boolean startedUow = startUnitOfWork(); try { toExecute(context); } catch (PersistenceException e) { int maxRefires = getMaxRetries(); boolean refire = maxRefires < 0 || context.getRefireCount() < maxRefires; log.error("Persistence exception caught running pinsetter task. Attempt: " + context.getRefireCount() + ", Refire: " + refire, e); throw new JobExecutionException(e, refire); } finally { if (startedUow) { endUnitOfWork(); } } }
Source:
<code>public Set<Rule> parse(InputStreamReader reader) throws ParsingException { JsonReader jr = new JsonReader(reader); try { Set<Rule> rules = new HashSet<>(); if (jr.hasNext()) { JsonToken token = jr.peek(); if (JsonToken.BEGIN_ARRAY.equals(token)) { Rule[] parsedRules = gson.fromJson(jr, Rule[].class); rules.addAll(Arrays.asList(parsedRules)); } else { Rule rule = gson.fromJson(jr, Rule.class); rules.add(rule); } return rules; } } catch (Exception e) { <START> e.printStackTrace(); <END> throw new ParsingException(new ParsingNestedException(ParsingNestedException.RULE, null, e)); } finally { try { jr.close(); } catch (IOException e) { } } return Collections.emptySet(); }</code><technical_language>This line removed</technical_language>

Target:
public Set<Rule> parse(InputStreamReader reader) throws ParsingException { JsonReader jr = new JsonReader(reader); try { Set<Rule> rules = new HashSet<>(); if (jr.hasNext()) { JsonToken token = jr.peek(); if (JsonToken.BEGIN_ARRAY.equals(token)) { rules.addAll(gson.fromJson(jr, new TypeToken<List<Rule>>() { }.getType())); } else { Rule rule = gson.fromJson(jr, Rule.class); rules.add(rule); } return rules; } } catch (Exception e) { throw new ParsingException(new ParsingNestedException(ParsingNestedException.RULE, null, e)); } finally { try { jr.close(); } catch (IOException e) { } } return Collections.emptySet(); }
Source:
<code>public void testCompleteMapping() { final ActivityCalendar activityCalendar = new ActivityCalendarBuilder().withCosemDateTime(this.cosemDateTime) .withFilledList().build(); final ActivityCalendarDto activityCalendarDto = this.configurationMapper.map(activityCalendar, ActivityCalendarDto.class); <START> assertNotNull(activityCalendar); <END> assertNotNull(activityCalendarDto); assertNotNull(activityCalendarDto.getActivatePassiveCalendarTime()); assertNotNull(activityCalendarDto.getSeasonProfileList()); assertEquals(activityCalendar.getCalendarName(), activityCalendarDto.getCalendarName()); this.checkListMapping(activityCalendar.getSeasonProfileList(), activityCalendarDto.getSeasonProfileList()); this.checkCosemDateTimeMapping(activityCalendar.getActivatePassiveCalendarTime(), activityCalendarDto.getActivatePassiveCalendarTime()); }</code><technical_language>delete this line</technical_language>

Target:
public void testCompleteMapping() { final ActivityCalendar activityCalendar = new ActivityCalendarBuilder().withCosemDateTime(this.cosemDateTime) .withFilledList().build(); final ActivityCalendarDto activityCalendarDto = this.configurationMapper.map(activityCalendar, ActivityCalendarDto.class); assertNotNull(activityCalendarDto); assertNotNull(activityCalendarDto.getActivatePassiveCalendarTime()); assertNotNull(activityCalendarDto.getSeasonProfileList()); assertEquals(activityCalendar.getCalendarName(), activityCalendarDto.getCalendarName()); this.checkListMapping(activityCalendar.getSeasonProfileList(), activityCalendarDto.getSeasonProfileList()); this.checkCosemDateTimeMapping(activityCalendar.getActivatePassiveCalendarTime(), activityCalendarDto.getActivatePassiveCalendarTime()); }
Source:
<code>public Group groupDifference(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, WrongReferenceAttributeValueException, NotGroupMemberException, AlreadyMemberException, NotMemberOfParentGroupException, WrongAttributeValueException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); <START> if ( (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || <END> (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup)) ) { throw new PrivilegeException(sess, "groupDifference"); } Group result = getGroupsManagerBl().groupDifference(sess, resultGroup, operandGroup); return result; }</code><technical_language>new lines</technical_language>

Target:
public Group groupDifference(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupOperationsException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); if ( (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup)) ) { throw new PrivilegeException(sess, "groupDifference"); } return getGroupsManagerBl().groupDifference(sess, resultGroup, operandGroup); }
Source:
<code><START> private boolean isAcceptableType(JavaType arg, JavaType formal, boolean autoboxing) { <END> if(formal.isTagged(JavaType.TYPEVAR) && !arg.isTagged(JavaType.TYPEVAR)) { return subtypeOfTypeVar(arg, ((JavaType.TypeVariableJavaType) formal)); } if (isParametrizedType(arg) || isParametrizedType(formal) || isWilcardType(arg) || isWilcardType(formal)) { return types.isSubtype(arg, formal) || isAcceptableByAutoboxing(arg, formal.erasure()); } return types.isSubtype(arg.erasure(), formal.erasure()) || (autoboxing && isAcceptableByAutoboxing(arg, formal.erasure())); }</code><technical_language>![MAJOR](<LINK_1> Cyclomatic Complexity of this method "isAcceptableType" is 12 is greater 10 authorized. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private boolean isAcceptableType(JavaType arg, JavaType formal, boolean autoboxing) { if(formal.isTagged(JavaType.TYPEVAR) && !arg.isTagged(JavaType.TYPEVAR)) { return subtypeOfTypeVar(arg, (JavaType.TypeVariableJavaType) formal); } if (isParametrizedType(arg) || isParametrizedType(formal) || isWilcardType(arg) || isWilcardType(formal)) { return types.isSubtype(arg, formal) || isAcceptableByAutoboxing(arg, formal.erasure()); } return types.isSubtype(arg.erasure(), formal.erasure()) || (autoboxing && isAcceptableByAutoboxing(arg, formal.erasure())); }
Source:
<code>private void handleColorTemperatureCommand(Command command) { if (command instanceof PercentType) { PercentType newValue = (PercentType) command; <START> if (!state.getColorTemperature().equals(newValue)) { <END> setColorTemperature(newValue); } else { logger.debug("Skipping setting the same value for ColorTemperature: {}", newValue.toBigDecimal()); } } else if (command instanceof IncreaseDecreaseType) { if (state != null && state.getColorTemperature() != null) { int current = state.getColorTemperature().intValue(); if (IncreaseDecreaseType.INCREASE.equals(command)) { setColorTemperature(new PercentType(Math.min(current + STEP, PercentType.HUNDRED.intValue()))); } else { setColorTemperature(new PercentType(Math.max(current - STEP, PercentType.ZERO.intValue()))); } } else { logger.debug("Cannot handle inc/dec as current state is not known."); } } else { logger.debug("Can't handle command on channel {}", command, CHANNEL_COLOR_TEMPERATURE); } }</code><technical_language>If some other Color command meanwhile, is guaranteed state.getColorTemperature() is changed? e.g. if I send a "green" bulb</technical_language>

Target:
private void handleColorTemperatureCommand(Command command) { if (command instanceof PercentType) { setColorTemperature((PercentType) command); } else if (command instanceof IncreaseDecreaseType) { if (state != null && state.getColorTemperature() != null) { int current = state.getColorTemperature().intValue(); if (IncreaseDecreaseType.INCREASE.equals(command)) { setColorTemperature(new PercentType(Math.min(current + STEP, PercentType.HUNDRED.intValue()))); } else { setColorTemperature(new PercentType(Math.max(current - STEP, PercentType.ZERO.intValue()))); } } else { logger.debug("Cannot handle inc/dec as current state is not known."); } } else { logger.debug("Can't handle command on channel {}", command, CHANNEL_COLOR_TEMPERATURE); } }
Source:
<code>public String toString() { if (buffer == null) { return typeIndex + " " + supertypeIndex; } StringBuilder result = new StringBuilder(); <START> result.append(buffer.typeNames().get(typeIndex)); <END> if (supertypeIndex != NO_INDEX) { result.append(" extends ").append(buffer.typeNames().get(supertypeIndex)); } return result.toString(); }</code><technical_language>getTypeName(typeIndex)</technical_language>

Target:
public String toString() { if (buffer == null) { return typeIndex + " " + supertypeIndex; } StringBuilder result = new StringBuilder(); result.append(getTypeName()); if (supertypeIndex != NO_INDEX) { result.append(" extends ").append(buffer.typeNames().get(supertypeIndex)); } return result.toString(); }
Source:
<code>public IStatus addComment(IReviewItem item, IComment comment, IProgressMonitor monitor) { short side = RIGHT_SIDE; String id = item.getId(); if (id.startsWith("base-")) { <START> id = id.substring(5); <END> side = LEFT_SIDE; } Patch.Key key = Patch.Key.parse(id); for (ILocation location : comment.getLocations()) { if (location instanceof ILineLocation) { ILineLocation lineLocation = (ILineLocation) location; SaveDraftRequest request = new SaveDraftRequest(key, lineLocation.getRangeMin(), side); request.setMessage(comment.getDescription()); if (comment.getId() != null && comment.getId().compareTo("") != 0) { request.setUuid(comment.getId()); } request.setParentUuid(comment.getParentId()); GerritOperation<PatchLineComment> operation = getOperationFactory().createSaveDraftOperation(getTask(), request); IStatus status = operation.run(monitor); PatchLineComment plc = operation.getOperationResult(); comment.setId(plc.getKey().get()); return status; } } throw new RuntimeException(Messages.GerritReviewBehavior_Internal_Exception + comment.getId()); }</code><technical_language>avoid magic number, replace "base-".lenght. "base-" a constant</technical_language>

Target:
public IStatus addComment(IReviewItem item, IComment comment, IProgressMonitor monitor) { short side = RIGHT_SIDE; String id = item.getId(); if (id.startsWith(BASE)) { id = id.substring(BASE.length()); side = LEFT_SIDE; } Patch.Key key = Patch.Key.parse(id); for (ILocation location : comment.getLocations()) { if (location instanceof ILineLocation) { ILineLocation lineLocation = (ILineLocation) location; SaveDraftRequest request = new SaveDraftRequest(key, lineLocation.getRangeMin(), side); request.setMessage(comment.getDescription()); if (comment.getId() != null && !(comment.getId().isEmpty())) { request.setUuid(comment.getId()); } request.setParentUuid(comment.getParentId()); GerritOperation<PatchLineComment> operation = getOperationFactory().createSaveDraftOperation(getTask(), request); IStatus status = operation.run(monitor); PatchLineComment plc = operation.getOperationResult(); comment.setId(plc.getKey().get()); return status; } } throw new RuntimeException(Messages.GerritReviewBehavior_Internal_Exception + comment.getId()); }
Source:
<code>public final NativeRequest.Builder readNativeRequest(JsonParser par) throws IOException { if (emptyToNull(par)) { return null; } NativeRequest.Builder req = NativeRequest.newBuilder(); boolean rootNativeField = false; boolean firstField = true; for (startObject(par); endObject(par); par.nextToken()) { String fieldName = getCurrentName(par); if (par.nextToken() != JsonToken.VALUE_NULL) { if (firstField) { firstField = false; if ((rootNativeField = "native".equals(fieldName)) == true) { startObject(par); fieldName = getCurrentName(par); par.nextToken(); } } if (par.getCurrentToken() != JsonToken.VALUE_NULL) { readNativeRequestField(par, req, fieldName); } } } if (rootNativeField && par.getCurrentToken() == JsonToken.END_OBJECT) { <START> par.nextToken(); <END> } return req; }</code><technical_language>This a bugfix (the missing nextToken()), please endObject() in condition, like: if (rootNativeField && endObject(par)) { par.nextToken(); } For thing, this prevent a bug if is current token, happen if JSON is broken ends abruptly</technical_language>

Target:
public final NativeRequest.Builder readNativeRequest(JsonParser par) throws IOException { if (emptyToNull(par)) { return null; } NativeRequest.Builder req = NativeRequest.newBuilder(); boolean rootNativeField = false; boolean firstField = true; for (startObject(par); endObject(par); par.nextToken()) { String fieldName = getCurrentName(par); if (par.nextToken() != JsonToken.VALUE_NULL) { if (firstField) { firstField = false; if ((rootNativeField = "native".equals(fieldName)) == true) { startObject(par); fieldName = getCurrentName(par); par.nextToken(); } } if (par.getCurrentToken() != JsonToken.VALUE_NULL) { readNativeRequestField(par, req, fieldName); } } } if (rootNativeField && !endObject(par)) { par.nextToken(); } return req; }
Source:
<code>private String getAdditionalFailureInfo(long allocated, long delta) { Map<String, Long> queryAllocations = memoryPool.getTaggedMemoryAllocations().get(queryId); String additionalInfo = format("Allocated: %s, Delta: %s", succinctBytes(allocated), succinctBytes(delta)); if (queryAllocations == null) { return additionalInfo; } String topConsumers = queryAllocations.entrySet().stream() <START> .filter(entry -> !entry.getKey().equals(FORCE_FREE_TAG)) <END> .sorted(comparingByValue(Comparator.reverseOrder())) .limit(3) .collect(toImmutableMap(Entry::getKey, e -> succinctBytes(e.getValue()))) .toString(); return format("%s, Top Consumers: %s", additionalInfo, topConsumers); }</code><technical_language>Another do this (if proper import AbstractAggregatedMemoryContext.FORCE_FREE_TAG directly, is queryAllocations returned memoryPool.getTaggedMemoryAllocations().get(queryId) do include this entry</technical_language>

Target:
private String getAdditionalFailureInfo(long allocated, long delta) { Map<String, Long> queryAllocations = memoryPool.getTaggedMemoryAllocations(queryId); String additionalInfo = format("Allocated: %s, Delta: %s", succinctBytes(allocated), succinctBytes(delta)); if (queryAllocations == null) { return additionalInfo; } String topConsumers = queryAllocations.entrySet().stream() .sorted(comparingByValue(Comparator.reverseOrder())) .limit(3) .collect(toImmutableMap(Entry::getKey, e -> succinctBytes(e.getValue()))) .toString(); return format("%s, Top Consumers: %s", additionalInfo, topConsumers); }
Source:
<code>private void initialize() { if(Config.<Boolean>getValue(ConfigValues.PMHealthCheckEnabled)) { log.info("Start initializing {}", getClass().getSimpleName()); Integer pmHealthCheckInterval = Config.<Integer> getValue(ConfigValues.PMHealthCheckIntervalInSec); Injector.get(SchedulerUtilQuartzImpl.class).scheduleAFixedDelayJob(this, "pmHealthCheck", new Class[] {}, new Object[] {}, pmHealthCheckInterval, pmHealthCheckInterval, TimeUnit.SECONDS); } recover(vdsDao.getAll()); log.info("Finished initializing {}", getClass().getSimpleName()); <START> lock = new ReentrantLock(); <END> }</code><technical_language>this is error prone: if schedule start process this line is executed, face NPE in line 83. Please initialize lock in c'tor is declared (line 52)</technical_language>

Target:
private void initialize() { if(Config.<Boolean>getValue(ConfigValues.PMHealthCheckEnabled)) { log.info("Start initializing {}", getClass().getSimpleName()); Integer pmHealthCheckInterval = Config.<Integer> getValue(ConfigValues.PMHealthCheckIntervalInSec); Injector.get(SchedulerUtilQuartzImpl.class).scheduleAFixedDelayJob(this, "pmHealthCheck", new Class[] {}, new Object[] {}, pmHealthCheckInterval, pmHealthCheckInterval, TimeUnit.SECONDS); } recover(vdsDao.getAll()); log.info("Finished initializing {}", getClass().getSimpleName()); }
Source:
<code>public void initialize(Map<String, Param> params) throws TikaConfigException { try { TrainedModelHelper helper; switch (modelType) { case "VGG16NOTOP": throw new TikaConfigException("VGG16NOTOP is not supported right now"); case "VGG16": helper = new TrainedModelHelper(TrainedModels.VGG16); modelFile = new File(MODEL_DIR_PREPROCESSED + File.separator + "vgg16.zip"); locationToSave = new File(MODEL_DIR + File.separator + "tikaPreprocessed" + File.separator + "vgg16.zip"); break; default: throw new TikaConfigException("Unknown or unsupported model"); } if (serialize.trim().toLowerCase(Locale.ROOT).equals("yes")) { if (!modelFile.exists()) { LOG.warn("Preprocessed Model doesn't exist at {}", modelFile); modelFile.getParentFile().mkdirs(); model = helper.loadModel(); LOG.info("Saving the Loaded model for future use. Saved models are more optimised to consume less resources."); ModelSerializer.writeModel(model, locationToSave, true); available = true; } else { model = ModelSerializer.restoreComputationGraph(locationToSave); LOG.info("Preprocessed Model Loaded from {}", locationToSave); available = true; } } else if (serialize.trim().toLowerCase(Locale.ROOT).equals("no")) { LOG.info("Weight graph model loaded via dl4j Helper functions"); model = helper.loadModel(); available = true; } else { throw new TikaConfigException("Configuration Error. serialization can be either yes or no."); } if (!available) { return; } HashMap<Pattern, String> patterns = new HashMap<>(); patterns.put(Pattern.compile(outPattern), null); setMetadataExtractionPatterns(patterns); <START> setIgnoredLineConsumer(IGNORED_LINE_LOGGER); <END> } catch (Exception e) { LOG.warn("exception occured"); throw new TikaConfigException(e.getMessage(), e); } }</code><technical_language>lines needed right</technical_language>

Target:
public void initialize(Map<String, Param> params) throws TikaConfigException { try { if (serialize) { if (locationToSave.exists()) { model = ModelSerializer.restoreComputationGraph(locationToSave); LOG.info("Preprocessed Model Loaded from {}", locationToSave); } else { LOG.warn("Preprocessed Model doesn't exist at {}", locationToSave); locationToSave.getParentFile().mkdirs(); model = MODEL_HELPER.loadModel(); LOG.info("Saving the Loaded model for future use. Saved models are more optimised to consume less resources."); ModelSerializer.writeModel(model, locationToSave, true); } } else { LOG.info("Weight graph model loaded via dl4j Helper functions"); model = MODEL_HELPER.loadModel(); } available = true; } catch (Exception e) { available = false; LOG.warn(e.getMessage(), e); throw new TikaConfigException(e.getMessage(), e); } }
Source:
<code>private Change createChange(CreateChangeOperation operation, boolean updateStatus, IRunnableContext context){ InvocationTargetException exception= null; try { <START> context.run((context == PlatformUI.getWorkbench().getActiveWorkbenchWindow()), fIsChangeCreationCancelable, new WorkbenchRunnableAdapter( <END> operation, ResourcesPlugin.getWorkspace().getRoot())); } catch (InterruptedException e) { setConditionCheckingStatus(null); return null; } catch (InvocationTargetException e) { exception= e; } if (updateStatus) { RefactoringStatus status= null; if (exception != null) { status= new RefactoringStatus(); String msg= exception.getMessage(); if (msg != null) { status.addFatalError(Messages.format(RefactoringUIMessages.RefactoringWizard_see_log, msg)); } else { status.addFatalError(RefactoringUIMessages.RefactoringWizard_Internal_error); } RefactoringUIPlugin.log(exception); } else { status= operation.getConditionCheckingStatus(); } setConditionCheckingStatus(status, operation.getConditionCheckingStyle()); } else { if (exception != null) ExceptionHandler.handle(exception, getContainer().getShell(), RefactoringUIMessages.RefactoringWizard_refactoring, RefactoringUIMessages.RefactoringWizard_unexpected_exception); } Change change= operation.getChange(); return change; }</code><technical_language>introduce new interface ask if run fork not. default true, if new interface is supported context (as before)</technical_language>

Target:
private Change createChange(CreateChangeOperation operation, boolean updateStatus, IRunnableContext context){ InvocationTargetException exception= null; try { context.run(true, fIsChangeCreationCancelable, new WorkbenchRunnableAdapter( operation, ResourcesPlugin.getWorkspace().getRoot())); } catch (InterruptedException e) { setConditionCheckingStatus(null); return null; } catch (InvocationTargetException e) { exception= e; } if (updateStatus) { RefactoringStatus status= null; if (exception != null) { status= new RefactoringStatus(); String msg= exception.getMessage(); if (msg != null) { status.addFatalError(Messages.format(RefactoringUIMessages.RefactoringWizard_see_log, msg)); } else { status.addFatalError(RefactoringUIMessages.RefactoringWizard_Internal_error); } RefactoringUIPlugin.log(exception); } else { status= operation.getConditionCheckingStatus(); } setConditionCheckingStatus(status, operation.getConditionCheckingStyle()); } else { if (exception != null) ExceptionHandler.handle(exception, getContainer().getShell(), RefactoringUIMessages.RefactoringWizard_refactoring, RefactoringUIMessages.RefactoringWizard_unexpected_exception); } Change change= operation.getChange(); return change; }
Source:
<code>public void testDecalin() throws Exception { <START> SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); <END> IAtomContainer mol = sp.parseSmiles("C1CCC2CCCCC2C1"); DescriptorValue value = descriptor.calculate(mol); Assert.assertEquals(0, ((IntegerResult) value.getValue()).intValue()); Assert.assertEquals(1, value.getNames().length); Assert.assertEquals("nSpiroAtoms", value.getNames()[0]); Assert.assertEquals(descriptor.getDescriptorNames()[0], value.getNames()[0]); }</code><technical_language>Consider setting SMILES parser in @BeforeClass ..</technical_language>

Target:
public void testDecalin() throws Exception { IAtomContainer mol = sp.parseSmiles("C1CCC2CCCCC2C1"); DescriptorValue value = descriptor.calculate(mol); Assert.assertEquals(0, ((IntegerResult) value.getValue()).intValue()); Assert.assertEquals(1, value.getNames().length); Assert.assertEquals("nSpiroAtoms", value.getNames()[0]); Assert.assertEquals(descriptor.getDescriptorNames()[0], value.getNames()[0]); }
Source:
<code>public static OzoneObjInfo fromProtobuf(OzoneManagerProtocolProtos.OzoneObj proto) { Builder builder = new Builder() .setResType(ResourceType.valueOf(proto.getResType().name())) .setStoreType(StoreType.valueOf(proto.getStoreType().name())); StringTokenizer tokenizer = new StringTokenizer(proto.getPath(), OzoneConsts.OZONE_URI_DELIMITER); if (tokenizer.hasMoreTokens()) { builder.setVolumeName(tokenizer.nextToken()); } if (tokenizer.hasMoreTokens()) { builder.setBucketName(tokenizer.nextToken()); } <START> StringBuffer sb = new StringBuffer(); <END> while (tokenizer.hasMoreTokens()) { sb.append(OzoneConsts.OZONE_URI_DELIMITER); sb.append(tokenizer.nextToken()); sb.append(OzoneConsts.OZONE_URI_DELIMITER); } builder.setKeyName(sb.toString()); return builder.build(); }</code><technical_language>wrap line 91-97 if (tokenizer.hasMoreTokens()) avoid setting empty keyName keyName is needed</technical_language>

Target:
public static OzoneObjInfo fromProtobuf(OzoneManagerProtocolProtos.OzoneObj proto) { Builder builder = new Builder() .setResType(ResourceType.valueOf(proto.getResType().name())) .setStoreType(StoreType.valueOf(proto.getStoreType().name())); StringTokenizer tokenizer = new StringTokenizer(proto.getPath(), OzoneConsts.OZONE_URI_DELIMITER); if (tokenizer.hasMoreTokens()) { builder.setVolumeName(tokenizer.nextToken()); } if (tokenizer.hasMoreTokens()) { builder.setBucketName(tokenizer.nextToken()); } if (tokenizer.hasMoreTokens()) { StringBuffer sb = new StringBuffer(); while (tokenizer.hasMoreTokens()) { sb.append(OzoneConsts.OZONE_URI_DELIMITER); sb.append(tokenizer.nextToken()); sb.append(OzoneConsts.OZONE_URI_DELIMITER); } builder.setKeyName(sb.toString()); } return builder.build(); }
Source:
<code>GPUDriver(Configuration config) throws Exception { final String discoveryScriptPath = config.getString(DISCOVERY_SCRIPT_PATH); if (StringUtils.isNullOrWhitespaceOnly(discoveryScriptPath)) { <START> throw new FlinkException("Could not find config of the path of gpu discovery script."); <END> } discoveryScript = new File(System.getenv().getOrDefault(ConfigConstants.ENV_FLINK_HOME_DIR, ".") + "/" + discoveryScriptPath); if (!discoveryScript.exists()) { throw new FlinkException("The gpu discovery script does not exist in path " + discoveryScript.getAbsolutePath()); } args = config.getString(DISCOVERY_SCRIPT_ARG); }</code><technical_language>IllegalConfigurationException more descriptive</technical_language>

Target:
GPUDriver(Configuration config) throws Exception { final String discoveryScriptPathStr = config.getString(DISCOVERY_SCRIPT_PATH); if (StringUtils.isNullOrWhitespaceOnly(discoveryScriptPathStr)) { throw new IllegalConfigurationException( String.format("GPU discovery script ('%s') is not configured.", ExternalResourceOptions.genericKeyWithSuffix(DISCOVERY_SCRIPT_PATH.key()))); } Path discoveryScriptPath = Paths.get(discoveryScriptPathStr); if (!discoveryScriptPath.isAbsolute()) { discoveryScriptPath = Paths.get(System.getenv().getOrDefault(ConfigConstants.ENV_FLINK_HOME_DIR, "."), discoveryScriptPathStr); } discoveryScriptFile = discoveryScriptPath.toFile(); if (!discoveryScriptFile.exists()) { throw new FileNotFoundException(String.format("The gpu discovery script does not exist in path %s.", discoveryScriptFile.getAbsolutePath())); } if (!discoveryScriptFile.canExecute()) { throw new FlinkException(String.format("The discovery script %s is not executable.", discoveryScriptFile.getAbsolutePath())); } args = config.getString(DISCOVERY_SCRIPT_ARG); }
Source:
<code>Mono<Response<ConfigurationSetting>> addSetting(ConfigurationSetting setting, Context context) { validateSetting(setting); return service.setKey(serviceEndpoint, setting.getKey(), setting.getLabel(), setting, null, getETagValue(ETAG_ANY), context) <START> .onErrorResume((Function<Throwable, Mono<Response<ConfigurationSetting>>>) throwable -> { <END> if (throwable instanceof HttpResponseException) { final HttpResponseException e = (HttpResponseException) throwable; final HttpResponse httpResponse = e.getResponse(); if (httpResponse.getStatusCode() == 412) { return Mono.error(new ResourceExistsException("Setting was already present.", httpResponse, throwable)); } } return Mono.error(throwable); }) .doOnSubscribe(ignoredValue -> logger.info("Adding ConfigurationSetting - {}", setting)) .doOnSuccess(response -> logger.info("Added ConfigurationSetting - {}", response.getValue())) .onErrorMap(ConfigurationAsyncClient::addSettingExceptionMapper) .doOnError(error -> logger.warning("Failed to add ConfigurationSetting - {}", setting, error)); }</code><technical_language>overload match class HttpResponse, bother this check. <LINK_0></technical_language>

Target:
Mono<Response<ConfigurationSetting>> addSetting(ConfigurationSetting setting, Context context) { validateSetting(setting); return service.setKey(serviceEndpoint, setting.getKey(), setting.getLabel(), setting, null, getETagValue(ETAG_ANY), context) .onErrorResume(HttpResponseException.class, (Function<Throwable, Mono<Response<ConfigurationSetting>>>) throwable -> { final HttpResponseException e = (HttpResponseException) throwable; final HttpResponse httpResponse = e.getResponse(); if (httpResponse.getStatusCode() == 412) { return Mono.error(new ResourceExistsException("Setting was already present.", httpResponse, throwable)); } return Mono.error(throwable); }) .doOnSubscribe(ignoredValue -> logger.info("Adding ConfigurationSetting - {}", setting)) .doOnSuccess(response -> logger.info("Added ConfigurationSetting - {}", response.getValue())) .onErrorMap(ConfigurationAsyncClient::addSettingExceptionMapper) .doOnError(error -> logger.warning("Failed to add ConfigurationSetting - {}", setting, error)); }
Source:
<code>protected VDSReturnValue getStatsForDomain() { VDS spmVds = <START> LinqUtils.first(getAllRunningVdssInPool()); <END> return runVdsCommand(VDSCommandType.GetStorageDomainStats, new GetStorageDomainStatsVDSCommandParameters(spmVds.getId(), getParameters().getStorageDomainId())); }</code><technical_language>please rename - this host neccessarily spm</technical_language>

Target:
protected VDSReturnValue getStatsForDomain() { VDS vds = LinqUtils.first(getAllRunningVdssInPool()); return runVdsCommand(VDSCommandType.GetStorageDomainStats, new GetStorageDomainStatsVDSCommandParameters(vds.getId(), getParameters().getStorageDomainId())); }
Source:
<code>public String getLine(int lineIndex) { try { final IRegion lineRegion = getLineInformation(lineIndex); return document.get(lineRegion.getOffset(), lineRegion.getLength()); } catch (BadLocationException e) { ConsolePlugin.log(e); <START> return null; <END> } }</code><technical_language>non-null returns</technical_language>

Target:
public String getLine(int lineIndex) { try { final IRegion lineRegion = getLineInformation(lineIndex); return document.get(lineRegion.getOffset(), lineRegion.getLength()); } catch (BadLocationException e) { ConsolePlugin.log(e); return ""; } }
Source:
<code><START> private <A> boolean all(List<A> list, Function<A, Boolean> predicate) { <END> for (A a : list) if (!predicate.apply(a)) return false; return true; }</code><technical_language>This static</technical_language>

Target:
private static <A> boolean all(List<A> list, Function<A, Boolean> predicate) { for (A a : list) if (!predicate.apply(a)) return false; return true; }
Source:
<code>protected void postProcessReplyProducer(AbstractReplyProducingMessageHandler handler) { if (this.sendTimeout != null) { handler.setSendTimeout(sendTimeout); } if (this.requiresReply != null) { handler.setRequiresReply(requiresReply); } if (!(handler instanceof AbstractMessageSplitter)) { Assert.isNull(this.applySequence, "Cannot set applySequence if the referenced bean is " + "an AbstractReplyProducingMessageHandler, but not an AbstractMessageSplitter"); Assert.isNull(this.delimiters, "Cannot set delimiters if the referenced bean is not an " + "an AbstractReplyProducingMessageHandler, but not an AbstractMessageSplitter"); } else { AbstractMessageSplitter splitter = (AbstractMessageSplitter) handler; if (this.delimiters != null) { Assert.isTrue(splitter instanceof DefaultMessageSplitter, "The 'delimiters' property is only available" + " for a Splitter definition where no 'ref', 'expression', or inner bean has been provided."); ((DefaultMessageSplitter) splitter).setDelimiters(this.delimiters); } if (this.applySequence != null) { splitter.setApplySequence(applySequence); } <START> else { <END> splitter.setApplySequence(true); } } }</code><technical_language>default is true in AbstractMessageSplitter: private boolean applySequence = true; ...but this is harmless (unless some day decide change default)</technical_language>

Target:
protected void postProcessReplyProducer(AbstractReplyProducingMessageHandler handler) { if (this.sendTimeout != null) { handler.setSendTimeout(sendTimeout); } if (this.requiresReply != null) { handler.setRequiresReply(requiresReply); } if (!(handler instanceof AbstractMessageSplitter)) { Assert.isNull(this.applySequence, "Cannot set applySequence if the referenced bean is " + "an AbstractReplyProducingMessageHandler, but not an AbstractMessageSplitter"); Assert.isNull(this.delimiters, "Cannot set delimiters if the referenced bean is not an " + "an AbstractReplyProducingMessageHandler, but not an AbstractMessageSplitter"); } else { AbstractMessageSplitter splitter = (AbstractMessageSplitter) handler; if (this.delimiters != null) { Assert.isTrue(splitter instanceof DefaultMessageSplitter, "The 'delimiters' property is only available" + " for a Splitter definition where no 'ref', 'expression', or inner bean has been provided."); ((DefaultMessageSplitter) splitter).setDelimiters(this.delimiters); } if (this.applySequence != null) { splitter.setApplySequence(applySequence); } } }
Source:
<code>public void printK(K result, KRunOptions options, CompiledDefinition compiledDef) { Set<String> patternVariables = new HashSet<>(); StringBuilder sb = new StringBuilder(); if (options.pattern != null) { new VisitK() { @Override public void apply(KVariable k) { patternVariables.add(k.name()); super.apply(k); } }.apply(parsePattern(files, kem, options.pattern, compiledDef, Source.apply("<command line: --pattern>")).body()); } <START> if (result instanceof KApply && ((KApply) result).klabel().equals(KLabel(KLabels.OR))) { <END> Some<Tuple2<KLabel, scala.collection.immutable.List<K>>> searchResults = KApply$.MODULE$.unapply((KApply) result); scala.collection.Seq<K> seq = Assoc.flatten(KORE.KLabel(KLabels.OR), searchResults.get()._2(), KORE.KLabel(KLabels.ML_FALSE)); List<K> resultList = mutable(seq).stream().filter(x -> !x.getClass().toString().contains("BoolToken")).collect(Collectors.toList()); resultList.sort(Comparator.comparing(K::toString)); Set<String> observedResults = new HashSet<>(); if (resultList.size() == 0) { sb.append("No Search Results\n"); } else { int index = 1; for (int i = 0; i < resultList.size(); ++i) { String conjunctString = filterAnonVarsAndPrint(resultList.get(i), patternVariables, compiledDef, options).toString(); if (!(conjunctString.trim().isEmpty()) && !observedResults.contains(conjunctString)) { sb.append("Solution " + index++ + "\n"); sb.append(conjunctString); observedResults.add(conjunctString); } } if (index == 1) { sb.append("No Search Results\n"); } } outputFile(sb.toString(), options); return; } else if (result.getClass().toString().contains("BoolToken")) { outputFile("No Search Results\n", options); return; } outputFile(filterAnonVarsAndPrint(result, patternVariables, compiledDef, options).toString(), options); }</code><technical_language>ML</technical_language>

Target:
public void printK(K result, KRunOptions options, CompiledDefinition compiledDef) { Set<String> patternVariables = getPatternVariableNames(options, compiledDef); StringBuilder sb = new StringBuilder(); if (result instanceof KApply && ((KApply) result).klabel().equals(KLabel(KLabels.ML_OR))) { List<K> resultList = Assoc.flatten(KLabel(KLabels.ML_OR), ((KApply) result).items(), KLabel(KLabels.ML_FALSE)) .stream().sorted(Comparator.comparing(K::toString)).collect(Collectors.toList()); Set<String> observedResults = new HashSet<>(); if (resultList.size() == 0) { sb.append("No Search Results\n"); } else { int index = 1; for (int i = 0; i < resultList.size(); ++i) { String conjunctString = filterAnonVarsAndPrint(resultList.get(i), patternVariables, compiledDef, options).toString(); if (!(conjunctString.trim().isEmpty()) && !observedResults.contains(conjunctString)) { sb.append("Solution " + index++ + "\n"); sb.append(conjunctString); observedResults.add(conjunctString); } } if (index == 1) { sb.append("No Search Results\n"); } } outputFile(sb.toString(), options); return; } if (result instanceof KApply && ((KApply) result).klabel().name().equals(KLabels.ML_FALSE)) { outputFile("No Search Results\n", options); return; } outputFile(filterAnonVarsAndPrint(result, patternVariables, compiledDef, options).toString(), options); }
Source:
<code>public List<HostAndPort> getAddresses() { <START> return Collections.singletonList(HostAndPort.fromHost("localhost")); <END> }</code><technical_language>ImmutableList.of</technical_language>

Target:
public List<HostAndPort> getAddresses() { return ImmutableList.of(HostAndPort.fromHost("localhost")); }
Source:
<code>protected boolean isAcpOrIacpExists(final CallbackProperties properties) { final List accessConstentValues = properties.getEvidenceAccessConstent(); final List evidenceInstanceAccessConsentValues = properties.getEvidenceInstantAccessConsent(); <START> if(CollectionUtils.isEmpty(accessConstentValues) && CollectionUtils.isEmpty(evidenceInstanceAccessConsentValues)){ <END> return Boolean.FALSE; } return Boolean.TRUE; }</code><technical_language>This popped sonarqube. simplified to: return !Collections.IsEmpty(accessConsentValues) && !CollectionUtils.isEmpty(evidenceInstanceAccessConsentValues); need for if statement</technical_language>

Target:
protected boolean isAcpOrIacpExists(final CallbackProperties properties) { return CollectionUtils.isNotEmpty(properties.getEvidenceAccessConstent()) && CollectionUtils.isNotEmpty(properties.getEvidenceInstantAccessConsent()); }
Source:
<code>public AddVmTemplateCommand(T parameters) { super(parameters); super.setVmId(parameters.getMasterVm().getId()); super.setVmTemplateName(parameters.getName()); setVdsGroupId(parameters.getMasterVm().getvds_group_id()); if (getVm() != null) { VmHandler.updateDisksFromDb(getVm()); setStoragePoolId(getVm().getstorage_pool_id()); } <START> imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap(); <END> setQuotaId(getVmTemplate().getQuotaId()); }</code><technical_language>is NullPointer</technical_language>

Target:
public AddVmTemplateCommand(T parameters) { super(parameters); super.setVmId(parameters.getMasterVm().getId()); super.setVmTemplateName(parameters.getName()); setVdsGroupId(parameters.getMasterVm().getvds_group_id()); if (getVm() != null) { VmHandler.updateDisksFromDb(getVm()); setStoragePoolId(getVm().getstorage_pool_id()); } imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap(); setQuotaId(getVm().getQuotaId()); }
Source:
<code>public int[] getAcceptableTokens() { return new int[] { TokenTypes.COMMA, TokenTypes.SEMI, TokenTypes.TYPECAST, TokenTypes.LITERAL_IF, TokenTypes.LITERAL_ELSE, <START> TokenTypes.LITERAL_WHILE, <END> TokenTypes.LITERAL_DO, TokenTypes.LITERAL_FOR, }; }</code><technical_language>I add token DO_WHILE. WHILE = while (true) { } DO_WHILE = do { // this is DO while (true); // this is DO_WHILE overlooked if external users WHILE DO_WHILE token. @romani Do agree</technical_language>

Target:
public int[] getAcceptableTokens() { return new int[] { TokenTypes.COMMA, TokenTypes.SEMI, TokenTypes.TYPECAST, TokenTypes.LITERAL_IF, TokenTypes.LITERAL_ELSE, TokenTypes.LITERAL_WHILE, TokenTypes.LITERAL_DO, TokenTypes.LITERAL_FOR, TokenTypes.DO_WHILE, }; }
Source:
<code>private List<LUNs> getLunsFromVgInfo() { <START> GetVGInfoVDSCommandParameters params = new GetVGInfoVDSCommandParameters( <END> Optional.ofNullable(getVds()).map(VDS::getId).orElse(null), getStorageDomain().getStorage()); if (getVds() == null) { return (List<LUNs>) VdsCommandsHelper.runVdsCommandWithoutFailover( VDSCommandType.GetVGInfo, params, getStoragePoolId(), this).getReturnValue(); } return (List<LUNs>) runVdsCommand(VDSCommandType.GetVGInfo, params).getReturnValue(); }</code><technical_language>Is relevant for this patch context? a (correct) unrelated fix.</technical_language>

Target:
private List<LUNs> getLunsFromVgInfo() { GetVGInfoVDSCommandParameters params = new GetVGInfoVDSCommandParameters( getVdsId(), getStorageDomain().getStorage()); if (getVdsId() == null) { return (List<LUNs>) VdsCommandsHelper.runVdsCommandWithoutFailover( VDSCommandType.GetVGInfo, params, getStoragePoolId(), null).getReturnValue(); } return (List<LUNs>) runVdsCommand(VDSCommandType.GetVGInfo, params).getReturnValue(); }