auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testTextType() throws Exception { Session s = openSession(); s.beginTransaction(); SearchEntity entity = new SearchEntity(); entity.key = Integer.valueOf( 1 ); entity.t = "TEST TEXT"; entity.c = "TEST STRING"; s.persist( entity ); s.flush(); s.getTransaction().commit(); s.clear(); Query<Object[]> legacyQuery = s.createQuery( "select b, snippets(t), highlighted(t), score() from " + ENTITY_NAME + " b where contains(b.t, 'text') = contains_rhs()", Object[].class); Object[] result = legacyQuery.getSingleResult(); SearchEntity retrievedEntity = (SearchEntity) result[0]; assertEquals(4, result.length); assertEquals( Integer.valueOf( 1 ), retrievedEntity.key ); assertEquals( "TEST TEXT", retrievedEntity.t ); assertEquals( "TEST STRING", retrievedEntity.c ); assertEquals("TEST <b>TEXT</b>", result[1]); assertEquals("TEST <b>TEXT</b>", result[2]); assertEquals(0.75d, result[3]); }

Target:
public void testTextType() throws Exception { doInHibernate( this::sessionFactory, s -> { SearchEntity entity = new SearchEntity(); entity.key = Integer.valueOf( 1 ); entity.t = "TEST TEXT"; entity.c = "TEST STRING"; s.persist( entity ); s.flush(); Query<Object[]> legacyQuery = s.createQuery( "select b, snippets(t), highlighted(t), score() from " + ENTITY_NAME + " b where contains(b.t, 'text') = contains_rhs()", Object[].class ); Object[] result = legacyQuery.getSingleResult(); SearchEntity retrievedEntity = (SearchEntity) result[0]; assertEquals( 4, result.length ); assertEquals( Integer.valueOf( 1 ), retrievedEntity.key ); assertEquals( "TEST TEXT", retrievedEntity.t ); assertEquals( "TEST STRING", retrievedEntity.c ); assertEquals( "TEST <b>TEXT</b>", result[1] ); assertEquals( "TEST <b>TEXT</b>", result[2] ); assertEquals( 0.75d, result[3] ); } ); }
Source:
private void updateAffinities(InvocationRequest invocationRequest, Map<String, Object> attachments, EJBLocator<?> ejbLocator, ComponentView componentView) { Affinity legacyAffinity = null; Affinity weakAffinity = null; Affinity strongAffinity = null; Affinity clusterAffinity = getClusterAffinity(); if (ejbLocator.isStateful() && componentView.getComponent() instanceof StatefulSessionComponent) { final StatefulSessionComponent statefulSessionComponent = (StatefulSessionComponent) componentView.getComponent(); strongAffinity = getStrongAffinity(statefulSessionComponent); weakAffinity = legacyAffinity = getWeakAffinity(statefulSessionComponent, ejbLocator.asStateful()); } else if (componentView.getComponent() instanceof StatelessSessionComponent) { legacyAffinity = clusterAffinity; strongAffinity = clusterAffinity; } if (strongAffinity != null && !(strongAffinity instanceof NodeAffinity)) { invocationRequest.updateStrongAffinity(strongAffinity); } if (weakAffinity != null && !weakAffinity.equals(Affinity.NONE)) { invocationRequest.updateWeakAffinity(weakAffinity); } if (legacyAffinity != null && !legacyAffinity.equals(Affinity.NONE)) { attachments.put(Affinity.WEAK_AFFINITY_CONTEXT_KEY, legacyAffinity); } EjbLogger.EJB3_INVOCATION_LOGGER.debugf("Called receiveInvocationRequest ( bean = %s ): strong affinity = %s, weak affinity = %s \n", componentView.getComponent().getClass().getName(), strongAffinity, weakAffinity); }

Target:
private void updateAffinities(InvocationRequest invocationRequest, Map<String, Object> attachments, EJBLocator<?> ejbLocator, ComponentView componentView) { Affinity legacyAffinity = null; Affinity weakAffinity = null; Affinity strongAffinity = null; if (ejbLocator.isStateful() && componentView.getComponent() instanceof StatefulSessionComponent) { final StatefulSessionComponent statefulSessionComponent = (StatefulSessionComponent) componentView.getComponent(); strongAffinity = getStrongAffinity(statefulSessionComponent); weakAffinity = legacyAffinity = getWeakAffinity(statefulSessionComponent, ejbLocator.asStateful()); } else if (componentView.getComponent() instanceof StatelessSessionComponent) { strongAffinity = legacyAffinity = this.getStatelessAffinity(); } if (strongAffinity != null && !(strongAffinity instanceof NodeAffinity)) { invocationRequest.updateStrongAffinity(strongAffinity); } if (weakAffinity != null && !weakAffinity.equals(Affinity.NONE)) { invocationRequest.updateWeakAffinity(weakAffinity); } if (legacyAffinity != null && !legacyAffinity.equals(Affinity.NONE)) { attachments.put(Affinity.WEAK_AFFINITY_CONTEXT_KEY, legacyAffinity); } EjbLogger.EJB3_INVOCATION_LOGGER.debugf("Called receiveInvocationRequest ( bean = %s ): strong affinity = %s, weak affinity = %s \n", componentView.getComponent().getClass().getName(), strongAffinity, weakAffinity); }
Source:
default ColumnValueSelector<Long> makeColumnValueSelector(ReadableOffset offset, ImmutableBitmap nullValueBitmap) { final boolean hasNulls = !nullValueBitmap.isEmpty(); class HistoricalLongColumnSelector implements LongColumnSelector, HistoricalColumnSelector<Long> { @Override public long getLong() { return ColumnarLongs.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { return ColumnarLongs.this.get(offset); } @Override public boolean isNull() { return hasNulls && nullValueBitmap.get(offset.getOffset()); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("columnar", ColumnarLongs.this); inspector.visit("offset", offset); } } return new HistoricalLongColumnSelector(); }

Target:
default ColumnValueSelector<Long> makeColumnValueSelector(ReadableOffset offset, ImmutableBitmap nullValueBitmap) { if (nullValueBitmap.isEmpty()) { class HistoricalLongColumnSelector implements LongColumnSelector, HistoricalColumnSelector<Long> { @Override public boolean isNull() { return false; } @Override public long getLong() { return ColumnarLongs.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { return ColumnarLongs.this.get(offset); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("columnar", ColumnarLongs.this); inspector.visit("offset", offset); } } return new HistoricalLongColumnSelector(); } else { class HistoricalLongColumnSelectorWithNulls implements LongColumnSelector, HistoricalColumnSelector<Long> { @Override public boolean isNull() { return nullValueBitmap.get(offset.getOffset()); } @Override public long getLong() { assert NullHandling.replaceWithDefault() || !isNull(); return ColumnarLongs.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { assert NullHandling.replaceWithDefault() || !nullValueBitmap.get(offset); return ColumnarLongs.this.get(offset); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("columnar", ColumnarLongs.this); inspector.visit("offset", offset); inspector.visit("nullValueBitmap", nullValueBitmap); } } return new HistoricalLongColumnSelectorWithNulls(); } }
Source:
private void invokeOnComplete(final IoCallback callback) { sendThread = null; inCall = Thread.currentThread(); try { callback.onComplete(exchange, this); } finally { inCall = null; } if (Thread.currentThread() != sendThread) { return; } while (next != null || pendingFile != null) { ByteBuffer[] next = this.next; IoCallback queuedCallback = this.queuedCallback; FileChannel file = this.pendingFile; this.next = null; this.queuedCallback = null; this.pendingFile = null; if (next != null) { for (ByteBuffer buffer : next) { writeBuffer(buffer, queuedCallback); } } else if (file != null) { performTransfer(file, queuedCallback); } sendThread = null; inCall = Thread.currentThread(); try { callback.onComplete(exchange, this); } finally { inCall = null; } if (Thread.currentThread() != sendThread) { return; } } }

Target:
private void invokeOnComplete(final IoCallback callback) { sendThread = null; inCall = Thread.currentThread(); try { callback.onComplete(exchange, this); } finally { inCall = null; } if (Thread.currentThread() != sendThread) { return; } while (next != null || pendingFile != null) { ByteBuffer[] next = this.next; IoCallback queuedCallback = this.queuedCallback; FileChannel file = this.pendingFile; this.next = null; this.queuedCallback = null; this.pendingFile = null; if (next != null) { for (ByteBuffer buffer : next) { writeBuffer(buffer, queuedCallback); } } else if (file != null) { performTransfer(file, queuedCallback); } sendThread = null; inCall = Thread.currentThread(); try { queuedCallback.onComplete(exchange, this); } finally { inCall = null; } if (Thread.currentThread() != sendThread) { return; } } }
Source:
public static TimeUnit valueOfTimeUnit(String timeUnitString) { Preconditions.checkNotNull(timeUnitString, "timeUnitString is null"); TimeUnit timeUnit; switch (timeUnitString) { case "ns": timeUnit = TimeUnit.NANOSECONDS; break; case "us": timeUnit = TimeUnit.MICROSECONDS; break; case "ms": timeUnit = TimeUnit.MILLISECONDS; break; case "s": timeUnit = TimeUnit.SECONDS; break; case "m": timeUnit = TimeUnit.MINUTES; break; case "h": timeUnit = TimeUnit.HOURS; break; case "d": timeUnit = TimeUnit.DAYS; break; default: throw new IllegalArgumentException("Unknown time unit: " + timeUnitString); } return timeUnit; }

Target:
public static TimeUnit valueOfTimeUnit(String timeUnitString) { Preconditions.checkNotNull(timeUnitString, "timeUnitString is null"); switch (timeUnitString) { case "ns": return NANOSECONDS; case "us": return MICROSECONDS; case "ms": return MILLISECONDS; case "s": return SECONDS; case "m": return MINUTES; case "h": return HOURS; case "d": return DAYS; default: throw new IllegalArgumentException("Unknown time unit: " + timeUnitString); } }
Source:
public void start(StartContext context) throws StartException { ServiceTarget target = context.getChildTarget(); this.primaryController = target.addService(this.serviceName.append("primary"), this.primaryService).setInitialMode(ServiceController.Mode.NEVER).install(); this.backupController = target.addService(this.serviceName.append("backup"), this.backupService.orElse(new PrimaryProxyService<>(this))).setInitialMode(ServiceController.Mode.PASSIVE).install(); this.dispatcher = this.dispatcherFactory.getValue().<SingletonContext<T>>createCommandDispatcher(this.serviceName, this); this.registration = this.registry.getValue().register(this.serviceName, this); this.started = true; }

Target:
public void start(StartContext context) throws StartException { ServiceTarget target = context.getChildTarget(); this.primaryController = target.addService(this.serviceName.append("primary"), this.primaryService).setInitialMode(ServiceController.Mode.NEVER).install(); this.backupController = target.addService(this.serviceName.append("backup"), this.backupService.orElse(new PrimaryProxyService<>(this))).setInitialMode(ServiceController.Mode.ACTIVE).install(); this.dispatcher = this.dispatcherFactory.getValue().<SingletonContext<T>>createCommandDispatcher(this.serviceName, this); this.registration = this.registry.getValue().register(this.serviceName, this); this.started = true; }
Source:
public Block getResult() { verify(result != null, "result has not been generated"); return result; }

Target:
public Block getResult() { checkState(result != null, "result has not been generated"); return result; }
Source:
public AnyValue mapRelationship( VirtualRelationshipValue value ) { if ( value instanceof RelationshipValue ) { return value; } needsConversion = true; return value; }

Target:
public AnyValue mapRelationship( VirtualRelationshipValue value ) { if ( !needsConversion ) { needsConversion = value instanceof RelationshipReference; } return value; }
Source:
public ProjectRecord[] getValidProjects() { List<ProjectRecord> validProjects = new ArrayList<ProjectRecord>(); for (int i = 0; i < selectedProjects.length; i++) { if (!isProjectInWorkspace(selectedProjects[i].getProjectName())) { selectedProjects[i].hasConflicts = false; validProjects.add(selectedProjects[i]); } else { selectedProjects[i].hasConflicts = true; } } return validProjects.toArray(new ProjectRecord[validProjects.size()]); }

Target:
public ProjectRecord[] getValidProjects() { List<ProjectRecord> validProjects = new ArrayList<ProjectRecord>(); for (int i = 0; i < selectedProjects.length; i++) { if (!isProjectInWorkspace(selectedProjects[i].getProjectName())) { selectedProjects[i].setHasConflicts(false); validProjects.add(selectedProjects[i]); } else { selectedProjects[i].setHasConflicts(true); } } return validProjects.toArray(new ProjectRecord[validProjects.size()]); }
Source:
public LongUiColumn( final List<HeaderMetaData> headerMetaData, final double width, final boolean isResizable, final boolean isVisible, final GuidedDecisionTablePresenter.Access access, final TextBoxLongSingletonDOMElementFactory factory ) { super( headerMetaData, new CellRenderer<Long, NumericLongTextBox, TextBoxDOMElement<Long, NumericLongTextBox>>( factory ) { @Override protected void doRenderCellContent( final Text t, final Long value, final GridBodyCellRenderContext context ) { t.setText( value.toString() ); } }, width, isResizable, isVisible, access, factory ); }

Target:
public LongUiColumn( final List<HeaderMetaData> headerMetaData, final double width, final boolean isResizable, final boolean isVisible, final GuidedDecisionTablePresenter.Access access, final TextBoxLongSingletonDOMElementFactory factory ) { super( headerMetaData, new CellRenderer<Long, NumericLongTextBox, TextBoxDOMElement<Long, NumericLongTextBox>>( factory ) { @Override protected void doRenderCellContent( final Text t, final Long value, final GridBodyCellRenderContext context ) { t.setText( ( (TextBoxLongSingletonDOMElementFactory) factory ).convert( value ) ); } }, width, isResizable, isVisible, access, factory ); }
Source:
public static boolean containsMatchingProperty(Set<IConfigurationProperty> existingProperties, String name, String os, String arch) { boolean result = false; for (IConfigurationProperty property : existingProperties) { if (name.equals(property.getName().trim())) { String propOs = property.getOs().trim(); if (propOs.length() == 0 || os.length() == 0) { result = true; break; } else if (os.equals(propOs)) { String propArch = property.getArch(); if (arch.length() == 0 || propArch.length() == 0) { result = true; break; } } else { continue; } } } return result; }

Target:
public static boolean containsMatchingProperty(Set<IConfigurationProperty> existingProperties, String name, String os, String arch) { for (IConfigurationProperty property : existingProperties) { if (name.equals(property.getName().trim())) { String propOs = property.getOs().trim(); if (ALL_OS.equals(propOs) || ALL_OS.equals(os)) { return true; } else if (os.equals(propOs)) { String propArch = property.getArch(); if (ALL_ARCH.equals(arch) || ALL_ARCH.equals(propArch)) { return true; } } } } return false; }
Source:
public ResultSet<Contact> getContactByEmail(String email) throws ConstantContactServiceException, UnsupportedEncodingException { return contactService.getContactByEmail(this.getAccessToken(), URLEncoder.encode(email, "UTF-8")); }

Target:
public ResultSet<Contact> getContactByEmail(String email) throws ConstantContactServiceException { String encodedEmail = null; try { encodedEmail = URLEncoder.encode(email, "UTF-8"); } catch(UnsupportedEncodingException ex) { throw new IllegalStateException(ex); } return contactService.getContactByEmail(this.getAccessToken(), encodedEmail); }
Source:
private void collectMembers(Set<Item> allMembers, Set<Item> members) { for (Item member : members) { if (allMembers.contains(member)) { return; } if (member instanceof GroupItem) { collectMembers(allMembers, ((GroupItem) member).members); allMembers.add(member); } else { allMembers.add(member); } } }

Target:
private void collectMembers(Set<Item> allMembers, Set<Item> members) { for (Item member : members) { if (allMembers.contains(member)) { continue; } allMembers.add(member); if (member instanceof GroupItem) { collectMembers(allMembers, ((GroupItem) member).members); } } }
Source:
public void testFederateGetHits() throws Exception { List<String> sourceIds = ImmutableList.of("1"); QueryRequest fedQueryRequest = new QueryRequestImpl(mockQuery, false, sourceIds, properties); Source mockSource = getMockSource(); List<Source> sourceList = ImmutableList.of(mockSource, mockSource, mockSource); when(mockResponse.getHits()).thenReturn((long) sourceList.size()); QueryResponse federateResponse = federateStrategy.federate(sourceList, fedQueryRequest); assertThat(federateResponse.getHits(), is((long) sourceList.size() * sourceList.size())); }

Target:
public void testFederateGetHits() throws Exception { QueryRequest fedQueryRequest = new QueryRequestImpl(mockQuery, true, null, null); Source mockSource1 = getMockSource(); Source mockSource2 = getMockSource(); Source mockSource3 = getMockSource(); List<Source> sourceList = ImmutableList.of(mockSource1, mockSource2, mockSource3); long numHits = 2; when(mockResponse.getHits()).thenReturn(numHits); QueryResponse federateResponse = federateStrategy.federate(sourceList, fedQueryRequest); assertThat(federateResponse.getHits(), is(numHits * sourceList.size())); }
Source:
public void setText (String string) { checkWidget (); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); if ((style & SWT.SEPARATOR) != 0) return; if (image == null || !IMAGE_AND_TEXT) { updateStyleBits(true); } if (string.equals (text)) return; text = string; string = Display.withCrLf (string); TCHAR buffer = new TCHAR (getCodePage (), string, true); OS.SetWindowText (handle, buffer); if ((state & HAS_AUTO_DIRECTION) != 0) { updateTextDirection (AUTO_TEXT_DIRECTION); } }

Target:
public void setText (String string) { checkWidget (); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); if ((style & SWT.SEPARATOR) != 0) return; updateStyleBits(true); if (string.equals (text)) return; text = string; string = Display.withCrLf (string); TCHAR buffer = new TCHAR (getCodePage (), string, true); OS.SetWindowText (handle, buffer); if ((state & HAS_AUTO_DIRECTION) != 0) { updateTextDirection (AUTO_TEXT_DIRECTION); } }
Source:
private void uploadObject() throws IOException { try { log.debug("Starting upload for host: %s, key: %s, file: %s, size: %s", host, key, tempFile, tempFile.length()); STATS.uploadStarted(); PutObjectRequest request = new PutObjectRequest(host, key, tempFile); if (sseEnabled) { switch (sseType) { case KMS: if (sseKmsKeyId != null) { request.withSSEAwsKeyManagementParams(new SSEAwsKeyManagementParams(sseKmsKeyId)); } else { request.withSSEAwsKeyManagementParams(new SSEAwsKeyManagementParams()); } break; case S3: ObjectMetadata metadata = new ObjectMetadata(); metadata.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION); request.setMetadata(metadata); break; } } request.withCannedAcl(this.aclType); Upload upload = transferManager.upload(request); if (log.isDebugEnabled()) { upload.addProgressListener(createProgressListener(upload)); } upload.waitForCompletion(); STATS.uploadSuccessful(); log.debug("Completed upload for host: %s, key: %s", host, key); } catch (AmazonClientException e) { STATS.uploadFailed(); throw new IOException(e); } catch (InterruptedException e) { STATS.uploadFailed(); Thread.currentThread().interrupt(); throw new InterruptedIOException(); } }

Target:
private void uploadObject() throws IOException { try { log.debug("Starting upload for host: %s, key: %s, file: %s, size: %s", host, key, tempFile, tempFile.length()); STATS.uploadStarted(); PutObjectRequest request = new PutObjectRequest(host, key, tempFile); if (sseEnabled) { switch (sseType) { case KMS: if (sseKmsKeyId != null) { request.withSSEAwsKeyManagementParams(new SSEAwsKeyManagementParams(sseKmsKeyId)); } else { request.withSSEAwsKeyManagementParams(new SSEAwsKeyManagementParams()); } break; case S3: ObjectMetadata metadata = new ObjectMetadata(); metadata.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION); request.setMetadata(metadata); break; } } request.withCannedAcl(aclType); Upload upload = transferManager.upload(request); if (log.isDebugEnabled()) { upload.addProgressListener(createProgressListener(upload)); } upload.waitForCompletion(); STATS.uploadSuccessful(); log.debug("Completed upload for host: %s, key: %s", host, key); } catch (AmazonClientException e) { STATS.uploadFailed(); throw new IOException(e); } catch (InterruptedException e) { STATS.uploadFailed(); Thread.currentThread().interrupt(); throw new InterruptedIOException(); } }
Source:
public boolean canExecute(ITmfTrace trace) { return !Iterables.isEmpty(getDependentAnalyses()); }

Target:
public boolean canExecute(ITmfTrace trace) { return true; }
Source:
private void processWarningSnapshot(RangeHighlighter[] highlighters) { if (highlighters.length == 0) { return; } final List<Warning<String>> warnings = Arrays.stream(highlighters) .filter(RangeHighlighterEx.class::isInstance) .map(RangeHighlighterEx.class::cast) .filter(IntelliJMarkupModelListener::isWarningRangeHighlighter) .map(rangeHighlighter -> createWarningFromRangeHighlighter(rangeHighlighter, null)) .map(IntelliJMarkupModelListener::classifyWarning) .collect(Collectors.toList()); this.trackingEventManager.addEvent(new FileWarningSnapshotEvent(this.document.prepareDocument(), warnings)); }

Target:
private void processWarningSnapshot(RangeHighlighter[] highlighters) { if (highlighters.length == 0) { return; } final Stream<RangeHighlighterEx> rangeHighlighters = Arrays.stream(highlighters) .filter(RangeHighlighterEx.class::isInstance) .map(RangeHighlighterEx.class::cast); final List<Warning<String>> warnings = rangeHighlighters .filter(IntelliJMarkupModelListener::isWarningRangeHighlighter) .map(rangeHighlighter -> createWarningFromRangeHighlighter(rangeHighlighter, null)) .map(IntelliJMarkupModelListener::classifyWarning) .collect(Collectors.toList()); this.trackingEventManager.addEvent(new FileWarningSnapshotEvent(this.document.prepareDocument(), warnings)); }
Source:
public boolean clickEditInstructorLink(int instrNum) { getEditInstructorLink(instrNum).click(); WebElement saveButton = browser.driver.findElement(By.id("btnSaveInstructor" + instrNum)); waitForElementVisibility(saveButton); WebElement editInstructorNameTextBox = browser.driver.findElement(By.id("instructorname" + instrNum)); WebElement editInstructorEmailTextBox = browser.driver.findElement(By.id("instructoremail" + instrNum)); boolean isEditable = editInstructorNameTextBox.isEnabled() && editInstructorEmailTextBox.isEnabled() && saveButton.isDisplayed(); return isEditable; }

Target:
public boolean clickEditInstructorLink(int instrNum) { getEditInstructorLink(instrNum).click(); WebElement saveButton = getSaveInstructorButton(instrNum); waitForElementVisibility(saveButton); WebElement editInstructorNameTextBox = getNameField(instrNum); WebElement editInstructorEmailTextBox = getEmailField(instrNum); boolean isEditable = editInstructorNameTextBox.isEnabled() && editInstructorEmailTextBox.isEnabled() && saveButton.isDisplayed(); return isEditable; }
Source:
private void assertSameRecords(int majorVersion, SAMRecord record1, SAMRecord record2) { Assert.assertEquals(record2.getFlags(), record1.getFlags()); Assert.assertEquals(record2.getReadName(), record1.getReadName()); Assert.assertEquals(record2.getReferenceName(), record1.getReferenceName()); Assert.assertEquals(record2.getAlignmentStart(), record1.getAlignmentStart()); if (record1.getReadBases() == SAMRecord.NULL_SEQUENCE && majorVersion < CramVersions.CRAM_v3.major) ; else Assert.assertEquals(record2.getReadBases(), record1.getReadBases()); Assert.assertEquals(record2.getBaseQualities(), record1.getBaseQualities()); }

Target:
private void assertSameRecords(int majorVersion, SAMRecord record1, SAMRecord record2) { Assert.assertEquals(record2.getFlags(), record1.getFlags()); Assert.assertEquals(record2.getReadName(), record1.getReadName()); Assert.assertEquals(record2.getReferenceName(), record1.getReferenceName()); Assert.assertEquals(record2.getAlignmentStart(), record1.getAlignmentStart()); if (record1.getReadBases() != SAMRecord.NULL_SEQUENCE || majorVersion >= CramVersions.CRAM_v3.major) { Assert.assertEquals(record2.getReadBases(), record1.getReadBases()); } Assert.assertEquals(record2.getBaseQualities(), record1.getBaseQualities()); }
Source:
public Data getResult() { if (result == null) { return ss.toData(newValue); } return result; }

Target:
public Data getResult() { return result; }
Source:
public int readUnsignedByte() throws IOException { return sageFileChannel.readUnsignedByte(); }

Target:
public int readUnsignedByte() throws IOException { ensureProperFile(false); return sageFileChannel.readUnsignedByte(); }
Source:
private LoadBalancer() { ConnectionStateListener connectionStateListener = null; UnhandledErrorListener unhandledErrorListener = null; List<Closeable> closeAbles = Lists.newArrayList(); try { curaFramework = CuratorFrameworkFactory.newClient(getZkConnectString(), new ExponentialBackoffRetry(1000, 3)); curaFramework.start(); curaFramework.setACL().withACL(CONFIG.getAcls()); connectionStateListener = getConnectionStateListener(); curaFramework.getConnectionStateListenable() .addListener(connectionStateListener); unhandledErrorListener = getUnhandledErrorListener(); curaFramework.getUnhandledErrorListenable() .addListener(unhandledErrorListener); cache = new PathChildrenCache(curaFramework, CONFIG.getParentPath(), true); cache.start(PathChildrenCache.StartMode.BUILD_INITIAL_CACHE); closeAbles.add(cache); closeAbles.add(curaFramework); }catch(Exception ex){ LOG.error("Exception while creating a zookeeper clients and cache",ex); if ((curaFramework != null) && (connectionStateListener != null)){ curaFramework.getConnectionStateListenable() .removeListener(connectionStateListener); } if ((curaFramework != null) && (unhandledErrorListener != null)){ curaFramework.getUnhandledErrorListenable() .removeListener(unhandledErrorListener); } for (Closeable closeable : closeAbles) { CloseableUtils.closeQuietly(closeable); } } }

Target:
private LoadBalancer() { try { start(); }catch(Exception ex){ LOG.error("Exception while creating a zookeeper clients and cache",ex); if ((curaFramework != null) && (connectionStateListener != null)){ curaFramework.getConnectionStateListenable() .removeListener(connectionStateListener); } if ((curaFramework != null) && (unhandledErrorListener != null)){ curaFramework.getUnhandledErrorListenable() .removeListener(unhandledErrorListener); } for (Closeable closeable : closeAbles) { CloseableUtils.closeQuietly(closeable); } } }
Source:
public FormValidation doCheckBasePath(@AncestorInPath AbstractProject project, @QueryParameter String basePath) throws IOException, InterruptedException { if (project == null) { return FormValidation.ok(); } FilePath ws = project.getSomeWorkspace(); FilePath reference; if (ws == null) { reference = Jenkins.getInstance().getRootPath(); } else { reference = ws; } FilePath filePath = reference.child(basePath); if (!filePath.getRemote().startsWith(reference.getRemote())) { return FormValidation.error(Messages.ArtifactArchiver_BasePathOutsideWorkspace()); } if (ws != null && ws.exists()) { if (!filePath.exists()) { return FormValidation.warning(Messages.ArtifactArchiver_BasePathDoesNotExist()); } if (!filePath.isDirectory()) { return FormValidation.warning(Messages.ArtifactArchiver_BasePathIsFile()); } } return FormValidation.ok(); }

Target:
public FormValidation doCheckBasePath(@AncestorInPath AbstractProject project, @QueryParameter String basePath) throws IOException, InterruptedException { if (project == null) { return FormValidation.ok(); } FilePath ws = project.getSomeWorkspace(); FilePath reference; if (ws == null) { reference = Jenkins.getInstance().getRootPath(); } else { reference = ws; } FilePath filePath = reference.child(basePath); if (!reference.equals(filePath) && !filePath.isDescendantOf(reference)) { return FormValidation.error(Messages.ArtifactArchiver_BasePathOutsideWorkspace()); } if (ws != null && ws.exists()) { if (!filePath.exists()) { return FormValidation.warning(Messages.ArtifactArchiver_BasePathDoesNotExist()); } if (!filePath.isDirectory()) { return FormValidation.warning(Messages.ArtifactArchiver_BasePathIsFile()); } } return FormValidation.ok(); }
Source:
public synchronized ListenableFuture<Supplier<LookupSource>> getLookupSource() { assertIn(State.SPILLED); unspillingRequested.set(null); setState(State.UNSPILLING); unspilledLookupSource = SettableFuture.create(); return unspilledLookupSource; }

Target:
public synchronized ListenableFuture<Supplier<LookupSource>> getLookupSource() { assertState(State.SPILLED); unspillingRequested.set(null); setState(State.UNSPILLING); checkState(unspilledLookupSource == null, "unspilledLookupSource already set"); unspilledLookupSource = SettableFuture.create(); return unspilledLookupSource; }
Source:
public void postCollectionDefaultItemReadGroupCreateDefaultItemReadGroupForbidden() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(eperson.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/itemReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isForbidden()); }

Target:
public void postCollectionDefaultItemReadGroupCreateDefaultItemReadGroupForbidden() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(eperson.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/itemReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isForbidden()); token = getAuthToken(admin.getEmail(), password); Group anon = groupService.findByName(context, Group.ANONYMOUS); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/itemReadGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(anon.getID(), anon.getName()))); }
Source:
protected void dumpState(StateDumpCollector dump) { dump.addState("cacheName", cache.getName()); dump.addState("cacheSie", String.valueOf(cache.size())); }

Target:
protected void dumpState(StateDumpCollector dump) { dump.addState("cacheName", cache.getName()); dump.addState("cacheSize", String.valueOf(cache.size())); }
Source:
public void setWriteBuffer(ByteBuffer buffer) { writeBuffer = null; writeBuffer = buffer; }

Target:
public void setWriteBuffer(ByteBuffer buffer) { writeBuffer = buffer; }
Source:
public void testExportOk() throws IOException { final Repository a = createBareRepository(); final String name = a.getDirectory().getName(); final File base = a.getDirectory().getParentFile(); final File export = new File(a.getDirectory(), "git-daemon-export-ok"); FileResolver resolver; assertFalse("no git-daemon-export-ok", export.exists()); resolver = new FileResolver(base, false ); try { resolver.open(null, name); fail("opened non-exported repository"); } catch (ServiceNotEnabledException e) { assertEquals("Service not enabled", e.getMessage()); } resolver = new FileResolver(base, true ); try { resolver.open(null, name).close(); } catch (ServiceNotEnabledException e) { fail("did not honor export-all flag"); } assertTrue(export.createNewFile()); assertTrue("has git-daemon-export-ok", export.exists()); resolver = new FileResolver(base, false ); try { resolver.open(null, name).close(); } catch (ServiceNotEnabledException e) { fail("did not honor git-daemon-export-ok"); } }

Target:
public void testExportOk() throws IOException { final Repository a = createBareRepository(); final String name = a.getDirectory().getName(); final File base = a.getDirectory().getParentFile(); final File export = new File(a.getDirectory(), "git-daemon-export-ok"); FileResolver resolver; assertFalse("no git-daemon-export-ok", export.exists()); resolver = new FileResolver(base, false ); try { resolver.open(null, name); fail("opened non-exported repository"); } catch (ServiceNotEnabledException e) { assertEquals("Service not enabled", e.getMessage()); } resolver = new FileResolver(base, true ); try { resolver.open(null, name).close(); } catch (ServiceNotEnabledException e) { fail("did not honor export-all flag"); } FileUtils.createNewFile(export); resolver = new FileResolver(base, false ); try { resolver.open(null, name).close(); } catch (ServiceNotEnabledException e) { fail("did not honor git-daemon-export-ok"); } }
Source:
public void testNMRegistration() throws InterruptedException, IOException { nm = new NodeManager() { @Override protected NodeStatusUpdater createNodeStatusUpdater(Context context, Dispatcher dispatcher, NodeHealthCheckerService healthChecker) { return new MyNodeStatusUpdater(context, dispatcher, healthChecker, metrics); } }; YarnConfiguration conf = createNMConfig(); nm.init(conf); Object[] services = nm.getServices().toArray(); Object lastService = services[services.length-1]; Assert.assertTrue("last service is NOT the node status updater", lastService instanceof NodeStatusUpdater); Thread starterThread = new Thread(() -> { try { nm.start(); } catch (Throwable e) { TestNodeStatusUpdater.this.nmStartError = e; throw new YarnRuntimeException(e); } }); starterThread.start(); LOG.info(" ----- thread already started..{}", nm.getServiceState()); starterThread.join(100000); if (nmStartError != null) { LOG.error("Error during startup. ", nmStartError); Assert.fail(nmStartError.getCause().getMessage()); } int waitCount = 0; while (nm.getServiceState() == STATE.STARTED && heartBeatID <= 3 && waitCount++ < 4000) { Thread.sleep(50); } Assert.assertFalse(heartBeatID <= 3); Assert.assertEquals("Number of registered NMs is wrong!!", 1, this.registeredNodes.size()); }

Target:
public void testNMRegistration() throws Exception { nm = new NodeManager() { @Override protected NodeStatusUpdater createNodeStatusUpdater(Context context, Dispatcher dispatcher, NodeHealthCheckerService healthChecker) { return new MyNodeStatusUpdater(context, dispatcher, healthChecker, metrics); } }; YarnConfiguration conf = createNMConfig(); nm.init(conf); Object[] services = nm.getServices().toArray(); Object lastService = services[services.length-1]; Assert.assertTrue("last service is NOT the node status updater", lastService instanceof NodeStatusUpdater); Thread starterThread = new Thread(() -> { try { nm.start(); } catch (Throwable e) { TestNodeStatusUpdater.this.nmStartError = e; throw new YarnRuntimeException(e); } }); starterThread.start(); LOG.info(" ----- thread already started..{}", nm.getServiceState()); starterThread.join(100000); if (nmStartError != null) { LOG.error("Error during startup. ", nmStartError); Assert.fail(nmStartError.getCause().getMessage()); } GenericTestUtils.waitFor( () -> nm.getServiceState() != STATE.STARTED || heartBeatID.get() > 3, 50, 20000); Assert.assertTrue(heartBeatID.get() > 3); Assert.assertEquals("Number of registered NMs is wrong!!", 1, this.registeredNodes.size()); }
Source:
public Collection<ObjectId> resolve(AbbreviatedObjectId id) throws IOException { if (id.isComplete()) return Collections.singleton(id.toObjectId()); boolean noGarbage = avoidUnreachable; HashSet<ObjectId> matches = new HashSet<ObjectId>(4); PackList packList = db.getPackList(); resolveImpl(packList, id, noGarbage, matches); if (matches.size() <= MAX_RESOLVE_MATCHES && packList.dirty()) { resolveImpl(db.scanPacks(packList), id, noGarbage, matches); } return matches; }

Target:
public Collection<ObjectId> resolve(AbbreviatedObjectId id) throws IOException { if (id.isComplete()) return Collections.singleton(id.toObjectId()); boolean noGarbage = avoidUnreachable; HashSet<ObjectId> matches = new HashSet<ObjectId>(4); PackList packList = db.getPackList(); resolveImpl(packList, id, noGarbage, matches); if (matches.size() < MAX_RESOLVE_MATCHES && packList.dirty()) { resolveImpl(db.scanPacks(packList), id, noGarbage, matches); } return matches; }
Source:
private void checkCsvResultFile() throws Exception { boolean success = false; final Deadline deadline = Deadline.fromNow(Duration.ofSeconds(120)); while (deadline.hasTimeLeft()) { if (Files.exists(result)) { List<String> lines = readCsvResultFiles(result); if (lines.size() == 4) { success = true; assertThat( lines.toArray(new String[0]), arrayContainingInAnyOrder( "\"2018-03-12 08:00:00.000\",Alice,\"This was a warning.\",2,\"Success constant folding.\"", "\"2018-03-12 09:00:00.000\",Bob,\"This was another warning.\",1,\"Success constant folding.\"", "\"2018-03-12 09:00:00.000\",Steve,\"This was another info.\",2,\"Success constant folding.\"", "\"2018-03-12 09:00:00.000\",Alice,\"This was a info.\",1,\"Success constant folding.\"" ) ); break; } else { LOG.info("The target CSV does not contain enough records, current records, left time: {}s", result, lines.size(), deadline.timeLeft().getSeconds()); } } else { LOG.info("The target CSV does not exist now", result); } Thread.sleep(500); } Assert.assertTrue("Did not get expected results before timeout.", success); }

Target:
private void checkCsvResultFile() throws Exception { boolean success = false; final Deadline deadline = Deadline.fromNow(Duration.ofSeconds(120)); while (deadline.hasTimeLeft()) { if (Files.exists(result)) { List<String> lines = readCsvResultFiles(result); if (lines.size() == 4) { success = true; assertThat( lines.toArray(new String[0]), arrayContainingInAnyOrder( "2018-03-12 08:00:00.000,Alice,This was a warning.,2,Success constant folding.", "2018-03-12 09:00:00.000,Bob,This was another warning.,1,Success constant folding.", "2018-03-12 09:00:00.000,Steve,This was another info.,2,Success constant folding.", "2018-03-12 09:00:00.000,Alice,This was a info.,1,Success constant folding." ) ); break; } else { LOG.info("The target CSV does not contain enough records, current records, left time: {}s", result, lines.size(), deadline.timeLeft().getSeconds()); } } else { LOG.info("The target CSV does not exist now", result); } Thread.sleep(500); } Assert.assertTrue("Did not get expected results before timeout.", success); }
Source:
public Response addOrUpdateAction(MultivaluedMap<String, String> form, @Context UriInfo uriInfo) throws Exception { String query = uriInfo.getPath(); System.out.println("query [" + query + "]"); String title = form.getFirst("ats_title"); String description = form.getFirst("desc"); String actionableItemName = form.getFirst("actionableItems"); String changeType = form.getFirst("changeType"); String priority = form.getFirst("priority"); ArtifactId actionId = ActionUtility.createAction(orcsApi, title, description, actionableItemName, changeType, priority); ArtifactReadable action = AtsServerImpl.get().getArtifactByGuid(actionId.getGuid()); String htmlStr = displayAction(registry, action, "Action Created - " + action.getGuid()); return Response.status(200).entity(htmlStr).build(); }

Target:
public Response addOrUpdateAction(MultivaluedMap<String, String> form, @Context UriInfo uriInfo) throws Exception { String query = uriInfo.getPath(); System.out.println("query [" + query + "]"); String title = form.getFirst("ats_title"); String description = form.getFirst("desc"); String actionableItemName = form.getFirst("actionableItems"); String changeType = form.getFirst("changeType"); String priority = form.getFirst("priority"); ArtifactId actionId = ActionUtility.createAction(orcsApi, title, description, actionableItemName, changeType, priority); ArtifactReadable action = AtsServerImpl.get().getArtifactByGuid(actionId.getGuid()); String htmlStr = ActionUtility.displayAction(registry, action, "Action Created - " + action.getGuid()); return Response.status(200).entity(htmlStr).build(); }
Source:
private Optional<HttpUrl> redirectTo(HttpUrl current, HttpUrl redirectBaseUrl) { lastBaseUrl.set(redirectBaseUrl); if (!isPathPrefixFor(redirectBaseUrl, current)) { return Optional.empty(); } else { return Optional.of(current.newBuilder() .scheme(redirectBaseUrl.scheme()) .host(redirectBaseUrl.host()) .port(redirectBaseUrl.port()) .encodedPath( redirectBaseUrl.encodedPath() + current.encodedPath().substring(redirectBaseUrl.encodedPath().length())) .build()); } }

Target:
private Optional<HttpUrl> redirectTo(HttpUrl current, HttpUrl redirectBaseUrl) { lastBaseUrl.set(redirectBaseUrl); if (!isPathPrefixFor(redirectBaseUrl, current)) { return Optional.empty(); } return Optional.of(current.newBuilder() .scheme(redirectBaseUrl.scheme()) .host(redirectBaseUrl.host()) .port(redirectBaseUrl.port()) .encodedPath( redirectBaseUrl.encodedPath() + current.encodedPath().substring(redirectBaseUrl.encodedPath().length())) .build()); }
Source:
private void createInterrupt(final ITmfStateSystem ssq, long startTime, long endTime, ResourcesEntryModel cpuEntry, List<Integer> irqQuarks, Type type, List<ResourcesEntryModel> builder) { for (Integer irqQuark : irqQuarks) { String resourceName = ssq.getAttributeName(irqQuark); int resourceId = Integer.parseInt(resourceName); long irqId = getId(irqQuark); builder.add(new ResourcesEntryModel(irqId, cpuEntry.getId(), computeEntryName(type, resourceId), startTime, endTime, resourceId, type)); fEntryModelTypes.put(irqQuark, type); String aggregateIrqtype = type == Type.IRQ ? Attributes.IRQS : Attributes.SOFT_IRQS; int aggregateQuark = ssq.optQuarkAbsolute(aggregateIrqtype, resourceName); if (aggregateQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return; } long aggregateId = getId(aggregateQuark); if (!Iterables.any(builder, entry -> entry.getId() == aggregateId)) { builder.add(new ResourcesEntryModel(aggregateId, cpuEntry.getParentId(), computeEntryName(type, resourceId), startTime, endTime, resourceId, type)); } builder.add(new ResourcesEntryModel(irqId, aggregateId, computeEntryName(Type.CPU, cpuEntry.getResourceId()), startTime, endTime, cpuEntry.getResourceId(), type)); fEntryModelTypes.put(aggregateQuark, type); } }

Target:
private void createInterrupt(final ITmfStateSystem ssq, long startTime, long endTime, ResourcesEntryModel cpuEntry, List<Integer> irqQuarks, Type type, List<ResourcesEntryModel> builder) { for (Integer irqQuark : irqQuarks) { String resourceName = ssq.getAttributeName(irqQuark); int resourceId = Integer.parseInt(resourceName); long irqId = getId(irqQuark); builder.add(new ResourcesEntryModel(irqId, cpuEntry.getId(), computeEntryName(type, resourceId), startTime, endTime, resourceId, type)); fEntryModelTypes.put(irqQuark, type); String aggregateIrqtype = type == Type.IRQ ? Attributes.IRQS : Attributes.SOFT_IRQS; int aggregateQuark = ssq.optQuarkAbsolute(aggregateIrqtype, resourceName); if (aggregateQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { continue; } long aggregateId = getId(aggregateQuark); if (!Iterables.any(builder, entry -> entry.getId() == aggregateId)) { builder.add(new ResourcesEntryModel(aggregateId, cpuEntry.getParentId(), computeEntryName(type, resourceId), startTime, endTime, resourceId, type)); } builder.add(new ResourcesEntryModel(irqId, aggregateId, computeEntryName(Type.CPU, cpuEntry.getResourceId()), startTime, endTime, cpuEntry.getResourceId(), type)); fEntryModelTypes.put(aggregateQuark, type); } }
Source:
private Drawable loadBackgroundSlideshowImage() { if (! settings.hasPermission(Manifest.permission.READ_EXTERNAL_STORAGE)) { return new ColorDrawable(Color.BLACK); } File cacheFile = new File(mContext.getCacheDir(), Config.backgroundImageCacheFilename); long now = System.currentTimeMillis(); long ONE_MINUTE = 10000; if (cacheFile.exists() && now - cacheFile.lastModified() < ONE_MINUTE) { BitmapDrawable cached = loadBackgroundImageFromCache(); if (cached != null) { return cached; } } if (files.isEmpty()) return new ColorDrawable(Color.BLACK); File file = files.get(new Random().nextInt(files.size())); Bitmap bitmap = loadImageFromPath(file); bitmap = rescaleBackgroundImage(bitmap); writeBackgroundImageToCache(bitmap); setDominantColorFromBitmap(bitmap); if (bitmap != null) { return new BitmapDrawable(mContext.getResources(), bitmap); } return new ColorDrawable(Color.BLACK); }

Target:
private Drawable loadBackgroundSlideshowImage() { if (! settings.hasPermission(Manifest.permission.READ_EXTERNAL_STORAGE)) { return new ColorDrawable(Color.BLACK); } File cacheFile = new File(mContext.getCacheDir(), Config.backgroundImageCacheFilename); long now = System.currentTimeMillis(); long ONE_MINUTE = 60000; if (cacheFile.exists() && now - cacheFile.lastModified() < ONE_MINUTE) { BitmapDrawable cached = loadBackgroundImageFromCache(); if (cached != null) { return cached; } } if (files.isEmpty()) return new ColorDrawable(Color.BLACK); File file = files.get(new Random().nextInt(files.size())); Bitmap bitmap = loadImageFromPath(file); bitmap = rescaleBackgroundImage(bitmap); writeBackgroundImageToCache(bitmap); setDominantColorFromBitmap(bitmap); if (bitmap != null) { return new BitmapDrawable(mContext.getResources(), bitmap); } return new ColorDrawable(Color.BLACK); }
Source:
private void postGetTemplatesNotPresentOnExportDomain(StoragePool storagePool) { ExportVmModel model = (ExportVmModel) getWindow(); Guid storageDomainId = ((StorageDomain) model.getStorage().getSelectedItem()).getId(); if (storagePool != null) { AsyncDataProvider.getAllTemplatesFromExportDomain(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { TemplateListModel templateListModel = (TemplateListModel) target; HashMap<VmTemplate, ArrayList<DiskImage>> templatesDiskSet = (HashMap<VmTemplate, ArrayList<DiskImage>>) returnValue; HashMap<String, ArrayList<String>> templateDic = new HashMap<String, ArrayList<String>>(); ArrayList<String> verTempMissingBase = new ArrayList<String>(); for (Object selectedItem : templateListModel.getSelectedItems()) { VmTemplate template = (VmTemplate) selectedItem; if (!template.isBaseTemplate()) { boolean hasMatch = false; for (VmTemplate a : templatesDiskSet.keySet()) { if (template.getBaseTemplateId().equals(a.getId())) { hasMatch = true; break; } } if (!template.getBaseTemplateId().equals(Guid.Empty) && !hasMatch) { verTempMissingBase.add(template.getName()); } } } templateListModel.postExportGetMissingTemplates(verTempMissingBase); } }), storagePool.getId(), storageDomainId); } }

Target:
private void postGetTemplatesNotPresentOnExportDomain(StoragePool storagePool) { ExportVmModel model = (ExportVmModel) getWindow(); Guid storageDomainId = ((StorageDomain) model.getStorage().getSelectedItem()).getId(); if (storagePool != null) { AsyncDataProvider.getAllTemplatesFromExportDomain(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { TemplateListModel templateListModel = (TemplateListModel) target; HashMap<VmTemplate, ArrayList<DiskImage>> templatesDiskSet = (HashMap<VmTemplate, ArrayList<DiskImage>>) returnValue; ArrayList<String> verTempMissingBase = new ArrayList<String>(); for (Object selectedItem : templateListModel.getSelectedItems()) { VmTemplate template = (VmTemplate) selectedItem; if (!template.isBaseTemplate()) { boolean hasMatch = false; for (VmTemplate a : templatesDiskSet.keySet()) { if (template.getBaseTemplateId().equals(a.getId())) { hasMatch = true; break; } } if (!template.getBaseTemplateId().equals(Guid.Empty) && !hasMatch) { verTempMissingBase.add(template.getName()); } } } templateListModel.postExportGetMissingTemplates(verTempMissingBase); } }), storagePool.getId(), storageDomainId); } }
Source:
public void validate(GlobalConfiguration globalConfig) { if(mediaType != null) { CONFIG.ignoringSpecificMediaTypes(); key().mediaType(mediaType); value().mediaType(mediaType); } keyContentTypeBuilder.validate(); valueContentTypeBuilder.validate(); }

Target:
public void validate(GlobalConfiguration globalConfig) { }