auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void loadNextReader() { if (pathIterator.hasNext()) { String path = pathIterator.next(); if (path.startsWith(S3_PREFIX)) { path = path.substring(S3_PREFIX.length()); } int slashIndex = path.indexOf("/"); if ((slashIndex < 0) || (slashIndex == (path.length() - 1))) { loadNextReader(); return; } String bucket = path.substring(0, slashIndex); String key = path.substring(slashIndex + 1); int retry = 2; while (retry > 0) { try { if (key.endsWith("/")) { ObjectListing objectListing = s3Client.listObjects(new ListObjectsRequest().withBucketName(bucket).withPrefix(key)); List<String> paths = Lists.newArrayList(); for (S3ObjectSummary summary : objectListing.getObjectSummaries()) { if (!summary.getKey().equals(key) && (summary.getSize() > 0)) { paths.add(summary.getBucketName() + "/" + summary.getKey()); } } currentReader = new PathReader(paths); } else { S3Object object = s3Client.getObject(bucket, key); currentReader = new BufferedReader(new InputStreamReader(object.getObjectContent())); } } catch (AmazonS3Exception e) { LOG.warning(String.format("Exception while trying to read bucket:%s, key:%s. Retrying.", bucket, key)); ensureClient(true); retry--; continue; } break; } } }

Target:
private void loadNextReader() throws IOException { if (pathIterator.hasNext()) { String path = pathIterator.next(); if (path.startsWith(S3_PREFIX)) { path = path.substring(S3_PREFIX.length()); } int slashIndex = path.indexOf("/"); if ((slashIndex < 0) || (slashIndex == (path.length() - 1))) { loadNextReader(); return; } String bucket = path.substring(0, slashIndex); String key = path.substring(slashIndex + 1); int retry = DEFAULT_RETRY; while (retry > 0) { try { if (key.endsWith("/")) { ObjectListing objectListing = s3Client.listObjects(new ListObjectsRequest().withBucketName(bucket).withPrefix(key)); List<String> paths = Lists.newArrayList(); for (S3ObjectSummary summary : objectListing.getObjectSummaries()) { if (!summary.getKey().equals(key) && (summary.getSize() > 0)) { paths.add(summary.getBucketName() + "/" + summary.getKey()); } } currentReader = new PathReader(paths); } else { S3Object object = s3Client.getObject(bucket, key); currentReader = new BufferedReader(new InputStreamReader(object.getObjectContent())); } return; } catch (AmazonS3Exception e) { LOG.warning(String.format("Exception while trying to read bucket:%s, key:%s. Exception code:%s, message:%s. Retrying.", bucket, key, e.getErrorCode(), e.getMessage())); resetS3Client(); retry--; } } throw new IOException(String.format("Exception while trying to read bucket:%s, key:%s", bucket, key)); } }
Source:
public void shouldReduceTwoNonEmptyListsAndReturnConcatenation() { final List<Integer> listOne = Collections.unmodifiableList( IntStream.range(0, 5) .boxed() .collect(Collectors.toList()) ); final List<Integer> listTwo = Collections.unmodifiableList( IntStream.range(5, 10) .boxed() .collect(Collectors.toList()) ); final List<Integer> actual = ListOps.reduce(listTwo, listOne, accumulator, combiner); final List<Integer> expected = IntStream.range(0, 10) .boxed() .collect(Collectors.toList()); assertNotNull(actual); assertFalse(actual.isEmpty()); assertEquals(expected, actual); }

Target:
public void shouldReduceTwoNonEmptyListsAndReturnConcatenation() { final List<Integer> listOne = Collections.unmodifiableList( Arrays.asList(0, 1, 2, 3, 4) ); final List<Integer> listTwo = Collections.unmodifiableList( Arrays.asList(5, 6, 7, 8, 9) ); final List<Integer> actual = ListOps.reduce(listTwo, listOne, accumulator, combiner); final List<Integer> expected = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); assertNotNull(actual); assertFalse(actual.isEmpty()); assertEquals(expected, actual); }
Source:
public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker arg0) { Intent i = new Intent(MapsActivity.this, MapImage.class); i.putExtra("path", arg0.getTitle()); Log.e("Image", arg0.getTitle()); startActivity(i); return true; } }); ArrayList<String> listOfAllImages = getImagesPath(this); int i; for (i = 0; i < listOfAllImages.size(); i++) { ExifInterface exif = null; try { exif = new ExifInterface(listOfAllImages.get(i)); } catch (IOException e) { e.printStackTrace(); } float[] latLong = new float[2]; boolean hasLatLong = exif.getLatLong(latLong); if (hasLatLong) { System.out.println("Latitude: " + latLong[0]); System.out.println("Longitude: " + latLong[1]); mMap.addMarker(new MarkerOptions() .position(new LatLng(latLong[0], latLong[1])) .title(listOfAllImages.get(i))); mMap.moveCamera(CameraUpdateFactory.newLatLng(new LatLng(latLong[0], latLong[1]))); } } }

Target:
public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() { @Override public void onInfoWindowClick(Marker arg0) { Intent i = new Intent(MapsActivity.this, MapImage.class); i.putExtra("path", arg0.getTitle()); Log.e("Image", arg0.getTitle()); startActivity(i); } }); mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() { @Override public View getInfoWindow(Marker arg0) { return null; } @Override public View getInfoContents(Marker arg0) { View v = getLayoutInflater().inflate(R.layout.marker_image, null); LatLng latLng = arg0.getPosition(); ImageView markerImage = (ImageView) v.findViewById(R.id.marker_image); final String p = arg0.getTitle(); markerImage.setImageURI(Uri.parse(arg0.getTitle())); return v; } }); mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker arg0) { arg0.showInfoWindow(); return true; } }); ArrayList<String> listOfAllImages = getImagesPath(this); int i; for (i = 0; i < listOfAllImages.size(); i++) { ExifInterface exif = null; try { exif = new ExifInterface(listOfAllImages.get(i)); } catch (IOException e) { e.printStackTrace(); } float[] latLong = new float[2]; boolean hasLatLong = exif.getLatLong(latLong); if (hasLatLong) { System.out.println("Latitude: " + latLong[0]); System.out.println("Longitude: " + latLong[1]); mMap.addMarker(new MarkerOptions() .position(new LatLng(latLong[0], latLong[1])) .title(listOfAllImages.get(i))); mMap.moveCamera(CameraUpdateFactory.newLatLng(new LatLng(latLong[0], latLong[1]))); } } }
Source:
public void testExpired() throws InterruptedException, IOException { final ExpiringCache<String, String> CACHE = new ExpiringCache<String, String>(CACHE_EXPIRY, new ExpiringCache.LoadAction<String, String>() { @Override public String load(String query) throws IOException { return RandomStringUtils.random(8); } }); String value1 = CACHE.get(TEST_QUERY); Thread.sleep(CACHE_EXPIRY + 100); String value2 = CACHE.get(TEST_QUERY); assertNotEquals(value1, value2); }

Target:
public void testExpired() throws InterruptedException { final ExpiringCache<String> single_cache = new ExpiringCache<String>(ExpiringCacheMapTest.CACHE_EXPIRY, ExpiringCacheMapTest.CACHE_ACTION); String value1 = single_cache.getValue(); assertFalse(single_cache.isExpired()); Thread.sleep(ExpiringCacheMapTest.CACHE_EXPIRY + 100); assertTrue(single_cache.isExpired()); String value2 = single_cache.getValue(); assertFalse(single_cache.isExpired()); assertNotEquals(value1, value2); }
Source:
default NothingHappened nothing() { return NothingHappened.getDefaultInstance(); }

Target:
default Nothing nothing() { return Nothing.getDefaultInstance(); }
Source:
protected void doSetUserAttributesWithID(String userID, Map<String, List<String>> claimAttributesToAdd, Map<String, List<String>> claimAttributesToDelete, Map<String, List<String>> claimAttributesToReplace, String profileName) throws UserStoreException, NotImplementedException { if (log.isDebugEnabled()) { log.debug("doSetUserAttributesWithID operation is not implemented in: " + this.getClass()); } throw new NotImplementedException("doSetUserAttributesWithID operation is not implemented in: " + this.getClass()); }

Target:
protected void doSetUserAttributesWithID(String userID, Map<String, List<String>> claimAttributesToAdd, Map<String, List<String>> claimAttributesToDelete, Map<String, List<String>> claimAttributesToReplace, String profileName) throws UserStoreException, NotImplementedException { throw new NotImplementedException("doSetUserAttributesWithID operation is not implemented in: " + this.getClass()); }
Source:
protected void setup(Context context) throws IOException, InterruptedException { config = HadoopDruidIndexerConfig.fromConfiguration(context.getConfiguration()); parser = config.getParser(); granularitySpec = config.getGranularitySpec(); reportParseExceptions = !config.isIgnoreInvalidRows(); if (config.getPathSpec() instanceof PartitionPathSpec) { PartitionPathSpec partitionPathSpec = (PartitionPathSpec)config.getPathSpec(); InputSplit split = context.getInputSplit(); Class<? extends InputSplit> splitClass = split.getClass(); FileSplit fileSplit = null; if (splitClass.equals(FileSplit.class)) { fileSplit = (FileSplit) split; } else if (splitClass.getName().equals("org.apache.hadoop.mapreduce.lib.input.TaggedInputSplit")) { try { Method getInputSplitMethod = splitClass .getDeclaredMethod("getInputSplit"); getInputSplitMethod.setAccessible(true); fileSplit = (FileSplit) getInputSplitMethod.invoke(split); } catch (Exception e) { throw new IOException(e); } } Path filePath = fileSplit.getPath(); partitionDimValues = partitionPathSpec.getPartitionValues(filePath); if (partitionDimValues.size() == 0) { partitionDimValues = null; } else { partitionDims = partitionDimValues.keySet(); } } }

Target:
protected void setup(Context context) throws IOException, InterruptedException { config = HadoopDruidIndexerConfig.fromConfiguration(context.getConfiguration()); parser = config.getParser(); granularitySpec = config.getGranularitySpec(); reportParseExceptions = !config.isIgnoreInvalidRows(); dimsMerger = new AdditionalDimsMergerFactory().create(config.getPathSpec().additionalDimValues(context)); }
Source:
public void waitsUntilQueueSizeLowerThanThreshold() throws InterruptedException, ExecutionException { assertTimeout(ofMillis(10000), () -> { q.put(100); q.put(200); q.put(300); Callable<Integer> tester = new Callable<Integer>() { @Override public Integer call() throws Exception { q.waitUntilQueueSizeLowerThanThreshold(new DateTime().plusMinutes(1)); return q.size(); } }; Future<Integer> result = newSingleThreadExecutor().submit(tester); sleep(1000); assertThat(result.isDone(), is(false)); q.poll(); sleep(1000); assertThat(result.isDone(), is(false)); q.poll(); sleep(1000); assertThat(result.isDone(), is(true)); assertThat(result.get(), is(1)); }); }

Target:
public void waitsUntilQueueSizeLowerThanThreshold() { assertTimeout(ofMillis(10000), () -> { q.put(100); q.put(200); q.put(300); Callable<Integer> tester = new Callable<Integer>() { @Override public Integer call() throws Exception { q.waitUntilQueueSizeLowerThanThreshold(DateTime.now().plusMinutes(1)); return q.size(); } }; Future<Integer> result = newSingleThreadExecutor().submit(tester); sleep(1000); assertThat(result.isDone(), is(false)); q.poll(); sleep(1000); assertThat(result.isDone(), is(false)); q.poll(); sleep(1000); assertThat(result.isDone(), is(true)); assertThat(result.get(), is(1)); }); }
Source:
private boolean commitPromotionMigrations(PartitionReplica destination, Collection<MigrationInfo> migrations) { internalMigrationListener.onPromotionStart(MigrationParticipant.MASTER, migrations); boolean success = commitPromotionsToDestination(destination, migrations); boolean local = node.getThisAddress().equals(destination.address()); if (!local) { processPromotionCommitResult(destination, migrations, success); } internalMigrationListener.onPromotionComplete(MigrationParticipant.MASTER, migrations, success); partitionService.syncPartitionRuntimeState(); return success; }

Target:
private boolean commitPromotionMigrations(PartitionReplica destination, Collection<MigrationInfo> migrations) { internalMigrationListener.onPromotionStart(MigrationParticipant.MASTER, migrations); boolean success = commitPromotionsToDestination(destination, migrations); boolean local = destination.isIdentical(node.getLocalMember()); if (!local) { processPromotionCommitResult(destination, migrations, success); } internalMigrationListener.onPromotionComplete(MigrationParticipant.MASTER, migrations, success); partitionService.syncPartitionRuntimeState(); return success; }
Source:
private IFileRevision getFileRevision(String revision) { if (entries != null) { for (IFileRevision entrie : entries) { if (entrie.getContentIdentifier().equals(revision)) { return entrie; } } } else if (cvsFileHistory != null) { return cvsFileHistory.getFileRevision(revision); } return null; }

Target:
private IFileRevision getFileRevision(String revision) { if (entries != null) { for (IFileRevision entry : entries) { if (entry.getContentIdentifier().equals(revision)) { return entry; } } } else if (cvsFileHistory != null) { return cvsFileHistory.getFileRevision(revision); } return null; }
Source:
byte[] byteArrayFromInt(int val) { byte[] b = new byte[4]; b[3] = (byte) (val); b[2] = (byte) (val >>> 8); b[1] = (byte) (val >>> 16); b[0] = (byte) (val >>> 24); return b; }

Target:
byte[] byteArrayFromInt(int val) { return new byte[] { (byte) (val >>> 24), (byte) (val >>> 16), (byte) (val >>> 8), (byte) (val) }; }
Source:
public static Obs generateOpenMRSObs(Observation observation, List<String> errors) { Obs obs = new Obs(); obs.setComment(observation.getComments()); if (observation.getSubject() != null) { ResourceReferenceDt subjectref = observation.getSubject(); IdDt id = subjectref.getReference(); String uri = id.getValue(); String[] paths = uri.split("/"); String patientUuid = paths[1]; obs.setPerson(Context.getPersonService().getPersonByUuid(patientUuid)); } else { errors.add("Subject cannot be null"); } DateTimeDt dateApplies = (DateTimeDt) observation.getApplies(); obs.setObsDatetime(dateApplies.getValue()); Date instant = observation.getIssued(); obs.setDateCreated(instant); CodeableConceptDt dt = observation.getCode(); List<CodingDt> dts = dt.getCoding(); CodingDt coding = dts.get(0); String conceptUuid = coding.getCode(); Concept concept = Context.getConceptService().getConceptByUuid(conceptUuid); obs.setConcept(concept); if (concept.isNumeric()) { QuantityDt quantity = (QuantityDt) observation.getValue(); BigDecimal bd = quantity.getValue(); double doubleValue = bd.doubleValue(); obs.setValueNumeric(doubleValue); } if (observation.getEncounter() != null) { ResourceReferenceDt encounter = observation.getEncounter(); IdDt ref = encounter.getReference(); String reference = ref.getValue(); String[] encpaths = reference.split("/"); String encounterUuid = encpaths[1]; obs.setEncounter(Context.getEncounterService().getEncounterByUuid(encounterUuid)); } return obs; }

Target:
public static Obs generateOpenMRSObs(Observation observation, List<String> errors) { Obs obs = new Obs(); obs.setComment(observation.getComments()); if (observation.getSubject() != null) { ResourceReferenceDt subjectref = observation.getSubject(); IdDt id = subjectref.getReference(); String patientUuid = id.getIdPart(); obs.setPerson(Context.getPersonService().getPersonByUuid(patientUuid)); } else { errors.add("Subject cannot be null"); } DateTimeDt dateApplies = (DateTimeDt) observation.getApplies(); obs.setObsDatetime(dateApplies.getValue()); Date instant = observation.getIssued(); obs.setDateCreated(instant); String conceptUuid = null; try { CodeableConceptDt dt = observation.getCode(); List<CodingDt> dts = dt.getCoding(); CodingDt coding = dts.get(0); conceptUuid = coding.getCode(); } catch (NullPointerException e) { errors.add("Code cannot be empty"); } Concept concept = Context.getConceptService().getConceptByUuid(conceptUuid); obs.setConcept(concept); if (concept != null) { if (concept.isNumeric()) { QuantityDt quantity = (QuantityDt) observation.getValue(); BigDecimal bd = quantity.getValue(); double doubleValue = bd.doubleValue(); obs.setValueNumeric(doubleValue); } } else { errors.add("Couldn't find a concept for the given uuid"); } if (observation.getEncounter() != null) { ResourceReferenceDt encounter = observation.getEncounter(); IdDt ref = encounter.getReference(); String encounterUuid = ref.getIdPart(); obs.setEncounter(Context.getEncounterService().getEncounterByUuid(encounterUuid)); } return obs; }
Source:
private void addMetaData(Object object, String version) { HashMapDataStore hashMapDataStore = hashMapDataStores.computeIfAbsent(version, ERROR_OUT); EntityDictionary dictionary = hashMapDataStore.getDictionary(); Map<Class<?>, Map<String, Object>> dataStore = hashMapDataStore.getStorage(); Class<?> cls = dictionary.lookupBoundClass(object.getClass()); String id = dictionary.getId(object); if (dataStore.get(cls).containsKey(id)) { if (!dataStore.get(cls).get(id).equals(object)) { throw new DuplicateMappingException("Duplicated " + cls.getSimpleName() + " metadata " + id); } } else { dataStore.get(cls).put(id, object); } }

Target:
private void addMetaData(Object object, String version) { HashMapDataStore hashMapDataStore = hashMapDataStores.computeIfAbsent(version, SERVER_ERROR); EntityDictionary dictionary = hashMapDataStore.getDictionary(); Class<?> cls = dictionary.lookupBoundClass(object.getClass()); String id = dictionary.getId(object); if (hashMapDataStore.get(cls).containsKey(id)) { if (!hashMapDataStore.get(cls).get(id).equals(object)) { throw new DuplicateMappingException("Duplicated " + cls.getSimpleName() + " metadata " + id); } } else { hashMapDataStore.get(cls).put(id, object); } }
Source:
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { if (ThingStatus.ONLINE.equals(bridgeStatusInfo.getStatus()) && ThingStatusDetail.BRIDGE_OFFLINE.equals(getThing().getStatusInfo().getStatusDetail())) { updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.NONE); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); } }

Target:
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { if (bridgeStatusInfo.getStatus() == ThingStatus.OFFLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); } }
Source:
public void updateUnits() { this.prefs.setUnits(xunit, yunit); fire(currentSed, VisualizerCommand.RESET); }

Target:
public void updateUnits() { plotter.getVisualizerPreferences().getSedPreferences(plotter.getSed()).setUnits(xunit, yunit); fire(plotter.getSed(), VisualizerCommand.RESET); }
Source:
public static List<EStructuralFeature> getFeaturesToCopy(EClass eClass) { List<EStructuralFeature> featuresToCopy = new ArrayList<>(); eClass.getEAllStructuralFeatures().stream().filter(EReference.class::isInstance).map(EReference.class::cast).forEach(eReference -> { EClass featureType = eReference.getEReferenceType(); if (isWidgetAction(featureType) || isToolbarAction(featureType) || isStyle(featureType) || isInitialOperation(featureType)) { featuresToCopy.add(eReference); } }); return featuresToCopy; }

Target:
public static List<EStructuralFeature> getFeaturesToCopy(EClass eClass) { List<EStructuralFeature> featuresToCopy = new ArrayList<>(); eClass.getEAllStructuralFeatures().stream().filter(EReference.class::isInstance).map(EReference.class::cast).forEach(eReference -> { EClass featureType = eReference.getEReferenceType(); if (shouldCopy(featureType)) { featuresToCopy.add(eReference); } }); return featuresToCopy; }
Source:
public void onSegmentEnd(ILiveStreamRecord liveStreamRecord) { logger.info("Stream [" + stream.getName() + "] segment number [" + this.getSegmentNumber() + "] duration [" + this.getCurrentDuration() + "]"); if (this.getCurrentDuration() == 0) { logger.warn("Stream [" + stream.getName() + "] include duration [" + this.getCurrentDuration() + "]"); return; } AppendRecordingTimerTask appendRecording = new AppendRecordingTimerTask(file.getAbsolutePath(), isLastChunk, (double) this.getCurrentDuration() / 1000) { @Override public void run() { KalturaLiveEntry updatedEntry; logger.debug("Running appendRecording task"); if (serverConfiguration.containsKey(Constants.COPY_SEGMENT_TO_LOCATION_FIELD_NAME)) { copySegmentToLocationFieldsName(filePath); } logger.info("Stream [" + stream.getName() + "] file [" + filePath + "] changing group name to [" + group.getName() + "]"); if (group != null) { setGroupPermision(filePath); } if (!KalturaAPI.getKalturaAPI().isNewRecordingEnabled(liveEntry)) { updatedEntry = appendRecording(liveEntry, liveAsset.id, index, filePath, appendTime, lastChunkFlag); if (updatedEntry != null){ liveEntry = updatedEntry; } } } }; Timer appendRecordingTimer = new Timer("appendRecording-"+liveEntry.id+"-"+liveAsset.id, true); appendRecordingTimer.schedule(appendRecording, 1); this.isLastChunk = false; }

Target:
public void onSegmentEnd(ILiveStreamRecord liveStreamRecord) { logger.info("Stream [" + stream.getName() + "] segment number [" + this.getSegmentNumber() + "] duration [" + this.getCurrentDuration() + "]"); if (this.getCurrentDuration() == 0) { logger.warn("Stream [" + stream.getName() + "] include duration [" + this.getCurrentDuration() + "]"); return; } AppendRecordingTimerTask appendRecording = new AppendRecordingTimerTask(file.getAbsolutePath(), isLastChunk, (double) this.getCurrentDuration() / 1000) { @Override public void run() { KalturaLiveEntry updatedEntry; logger.debug("Running appendRecording task"); if (serverConfiguration.containsKey(Constants.COPY_SEGMENT_TO_LOCATION_FIELD_NAME)) { copySegmentToLocationFieldsName(filePath); } logger.info("Stream [" + stream.getName() + "] file [" + filePath + "] changing group name to [" + group.getName() + "]"); if (group != null) { setGroupPermision(filePath); } if (!isNewLiveRecordingEnabled) { updatedEntry = appendRecording(liveEntry, liveAsset.id, index, filePath, appendTime, lastChunkFlag); if (updatedEntry != null){ liveEntry = updatedEntry; } } } }; Timer appendRecordingTimer = new Timer("appendRecording-"+liveEntry.id+"-"+liveAsset.id, true); appendRecordingTimer.schedule(appendRecording, 1); this.isLastChunk = false; }
Source:
public synchronized ServerTemplateKey getTemplateKey(String id) { return templateKeyMap.get(id); }

Target:
public ServerTemplateKey getTemplateKey(String id) { return templateKeyMap.get(id); }
Source:
public void save(File file) { try { PropertiesConfiguration pconf = newPropertiesConfiguration(); pconf.append(internalConfig); new FileHandler(pconf).save(file); } catch (ConfigurationException e) { throw new FluoException(e); } }

Target:
public void save(File file) { try (Writer writer = Files.newBufferedWriter(file.toPath())) { PropertiesConfiguration pconf = new PropertiesConfiguration(); pconf.append(internalConfig); pconf.getLayout().save(pconf, writer); } catch (ConfigurationException | IOException e) { throw new FluoException(e); } }
Source:
public static String toProtobufFormat(String value) { return value.replaceAll("\\.", "__") .replaceAll("/", "__") .replaceAll(":", "__") .replaceAll("\\[", "__") .replaceAll("]", "__") .replaceAll("-", "_"); }

Target:
public static String toProtobufFormat(String value) { return INVALID_CHAR.matcher(value).replaceAll("__") .replaceAll("-", "_"); }
Source:
protected void run() throws Exception { CommitCommand commitCmd=new Git(db).commit(); if (author!=null) commitCmd.setAuthor(new PersonIdent(author)); if (message!=null) commitCmd.setMessage(message); commitCmd.call(); }

Target:
protected void run() throws NoHeadException, NoMessageException, ConcurrentRefUpdateException, JGitInternalException, Exception { CommitCommand commitCmd = new Git(db).commit(); if (author != null) commitCmd.setAuthor(new PersonIdent(author)); if (message != null) commitCmd.setMessage(message); Ref head = db.getRef(Constants.HEAD); RevCommit commit = commitCmd.call(); String branchName; if (!head.isSymbolic()) branchName="detached HEAD"; else { branchName = head.getTarget().getName(); if (branchName.startsWith(Constants.R_HEADS)) branchName = branchName.substring(Constants.R_HEADS.length()); } out.println("[" + branchName + " " + commit.name() + "] " + commit.getShortMessage()); }
Source:
public void afterFromProto(Message proto) { Topology.Rule rule = (Topology.Rule)proto; UUID id = UUIDUtil.fromProto(rule.getId()); if (!rule.hasAction()) { throw new ZoomConvert.ConvertException( "Rule " + id + " has no action set (" + rule + ")"); } switch (rule.getType()) { case JUMP_RULE: if (rule.getAction() != Topology.Rule.Action.JUMP) throw new ZoomConvert.ConvertException( "Rule " + id + " is a JUMP rule but does not have its " + "action set to JUMP (" + rule + ")"); break; case NAT_RULE: if (!rule.getNatRuleData().getReverse() && rule.getNatRuleData().getNatTargetsCount() == 0) { throw new ZoomConvert.ConvertException( "Rule " + id + " is a forward NAT rule but has no " + "targets set (" + rule + ")"); } break; case TRACE_RULE: if (rule.getAction() != Topology.Rule.Action.CONTINUE) throw new ZoomConvert.ConvertException( "Rule " + id + " is a TRACE rule but its action is not " + " set to CONTINUE (" + rule + ")"); break; } condition = ZoomConvert.fromProto(proto, Condition.class); }

Target:
public void afterFromProto(Message proto) { Topology.Rule rule = (Topology.Rule)proto; UUID id = UUIDUtil.fromProto(rule.getId()); if (!rule.hasAction()) { throw new ZoomConvert.ConvertException( "Rule " + id + " has no action set (" + rule + ")"); } switch (rule.getType()) { case JUMP_RULE: if (!rule.hasJumpRuleData()) { throw new ZoomConvert.ConvertException( "Rule " + id + " is a JUMP rule but does not have its " + "JUMP data set (" + rule + ")"); } if (rule.getAction() != Topology.Rule.Action.JUMP) throw new ZoomConvert.ConvertException( "Rule " + id + " is a JUMP rule but does not have its " + "action set to JUMP (" + rule + ")"); break; case NAT_RULE: if (!rule.hasNatRuleData()) { throw new ZoomConvert.ConvertException( "Rule " + id + " is a NAT rule but does not have its " + "NAT data set (" + rule + ")"); } if (!rule.getNatRuleData().getReverse() && rule.getNatRuleData().getNatTargetsCount() == 0) { throw new ZoomConvert.ConvertException( "Rule " + id + " is a forward NAT rule but has no " + "targets set (" + rule + ")"); } break; case TRACE_RULE: if (rule.getAction() != Topology.Rule.Action.CONTINUE) throw new ZoomConvert.ConvertException( "Rule " + id + " is a TRACE rule but its action is not " + " set to CONTINUE (" + rule + ")"); break; } condition = ZoomConvert.fromProto(proto, Condition.class); }
Source:
private List<QueryStateInfo> getAllAggregatedRunningQueriesInfo() { synchronized (root) { InternalResourceGroup resourceGroup = this; List<QueryStateInfo> result = new ArrayList<>(resourceGroup.getAggregatedRunningQueriesInfo()); while (resourceGroup.getPrev().isPresent()) { resourceGroup = resourceGroup.getPrev().get(); result.addAll(resourceGroup.getAggregatedRunningQueriesInfo()); } return ImmutableList.copyOf(result); } }

Target:
private List<QueryStateInfo> getAllAggregatedRunningQueriesInfo() { synchronized (root) { InternalResourceGroup resourceGroup = this; ImmutableList.Builder<QueryStateInfo> result = ImmutableList.builder(); result.addAll(resourceGroup.getAggregatedRunningQueriesInfo()); while (resourceGroup.getPrev().isPresent()) { resourceGroup = resourceGroup.getPrev().get(); result.addAll(resourceGroup.getAggregatedRunningQueriesInfo()); } return result.build(); } }
Source:
private static String parseElementName(XMLStreamReader reader) throws XMLStreamException { int event = reader.getEventType(); while (event != XMLStreamConstants.START_ELEMENT) { event = reader.next(); } String prefix = reader.getPrefix(); if (prefix.length() == 0) { return reader.getLocalName(); } return prefix + ':' + reader.getLocalName(); }

Target:
private static String parseElementName(XMLStreamReader reader) throws XMLStreamException { int event = reader.getEventType(); while (event != XMLStreamConstants.START_ELEMENT) { event = reader.next(); } String prefix = reader.getPrefix(); if (prefix == null || prefix.isEmpty()) { return reader.getLocalName(); } return prefix + ':' + reader.getLocalName(); }
Source:
private void showNearbyPages(NearbyResult result) { getActivity().invalidateOptionsMenu(); if (currentLocation != null) { sortByDistance(result.getList()); } adapter.clear(); addResultsToAdapter(result.getList()); compassViews.clear(); mMarkerList.clear(); mapView.clear(); if (adapter.getCount() == 0) { nearbyListContainer.setVisibility(View.GONE); } else { nearbyListContainer.setVisibility(View.VISIBLE); } for (int i = 0; i < adapter.getCount(); i++) { NearbyPage item = adapter.getItem(i); Location location = item.getLocation(); Marker marker = new CustomMarker(mapView, item.getTitle(), item.getDescription(), new LatLng(location.getLatitude(), location.getLongitude())); marker.setIcon(mMarkerIconPassive); marker.setRelatedObject(item); marker.setHotspot(Marker.HotspotPlace.CENTER); mMarkerList.add(marker); } mapView.addMarkers(mMarkerList); }

Target:
private void showNearbyPages(NearbyResult result) { getActivity().invalidateOptionsMenu(); if (currentLocation != null) { sortByDistance(result.getList()); } adapter.clear(); addResultsToAdapter(result.getList()); compassViews.clear(); mMarkerList.clear(); mapView.clear(); nearbyListContainer.setVisibility(adapter.getCount() == 0 ? View.GONE : View.VISIBLE); for (int i = 0; i < adapter.getCount(); i++) { NearbyPage item = adapter.getItem(i); Location location = item.getLocation(); Marker marker = new CustomMarker(mapView, item.getTitle(), item.getDescription(), new LatLng(location.getLatitude(), location.getLongitude())); marker.setIcon(mMarkerIconPassive); marker.setRelatedObject(item); marker.setHotspot(Marker.HotspotPlace.BOTTOM_CENTER); mMarkerList.add(marker); } mapView.addMarkers(mMarkerList); }
Source:
private Object findFilterTarget(String filterTargetName, EvaluationContext ctx, MethodInvocation mi) { Object filterTarget = null; if (filterTargetName.length() > 0) { filterTarget = ctx.lookupVariable(filterTargetName); if (filterTarget == null) { throw new IllegalArgumentException( "Filter target was null, or no argument with name " + filterTargetName + " found in method"); } } else if (mi.getArguments().length == 1) { Object arg = mi.getArguments()[0]; if (arg.getClass().isArray() || arg instanceof Collection<?>) { filterTarget = arg; } if (filterTarget == null) { throw new IllegalArgumentException( "A PreFilter expression was set but the method argument type" + arg.getClass() + " is not filterable"); } } else if (mi.getArguments().length > 1) { throw new IllegalArgumentException( "Unable to define the method argument for filtering. Specify the filter target."); } if (filterTarget.getClass().isArray()) { throw new IllegalArgumentException( "Pre-filtering on array types is not supported. " + "Using a Collection will solve this problem"); } return filterTarget; }

Target:
private Object findFilterTarget(String filterTargetName, EvaluationContext ctx, MethodInvocation mi) { Object filterTarget = null; if (filterTargetName.length() > 0) { filterTarget = ctx.lookupVariable(filterTargetName); if (filterTarget == null) { throw new IllegalArgumentException( "Filter target was null, or no argument with name " + filterTargetName + " found in method"); } } else if (mi.getArguments().length == 1) { Object arg = mi.getArguments()[0]; if (arg.getClass().isArray() || arg instanceof Collection<?>) { filterTarget = arg; } if (filterTarget == null) { throw new IllegalArgumentException( "A PreFilter expression was set but the method argument type" + arg.getClass() + " is not filterable"); } } else if (mi.getArguments().length > 1) { throw new IllegalArgumentException( "Unable to determine the method argument for filtering. Specify the filter target."); } if (filterTarget.getClass().isArray()) { throw new IllegalArgumentException( "Pre-filtering on array types is not supported. " + "Using a Collection will solve this problem"); } return filterTarget; }
Source:
public String getConstraintName() { return constraintName != null ? constraintName.getSimple() : null; }

Target:
public Optional<String> getConstraintName() { String ret = constraintName != null ? constraintName.getSimple() : null; return Optional.ofNullable(ret); }
Source:
public void saveConfiguration(CronTaskConfigurationDto configuration) throws Exception { logger.debug("CronTaskConfigurationService.saveConfiguration()"); Class c = Class.forName(configuration.getProperty("jobClass")); Object classInstance = c.newInstance(); logger.debug("> " + c.getSuperclass().getCanonicalName()); if (!(classInstance instanceof AbstractCronJob)) { throw new CronTaskException(c + " does not extend " + AbstractCronJob.class); } if (!configuration.isOneTimeExecution()) { cronTaskDataService.save(configuration); } cronJobSchedulerService.scheduleJob(configuration); if (configuration.isOneTimeExecution() || configuration.shouldExecuteImmediately()) { cronJobSchedulerService.executeJob(configuration); } cronTaskEventListenerRegistry.dispatchCronTaskCreatedEvent(configuration.getName()); }

Target:
public void saveConfiguration(CronTaskConfigurationDto configuration) throws Exception { logger.debug("CronTaskConfigurationService.saveConfiguration()"); cronTaskDataService.save(configuration); if (configuration.contains("jobClass")) { cronJobSchedulerService.scheduleJob(configuration); } cronTaskEventListenerRegistry.dispatchCronTaskCreatedEvent(configuration.getName()); }
Source:
void onBindFeedViewHolder(StatisticsHolder holder, StatisticsItem item) { holder.value.setText(Formatter.formatShortFileSize(context, item.totalDownloadSize) + "/" + String.format(Locale.getDefault(), "%d%s", item.episodesDownloadCount, context.getString(R.string.episodes_suffix))); }

Target:
void onBindFeedViewHolder(StatisticsHolder holder, StatisticsItem item) { holder.value.setText(Formatter.formatShortFileSize(context, item.totalDownloadSize) + " • " + String.format(Locale.getDefault(), "%d%s", item.episodesDownloadCount, context.getString(R.string.episodes_suffix))); }
Source:
void onConferenceCallInvited(Call incomingCall) { if (destination == null) { sipCall.setConference(incomingCall.getConference()); boolean useTranslator = incomingCall.getProtocolProvider() .getAccountID().getAccountPropertyBoolean( ProtocolProviderFactory.USE_TRANSLATOR_IN_CONFERENCE, false); CallPeer peer = incomingCall.getCallPeers().next(); if (useTranslator && !addSsrcRewriter(peer)) { peer.addCallPeerListener(new CallPeerAdapter() { @Override public void peerStateChanged(CallPeerChangeEvent evt) { CallPeer peer = evt.getSourceCallPeer(); CallPeerState peerState = peer.getState(); if (CallPeerState.CONNECTED.equals(peerState)) { peer.removeCallPeerListener(this); addSsrcRewriter(peer); } } }); } } logger.info("JVB conference call IN_PROGRESS " + callContext.getRoomName()); Exception error = this.onConferenceCallStarted(incomingCall); if (error != null) { logger.error(error, error); } }

Target:
void onConferenceCallInvited(Call incomingCall) { if (destination == null) { incomingCall.setConference(sipCall.getConference()); boolean useTranslator = incomingCall.getProtocolProvider() .getAccountID().getAccountPropertyBoolean( ProtocolProviderFactory.USE_TRANSLATOR_IN_CONFERENCE, false); CallPeer peer = incomingCall.getCallPeers().next(); if (useTranslator && !addSsrcRewriter(peer)) { peer.addCallPeerListener(new CallPeerAdapter() { @Override public void peerStateChanged(CallPeerChangeEvent evt) { CallPeer peer = evt.getSourceCallPeer(); CallPeerState peerState = peer.getState(); if (CallPeerState.CONNECTED.equals(peerState)) { peer.removeCallPeerListener(this); addSsrcRewriter(peer); } } }); } } Exception error = this.onConferenceCallStarted(incomingCall); if (error != null) { logger.error(error, error); } }
Source:
public boolean equals(Object obj) { return (obj instanceof DisableDepthWriting) && this.enabled == ((DisableDepthWriting) obj).enabled; }

Target:
public boolean equals(Object obj) { return (obj instanceof DisableDepthWriting); }
Source:
public void labelClicked(LabelEntity label) { if (label == quitButton) { System.exit(0); } if (label == loadGameButton) { Optional<GameInformation> gi = GameInformation.load(); if (gi.isPresent()) { Engine engine = Engine.getInstance(); engine.setScene(new StoreScene(scene, gi.get())); } } if (label == startButton) { Engine engine = Engine.getInstance(); engine.setScene(new PlayScene(engine.getScene().scene)); } }

Target:
public void labelClicked(LabelEntity label) { if (label == quitButton) { System.exit(0); } if (label == loadGameButton) { Optional<GameInformation> gi = GameInformation.load(); if (gi.isPresent()) { Engine engine = Engine.getInstance(); engine.setScene(new StoreScene(scene, gi.get())); } else { loadGameButton.setText("LOAD GAME (failed)"); } } if (label == startButton) { Engine engine = Engine.getInstance(); engine.setScene(new PlayScene(engine.getScene().scene)); } }
Source:
public NullnessStubfileTest(List<File> testFiles) { super( testFiles, org.checkerframework.checker.nullness.NullnessChecker.class, "nullness", "-Anomsgtext", "-AstubWarnIfNotFound", "-Astubs=" + "tests/nullness-stubfile/stubfile1.astub:" + "tests/nullness-stubfile/stubfile2.astub:"); }

Target:
public NullnessStubfileTest(List<File> testFiles) { super( testFiles, org.checkerframework.checker.nullness.NullnessChecker.class, "nullness", "-Anomsgtext", "-AstubWarnIfNotFound", "-Astubs=" + "tests/nullness-stubfile/stubfile1.astub:" + "tests/nullness-stubfile/stubfile2.astub"); }
Source:
private void putDepositionOnZenodo(DepositsApi depositApi, DepositMetadata depositMetadata, int depositionID) { NestedDepositMetadata nestedDepositMetadata = new NestedDepositMetadata(); nestedDepositMetadata.setMetadata(depositMetadata); try { depositApi.putDeposit(depositionID, nestedDepositMetadata); } catch (ApiException e) { LOG.error("Could not put deposition metadata on Zenodo. Error is " + e.getMessage()); throw new CustomWebApplicationException("Could not put deposition metadata on Zenodo." + " Error is " + e.getMessage(), HttpStatus.SC_BAD_REQUEST); } }

Target:
private void putDepositionOnZenodo(DepositsApi depositApi, DepositMetadata depositMetadata, int depositionID) { NestedDepositMetadata nestedDepositMetadata = new NestedDepositMetadata(); nestedDepositMetadata.setMetadata(depositMetadata); try { depositApi.putDeposit(depositionID, nestedDepositMetadata); } catch (ApiException e) { LOG.error("Could not put deposition metadata on Zenodo. Error is " + e.getMessage(), e); throw new CustomWebApplicationException("Could not put deposition metadata on Zenodo." + " Error is " + e.getMessage(), HttpStatus.SC_BAD_REQUEST); } }
Source:
protected boolean shouldSkip() { String scheme = new AlluxioURI(InstancedConfiguration.defaults() .get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS)).getScheme(); if (scheme == null || !scheme.startsWith("hdfs")) { System.out.format("Root underFS is not HDFS. Skipping validation for HDFS properties.%n"); return true; } return false; }

Target:
protected boolean shouldSkip() { String scheme = new AlluxioURI(mConf.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS)) .getScheme(); if (scheme == null || !scheme.startsWith("hdfs")) { System.out.format("Root underFS is not HDFS. Skipping validation for HDFS properties.%n"); return true; } return false; }
Source:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { File file = new File(tempDir.getAbsoluteFile() + File.separator + "zzz"); if (!file.exists()) { throw new FileNotFoundException(file.getAbsolutePath()); } File zipFile = new File(tempDir.getAbsolutePath() + File.separator + "bak.zip"); FileUtil.zipDir(file.getAbsolutePath(), zipFile.getAbsolutePath()); response.setHeader("Content-Type", "application/zip"); response.setHeader("Content-Length", String.valueOf(zipFile.length())); response.setHeader("Content-disposition", "attachment;filename=\"bak.zip\""); BufferedInputStream bis = new BufferedInputStream(new FileInputStream(zipFile)); BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); IoUtil.write(bis, bos); bos.flush(); bos.close(); bis.close(); }

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { String fname = request.getParameter("file"); String qs = request.getQueryString(); logger.debug("--------- Query string=" + qs); File file = new File(tempDir.getAbsoluteFile() + File.separator + fname); if (!file.exists()) { throw new FileNotFoundException(file.getAbsolutePath()); } File zipFile = new File(tempDir.getAbsolutePath() + File.separator + "bak.zip"); FileUtil.zipDir(file.getAbsolutePath(), zipFile.getAbsolutePath()); response.setHeader("Content-Type", "application/zip"); response.setHeader("Content-Length", String.valueOf(zipFile.length())); response.setHeader("Content-disposition", "attachment;filename=\"bak.zip\""); BufferedInputStream bis = new BufferedInputStream(new FileInputStream(zipFile)); BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); IoUtil.write(bis, bos); bos.flush(); bos.close(); bis.close(); }
Source:
public static boolean isEventApplier(Method method) { final boolean isAnnotated = method.isAnnotationPresent(Apply.class); if (!isAnnotated) { return false; } final Class<?>[] parameterTypes = method.getParameterTypes(); final boolean hasOneParam = parameterTypes.length == NUMBER_OF_PARAMS; if (!hasOneParam) { return false; } final boolean firstParamIsMessage = Message.class.isAssignableFrom(parameterTypes[EVENT_PARAM_INDEX]); final boolean returnsNothing = Void.TYPE.equals(method.getReturnType()); return firstParamIsMessage && returnsNothing; }

Target:
public static boolean isEventApplier(Method method) { final boolean isAnnotated = method.isAnnotationPresent(Apply.class); if (!isAnnotated) { return false; } final Class<?>[] parameterTypes = method.getParameterTypes(); final boolean paramCountValid = parameterTypes.length == NUMBER_OF_PARAMS; if (!paramCountValid) { return false; } final boolean firstParamIsMessage = Message.class.isAssignableFrom(parameterTypes[EVENT_PARAM_INDEX]); final boolean returnsNothing = Void.TYPE.equals(method.getReturnType()); return firstParamIsMessage && returnsNothing; }
Source:
public void init(Shell splash) { super.init(splash); String progressString = null; String messageString = null; IProduct product = Platform.getProduct(); if(product != null) { progressString = product.getProperty(IProductConstants.STARTUP_PROGRESS_RECT); messageString = product.getProperty(IProductConstants.STARTUP_MESSAGE_RECT); } Rectangle progressRect = StringConverter.asRectangle(progressString, new Rectangle(10, 300, 480, 15)); setProgressRect(progressRect); Rectangle messageRect = StringConverter.asRectangle(messageString, new Rectangle(10, 280, 490, 0)); setMessageRect(messageRect); try { setForeground(getSplash().getDisplay().getSystemColor(SWT.COLOR_WHITE).getRGB()); } catch(IllegalArgumentException e) { } getContent().addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { e.gc.setForeground(getForeground()); e.gc.drawText( NLS.bind(Messages.SplahScreen_VersionString, TracingRcpPlugin.getDefault().getBundle().getVersion().toString()), VERSION_LOCATION.x, VERSION_LOCATION.y, true); } }); }

Target:
public void init(Shell splash) { super.init(splash); String progressString = null; IProduct product = Platform.getProduct(); if(product != null) { progressString = product.getProperty(IProductConstants.STARTUP_PROGRESS_RECT); } Rectangle progressRect = StringConverter.asRectangle(progressString, new Rectangle(10, 300, 480, 15)); setProgressRect(progressRect); try { setForeground(getSplash().getDisplay().getSystemColor(SWT.COLOR_WHITE).getRGB()); } catch(IllegalArgumentException e) { } getContent().addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { e.gc.setForeground(getForeground()); e.gc.drawText( NLS.bind(Messages.SplahScreen_VersionString, TracingRcpPlugin.getDefault().getBundle().getVersion().toString()), VERSION_LOCATION.x, VERSION_LOCATION.y, true); } }); }
Source:
public ExecutionResult execute(Item item) { if (item instanceof DatabaseConnectionItem) { Connection connection = ((DatabaseConnectionItem) item).getConnection(); if (connection instanceof DatabaseConnection) { DatabaseConnection dbConn = (DatabaseConnection) connection; try { if (EDatabaseTypeName.REDSHIFT.getDisplayName().equals(dbConn.getDatabaseType())) { String oldUrl = dbConn.getURL(); if (oldUrl != null) { String newUrl = oldUrl.replaceFirst("jdbc:\\w+:", "jdbc:redshift:"); if (!oldUrl.equals(newUrl)) { dbConn.setURL(newUrl); ProxyRepositoryFactory.getInstance().save(item, true); return ExecutionResult.SUCCESS_NO_ALERT; } } } if (EDatabaseTypeName.REDSHIFT_SSO.getDisplayName().equals(dbConn.getDatabaseType())) { String oldUrl = dbConn.getURL(); if (oldUrl != null) { String newUrl = oldUrl.replaceFirst("jdbc:\\w+:", "jdbc:redshift:iam:"); if (!oldUrl.equals(newUrl)) { dbConn.setURL(newUrl); ProxyRepositoryFactory.getInstance().save(item, true); return ExecutionResult.SUCCESS_NO_ALERT; } } } } catch (PersistenceException e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } } } return ExecutionResult.NOTHING_TO_DO; }

Target:
public ExecutionResult execute(Item item) { if (item instanceof DatabaseConnectionItem) { Connection connection = ((DatabaseConnectionItem) item).getConnection(); if (connection instanceof DatabaseConnection) { DatabaseConnection dbConn = (DatabaseConnection) connection; try { if (EDatabaseTypeName.REDSHIFT.getDisplayName().equals(dbConn.getDatabaseType())) { String oldUrl = dbConn.getURL(); if (oldUrl != null) { String newUrl = oldUrl.replaceFirst("jdbc:\\w+:", "jdbc:redshift:"); if (!oldUrl.equals(newUrl)) { dbConn.setURL(newUrl); ProxyRepositoryFactory.getInstance().save(item, true); return ExecutionResult.SUCCESS_NO_ALERT; } } } } catch (PersistenceException e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } } } return ExecutionResult.NOTHING_TO_DO; }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> hostExtStatusUpdatePermissionsList = new ArrayList<>(); if (hasHostExternalStatus()) { hostExtStatusUpdatePermissionsList.add(new PermissionSubject(new Guid(getParameters().getEvent().getVdsId().toString()), VdcObjectType.VDS, ActionGroup.EDIT_HOST_CONFIGURATION)); } List<PermissionSubject> permissionList = getPermissionList(getParameters().getEvent()); List<PermissionSubject> joinedPermissionList = new ArrayList<>(); joinedPermissionList.addAll(hostExtStatusUpdatePermissionsList); joinedPermissionList.addAll(permissionList); return joinedPermissionList; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = getPermissionList(getParameters().getEvent()); if (hasHostExternalStatus()) { permissionList.add(new PermissionSubject(new Guid(getParameters().getEvent().getVdsId().toString()), VdcObjectType.VDS, ActionGroup.EDIT_HOST_CONFIGURATION)); } return permissionList; }