auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ExtendSANStorageDomainParameters createParameters(Guid storageDomainId, List<LogicalUnit> newLuns, boolean force) { ExtendSANStorageDomainParameters params = new ExtendSANStorageDomainParameters(); params.setStorageDomainId(storageDomainId); Set<String> lunIds = newLuns.stream().map(LogicalUnit::getId).collect(toCollection(HashSet::new)); params.setLunIds(lunIds); params.setForce(force); return params; }

Target:
private ExtendSANStorageDomainParameters createParameters(Guid storageDomainId, List<LogicalUnit> newLuns, boolean force) { ExtendSANStorageDomainParameters params = new ExtendSANStorageDomainParameters(); params.setStorageDomainId(storageDomainId); Set<String> lunIds = newLuns.stream().map(LogicalUnit::getId).collect(Collectors.toSet()); params.setLunIds(lunIds); params.setForce(force); return params; }
Source:
public Set<AuthenticationHandler> resolve(final Set<AuthenticationHandler> candidateHandlers, final AuthenticationTransaction transaction) { final Set<Credential> supportedCreds = supported(transaction.getCredentials()); return candidateHandlers.stream().filter(h -> supportedCreds.stream().anyMatch(c -> h.supports(c))) .collect(Collectors.toSet()); }

Target:
public Set<AuthenticationHandler> resolve(final Set<AuthenticationHandler> candidateHandlers, final AuthenticationTransaction transaction) { final Set<Credential> supportedCreds = supported(transaction.getCredentials()); return candidateHandlers.stream().filter(h -> supportedCreds.stream().anyMatch(c -> h.supports(c))) .collect(Collectors.toCollection(LinkedHashSet::new)); }
Source:
private void extractZipEntriesFromZipFile(Predicate<String> filter, Processor<ExtractedFile, Boolean> extractedFileConsumer, ZipFile zipFile) throws Exception { Enumeration<? extends ZipEntry> entries = zipFile.entries(); int numberOfFiles = 0; while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); numberOfFiles++; if (!entry.isDirectory() && filter.test(entry.getName())) { Amount progress = Amount.of(numberOfFiles).divideBy(Amount.of(zipFile.size())); boolean shouldContinue = extractedFileConsumer.apply(new ExtractedZipFile(entry, () -> { try { return zipFile.getInputStream(entry); } catch (IOException e) { throw Exceptions.createHandled() .error(e) .withSystemErrorMessage("Failed to unzip file from an archive: %s (%s)") .handle(); } }, progress)); if (!shouldContinue) { return; } } } }

Target:
private void extractZipEntriesFromZipFile(Predicate<String> filter, Processor<ExtractedFile, Boolean> extractedFileConsumer, ZipFile zipFile) throws Exception { Enumeration<? extends ZipEntry> entries = zipFile.entries(); int numberOfFiles = 0; while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); numberOfFiles++; if (!entry.isDirectory() && filter.test(entry.getName())) { Amount progress = Amount.of(numberOfFiles).divideBy(Amount.of(zipFile.size())); boolean shouldContinue = extractedFileConsumer.apply(new ExtractedZipFile(entry, () -> zipFile.getInputStream( entry), progress)); if (!shouldContinue) { return; } } } }
Source:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { setupWindow(); View v = inflater.inflate(R.layout.panel_speed_popup_dialog_fragment, container, false); try { float selectedPlaybackSpeed = NORMAL_PLAYBACK_SPEED; if (getArguments() != null) { selectedPlaybackSpeed = getArguments().getFloat(PLAYBACK_SPEED, NORMAL_PLAYBACK_SPEED); } SpeedAdapter adapter = new SpeedAdapter(getContext(), environment, selectedPlaybackSpeed) { @Override public void onItemClicked(Float speed) { if (callback != null) { callback.onItemClicked(speed); } dismiss(); } }; adapter.setItems(speeds); ListView list = (ListView) v.findViewById(R.id.speed_list); list.setAdapter(adapter); list.setOnItemClickListener(adapter); TextView tvCancel = (TextView) v.findViewById(R.id.tv_cancel); tvCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (callback != null) { callback.onCancelClicked(); } } }); } catch (Exception e) { e.printStackTrace(); } return v; }

Target:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { setupWindow(); View view = inflater.inflate(R.layout.panel_speed_popup_dialog_fragment, container, false); float selectedPlaybackSpeed = VideoPlaybackSpeed.NORMAL.getSpeedValue(); if (getArguments() != null) { selectedPlaybackSpeed = getArguments().getFloat(PLAYBACK_SPEED, VideoPlaybackSpeed.NORMAL.getSpeedValue()); } SpeedAdapter adapter = new SpeedAdapter(getContext(), environment, selectedPlaybackSpeed) { @Override public void onItemClicked(Float speed) { if (callback != null) { callback.onItemClicked(speed); } dismiss(); } }; adapter.setItems(speeds); ListView list = (ListView) view.findViewById(R.id.speed_list); list.setAdapter(adapter); list.setOnItemClickListener(adapter); TextView tvCancel = (TextView) view.findViewById(R.id.tv_cancel); tvCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (callback != null) { callback.onCancelClicked(); } } }); return view; }
Source:
public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { EditedStyleItem item = (value instanceof EditedStyleItem) ? (EditedStyleItem) value : null; final Component returnedComponent = myDelegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (item != null && item.getSourceStyle().equals(((AttributesTableModel) table.getModel()).getSelectedStyle())) { returnedComponent.setFont(table.getFont().deriveFont(Font.BOLD)); } else { returnedComponent.setFont(table.getFont()); } if (item != null && !item.isPublicAttribute()) { returnedComponent.setForeground(JBColor.GRAY); } else { returnedComponent.setForeground(table.getForeground()); } if (!(returnedComponent instanceof JComponent)) { return returnedComponent; } final JComponent jComponent = (JComponent)returnedComponent; Point mousePos = table.getMousePosition(); if (mousePos != null && item != null) { if (table.getCellRect(row, column, true).contains(mousePos)) { final ItemResourceValue resValue = ((EditedStyleItem)value).getItemResourceValue(); Configuration configuration = item.getSourceStyle().getConfiguration(); String toolTipText = ThemeEditorUtils.generateToolTipText(resValue, configuration.getModule(), configuration); jComponent.setToolTipText(toolTipText); } } else { jComponent.setToolTipText(null); } return returnedComponent; }

Target:
public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { EditedStyleItem item = (value instanceof EditedStyleItem) ? (EditedStyleItem) value : null; final Component returnedComponent = myDelegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (item != null && item.getSourceStyle().equals(((AttributesTableModel) table.getModel()).getSelectedStyle())) { returnedComponent.setFont(table.getFont().deriveFont(Font.BOLD)); } else { returnedComponent.setFont(table.getFont()); } returnedComponent.setForeground((item != null && !item.isPublicAttribute()) ? JBColor.GRAY : table.getForeground()); if (!(returnedComponent instanceof JComponent)) { return returnedComponent; } final JComponent jComponent = (JComponent)returnedComponent; Point mousePos = table.getMousePosition(); if (mousePos != null && item != null) { if (table.getCellRect(row, column, true).contains(mousePos)) { final ItemResourceValue resValue = ((EditedStyleItem)value).getItemResourceValue(); Configuration configuration = item.getSourceStyle().getConfiguration(); String toolTipText = ThemeEditorUtils.generateToolTipText(resValue, configuration.getModule(), configuration); jComponent.setToolTipText(toolTipText); } } else { jComponent.setToolTipText(null); } return returnedComponent; }
Source:
public ResponseEntity<?> updateTestEnvironment(@CookieValue(TestEnvUtils.SESSION_COOKIE) String sessionId, @PathVariable String envId, @RequestBody TestEnvironmentEntity testEnv, HttpServletResponse response) { if (!testEnvService.exists(envId)) throw ResourceNotFoundException.getTestEnvResourceNfe(); if (!testEnvService.existsWithSessionId(envId, sessionId)) throw new TestEnvironmentSessionNotFoundException(envId, sessionId); validateTestEnv(testEnv); TestEnvironmentEntity oldEnv = testEnvService.read(envId); testEnv.setEnvironmentId(envId); TestEnvironmentEntity updated = testEnvService.update(testEnv); if (updated.getStatus() == PENDING) { if (oldEnv.getStatus() == RUNNING) jobExecutionService.finishExecution(envId, oldEnv.getRunningTestSuite().getTestSuiteId()); else getTestSuiteNameToExecute(updated).ifPresent(testSuiteName -> setNextConfigToExecuteHeader(response, testSuiteName)); } if (updated.getStatus() == RUNNING) { jobExecutionService.startExecution(envId, testEnv.getRunningTestSuite().getTestSuiteId()); } response.addCookie(getSessionCookie(updated)); return ResponseEntity.accepted().build(); }

Target:
public ResponseEntity<?> updateTestEnvironment(@CookieValue(TestEnvUtils.SESSION_COOKIE) String sessionId, @PathVariable String envId, @RequestBody TestEnvironmentEntity testEnv, HttpServletResponse response) { if (!testEnvService.exists(envId)) throw ResourceNotFoundException.getTestEnvResourceNfe(); if (!testEnvService.existsWithSessionId(envId, sessionId)) throw new TestEnvironmentSessionNotFoundException(envId, sessionId); validateTestEnv(testEnv); TestEnvironmentEntity oldEnv = testEnvService.read(envId); testEnv.setEnvironmentId(envId); TestEnvironmentEntity updated = testEnvService.update(testEnv); if (updated.getStatus() == PENDING) { getLoadScenarioNameToExecute(updated).ifPresent(loadScenarioName -> setNextConfigToExecuteHeader(response, loadScenarioName)); if (oldEnv.getStatus() == RUNNING) testExecutionService.finishExecution(envId, oldEnv.getRunningLoadScenario().getLoadScenarioId()); } if (oldEnv.getStatus() == PENDING && updated.getStatus() == RUNNING) { testExecutionService.startExecution(envId, testEnv.getRunningLoadScenario().getLoadScenarioId()); } response.addCookie(getSessionCookie(updated)); return ResponseEntity.accepted().build(); }
Source:
protected boolean Validate(ParserSession PS, Schema ParentSchema) { if (_Validated == true) return true; int Errs = PS.getErrorCount(); _ParentSchema = ParentSchema; if (TextUtil.isNullOrEmpty(_Name) == true) return PS.AddError("Schema '" + _ParentSchema.getFullName() + "' is declaring an "+getWhat()+" without a name."); else { _OriginalName = _Name; LOG.debug(" Validating "+getWhat()+" " + getFullName() + "."); } if (ValidationHelper.isValidIdentifier(_Name) == false) return PS.AddError("Schema '" + _ParentSchema.getFullName() + "' is declaring "+getWhat()+" '" + getFullName() + "' with a name '"+_Name+"' which is not valid. "+ValidationHelper._ValidIdentifierMessage); if (TextUtil.isNullOrEmpty(_Description) == true) return PS.AddError("Schema '" + _ParentSchema.getFullName() + "' is declaring "+getWhat()+" '" + getFullName() + "' without a description name."); _BaseClassName = "TILDA__" + _Name.toUpperCase(); _AppDataClassName = _OriginalName+"_Data"; _AppFactoryClassName = _OriginalName+"_Factory"; _AppJsonClassName = _OriginalName+"_Json"; _Validated = Errs == PS.getErrorCount(); return _Validated; }

Target:
protected boolean Validate(ParserSession PS, Schema ParentSchema) { if (_Validated == true) return true; int Errs = PS.getErrorCount(); _ParentSchema = ParentSchema; if (TextUtil.isNullOrEmpty(_Name) == true) return PS.AddError("Schema '" + _ParentSchema.getFullName() + "' is declaring an "+getWhat()+" without a name."); _OriginalName = _Name; LOG.debug(" Validating "+getWhat()+" " + getFullName() + "."); if (ValidationHelper.isValidIdentifier(_Name) == false) return PS.AddError("Schema '" + _ParentSchema.getFullName() + "' is declaring "+getWhat()+" '" + getFullName() + "' with a name '"+_Name+"' which is not valid. "+ValidationHelper._ValidIdentifierMessage); if (TextUtil.isNullOrEmpty(_Description) == true) return PS.AddError("Schema '" + _ParentSchema.getFullName() + "' is declaring "+getWhat()+" '" + getFullName() + "' without a description name."); _BaseClassName = "TILDA__" + _Name.toUpperCase(); _AppDataClassName = _OriginalName+"_Data"; _AppFactoryClassName = _OriginalName+"_Factory"; _AppJsonClassName = _OriginalName+"_Json"; _Validated = Errs == PS.getErrorCount(); return _Validated; }
Source:
void onNewTrainingCompletionDateClick() { final LocalDate currentDate = mTrainingDate != null ? mTrainingDate : LocalDate.now(); new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() { public void onDateSet(final DatePicker view, final int year, final int month, final int day) { onChangeTrainingDate(new LocalDate(year, month + 1, day)); } }, currentDate.getYear(), currentDate.getMonthOfYear() - 1, currentDate.getDayOfMonth()).show(); }

Target:
void onNewTrainingCompletionDateClick() { final LocalDate currentDate = mNewCompletionDate != null ? mNewCompletionDate : LocalDate.now(); new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() { public void onDateSet(final DatePicker view, final int year, final int month, final int day) { onChangeNewCompletionDate(new LocalDate(year, month + 1, day)); } }, currentDate.getYear(), currentDate.getMonthOfYear() - 1, currentDate.getDayOfMonth()).show(); }
Source:
public abstract T call() throws IOException, AbortedByHookException; public abstract Hook getHookType(); protected Repository getRepository() { return repo; }

Target:
public abstract T call() throws IOException, AbortedByHookException; public abstract String getHookName(); protected Repository getRepository() { return repo; }
Source:
private Function<Throwable, Throwable> getThrowableFunction(CoreEvent event) { return throwable -> { Throwable cause = getMessagingExceptionCause(throwable); CoreEvent exceptionEvent = event; if (throwable instanceof MessagingException) { exceptionEvent = ((MessagingException) throwable).getEvent(); } return new MessagingException(exceptionEvent, new RetryPolicyExhaustedException(createStaticMessage(UNTIL_SUCCESSFUL_MSG_PREFIX, cause.getMessage()), null, owner), owner); }; }

Target:
private Function<Throwable, Throwable> getThrowableFunction(CoreEvent event) { return throwable -> { Throwable cause = getMessagingExceptionCause(throwable); CoreEvent exceptionEvent = event; if (throwable instanceof MessagingException) { exceptionEvent = ((MessagingException) throwable).getEvent(); } return new MessagingException(exceptionEvent, new RetryPolicyExhaustedException(createStaticMessage(UNTIL_SUCCESSFUL_MSG_PREFIX, cause.getMessage()), owner), owner); }; }
Source:
protected abstract Optional<String> updateBlob(@Nonnull B blob, @Nonnull String nextPhysicalId, long size, @Nullable String filename) throws Exception; public void updateContent(B blob, String filename, InputStream data, long contentLength) { String nextPhysicalId = keyGenerator.generateId(); try { getPhysicalSpace().upload(nextPhysicalId, data, contentLength); Optional<String> previousPhysicalId = updateBlob(blob, nextPhysicalId, contentLength, filename); if (previousPhysicalId.isPresent()) { blob.fetchVariants().forEach(BlobVariant::delete); getPhysicalSpace().delete(previousPhysicalId.get()); } blobByPathCache.clear(); } catch (Exception e) { try { getPhysicalSpace().delete(nextPhysicalId); } catch (Exception ex) { Exceptions.ignore(ex); } throw Exceptions.handle() .to(StorageUtils.LOG) .error(e) .withSystemErrorMessage("Layer 2: Cannot update the contents of %s in %s: %s (%s)", blob.getBlobKey(), spaceName) .handle(); } }

Target:
protected abstract Optional<String> updateBlob(@Nonnull B blob, @Nonnull String nextPhysicalId, long size, @Nullable String filename) throws Exception; public void updateContent(B blob, String filename, InputStream data, long contentLength) { String nextPhysicalId = keyGenerator.generateId(); try { getPhysicalSpace().upload(nextPhysicalId, data, contentLength); Optional<String> previousPhysicalId = updateBlob(blob, nextPhysicalId, contentLength, filename); if (previousPhysicalId.isPresent()) { blob.fetchVariants().forEach(BlobVariant::delete); getPhysicalSpace().delete(previousPhysicalId.get()); } if (Strings.isFilled(filename)) { blobByPathCache.clear(); } } catch (Exception e) { try { getPhysicalSpace().delete(nextPhysicalId); } catch (Exception ex) { Exceptions.ignore(ex); } throw Exceptions.handle() .to(StorageUtils.LOG) .error(e) .withSystemErrorMessage("Layer 2: Cannot update the contents of %s in %s: %s (%s)", blob.getBlobKey(), spaceName) .handle(); } }
Source:
public void put(Slice key, long timeBucket, Slice value) { BucketedValue bucketedValue = flash.get(key); if (bucketedValue == null) { bucketedValue = new BucketedValue(timeBucket, value); flash.put(key, bucketedValue); sizeInBytes.getAndAdd(key.length + value.length + Longs.BYTES); } else { if (timeBucket >= bucketedValue.getTimeBucket()) { int inc = null == bucketedValue.getValue() ? value.length : value.length - bucketedValue.getValue().length; sizeInBytes.getAndAdd(inc); bucketedValue.setTimeBucket(timeBucket); bucketedValue.setValue(value); } else { LOG.warn("ignoring {}; existing {}", key, value, timeBucket, bucketedValue.getValue(), bucketedValue.getTimeBucket()); } } }

Target:
public void put(Slice key, long timeBucket, Slice value) { BucketedValue bucketedValue = flash.get(key); if (bucketedValue == null) { bucketedValue = new BucketedValue(timeBucket, value); flash.put(key, bucketedValue); sizeInBytes.getAndAdd(key.length + value.length + Longs.BYTES); } else { if (timeBucket >= bucketedValue.getTimeBucket()) { int inc = null == bucketedValue.getValue() ? value.length : value.length - bucketedValue.getValue().length; sizeInBytes.getAndAdd(inc); bucketedValue.setTimeBucket(timeBucket); bucketedValue.setValue(value); } else { throw new AssertionError("newer entry exists for " + key); } } }
Source:
public ParameterWorkerMetrics buildParameterWorkerMetrics() { final Pair<Integer, Double> totalPullStat = summarizeAndResetStats(pullStats); final Pair<Integer, Double> totalPushStat = summarizeAndResetStats(pushStats); final Pair<Integer, Double> totalNetworkStat = summarizeAndResetStats(networkStats); final Pair<Integer, Double> totalWaitingStat = summarizeAndResetStats(waitingStats); final Pair<Integer, Double> totalSentBytesStat = summarizeAndResetStats(sentBytesStats); final Pair<Integer, Double> totalReceivedBytesStat = summarizeAndResetStats(receivedBytesStats); final Double receivedBytes = totalReceivedBytesStat.getRight(); final Double sentBytes = totalSentBytesStat.getRight(); return ParameterWorkerMetrics.newBuilder() .setNumThreads(numWorkerThreads) .setTotalPullCount(totalPullStat.getLeft()) .setTotalPullTimeSec(totalPullStat.getRight() / 1e9D) .setTotalPushCount(totalPushStat.getLeft()) .setTotalPushTimeSec(totalPushStat.getRight() / 1e9D) .setTotalNetworkStatCount(totalNetworkStat.getLeft()) .setTotalNetworkTimeSec(totalNetworkStat.getRight() / 1e9D) .setTotalWaitingStatCount(totalWaitingStat.getLeft()) .setTotalSentBytes(totalSentBytesStat.getRight().intValue()) .setTotalSentBytesStatCount(totalSentBytesStat.getLeft()) .setTotalReceivedBytes(totalReceivedBytesStat.getRight().intValue()) .setTotalReceivedBytesStatCount(totalReceivedBytesStat.getLeft()) .setTotalWaitingTimeSec(totalWaitingStat.getRight() / 1e9D) .build(); }

Target:
public ParameterWorkerMetrics buildParameterWorkerMetrics() { final Pair<Integer, Double> totalPullStat = summarizeAndResetStats(pullStats); final Pair<Integer, Double> totalPushStat = summarizeAndResetStats(pushStats); final Pair<Integer, Double> totalNetworkStat = summarizeAndResetStats(networkStats); final Pair<Integer, Double> totalWaitingStat = summarizeAndResetStats(waitingStats); final Pair<Integer, Double> totalSentBytesStat = summarizeAndResetStats(sentBytesStats); final Pair<Integer, Double> totalReceivedBytesStat = summarizeAndResetStats(receivedBytesStats); return ParameterWorkerMetrics.newBuilder() .setNumThreads(numWorkerThreads) .setTotalPullCount(totalPullStat.getLeft()) .setTotalPullTimeSec(totalPullStat.getRight() / 1e9D) .setTotalPushCount(totalPushStat.getLeft()) .setTotalPushTimeSec(totalPushStat.getRight() / 1e9D) .setTotalNetworkStatCount(totalNetworkStat.getLeft()) .setTotalNetworkTimeSec(totalNetworkStat.getRight() / 1e9D) .setTotalWaitingStatCount(totalWaitingStat.getLeft()) .setTotalWaitingTimeSec(totalWaitingStat.getRight() / 1e9D) .setTotalSentBytes(totalSentBytesStat.getRight().intValue()) .setTotalSentBytesStatCount(totalSentBytesStat.getLeft()) .setTotalReceivedBytes(totalReceivedBytesStat.getRight().intValue()) .setTotalReceivedBytesStatCount(totalReceivedBytesStat.getLeft()) .build(); }
Source:
public Statement apply(FrameworkMethod method, Description description, Object target, Statement statement) { if (methodRules.isEmpty() && testRules.isEmpty()) { return statement; } Statement result = statement; for (RuleEntry ruleEntry : getSortedEntries()) { if (ruleEntry instanceof TestRuleEntry) { result = ((TestRuleEntry) ruleEntry).rule.apply(result, description); } else { result = ((MethodRuleEntry) ruleEntry).rule.apply(result, method, target); } } return result; }

Target:
public Statement apply(FrameworkMethod method, Description description, Object target, Statement statement) { if (methodRules.isEmpty() && testRules.isEmpty()) { return statement; } Statement result = statement; for (RuleEntry ruleEntry : getSortedEntries()) { if (ruleEntry.type == RuleEntry.TYPE_TEST_RULE) { result = ((TestRule) ruleEntry.rule).apply(result, description); } else { result = ((MethodRule) ruleEntry.rule).apply(result, method, target); } } return result; }
Source:
public static Map<ArtifactMode, Double> scoreOrientationBiasMetricsOverContext(final List<SequencingArtifactMetrics.PreAdapterDetailMetrics> metrics) { Utils.nonNull(metrics, "Input metrics cannot be null"); final Map<ArtifactMode, Double> result = new HashMap<>(); final Map<ArtifactMode, RealMatrix> counts = countOrientationBiasMetricsOverContext(metrics); for (final ArtifactMode artifactMode : counts.keySet()) { final RealMatrix count = counts.get(artifactMode); final double totalBases = count.getEntry(PRO, REF) + count.getEntry(PRO, ALT) + count.getEntry(CON, REF) + count.getEntry(CON, ALT); final double rawScorePro = count.getEntry(PRO, ALT)/totalBases; final double rawScoreCon = count.getEntry(CON, ALT)/totalBases; final double rawScore = rawScorePro - rawScoreCon; final double score = -10 * Math.log10(Math.max(rawScore, Math.pow(10, -10))); result.put(artifactMode, score); } return result; }

Target:
public static Map<Transition, Double> scoreOrientationBiasMetricsOverContext(final List<SequencingArtifactMetrics.PreAdapterDetailMetrics> metrics) { Utils.nonNull(metrics, "Input metrics cannot be null"); final Map<Transition, Double> result = new HashMap<>(); final Map<Transition, RealMatrix> counts = countOrientationBiasMetricsOverContext(metrics); for (final Transition transition : counts.keySet()) { final RealMatrix count = counts.get(transition); final double totalBases = count.getEntry(PRO, REF) + count.getEntry(PRO, ALT) + count.getEntry(CON, REF) + count.getEntry(CON, ALT); final double rawFractionPro = count.getEntry(PRO, ALT)/totalBases; final double rawFractionCon = count.getEntry(CON, ALT)/totalBases; final double baseScore = rawFractionPro - rawFractionCon; final double score = QualityUtils.phredScaleErrorRate(Math.max(baseScore, MAX_BASE_SCORE)); result.put(transition, score); } return result; }
Source:
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException { final Type elementType = persister.getElementType(); final List<Object> sn = (List<Object>) getSnapshot(); if ( sn.size() != bag.size() ) { return false; } final Map<Integer, List<Object>> hashToInstancesBag = groupByEqualityHash( bag, elementType ); final Map<Integer, List<Object>> HashToInstancesSn = groupByEqualityHash( sn, elementType ); if ( hashToInstancesBag.size() != HashToInstancesSn.size() ) { return false; } for ( Map.Entry<Integer, List<Object>> hashToInstancesBagEntry : hashToInstancesBag.entrySet() ) { final int hash = hashToInstancesBagEntry.getKey(); final List<Object> instancesBag = hashToInstancesBagEntry.getValue(); final List<Object> instancesSn = HashToInstancesSn.getOrDefault( hash, Collections.emptyList() ); if ( instancesBag.size() != instancesSn.size() ) { return false; } for ( Object instance : instancesBag ) { if ( countOccurrences( instance, instancesBag, elementType ) != countOccurrences( instance, instancesSn, elementType ) ) { return false; } } } return true; }

Target:
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException { final Type elementType = persister.getElementType(); final List<Object> sn = (List<Object>) getSnapshot(); if ( sn.size() != bag.size() ) { return false; } final Map<Integer, List<Object>> hashToInstancesBag = groupByEqualityHash( bag, elementType ); final Map<Integer, List<Object>> hashToInstancesSn = groupByEqualityHash( sn, elementType ); if ( hashToInstancesBag.size() != hashToInstancesSn.size() ) { return false; } for ( Map.Entry<Integer, List<Object>> hashToInstancesBagEntry : hashToInstancesBag.entrySet() ) { final Integer hash = hashToInstancesBagEntry.getKey(); final List<Object> instancesBag = hashToInstancesBagEntry.getValue(); final List<Object> instancesSn = hashToInstancesSn.get( hash ); if ( instancesSn == null || ( instancesBag.size() != instancesSn.size() ) ) { return false; } } for ( Map.Entry<Integer, List<Object>> hashToInstancesBagEntry : hashToInstancesBag.entrySet() ) { final Integer hash = hashToInstancesBagEntry.getKey(); final List<Object> instancesBag = hashToInstancesBagEntry.getValue(); final List<Object> instancesSn = hashToInstancesSn.get( hash ); for ( Object instance : instancesBag ) { if ( !expectOccurrences( instance, instancesBag, elementType, countOccurrences( instance, instancesSn, elementType ) ) ) { return false; } } } return true; }
Source:
protected void addCookieRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException { LOG.trace("enter HttpMethodBase.addCookieRequestHeader(HttpState, " + "HttpConnection)"); Header[] cookieheaders = getRequestHeaderGroup().getHeaders(HttpHeader.COOKIE); for (int i = 0; i < cookieheaders.length; i++) { Header cookieheader = cookieheaders[i]; if (cookieheader.isAutogenerated()) { getRequestHeaderGroup().removeHeader(cookieheader); } } CookieSpec matcher = getCookieSpec(state); String host = this.params.getVirtualHost(); if (host == null) { host = conn.getHost(); } Cookie[] cookies = matcher.match(host, conn.getPort(), getPath(), conn.isSecure(), state.getCookies()); if ((cookies != null) && (cookies.length > 0)) { if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) { putAllCookiesInASingleHeader(host, matcher, cookies); } else { for (int i = 0; i < cookies.length; i++) { String s = matcher.formatCookie(cookies[i]); getRequestHeaderGroup().addHeader(new Header(HttpHeader.COOKIE, s, true)); } } if (matcher instanceof CookieVersionSupport) { CookieVersionSupport versupport = (CookieVersionSupport) matcher; int ver = versupport.getVersion(); boolean needVersionHeader = false; for (int i = 0; i < cookies.length; i++) { if (ver != cookies[i].getVersion()) { needVersionHeader = true; } } if (needVersionHeader) { getRequestHeaderGroup().addHeader(versupport.getVersionHeader()); } } } }

Target:
protected void addCookieRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException { LOG.trace("enter HttpMethodBase.addCookieRequestHeader(HttpState, " + "HttpConnection)"); Header[] cookieheaders = getRequestHeaderGroup().getHeaders("Cookie"); for (int i = 0; i < cookieheaders.length; i++) { Header cookieheader = cookieheaders[i]; if (cookieheader.isAutogenerated()) { getRequestHeaderGroup().removeHeader(cookieheader); } } CookieSpec matcher = getCookieSpec(state); String host = this.params.getVirtualHost(); if (host == null) { host = conn.getHost(); } Cookie[] cookies = matcher.match(host, conn.getPort(), getPath(), conn.isSecure(), state.getCookies()); if ((cookies != null) && (cookies.length > 0)) { if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) { putAllCookiesInASingleHeader(host, matcher, cookies); } else { for (int i = 0; i < cookies.length; i++) { String s = matcher.formatCookie(cookies[i]); getRequestHeaderGroup().addHeader(new Header(HttpHeader.COOKIE, s, true)); } } if (matcher instanceof CookieVersionSupport) { CookieVersionSupport versupport = (CookieVersionSupport) matcher; int ver = versupport.getVersion(); boolean needVersionHeader = false; for (int i = 0; i < cookies.length; i++) { if (ver != cookies[i].getVersion()) { needVersionHeader = true; } } if (needVersionHeader) { getRequestHeaderGroup().addHeader(versupport.getVersionHeader()); } } } }
Source:
private WaitForDownloadService.ThenPerform.Action<Void> executeUpdateNotification(DownloadBatchStatus downloadBatchStatus) { return () -> { NotificationInformation notificationInformation = notificationCreator.createNotification(downloadBatchStatus); DownloadBatchStatus.Status status = downloadBatchStatus.status(); if (downloadBatchStatus.notificationSeen()) { Log.v("DownloadBatchStatus:", downloadBatchStatus.getDownloadBatchId(), "notification has already been seen."); return null; } downloadService.dismissStackedNotification(notificationInformation); if (status == DOWNLOADED) { notificationSeenPersistence.updateNotificationSeenAsync(downloadBatchStatus.getDownloadBatchId(), NOTIFICATION_SEEN); } if (notificationInformation.notificationStackState() == STACK_NOTIFICATION_DISMISSIBLE) { downloadService.stackNotification(notificationInformation); } else if (notificationInformation.notificationStackState() == STACK_NOTIFICATION_NOT_DISMISSIBLE) { downloadService.stackNotificationNotDismissible(notificationInformation); } else { downloadService.updateNotification(notificationInformation); } return null; }; }

Target:
private WaitForDownloadService.ThenPerform.Action<Void> executeUpdateNotification(DownloadBatchStatus downloadBatchStatus) { return () -> { NotificationInformation notificationInformation = notificationCreator.createNotification(downloadBatchStatus); DownloadBatchStatus.Status status = downloadBatchStatus.status(); if (downloadBatchStatus.notificationSeen()) { Log.v("DownloadBatchStatus:", downloadBatchStatus.getDownloadBatchId(), "notification has already been seen."); return null; } downloadService.dismissStackedNotification(notificationInformation); if (status == DOWNLOADED) { notificationSeenPersistence.updateNotificationSeenAsync(downloadBatchStatus.getDownloadBatchId(), NOTIFICATION_SEEN); } switch (notificationInformation.notificationStackState()) { case SINGLE_PERSISTENT_NOTIFICATION: downloadService.updateNotification(notificationInformation); break; case STACK_NOTIFICATION_NOT_DISMISSIBLE: downloadService.stackNotificationNotDismissible(notificationInformation); break; case STACK_NOTIFICATION_DISMISSIBLE: downloadService.stackNotification(notificationInformation); break; default: String message = String.format( "%s: %s is not supported.", NotificationCustomizer.NotificationStackState.class.getSimpleName(), notificationInformation.notificationStackState() ); throw new IllegalArgumentException(message); } return null; }; }
Source:
public void deleteGroup(Group group) { GroupsRecord r = dslContext.fetchOne(GROUPS, GROUPS.ID.eq(Math.toIntExact(group.getId()))); r.delete(); }

Target:
public void deleteGroup(Group group) { dslContext.delete(GROUPS).where(GROUPS.ID.eq(Math.toIntExact(group.getId()))).execute(); }
Source:
private void setComposite(Composite parent) throws IOException { container = new Composite(parent, SWT.NONE); Label lblSelectPattern = new Label(container, SWT.NONE); lblSelectPattern.setBounds(10, 20, 76, 15); lblSelectPattern.setText("Select Pattern"); combo = new Combo(container, SWT.READ_ONLY); combo.setBounds(88, 17, 199, 23); addPatternToCombo(combo); combo.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { setPageComplete(getComboSelect()); canvas = new Canvas(container , SWT.NONE); canvas.setBounds(240, 130, 200, 160); ImageDescriptor image = AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.sirius.editor.diagram", comboSelection.getImagePath()); Image img = new Image(container.getDisplay(), image.getImageData()); canvas.setBackgroundImage(img); lblParagra = new Label(container, SWT.NONE); lblParagra.setBounds(10, 132, 206, 158); lblParagra.setText(comboSelection.getDescription()); ((InitializerConfigureClassDiagramPatternPage) getNextPage()).setSelectedPattern(getComboSelection()); getContainer().updateButtons(); } }); lblDescription = new Label(container, SWT.NONE); lblDescription.setBounds(10, 90, 76, 15); lblDescription.setText("Description:"); }

Target:
private void setComposite(Composite parent) throws IOException { container = new Composite(parent, SWT.NONE); Label lblSelectPattern = new Label(container, SWT.NONE); lblSelectPattern.setBounds(10, 20, 76, 15); lblSelectPattern.setText("Select Pattern"); combo = new Combo(container, SWT.READ_ONLY); combo.setBounds(88, 17, 199, 23); addPatternToCombo(combo); combo.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { setPageComplete(getComboSelect()); canvas = new Canvas(container, SWT.NONE); canvas.setBounds(240, 130, 200, 160); ImageDescriptor image = AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.sirius.editor.diagram", comboSelection.getImagePath()); Image img = new Image(container.getDisplay(), image.getImageData()); canvas.setBackgroundImage(img); lblParagra = new Label(container, SWT.NONE); lblParagra.setBounds(10, 132, 206, 158); lblParagra.setText(comboSelection.getDescription()); ((ClassDiagramPatternConfigurationPage) getNextPage()).setSelectedPattern(getComboSelection()); getContainer().updateButtons(); } }); lblDescription = new Label(container, SWT.NONE); lblDescription.setBounds(10, 90, 76, 15); lblDescription.setText("Description:"); canFlipToNextPage(); }
Source:
public void enableDefault() { if (getDefaultApi() == null) { return; } List<? extends CloudTestingType> appSupportedDomain = getAppSupportedDomain(); if (appSupportedDomain.contains(defaultApi)) { enable(defaultApi); } else if (appSupportedDomain.size() > 0) { enable(appSupportedDomain.get(0)); } }

Target:
public void enableDefault() { if (getDefaultApi() == null) { return; } List<? extends CloudTestingType> appSupportedDomain = getAppSupportedDomain(); if (appSupportedDomain.contains(defaultApi)) { enable(defaultApi); } else if (!appSupportedDomain.isEmpty()) { enable(appSupportedDomain.get(0)); } }
Source:
protected void executeQueryCommand() { StorageDomainStatic storage = DbFacade.getInstance().getStorageDomainStaticDao().get( getParameters().getStorageDomainId()); if (storage.getstorage_domain_type() == StorageDomainType.ImportExport) { VDSReturnValue retVal = null; try { retVal = executeVerb(); } catch (RuntimeException e) { AuditLogableBase logable = new AuditLogableBase(); logable.AddCustomValue("StorageDomainName", storage.getstorage_name()); AuditLogDirector.log(logable, AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED); throw e; } buildOvfReturnValue(retVal.getReturnValue()); } else { getQueryReturnValue().setReturnValue(new java.util.ArrayList<VM>()); } }

Target:
protected void executeQueryCommand() { StorageDomainStatic storage = DbFacade.getInstance().getStorageDomainStaticDao().get( getParameters().getStorageDomainId()); if (storage.getstorage_domain_type() == StorageDomainType.ImportExport) { VDSReturnValue retVal = null; retVal = executeVerb(storage); buildOvfReturnValue(retVal.getReturnValue()); } else { getQueryReturnValue().setReturnValue(new java.util.ArrayList<VM>()); } }
Source:
private boolean checkSelection(ISelection selection) { if (selection instanceof StructuredSelection ) { for (Object selected : ((StructuredSelection) selection).toList()) { if (selected instanceof AbstractFBNElementEditPart) { checkMapping(((AbstractFBNElementEditPart)selected).getModel()); } } } return (!selectedNetworkElements.isEmpty()); }

Target:
private boolean checkSelection(ISelection selection) { if (selection instanceof StructuredSelection) { for (Object selected : ((StructuredSelection) selection).toList()) { if ((selected instanceof FBEditPart) || (selected instanceof SubAppForFBNetworkEditPart)) { checkMapping(((AbstractFBNElementEditPart) selected).getModel()); } } } return (!selectedNetworkElements.isEmpty()); }
Source:
protected abstract void tryDelete(String name, Jenkins jenkins) throws Exception; protected void checkExists(T item, String item_s, String item_type) throws Exception{ if(item == null) { throw new IllegalArgumentException("No such " + item_type + " '" + item_s + "'"); } return; }

Target:
protected abstract void tryDelete(String name, Jenkins jenkins) throws Exception; protected void checkExists(T elementObject, String elementName, String elementType) throws Exception{ if(elementObject == null) { throw new IllegalArgumentException("No such " + elementType + " '" + elementName + "'"); } return; }
Source:
public ResponseEntity<GeneralConfigViewModel> updateGeneralConfig(@RequestBody @Valid GeneralConfigBackingForm form, @PathVariable Integer id) { GeneralConfig updatedConfig = null; form.setId(id); updatedConfig = configRepository.update(form.getGeneralConfig()); if (form.getName().equalsIgnoreCase("log.level")) setLogLevel(configRepository.getGeneralConfigByName("log.level").getValue()); return new ResponseEntity<GeneralConfigViewModel>(new GeneralConfigViewModel(updatedConfig), HttpStatus.CREATED); }

Target:
public ResponseEntity<GeneralConfigViewModel> updateGeneralConfig(@RequestBody @Valid GeneralConfigBackingForm form, @PathVariable Integer id) { GeneralConfig updatedConfig = null; form.setId(id); updatedConfig = configRepository.update(form.getGeneralConfig()); if (form.getName().equalsIgnoreCase("log.level")) LoggerUtil.setLogLevel(configRepository.getGeneralConfigByName("log.level").getValue()); return new ResponseEntity<GeneralConfigViewModel>(new GeneralConfigViewModel(updatedConfig), HttpStatus.OK); }
Source:
public <T extends AbstractEntity> List<CdoSnapshot> getChanges(final T entity) { if(isAuditable(entity)) { return javers.findSnapshots(QueryBuilder.byInstanceId(entity.getId(), entity.getClass()).build()); } else { throw new DolphinRuntimeException("Entity not auditable"); } }

Target:
public <T extends AbstractEntity> List<CdoSnapshot> getChanges(final T entity) { Assert.requireNonNull(entity , "entity"); if(isAuditable(entity)) { return javers.findSnapshots(QueryBuilder.byInstanceId(entity.getId(), entity.getClass()).build()); } else { throw new DolphinRuntimeException("Entity not auditable"); } }
Source:
void fetchRepositoryAndPackageMetaData(GoPluginDescriptor pluginDescriptor) { try { RepositoryConfiguration repositoryConfiguration = packageAsRepositoryExtension.getRepositoryConfiguration(pluginDescriptor.id()); if (repositoryConfiguration != null) { repositoryMetadataStore.addMetadataFor(pluginDescriptor.id(), new PackageConfigurations(repositoryConfiguration)); } com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration packageConfiguration = packageAsRepositoryExtension.getPackageConfiguration(pluginDescriptor.id()); if (packageConfiguration != null) { packageMetadataStore.addMetadataFor(pluginDescriptor.id(), new PackageConfigurations(packageConfiguration)); } } catch (GoPluginFrameworkException e) { LOGGER.error(String.format("Failed to fetch package metadata for plugin : %s", pluginDescriptor.id()), e); } }

Target:
void fetchRepositoryAndPackageMetaData(GoPluginDescriptor pluginDescriptor) { try { RepositoryConfiguration repositoryConfiguration = packageAsRepositoryExtension.getRepositoryConfiguration(pluginDescriptor.id()); com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration packageConfiguration = packageAsRepositoryExtension.getPackageConfiguration(pluginDescriptor.id()); if (repositoryConfiguration == null) { throw new RuntimeException(format("Plugin[%s] returned null repository configuration", pluginDescriptor.id())); } if (packageConfiguration == null) { throw new RuntimeException(format("Plugin[%s] returned null package configuration", pluginDescriptor.id())); } repositoryMetadataStore.addMetadataFor(pluginDescriptor.id(), new PackageConfigurations(repositoryConfiguration)); packageMetadataStore.addMetadataFor(pluginDescriptor.id(), new PackageConfigurations(packageConfiguration)); } catch (GoPluginFrameworkException e) { LOGGER.error(format("Failed to fetch package metadata for plugin : %s", pluginDescriptor.id()), e); } }
Source:
public static int getSkyBlendColour(World world, int playerX, int playerY, int playerZ) { if (playerX == skyX && playerZ == skyZ && skyInit) { return skyRGBMultiplier; } skyInit = true; GameSettings settings = Minecraft.getMinecraft().gameSettings; int[] ranges = ForgeModContainer.blendRanges; int distance = 0; if (settings.fancyGraphics && settings.renderDistanceChunks >= 0 && settings.renderDistanceChunks < ranges.length) { distance = ranges[settings.renderDistanceChunks]; } int r = 0; int g = 0; int b = 0; int divider = 0; for (int x = -distance; x <= distance; ++x) { for (int z = -distance; z <= distance; ++z) { BiomeGenBase biome = world.getBiomeGenForCoords(playerX + x, playerZ + z); int colour = biome.getSkyColorByTemp(biome.getFloatTemperature(playerX + x, playerY, playerZ + z)); r += (colour & 0xFF0000) >> 16; g += (colour & 0x00FF00) >> 8; b += colour & 0x0000FF; divider++; } } SkyColorEvent event = new SkyColorEvent(r, g, b, divider); MinecraftForge.EVENT_BUS.post(event); r = event.red; g = event.green; b = event.blue; int multiplier = (r / divider & 255) << 16 | (g / divider & 255) << 8 | b / divider & 255; skyX = playerX; skyZ = playerZ; skyRGBMultiplier = multiplier; return skyRGBMultiplier; }

Target:
public static int getSkyBlendColour(World world, int playerX, int playerY, int playerZ) { if (playerX == skyX && playerZ == skyZ && skyInit) { return skyRGBMultiplier; } skyInit = true; GameSettings settings = Minecraft.getMinecraft().gameSettings; int[] ranges = ForgeModContainer.blendRanges; int distance = 0; if (settings.fancyGraphics && settings.renderDistanceChunks >= 0 && settings.renderDistanceChunks < ranges.length) { distance = ranges[settings.renderDistanceChunks]; } int r = 0; int g = 0; int b = 0; int divider = 0; for (int x = -distance; x <= distance; ++x) { for (int z = -distance; z <= distance; ++z) { BiomeGenBase biome = world.getBiomeGenForCoords(playerX + x, playerZ + z); int colour = biome.getSkyColorByTemp(biome.getFloatTemperature(playerX + x, playerY, playerZ + z)); r += (colour & 0xFF0000) >> 16; g += (colour & 0x00FF00) >> 8; b += colour & 0x0000FF; divider++; } } SkyColorEvent event = new SkyColorEvent(r / divider, g / divider, b / divider); MinecraftForge.EVENT_BUS.post(event); r = event.red; g = event.green; b = event.blue; int multiplier = (r & 255) << 16 | (g & 255) << 8 | b & 255; skyX = playerX; skyZ = playerZ; skyRGBMultiplier = multiplier; return skyRGBMultiplier; }
Source:
public String getMobileUri() { try { return String.format( "%1$s://%2$s/wiki/%3$s%4$s", WikipediaApp.PROTOCOL, getSite().getApiDomain(), URLEncoder.encode(getPrefixedText().replace(" ", "_"), "utf-8"), (this.fragment != null && this.fragment.length() > 0) ? ("#" + this.fragment) : "" ); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }

Target:
public String getMobileUri() { return getUriForDomain(getSite().getApiDomain()); }
Source:
public static ImageType getType(List<ImageHeaderParser> parsers, @Nullable InputStream is, ArrayPool byteArrayPool) throws IOException { if (is == null) { return ImageType.UNKNOWN; } if (!is.markSupported()) { is = new RecyclableBufferedInputStream(is, byteArrayPool); } is.mark(MARK_POSITION); for (ImageHeaderParser parser : parsers) { try { ImageType type = parser.getType(is); if (type != ImageType.UNKNOWN) { return type; } } finally { is.reset(); } } return ImageType.UNKNOWN; }

Target:
public static ImageType getType(List<ImageHeaderParser> parsers, @Nullable InputStream is, ArrayPool byteArrayPool) throws IOException { if (is == null) { return ImageType.UNKNOWN; } if (!is.markSupported()) { is = new RecyclableBufferedInputStream(is, byteArrayPool); } is.mark(MARK_POSITION); for (int i = 0, size = parsers.size(); i < size; i++) { ImageHeaderParser parser = parsers.get(i); try { ImageType type = parser.getType(is); if (type != ImageType.UNKNOWN) { return type; } } finally { is.reset(); } } return ImageType.UNKNOWN; }
Source:
public void createContent(Composite parent) { this.controls = new LinkedHashMap<>(); GridLayout layout = new GridLayout(1, false); parent.setLayout(layout); boolean firstControl = true; for (Entry<ITextHover, IInformationControlCreator> hoverControlCreator : this.creators.entrySet()) { IInformationControl informationControl = hoverControlCreator.getValue().createInformationControl(parent.getShell()); if (informationControl instanceof AbstractInformationControl) { List<Control> children = Arrays.asList(((AbstractInformationControl)informationControl).getShell().getChildren()); children.remove(parent); if (children.isEmpty() ) { continue; } for (Control control : children) { control.setParent(parent); control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); } if (!firstControl) { ((GridData)children.get(0).getLayoutData()).verticalIndent = 0; } controls.put(hoverControlCreator.getKey(), informationControl); firstControl = false; } else { GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, GenericEditorPlugin.BUNDLE_ID, "Only text hovers producing an AbstractInformationControl can be aggregated; got a " + informationControl.getClass().getSimpleName())); informationControl.dispose(); } } }

Target:
public void createContent(Composite parent) { this.controls = new LinkedHashMap<>(); GridLayout layout = new GridLayout(1, false); parent.setLayout(layout); boolean firstControl = true; for (Entry<ITextHover, IInformationControlCreator> hoverControlCreator : this.creators.entrySet()) { IInformationControl informationControl = hoverControlCreator.getValue().createInformationControl(parent.getShell()); if (informationControl instanceof AbstractInformationControl) { List<Control> children = Arrays.asList(((AbstractInformationControl)informationControl).getShell().getChildren()); children.remove(parent); if (children.isEmpty() ) { continue; } for (Control control : children) { control.setParent(parent); control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); } controls.put(hoverControlCreator.getKey(), informationControl); firstControl = false; } else { GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, GenericEditorPlugin.BUNDLE_ID, "Only text hovers producing an AbstractInformationControl can be aggregated; got a " + informationControl.getClass().getSimpleName())); informationControl.dispose(); } } }