auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testGetAllInterfacesForVdsWithPermissionsForUnpriviligedUser() { List<VdsNetworkInterface> result = dao.getAllInterfacesForVds(VDS_ID, UNPRIVILEGED_USER_ID, true); assertNotNull(result); <START> assertTrue(result.size() == 0); <END> }</code><technical_language>isEmpty() instead</technical_language>

Target:
public void testGetAllInterfacesForVdsWithPermissionsForUnpriviligedUser() { List<VdsNetworkInterface> result = dao.getAllInterfacesForVds(VDS_ID, UNPRIVILEGED_USER_ID, true); assertNotNull(result); assertTrue(result.isEmpty()); }
Source:
<code>public SeekableByteChannel open( final StorageResourceId resourceId, GoogleCloudStorageReadOptions readOptions) throws IOException { logger.atFine().log("open(%s, %s)", resourceId, readOptions); Preconditions.checkArgument( resourceId.isStorageObject(), "Expected full StorageObject id, got %s", resourceId); GoogleCloudStorageItemInfo info; if (readOptions.getFastFailOnNotFound()) { info = getItemInfo(resourceId); if (!info.exists()) { throw GoogleCloudStorageExceptions.getFileNotFoundException( resourceId.getBucketName(), resourceId.getObjectName()); } <START> if (readOptions.getFastFailOnGzipEncoding() <END> && (GZIP_ENCODING.equals(info.getContentEncoding()) || GZIP_TYPE.equals(info.getContentType()))) { throw new IOException("Gzip encoding is deprecated"); } } else { info = null; } return new GoogleCloudStorageReadChannel( gcs, resourceId.getBucketName(), resourceId.getObjectName(), errorExtractor, clientRequestHelper, readOptions) { @Override @Nullable protected GoogleCloudStorageItemInfo getInitialMetadata() { return info; } @Override protected Storage.Objects.Get createRequest() throws IOException { return configureRequest(super.createRequest(), resourceId.getBucketName()); } }; }</code><technical_language>move this check in GoogleCloudStorageReadChannel, determine initialization if opened file is GZIP encoded</technical_language>

Target:
public SeekableByteChannel open( final StorageResourceId resourceId, GoogleCloudStorageReadOptions readOptions) throws IOException { logger.atFine().log("open(%s, %s)", resourceId, readOptions); Preconditions.checkArgument( resourceId.isStorageObject(), "Expected full StorageObject id, got %s", resourceId); GoogleCloudStorageItemInfo info; if (readOptions.getFastFailOnNotFound()) { info = getItemInfo(resourceId); if (!info.exists()) { throw GoogleCloudStorageExceptions.getFileNotFoundException( resourceId.getBucketName(), resourceId.getObjectName()); } } else { info = null; } return new GoogleCloudStorageReadChannel( gcs, resourceId.getBucketName(), resourceId.getObjectName(), errorExtractor, clientRequestHelper, readOptions) { @Override @Nullable protected GoogleCloudStorageItemInfo getInitialMetadata() { return info; } @Override protected Storage.Objects.Get createRequest() throws IOException { return configureRequest(super.createRequest(), resourceId.getBucketName()); } }; }
Source:
<code>private boolean matches(Offer offer, Request request) { double cpus = -1; double mem = -1; for (Resource resource : offer.getResourcesList()) { if (resource.getName().equals("cpus")) { if (resource.getType().equals(Value.Type.SCALAR)) { cpus = resource.getScalar().getValue(); } else { LOGGER.severe("Cpus resource was not a scalar: " + resource.getType().toString()); } } else if (resource.getName().equals("mem")) { if (resource.getType().equals(Value.Type.SCALAR)) { mem = resource.getScalar().getValue(); } else { LOGGER.severe("Mem resource was not a scalar: " + resource.getType().toString()); } } else if (resource.getName().equals("disk")) { LOGGER.warning("Ignoring disk resources from offer"); } else if (resource.getName().equals("ports")) { LOGGER.info("Ignoring ports resources from offer"); } else { LOGGER.warning("Ignoring unknown resource type: " + resource.getName()); } } if (cpus < 0) LOGGER.severe("No cpus resource present"); if (mem < 0) LOGGER.severe("No mem resource present"); double requestedCpus = request.request.cpus; double requestedMem = (1 + JVM_MEM_OVERHEAD_FACTOR) * request.request.mem; if (requestedCpus <= cpus && requestedMem <= mem && slaveAttributesMatch(offer)) { return true; } else { <START> LOGGER.info( <END> "Offer not sufficient for slave request:\n" + offer.getResourcesList().toString() + "\nRequested for Jenkins slave:\n" + " cpus: " + requestedCpus + "\n" + " mem: " + requestedMem); return false; } }</code><technical_language>fix this log statement reflect fact attributes matched</technical_language>

Target:
private boolean matches(Offer offer, Request request) { double cpus = -1; double mem = -1; for (Resource resource : offer.getResourcesList()) { if (resource.getName().equals("cpus")) { if (resource.getType().equals(Value.Type.SCALAR)) { cpus = resource.getScalar().getValue(); } else { LOGGER.severe("Cpus resource was not a scalar: " + resource.getType().toString()); } } else if (resource.getName().equals("mem")) { if (resource.getType().equals(Value.Type.SCALAR)) { mem = resource.getScalar().getValue(); } else { LOGGER.severe("Mem resource was not a scalar: " + resource.getType().toString()); } } else if (resource.getName().equals("disk")) { LOGGER.warning("Ignoring disk resources from offer"); } else if (resource.getName().equals("ports")) { LOGGER.info("Ignoring ports resources from offer"); } else { LOGGER.warning("Ignoring unknown resource type: " + resource.getName()); } } if (cpus < 0) LOGGER.severe("No cpus resource present"); if (mem < 0) LOGGER.severe("No mem resource present"); double requestedCpus = request.request.cpus; double requestedMem = (1 + JVM_MEM_OVERHEAD_FACTOR) * request.request.mem; if (requestedCpus <= cpus && requestedMem <= mem && slaveAttributesMatch(offer)) { return true; } else { LOGGER.info( "Offer not sufficient for slave request:\n" + offer.getResourcesList().toString() + "\n" + offer.getAttributesList().toString() + "\nRequested for Jenkins slave:\n" + " cpus: " + requestedCpus + "\n" + " mem: " + requestedMem + "\n" + " attributes: " + getMesosCloud().getSlaveAttributes().toString()); return false; } }
Source:
<code>private void applyForEachAddress(BiConsumer<Long, ILogData> logDataProcessor) { summonNecromancer(); nextRead = logHead; while (nextRead <= logTail) { try { final long lower = nextRead; final long upper = Math.min(lower + batchReadSize - 1, logTail); nextRead = upper + 1; Map<Long, ILogData> range = <START> runtime.getAddressSpaceView().nonCacheFetchAll(ContiguousSet.create( <END> Range.closed(lower, upper), DiscreteDomain.longs()), true); for (Map.Entry<Long, ILogData> entry : range.entrySet()) { long address = entry.getKey(); ILogData logData = entry.getValue(); if (address != addressProcessed + 1) { throw new IllegalStateException("We missed an entry. It can lead to correctness issues."); } addressProcessed++; if (logData.getType() == DataType.TRIMMED) { throw new IllegalStateException("Unexpected TRIMMED data"); } if (address % STATUS_UPDATE_PACE == 0) { log.info("applyForEachAddress: read up to {}", address); } } invokeNecromancer(range, logDataProcessor); } catch (TrimmedException ex) { log.warn("Error loading data", ex); handleRetry(); } } killNecromancer(); }</code><technical_language>please reformat this piece of code, is pretty inconvenient read ContiguousSet<Long> addresses = ContiguousSet.create( Range.closed(lower, upper), DiscreteDomain.longs() ); Map<Long, ILogData> range = runtime.getAddressSpaceView().fetchAll(addresses, true);</technical_language>

Target:
private void applyForEachAddress(BiConsumer<Long, ILogData> logDataProcessor) { summonNecromancer(); nextRead = logHead; while (nextRead <= logTail) { try { final long lower = nextRead; final long upper = Math.min(lower + batchReadSize - 1, logTail); nextRead = upper + 1; ContiguousSet<Long> addresses = ContiguousSet.create( Range.closed(lower, upper), DiscreteDomain.longs()); Map<Long, ILogData> range = runtime.getAddressSpaceView().nonCacheFetchAll(addresses, true); for (Map.Entry<Long, ILogData> entry : range.entrySet()) { long address = entry.getKey(); ILogData logData = entry.getValue(); if (address != addressProcessed + 1) { throw new IllegalStateException("We missed an entry. It can lead to correctness issues."); } addressProcessed++; if (logData.getType() == DataType.TRIMMED) { throw new IllegalStateException("Unexpected TRIMMED data"); } if (address % STATUS_UPDATE_PACE == 0) { log.info("applyForEachAddress: read up to {}", address); } } invokeNecromancer(range, logDataProcessor); } catch (TrimmedException ex) { log.warn("Error loading data", ex); handleRetry(); } } killNecromancer(); }
Source:
<code>private Folder getInboxFolder() throws MessagingException { final Folder inbox = store.getFolder("inbox"); <START> inbox.open(Folder.READ_WRITE); <END> return inbox; }</code><technical_language>Do need write permission</technical_language>

Target:
private Folder getInboxFolder() throws MessagingException { Folder inbox = store.getFolder("inbox"); inbox.open(Folder.READ_ONLY); return inbox; }
Source:
<code>public KieServerImpl(KieServerStateRepository stateRepository) { this.repository = stateRepository; <START> String modeParam = System.getProperty(KieServerConstants.KIE_SERVER_MODE, KieServerMode.DEVELOPMENT.toString()); <END> try { mode = KieServerMode.valueOf(modeParam.toUpperCase()); } catch (Exception ex) { mode = KieServerMode.DEVELOPMENT; } }</code><technical_language>agree default development mode</technical_language>

Target:
public KieServerImpl(KieServerStateRepository stateRepository) { this.repository = stateRepository; String modeParam = System.getProperty(KieServerConstants.KIE_SERVER_MODE, KieServerMode.DEVELOPMENT.toString()); try { mode = KieServerMode.valueOf(modeParam.toUpperCase()); logger.info("Starting server in '" + mode.name() + "' mode."); } catch (Exception ex) { mode = KieServerMode.DEVELOPMENT; logger.warn("Unable to parse value of " + KieServerConstants.KIE_SERVER_MODE + " = " + modeParam + "; supported values are 'REGULAR' or 'DEVELOPMENT'. Falling back to 'DEVELOPMENT' mode."); } }
Source:
<code>public void writeTo(ByteBuf buf) { <START> buf.writeLong(intermediateDataSetID.getLowerPart()); <END> buf.writeLong(intermediateDataSetID.getUpperPart()); buf.writeInt(partitionNum); }</code><technical_language>I intermediateDataSetID implement writeTo() fromByteBuf (...) invokes in IntermediateResultPartitionID</technical_language>

Target:
public void writeTo(ByteBuf buf) { intermediateDataSetID.writeTo(buf); buf.writeInt(partitionNum); }
Source:
<code><START> public SelectionContext<VariableMap> expandTemplate(VariableMap context) <END> { ResourceGroupId id = null; for (ResourceGroupNameTemplate segment : segments) { String expanded = segment.expandTemplate(context); if (id == null) { id = new ResourceGroupId(expanded); } else { id = new ResourceGroupId(id, expanded); } } OptionalInt first = IntStream.range(0, segments.size()) .filter(i -> segments.get(i).hasVariables()) .findFirst(); return new SelectionContext<>(id, context, createResourceGroupSelectionContext(first)); }</code><technical_language>changing semantics of this method. expanding template a resource group id, giving entire selection context. I this method unchanged private, a new method calls this method get id, (and public)</technical_language>

Target:
public ResourceGroupId expandTemplate(VariableMap context) { ResourceGroupId id = null; for (ResourceGroupNameTemplate segment : segments) { String expanded = segment.expandTemplate(context); if (id == null) { id = new ResourceGroupId(expanded); } else { id = new ResourceGroupId(id, expanded); } } return id; }
Source:
<code>public void testOnJobRenamed() throws Exception { FreeStyleProject job = j.createFreeStyleProject("MyJob"); PatchsetCreated event = Setup.createManualPatchsetCreated(); GerritTrigger trigger = spy(new GerritTrigger( null, null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true, true, true, false, false, "", "", "", "", "", "", "", null, null, null, null, false, false, "", null)); doReturn(new GerritTrigger.DescriptorImpl()).when(trigger, "getDescriptor"); job.addTrigger(trigger); trigger.start(job, true); when(trigger.isInteresting(event)).thenReturn(true); job.renameTo("MyJobRenamed"); GerritItemListener listener = new GerritItemListener(); listener.onLocationChanged(job, "MyJob", "MyJobRenamed"); PluginImpl.getInstance().getHandler().notifyListeners(event); <START> Thread.sleep(100); <END> Assert.assertNotNull(job.getLastBuild()); }</code><technical_language>Jenkins.getInstance().getQueue().maintain()</technical_language>

Target:
public void testOnJobRenamed() throws Exception { FreeStyleProject job = j.createFreeStyleProject("MyJob"); GerritHandler handler = PluginImpl.getInstance().getHandler(); PatchsetCreated event = Setup.createManualPatchsetCreated(); GerritTrigger trigger = spy(new GerritTrigger( null, null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true, true, true, false, false, "", "", "", "", "", "", "", null, null, null, null, false, false, "", null)); doReturn(new GerritTrigger.DescriptorImpl()).when(trigger, "getDescriptor"); job.addTrigger(trigger); trigger.start(job, true); int before = handler.getEventListenersCount(); when(trigger.isInteresting(event)).thenReturn(true); job.renameTo("MyJobRenamed"); assertEquals("We leak some listeners", before, handler.getEventListenersCount()); handler.notifyListeners(event); TestUtils.waitForBuilds(job, 1); assertNotNull(job.getLastBuild()); }
Source:
<code>public void scheduleMessageForRetry(ChargeCaptureMessage message) throws QueueException { <START> sqsQueueService.deferMessage(this.captureQueueUrl, message.getReceiptHandle()); <END> }</code><technical_language>pass in delay this method, SqsQueueService need capture process configuration</technical_language>

Target:
public void scheduleMessageForRetry(ChargeCaptureMessage message) throws QueueException { int captureMessageDeferTimeout = 3600; sqsQueueService.deferMessage(this.captureQueueUrl, message.getReceiptHandle(), captureMessageDeferTimeout); }
Source:
<code>public void testInEnumBlockInLiteralNew() { <START> final DetailAST ast = new DetailAST(); <END> ast.setType(TokenTypes.LITERAL_NEW); final DetailAST ast2 = new DetailAST(); ast2.setType(TokenTypes.IDENT); ast.addChild(ast2); Assert.assertFalse(ScopeUtils.isInEnumBlock(ast2)); }</code><technical_language>getNode</technical_language>

Target:
public void testInEnumBlockInLiteralNew() { assertFalse(ScopeUtils.isInEnumBlock( getNode(TokenTypes.LITERAL_NEW, TokenTypes.IDENT))); }
Source:
<code>public ShapedCraftingRecipe.Builder group(@Nullable String name) { <START> this.groupName = name == null ? "" : name; <END> return this; }</code><technical_language>Strings.nullToEmpty</technical_language>

Target:
public EndStep group(@Nullable String name) { this.groupName = Strings.nullToEmpty(name); return this; }
Source:
<code><START> public Map<String,Integer> listLanguages() throws IOException { <END> return root.retrieve().to(getApiTailUrl("languages"), HashMap.class); }</code><technical_language>Size in bytes, max Integer 2Gb, i some crazy repo number. Long better</technical_language>

Target:
public Map<String,Long> listLanguages() throws IOException { return root.retrieve().to(getApiTailUrl("languages"), HashMap.class); }
Source:
<code>public EnumSet<NeededData> getNeededData() { loadRules(); <START> EnumSet<NeededData> needed = EnumSet.noneOf(NeededData.class); <END> for (List<Predicate<ChangeData>> list : rules.values()) { for (Predicate<ChangeData> p : list) { if (p instanceof Prefetchable) { needed.addAll(((Prefetchable) p).getNeededData()); } } } return needed; }</code><technical_language>need CHANGE filter project name</technical_language>

Target:
public EnumSet<NeededData> getNeededData() { Map<NameKey, List<Predicate<ChangeData>>> rules = getRules(); if (rules.isEmpty()) { return EnumSet.noneOf(NeededData.class); } EnumSet<NeededData> needed = EnumSet.of(NeededData.CHANGE); for (List<Predicate<ChangeData>> list : rules.values()) { for (Predicate<ChangeData> p : list) { if (p instanceof Prefetchable) { needed.addAll(((Prefetchable) p).getNeededData()); } } } return needed; }
Source:
<code>private String validateAndNormalizeAvroSchemaUrl(String url, HdfsContext context) { try { new URL(url).openStream().close(); return url; } catch (MalformedURLException e) { if (new File(url).exists()) { <START> url = "file:/ END> return url; } else { try { if (!hdfsEnvironment.getFileSystem(context, new Path(url)).exists(new Path(url))) { throw new PrestoException(INVALID_TABLE_PROPERTY, "Cannot locate AVRO schema file " + url); } return url; } catch (IOException ex) { throw new PrestoException(INVALID_TABLE_PROPERTY, "AVRO schema file is not a valid file system URI", ex); } } } catch (IOException e) { throw new PrestoException(INVALID_TABLE_PROPERTY, "Cannot open AVRO schema file " + url, e); } }</code><technical_language>This incorrect: * A relative path foo/bar absolute path file:///foo/bar. * absolute path /foo/bar slashes file:////foo/bar. This works, is incorrect RFC 8089. slash (no authority) slashes (empty authority). safer construct this, guarantees format is correct: java return new File(url).toURI().toString();</technical_language>

Target:
private String validateAndNormalizeAvroSchemaUrl(String url, HdfsContext context) { try { new URL(url).openStream().close(); return url; } catch (MalformedURLException e) { if (new File(url).exists()) { return new File(url).toURI().toString(); } try { if (!hdfsEnvironment.getFileSystem(context, new Path(url)).exists(new Path(url))) { throw new PrestoException(INVALID_TABLE_PROPERTY, "Cannot locate Avro schema file: " + url); } return url; } catch (IOException ex) { throw new PrestoException(INVALID_TABLE_PROPERTY, "Avro schema file is not a valid file system URI: " + url, ex); } } catch (IOException e) { throw new PrestoException(INVALID_TABLE_PROPERTY, "Cannot open Avro schema file: " + url, e); } }
Source:
<code>public void testExcludedCipher() throws Exception { <START> String keyStorePath = new File(getResource("test.keystore").toURI()).getAbsolutePath(); <END> String keyStorePassword = "airlift"; HttpServerConfig config = new HttpServerConfig() .setHttpsEnabled(true) .setHttpsPort(0) .setKeystorePath(keyStorePath) .setKeystorePassword(keyStorePassword) .setHttpsExcludedCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); NodeInfo nodeInfo = new NodeInfo("test"); HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo); HttpServer server = createServer(nodeInfo, httpServerInfo, config); try { server.start(); URI httpsUri = httpServerInfo.getHttpsUri(); HttpClient httpClient = createClient(new String[] {}, new String[] {}, keyStorePath, keyStorePassword); httpClient.GET(httpsUri); httpClient = createClient(new String[] {"TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"}, new String[] {}, keyStorePath, keyStorePassword); try { httpClient.GET(httpsUri); Assert.fail("SSL handshake should fail because client included only certificates the server excluded"); } catch (ExecutionException e) { } } finally { server.stop(); } }</code><technical_language>class variables</technical_language>

Target:
public void testExcludedCipher() throws Exception { HttpServerConfig config = new HttpServerConfig() .setHttpsEnabled(true) .setHttpsPort(0) .setKeystorePath(KEY_STORE_PATH) .setKeystorePassword(KEY_STORE_PASSWORD) .setHttpsExcludedCipherSuites(CIPHER_1 + "," + CIPHER_2); NodeInfo nodeInfo = new NodeInfo("test"); HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo); HttpServer server = createServer(nodeInfo, httpServerInfo, config); try { server.start(); URI httpsUri = httpServerInfo.getHttpsUri(); HttpClient httpClient = createClientIncludeCiphers(); httpClient.GET(httpsUri); httpClient = createClientIncludeCiphers(CIPHER_1, CIPHER_2); try { httpClient.GET(httpsUri); Assert.fail("SSL handshake should fail because client included only ciphers the server excluded"); } catch (ExecutionException e) { } } finally { server.stop(); } }
Source:
<code>public synchronized void noMoreDrivers() { if (closed) { return; } if (encounteredDriverGroups.size() != closedDriverGroups.size()) { Sets.SetView<DriverLifeCycle> unclosedDriverGroups = Sets.difference(encounteredDriverGroups, closedDriverGroups); <START> for (DriverLifeCycle driverGroup : unclosedDriverGroups) { <END> noMoreDrivers(driverGroup); } verify(encounteredDriverGroups.size() == closedDriverGroups.size()); } closed = true; for (OperatorFactory operatorFactory : operatorFactories) { operatorFactory.noMoreOperators(); } }</code><technical_language>inline... foreach</technical_language>

Target:
public synchronized void noMoreDrivers() { if (closed) { return; } if (encounteredLifespans.size() != closedLifespans.size()) { Sets.difference(encounteredLifespans, closedLifespans).forEach(this::noMoreDrivers); verify(encounteredLifespans.size() == closedLifespans.size()); } closed = true; for (OperatorFactory operatorFactory : operatorFactories) { operatorFactory.noMoreOperators(); } }
Source:
<code>public void testCompareDifferentNames() throws Exception { final SAMRecord a = new SAMRecord(null); a.setReadName("A"); final SAMRecord b = new SAMRecord(null); b.setReadName("B"); <START> Assert.assertTrue(COMPARATOR.compare(a, b) > 0); <END> Assert.assertTrue(COMPARATOR.compare(b, a) < 0); }</code><technical_language>order such? trial error, no? check != hash function change</technical_language>

Target:
public void testCompareDifferentNames() throws Exception { final SAMRecord a = new SAMRecord(null); a.setReadName("A"); final SAMRecord b = new SAMRecord(null); b.setReadName("B"); Assert.assertTrue(COMPARATOR.compare(a, b) != 0); Assert.assertTrue(COMPARATOR.compare(b, a) != 0); }
Source:
<code>private WebDriver createDriver() { CreateDriverCommand.Result result = createDriverCommand.createDriver(config, factory, userProvidedProxy, listeners); long threadId = currentThread().getId(); threadWebDriver.put(threadId, result.webDriver); if (result.selenideProxyServer != null) { threadProxyServer.put(threadId, result.selenideProxyServer); } if (config.holdBrowserOpen()) { <START> log.info("Hold browser and proxy open: -> {}, {}", threadId, result.webDriver, result.selenideProxyServer); <END> } else { markForAutoClose(currentThread()); } return result.webDriver; }</code><technical_language>good duplicated log messages [CloseDriverCommand:18](<LINK_0> this point, browser closed running? do think</technical_language>

Target:
private WebDriver createDriver() { CreateDriverCommand.Result result = createDriverCommand.createDriver(config, factory, userProvidedProxy, listeners); long threadId = currentThread().getId(); threadWebDriver.put(threadId, result.webDriver); if (result.selenideProxyServer != null) { threadProxyServer.put(threadId, result.selenideProxyServer); } if (config.holdBrowserOpen()) { log.info("Browser and proxy will stay open due to holdBrowserOpen=true: -> {}, {}", threadId, result.webDriver, result.selenideProxyServer); } else { markForAutoClose(currentThread()); } return result.webDriver; }
Source:
<code>private void normalizeAndCalculateStatistics() { <START> if (allNormalizationIds != null) { <END> normalizeIntensities(); } calculateStatistics(); }</code><technical_language>true</technical_language>

Target:
private void normalizeAndCalculateStatistics() { normalizeIntensities(); calculateStatistics(); }
Source:
<code>public Map<String, String> getProperties() { <START> return MoreObjects.firstNonNull(properties, new HashMap<>()); <END> }</code><technical_language>produces needed objects. wasting CPU time</technical_language>

Target:
public Map<String, String> getProperties() { return properties != null ? properties : new HashMap<>(); }
Source:
<code><START> private byte[] getJarFileAsByteArray (File tarFile) { <END> byte[] data = null; LOG.info("Getting jar file from {}", tarFile); try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(tarFile)); TarArchiveInputStream tarArchiveInputStream = new TarArchiveInputStream(bis)) { TarArchiveEntry tarArchiveEntry = tarArchiveInputStream.getNextTarEntry(); while (tarArchiveEntry != null) { if (tarArchiveEntry.getName().endsWith(".jar")) { data = IOUtils.toByteArray(tarArchiveInputStream); break; } tarArchiveEntry = tarArchiveInputStream.getNextTarEntry(); } } catch (IOException e) { LOG.warn("Exception occured while getting jar file: from " + tarFile, e); } return data; }</code><technical_language>This similar other method file name check in code. is good refactor avoid duplication. private byte[] getJarFileAsByteArray (File tarFile) { return getFileAsByteArray(tarFile, x -> x.endsWith(".jar")); } private byte[] getFileAsByteArray (File tarFile, final String fileName) { return getFileAsByteArray(tarFile, x -> x.equals(fileName)); } private byte[] getFileAsByteArray (File tarFile, Function<String, Boolean> filterFunc) { byte[] data = null; LOG.info("Looking file {}", tarFile); try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(tarFile)); TarArchiveInputStream tarArchiveInputStream = new TarArchiveInputStream(bis)) { TarArchiveEntry tarArchiveEntry = tarArchiveInputStream.getNextTarEntry(); while (tarArchiveEntry != null) { if (filterFunc.apply(tarArchiveEntry.getName())) { data = IOUtils.toByteArray(tarArchiveInputStream); break; } tarArchiveEntry = tarArchiveInputStream.getNextTarEntry(); } } catch (IOException e) { LOG.warn("Exception occurred while tar file ", filterFunc, tarFile, e); } return data; }</technical_language>

Target:
private byte[] getJarFileAsByteArray (File tarFile) { return getFileAsByteArray(tarFile, x -> x.endsWith(".jar")); }
Source:
<code>public static void clearVisitDate(String[] selected) { ArrayList<String> geocodes = new ArrayList<String>(); for (int i = 0; i < selected.length; i++) { geocodes.add(selected[i]); } setVisitDate(geocodes, 0); <START> } <END></code><technical_language>This method written java public static void clearVisitDate(String[] selected) { setVisitDate(Arrays.asList(selected), 0); }</technical_language>

Target:
public static void clearVisitDate(String[] selected) { setVisitDate(Arrays.asList(selected), 0); }
Source:
<code>private static DistributedQueryRunner createQueryRunner(boolean legacyLogFunction) throws Exception { <START> return DistributedQueryRunner.builder(testSessionBuilder().build()) <END> .setNodeCount(1) .setExtraProperties(legacyLogFunction ? ImmutableMap.of("deprecated.legacy-log-function", "true") : ImmutableMap.of("deprecated.legacy-log-function", "false")) .build(); }</code><technical_language>LocalQueryRunner</technical_language>

Target:
private static QueryRunner createQueryRunner(boolean legacyLogFunction) { return new LocalQueryRunner(testSessionBuilder().build(), new FeaturesConfig().setLegacyLogFunction(legacyLogFunction)); }
Source:
<code>public void testrunMultipleActions_ignored_failure_multiple() { ArrayList<VdcActionParametersBase> parameters = new ArrayList<VdcActionParametersBase>(); parameters.add(new VdcActionParametersBase()); testState = null; frontend.runMultipleAction(VdcActionType.AddLocalStorageDomain, parameters, false, mockMultipleActionCallback, null); verify(mockService).runMultipleActions(eq(VdcActionType.AddLocalStorageDomain), eq(parameters), eq(false), eq(false), callbackMultipleActions.capture()); StatusCodeException exception = new StatusCodeException(0, "0 status code"); callbackMultipleActions.getValue().onFailure(exception); verify(mockFrontendFailureEvent, never()).raise(eq(Frontend.class), (FrontendFailureEventArgs) any()); verify(mockMultipleActionCallback, never()).executed(callbackMultipleParam.capture()); <START> verifyAsyncActionStarted(); <END> }</code><technical_language>This case user presses escape (closing dialog). progress bar is cleared that</technical_language>

Target:
public void testrunMultipleActions_ignored_failure_multiple() { ArrayList<VdcActionParametersBase> parameters = new ArrayList<VdcActionParametersBase>(); parameters.add(new VdcActionParametersBase()); testState = null; frontend.runMultipleAction(VdcActionType.AddLocalStorageDomain, parameters, false, mockMultipleActionCallback, null); verify(mockService).runMultipleActions(eq(VdcActionType.AddLocalStorageDomain), eq(parameters), eq(false), eq(false), callbackMultipleActions.capture()); StatusCodeException exception = new StatusCodeException(0, "0 status code"); callbackMultipleActions.getValue().onFailure(exception); verify(mockFrontendFailureEvent, never()).raise(eq(Frontend.class), (FrontendFailureEventArgs) any()); verify(mockMultipleActionCallback, never()).executed(callbackMultipleParam.capture()); verifyAsyncActionStartedButNotCompleted(); }
Source:
<code>public static byte[][] splitArray(byte[] source, int chunkSize) { <START> byte[][] newArray = new byte[(int) Math.ceil(source.length / (double) chunkSize)][chunkSize]; <END> int start = 0; for (int i = 0; i < newArray.length; i++) { newArray[i] = Arrays.copyOfRange(source, start, start + chunkSize); start += chunkSize; } return newArray; }</code><technical_language>Math.ceil "(int)(tmpFileSize / chunkSize) + 1" in onChunkedUploadStarted? Theoretically correct, while I a slight preference for integer approach I request approach in cases</technical_language>

Target:
public static byte[][] splitArray(byte[] source, int chunkSize) { byte[][] newArray = new byte[(source.length / chunkSize) + 1][chunkSize]; int start = 0; for (int i = 0; i < newArray.length; i++) { newArray[i] = Arrays.copyOfRange(source, start, start + chunkSize); start += chunkSize; } return newArray; }
Source:
<code>private boolean entitleGuest(AutobindData data, List<Entitlement> entitlements) throws EntitlementRefusedException { Consumer host; List<String> hostProvidedPools; Consumer consumer = data.getConsumer(); Owner owner = consumer.getOwner(); if (!consumer.hasFact("virt.uuid") || !"true".equalsIgnoreCase(consumer.getFact("virt.is_guest")) <START> || !data.getPossiblePools().isEmpty()) { <END> return true; } host = consumerCurator.getHost(consumer.getFact("virt.uuid"), owner); if (host == null) { return true; } hostProvidedPools = poolCurator.getPoolsProvidedByHost(host, owner); if (hostProvidedPools.isEmpty()) { return true; } data.setPossiblePools(hostProvidedPools); entitlements.addAll(poolManager.entitleByProducts(data)); ComplianceStatus status = complianceRules.getStatus(consumer); if (!status.isCompliant()) { data.setPossiblePools(null); Set<String> remainingProductsToCheck = status.getNonCompliantProducts(); remainingProductsToCheck.addAll(status.getPartiallyCompliantProducts().keySet()); data.setProductIds(remainingProductsToCheck.toArray(new String[remainingProductsToCheck.size()])); return true; } return false; }</code><technical_language>sense add a null check for getPossiblePools</technical_language>

Target:
private boolean entitleGuest(AutobindData data, List<Entitlement> entitlements) throws EntitlementRefusedException { Consumer host; List<String> hostProvidedPools; Consumer consumer = data.getConsumer(); Owner owner = consumer.getOwner(); if (!consumer.hasFact("virt.uuid") || !"true".equalsIgnoreCase(consumer.getFact("virt.is_guest")) || (data.getPossiblePools() != null && !data.getPossiblePools().isEmpty())) { return true; } host = consumerCurator.getHost(consumer.getFact("virt.uuid"), owner); if (host == null) { return true; } hostProvidedPools = poolCurator.getPoolsProvidedByHost(host); if (hostProvidedPools.isEmpty()) { return true; } data.setPossiblePools(hostProvidedPools); entitlements.addAll(poolManager.entitleByProducts(data)); ComplianceStatus status; if (data.getOnDate() != null) { status = complianceRules.getStatus(consumer, data.getOnDate()); } else { status = complianceRules.getStatus(consumer); } if (!status.isCompliant()) { data.setPossiblePools(new ArrayList<String>()); Set<String> remainingProductsToCheck = status.getNonCompliantProducts(); remainingProductsToCheck.addAll(status.getPartiallyCompliantProducts().keySet()); data.setProductIds(remainingProductsToCheck.toArray(new String[remainingProductsToCheck.size()])); return true; } return false; }
Source:
<code>protected void checkOSType() { <START> LOGGER.info("Checking Docker container OS type"); <END> String osType = client.infoCmd().exec().getOsType(); if (StringUtils.isBlank(osType)) { LOGGER.warn("Could not determine Docker container OS type"); } else if (!osType.equals("linux")) { LOGGER.warn("{} is currently not supported", osType); throw new InvalidConfigurationException(osType + " containers are currently not supported"); } }</code><technical_language>suggestion LOGGER.debug("Checking Docker OS type");</technical_language>

Target:
protected void checkOSType() { LOGGER.debug("Checking Docker OS type for {}", this.getDescription()); String osType = client.infoCmd().exec().getOsType(); if (StringUtils.isBlank(osType)) { LOGGER.warn("Could not determine Docker OS type"); } else if (!osType.equals("linux")) { LOGGER.warn("{} is currently not supported", osType); throw new InvalidConfigurationException(osType + " containers are currently not supported"); } }
Source:
<code>public InputStream getRepositoryArchive(Integer projectId, String sha, String format) throws GitLabApiException { Form formData = new GitLabApiForm().withParam("sha", sha); Response response = getWithAccepts(Response.Status.OK, formData.asMap(), MediaType.MEDIA_TYPE_WILDCARD, <START> "projects", projectId, "repository", "archive".concat(checkFormat(format))); <END> return (response.readEntity(InputStream.class)); }</code><technical_language>I more understandable do following: // Throws a GitLabApiException if format is invalid format = checkFormat(format); Form formData = new GitLabApiForm().withParam("sha", sha); Response response = getWithAccepts(Response.Status.OK, formData.asMap(), MediaType.MEDIA_TYPE_WILDCARD, "projects", projectId, "repository", "archive", ".", format);</technical_language>

Target:
public InputStream getRepositoryArchive(Integer projectId, String sha, String format) throws GitLabApiException { format = checkFormat(format); Form formData = new GitLabApiForm().withParam("sha", sha); Response response = getWithAccepts(Response.Status.OK, formData.asMap(), MediaType.MEDIA_TYPE_WILDCARD, "projects", projectId, "repository", "archive", ".", format); return (response.readEntity(InputStream.class)); }
Source:
<code><START> protected void toLegacyText(StringBuilder builder) <END> { builder.append(this.value); }</code><technical_language>Override</technical_language>

Target:
protected void toLegacyText(StringBuilder builder) { builder.append( this.value ); super.toLegacyText( builder ); }
Source:
<code>public URI getUri() { <START> return uri; <END> }</code><technical_language>this.uri</technical_language>

Target:
public URI getUri() { return this.uri; }
Source:
<code>protected Result check() throws Exception { return timeBoundHealthCheck.check(() -> { final Session session = sessionFactory.openSession(); try { final Transaction txn = session.beginTransaction(); try { session.createSQLQuery(validationQuery).list(); txn.commit(); } catch (Exception e) { <START> if (txn.getStatus() == ACTIVE || txn.getStatus() == MARKED_ROLLBACK) { <END> txn.rollback(); } throw e; } } finally { session.close(); } return Result.healthy(); }); }</code><technical_language>[TransactionStatus#canRollback()](<LINK_0> here</technical_language>

Target:
protected Result check() throws Exception { return timeBoundHealthCheck.check(() -> { final Session session = sessionFactory.openSession(); try { final Transaction txn = session.beginTransaction(); try { session.createSQLQuery(validationQuery).list(); txn.commit(); } catch (Exception e) { if (txn.getStatus().canRollback()) { txn.rollback(); } throw e; } } finally { session.close(); } return Result.healthy(); }); }
Source:
<code>private void <START> syncLunsForBlockStorageDomains() <END> { Collection<StorageDomain> unSyncedStorageDomains = syncLunsForStorageDomains(storageDomainDao.getAllForStoragePool(getStoragePoolId())); if (!unSyncedStorageDomains.isEmpty()) { String unSyncedStorageDomainsList = unSyncedStorageDomains.stream() .map(StorageDomain::getId) .map(Guid::toString) .collect(Collectors.joining(", ")); addCustomValue("StorageDomainsIds", unSyncedStorageDomainsList); auditLogDirector.log(this, AuditLogType.STORAGE_DOMAINS_COULD_NOT_BE_SYNCED); } }</code><technical_language>This is a pretty heavy operation, need upgrading a DC support discard a DC does. FeatureSupported do this redundantly</technical_language>

Target:
private void syncLunsForBlockStorageDomains() { Collection<VDS> hosts = new LinkedList<>(vdsDao.getAllForStoragePoolAndStatus( getStoragePool().getId(), VDSStatus.Up)); if (hosts.isEmpty()) { return; } Collection<StorageDomain> unSyncedStorageDomains = syncLunsForStorageDomains(storageDomainDao.getAllForStoragePool(getStoragePoolId()), hosts); if (!unSyncedStorageDomains.isEmpty()) { String unSyncedStorageDomainsList = unSyncedStorageDomains.stream() .map(StorageDomain::getId) .map(Guid::toString) .collect(Collectors.joining(", ")); addCustomValue("StorageDomainsIds", unSyncedStorageDomainsList); auditLogDirector.log(this, AuditLogType.STORAGE_DOMAINS_COULD_NOT_BE_SYNCED); } }
Source:
<code>public VacationDaysLeft getVacationDaysLeft(Account account, Optional<Account> nextYear) { BigDecimal vacationDays = account.getVacationDays(); BigDecimal remainingVacationDays = account.getRemainingVacationDays(); BigDecimal remainingVacationDaysNotExpiring = account.getRemainingVacationDaysNotExpiring(); BigDecimal daysBeforeApril = getUsedDaysBeforeApril(account); BigDecimal daysAfterApril = getUsedDaysAfterApril(account); return VacationDaysLeft.builder() .withAnnualVacation(vacationDays) .withRemainingVacation(remainingVacationDays) .notExpiring(remainingVacationDaysNotExpiring) .forUsedDaysBeforeApril(daysBeforeApril) .forUsedDaysAfterApril(daysAfterApril) <START> .withVacationDaysUsedNextYear(getRemainingVacationDaysAlreadyUsed(nextYear)) <END> .get(); }</code><technical_language>I prefer equal BigDecimal daysAfterApril = getUsedDaysAfterApril(account); BigDeciaml daysUsedNextYear = getRemainingVacationDaysAlreadyUsed(nextYear); //... .withVacationDaysUsedNextYear(daysUsedNextYear)</technical_language>

Target:
public VacationDaysLeft getVacationDaysLeft(Account account, Optional<Account> nextYear) { BigDecimal vacationDays = account.getVacationDays(); BigDecimal remainingVacationDays = account.getRemainingVacationDays(); BigDecimal remainingVacationDaysNotExpiring = account.getRemainingVacationDaysNotExpiring(); BigDecimal daysBeforeApril = getUsedDaysBeforeApril(account); BigDecimal daysAfterApril = getUsedDaysAfterApril(account); BigDecimal daysUsedNextYear = getRemainingVacationDaysAlreadyUsed(nextYear); return VacationDaysLeft.builder() .withAnnualVacation(vacationDays) .withRemainingVacation(remainingVacationDays) .notExpiring(remainingVacationDaysNotExpiring) .forUsedDaysBeforeApril(daysBeforeApril) .forUsedDaysAfterApril(daysAfterApril) .withVacationDaysUsedNextYear(daysUsedNextYear) .get(); }
Source:
<code>private static void loadLibrary() throws IOException { <START> String path = LIBTORRENT_OS_LIBRARY_PATH(); <END> InputStream is = BittorrentNotebookRepo.class.getResourceAsStream(path); File temp = File.createTempFile("libjlibtorrent", ".so"); OutputStream os = new FileOutputStream(temp); if (is == null) { throw new FileNotFoundException("File " + path + " was not found inside JAR."); } int readBytes; byte[] buffer = new byte[1024]; try { while ((readBytes = is.read(buffer)) != -1) { os.write(buffer, 0, readBytes); } } finally { os.close(); is.close(); } System.setProperty("jlibtorrent.jni.path", temp.getAbsolutePath()); }</code><technical_language>checking this return in case null, sense</technical_language>

Target:
private static void loadLibrary() throws IOException { String path = LIBTORRENT_OS_LIBRARY_PATH(); if (path == null) { LOG.error("Unknown Operating system"); throw new IOException(); } InputStream is = BittorrentNotebookRepo.class.getResourceAsStream(path); File temp = File.createTempFile("libjlibtorrent", ".so"); OutputStream os = new FileOutputStream(temp); if (is == null) { throw new FileNotFoundException("File " + path + " was not found inside JAR."); } int readBytes; byte[] buffer = new byte[1024]; try { while ((readBytes = is.read(buffer)) != -1) { os.write(buffer, 0, readBytes); } } finally { os.close(); is.close(); } System.setProperty("jlibtorrent.jni.path", temp.getAbsolutePath()); }
Source:
<code><START> public boolean equals(Object o) { <END> if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TrashNetworkVspCommand that = (TrashNetworkVspCommand) o; if (_isL3Network != that._isL3Network) return false; if (_isSharedNetwork != that._isSharedNetwork) return false; if (_domainTemplateName != null ? !_domainTemplateName.equals(that._domainTemplateName) : that._domainTemplateName != null) return false; if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : that._domainUuid != null) return false; if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) : that._networkUuid != null) return false; if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : that._vpcUuid != null) return false; return true; }</code><technical_language>This equals implementation include attributes Command super class</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TrashNetworkVspCommand)) return false; if (!super.equals(o)) return false; TrashNetworkVspCommand that = (TrashNetworkVspCommand) o; if (_isL3Network != that._isL3Network) return false; if (_isSharedNetwork != that._isSharedNetwork) return false; if (_domainTemplateName != null ? !_domainTemplateName.equals(that._domainTemplateName) : that._domainTemplateName != null) return false; if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : that._domainUuid != null) return false; if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) : that._networkUuid != null) return false; if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : that._vpcUuid != null) return false; return true; }
Source:
<code>ILogData read(long address) { if (!runtime.getParameters().isCacheDisabled()) { ILogData data = readCache.getIfPresent(address); <START> if (data == null) { <END> final ILogData loadedVal = fetch(address); data = readCache.asMap().computeIfAbsent(address, (k) -> loadedVal); } return data; } return fetch(address); }</code><technical_language>explain this code removed</technical_language>

Target:
ILogData read(long address) { if (!runtime.getParameters().isCacheDisabled()) { ILogData data = readCache.getIfPresent(address); if (data == null) { final ILogData loadedVal = fetch(address); return readCache.asMap().computeIfAbsent(address, (k) -> loadedVal); } return data; } return fetch(address); }
Source:
<code>public int compare(final Enum o1, final Enum o2) { final Integer w1 = classWeight(o1); final Integer w2 = classWeight(o2); if (w1 == null && w2 == null) { final String s1 = o1.getClass().getName() + o1.ordinal(); final String s2 = o2.getClass().getName() + o2.ordinal(); return s1.compareTo(s2); } else if (w1 == null) { return 1; } else if (w2 == null) { return -1; } else if (!w1.equals(w2)) { return w1 - w2; } else { <START> return o1.compareTo(o2); <END> } }</code><technical_language>Is this essentially null case? I covered bases difficult o1 o2 type. I ORDER is guaranteed return Integer for enums</technical_language>

Target:
public int compare(final Enum o1, final Enum o2) { final Integer w1 = classWeight(o1); final Integer w2 = classWeight(o2); if (w1 != null && w2 != null && !w1.equals(w2)) { return w1 - w2; } else if (w1 == null && w2 != null) { return 1; } else if (w1 != null && w2 == null) { return -1; } else { final String s1 = o1.getClass().getName() + o1.ordinal(); final String s2 = o2.getClass().getName() + o2.ordinal(); return s1.compareTo(s2); } }
Source:
<code>public ImageWorker(RenderingHints hints) { <START> setRenderingHints(hints); <END> }</code><technical_language>this call empty constructor? empty constructor useless code of it</technical_language>

Target:
public ImageWorker(RenderingHints hints) { this(); setRenderingHints(hints); }
Source:
<code>@Test public void simpleMultipart() throws Exception { Request request = new Helper() .setMethod("POST") .setHasBody() .setUrl("<LINK_1>") .setPath("/foo/bar/") .addNamedParam("ping", "pong") .addNamedParam("kit", new TypedString("kat")) .setMultipart() .build(); assertThat(request.getMethod()).isEqualTo("POST"); assertThat(request.getHeaders()).isEmpty(); assertThat(request.getUrl()).isEqualTo("<LINK_0>"); MultipartTypedOutput body = (MultipartTypedOutput) request.getBody(); assertThat(body.parts).hasSize(2); Iterator<byte[]> iterator = body.parts.iterator(); String one = new String(iterator.next(), "UTF-8"); assertThat(one.contains("ping")); <START> assertThat(one.contains("pong")); <END> String two = new String(iterator.next(), "UTF-8"); assertThat(two.contains("kit")); assertThat(two.contains("kat")); }</code><technical_language>This asserting anything. Needs be: java assertThat(one).contains("ping").contains("pong"); below</technical_language>

Target:
@Test public void simpleMultipart() throws Exception { Request request = new Helper() .setMethod("POST") .setHasBody() .setUrl("<LINK_1>") .setPath("/foo/bar/") .addNamedParam("ping", "pong") .addNamedParam("kit", new TypedString("kat")) .setMultipart() .build(); assertThat(request.getMethod()).isEqualTo("POST"); assertThat(request.getHeaders()).isEmpty(); assertThat(request.getUrl()).isEqualTo("<LINK_0>"); MultipartTypedOutput body = (MultipartTypedOutput) request.getBody(); assertThat(body.parts).hasSize(2); Iterator<byte[]> iterator = body.parts.iterator(); String one = new String(iterator.next(), "UTF-8"); assertThat(one).contains("ping").contains("pong"); String two = new String(iterator.next(), "UTF-8"); assertThat(two).contains("kit").contains("kat"); }
Source:
<code>void set(Object value) { <START> LATEST_UPDATER.lazySet(this, value); <END> }</code><technical_language>get() guaranteed visibility is this safe do</technical_language>

Target:
void set(Object value) { latest = value; }
Source:
<code>public void close() throws IOException { <START> objects.remove(this); <END> count.decrementAndGet(); objects.offer(this); }</code><technical_language>This is safe multiple objects close() get() time. end object offered queue times</technical_language>

Target:
public void close() throws IOException { synchronized (this) { boolean removed = queue.remove(this); count.decrementAndGet(); if (removed) { queue.offer(this); } } }
Source:
<code>public void testXMIIDPriorityA2() throws IOException { final Resource left = input.getXMIIDPriorityA2Left(); final Resource right = input.getXMIIDPriorityA2Right(); final IComparisonScope scope = new DefaultComparisonScope(left, right, null); final Comparison comparison = EMFCompare.builder().build().compare(scope); final List<Match> matches = comparison.getMatches(); assertEquals(1, matches.size()); final Match rootMatch = matches.get(0); final List<Match> subMatches = rootMatch.getSubmatches(); <START> assertEquals(4, subMatches.size()); <END> }</code><technical_language>check for IDs equal</technical_language>

Target:
public void testXMIIDPriorityA2() throws IOException { final Resource left = input.getXMIIDPriorityA2Left(); final Resource right = input.getXMIIDPriorityA2Right(); final IComparisonScope scope = new DefaultComparisonScope(left, right, null); final Comparison comparison = EMFCompare.builder().build().compare(scope); final List<Match> matches = comparison.getMatches(); assertEquals(1, matches.size()); final Match rootMatch = matches.get(0); final List<Match> subMatches = rootMatch.getSubmatches(); assertEquals(4, subMatches.size()); for (Match match : subMatches) { EObject leftObject = match.getLeft(); EObject rightObject = match.getRight(); final boolean leftIsNull = leftObject == null && rightObject != null; final boolean rightIsNull = rightObject == null && leftObject != null; assertTrue(leftIsNull || rightIsNull); } }