auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String getIPv4inSubnet(String subnet) { try { final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); while (interfaces.hasMoreElements()) { final NetworkInterface current = interfaces.nextElement(); if (!current.isUp() || current.isLoopback() || current.isVirtual()) { continue; } for (InterfaceAddress ifAddr : current.getInterfaceAddresses()) { InetAddress addr = ifAddr.getAddress(); if (addr.isLoopbackAddress() || (addr instanceof Inet6Address)) { continue; } String ipv4Address = addr.getHostAddress(); String subNetString = getIpv4NetAddress(ipv4Address, ifAddr.getNetworkPrefixLength()) + "/" + String.valueOf(ifAddr.getNetworkPrefixLength()); if (subNetString.equals(subnet)) { return ipv4Address; } } } } catch (SocketException ex) { LOGGER.error("Could not retrieve network interface: {}", ex.getMessage(), ex); return null; } return null; }

Target:
private String getIPv4inSubnet(String subnet) { try { final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); while (interfaces.hasMoreElements()) { final NetworkInterface current = interfaces.nextElement(); if (!current.isUp() || current.isLoopback() || current.isVirtual()) { continue; } for (InterfaceAddress ifAddr : current.getInterfaceAddresses()) { InetAddress addr = ifAddr.getAddress(); if (addr.isLoopbackAddress() || (addr instanceof Inet6Address)) { continue; } String ipv4Address = addr.getHostAddress(); String subNetString = getIpv4NetAddress(ipv4Address, ifAddr.getNetworkPrefixLength()) + "/" + String.valueOf(ifAddr.getNetworkPrefixLength()); if (subNetString.equals(subnet)) { return ipv4Address; } } } } catch (SocketException ex) { LOGGER.error("Could not retrieve network interface: {}", ex.getMessage(), ex); } return null; }
Source:
KeyEncryptionKeyAsyncClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version) { super(keyId, pipeline, version); this.keyId = keyId; }

Target:
KeyEncryptionKeyAsyncClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version) { super(keyId, pipeline, version); }
Source:
private List<DiscoverySelector> getSelectorsFromTestCasesHeader(BundleDescriptor bd) { Bundle bundle = bd.getBundle(); Bundle host = BundleUtils.getHost(bundle) .get(); return BundleUtils.testCases(bundle) .map(testcase -> { int index = testcase.indexOf('#'); String className = (index < 0) ? testcase : testcase.substring(0, index); try { Class<?> testClass = host.loadClass(className); testClass.getDeclaredMethods(); testClass.getDeclaredFields(); if (!resolvedClasses.contains(testClass)) { checkForMixedJUnit34(bd, testClass); if (index < 0) { resolvedClasses.add(testClass); return selectClass(testClass); } return selectMethod(testClass, DiscoverySelectors.selectMethod(testcase)); } } catch (ClassNotFoundException | NoClassDefFoundError cnfe) { info(() -> "error: " + cnfe); StaticFailureDescriptor unresolvedClassDescriptor = new StaticFailureDescriptor(bd.getUniqueId() .append("test", testcase), testcase, cnfe); bd.addChild(unresolvedClassDescriptor); } return null; }) .filter(Objects::nonNull) .collect(toList()); }

Target:
private List<DiscoverySelector> getSelectorsFromTestCasesHeader(BundleDescriptor bd) { Bundle bundle = bd.getBundle(); Bundle host = BundleUtils.getHost(bundle) .get(); return BundleUtils.testCases(bundle) .map(testcase -> { int index = testcase.indexOf('#'); String className = (index < 0) ? testcase : testcase.substring(0, index); Class<?> testClass = tryToResolveTestClass(host, className, bd); if (testClass != null && !resolvedClasses.contains(testClass)) { checkForMixedJUnit34(bd, testClass); if (index < 0) { resolvedClasses.add(testClass); return selectClass(testClass); } return selectMethod(testClass, DiscoverySelectors.selectMethod(testcase)); } return null; }) .filter(Objects::nonNull) .collect(toList()); }
Source:
private String getCompressLobsStatements(final DbEntity entity) { if (!this.properties.shouldCompressLobs()) { return ""; } final String defaultLob = " LOB (\"%s\") STORE AS SECUREFILE (COMPRESS HIGH CACHE LOGGING)"; return entity.getColumns() .stream() .filter(dbColumn -> dbColumn.getDbColumnType().equals(DbColumnType.CLOB) || dbColumn.getDbColumnType().equals(DbColumnType.BLOB)) .map(dbColumn -> String.format(defaultLob, dbColumn.getName())) .collect(joining()); }

Target:
private String getCompressLobsStatements(final DbEntity entity) { if (!this.properties.shouldCompressLobs()) { return ""; } final String defaultLob = " LOB (\"%s\") STORE AS SECUREFILE (COMPRESS MEDIUM CACHE LOGGING)"; return entity.getColumns() .stream() .filter(dbColumn -> dbColumn.getDbColumnType().equals(DbColumnType.CLOB) || dbColumn.getDbColumnType().equals(DbColumnType.BLOB)) .map(dbColumn -> String.format(defaultLob, dbColumn.getName())) .collect(joining()); }
Source:
public void testIntCollectSet() { Schema schema = Schema.recordOf("test", Schema.Field.of("x", Schema.of(Schema.Type.INT))); CollectSet collectSet = new CollectSet("x", Schema.of(Schema.Type.INT)); collectSet.beginFunction(); collectSet.operateOn(StructuredRecord.builder(schema).set("x", 1).build()); collectSet.operateOn(StructuredRecord.builder(schema).set("x", 2).build()); collectSet.operateOn(StructuredRecord.builder(schema).set("x", 1).build()); Set set = collectSet.getAggregate(); Assert.assertArrayEquals(new Integer[] {1, 2}, set.toArray()); }

Target:
public void testIntCollectSet() { Schema schema = Schema.recordOf("test", Schema.Field.of("x", Schema.of(Schema.Type.INT))); CollectSet collectSet = new CollectSet("x", Schema.of(Schema.Type.INT)); collectSet.beginFunction(); collectSet.operateOn(StructuredRecord.builder(schema).set("x", 1).build()); collectSet.operateOn(StructuredRecord.builder(schema).set("x", 2).build()); collectSet.operateOn(StructuredRecord.builder(schema).set("x", 1).build()); Set set = collectSet.getAggregate(); Set<Integer> expectedSet = ImmutableSet.of(1, 2); Assert.assertEquals(expectedSet, set); }
Source:
public SchemaVersionsResponse versions(Topic topic, boolean online) { try { if (online) { List<SchemaVersion> v = rawSchemaClient.getVersions(topic.getName()); versionsCache.put(topic, v); return SchemaVersionsResponse.succeeded(v); } else { List<SchemaVersion> versions = versionsCache.get(topic); return SchemaVersionsResponse.succeeded(versions); } } catch (Exception e) { logger.error("Error while loading schema versions for topic {}", topic.getQualifiedName(), e); return SchemaVersionsResponse.failed(); } }

Target:
public SchemaVersionsResult versions(Topic topic, boolean online) { try { if (online) { List<SchemaVersion> versions = rawSchemaClient.getVersions(topic.getName()); versionsCache.put(topic, versions); return SchemaVersionsResult.succeeded(versions); } else { List<SchemaVersion> versions = versionsCache.get(topic); return SchemaVersionsResult.succeeded(versions); } } catch (Exception e) { logger.error("Error while loading schema versions for topic {}", topic.getQualifiedName(), e); return SchemaVersionsResult.failed(); } }
Source:
private static void generateEntityStatistics() { for (EntityType entityType : EntityType.values()) { Class<? extends Entity> entityClass = entityType.getEntityClass(); if (entityClass == null) { continue; } if (Monster.class.isAssignableFrom(entityClass)) { set(ENTITY_KILLED_BY, entityType, "entityKilledBy." + UPPER_UNDERSCORE.to(UPPER_CAMEL, entityType.name())); } if (Creature.class.isAssignableFrom(entityClass)) { set(KILL_ENTITY, entityType, "killEntity." + UPPER_UNDERSCORE.to(UPPER_CAMEL, entityType.name())); } } }

Target:
private static void generateEntityStatistics() { for (EntityType entityType : EntityType.values()) { Class<? extends Entity> entityClass = entityType.getEntityClass(); if (entityClass == null) { continue; } if (Monster.class.isAssignableFrom(entityClass)) { set(ENTITY_KILLED_BY, entityType, "entityKilledBy." + entityClass.getSimpleName()); } if (Creature.class.isAssignableFrom(entityClass)) { set(KILL_ENTITY, entityType, "killEntity." + entityClass.getSimpleName()); } } }
Source:
private void appendData(DecodedBlockNode[] decodedBlocks, int fixedWidthRowSize, List<Integer> variableWidthChannels, OutputBuffer outputBuffer) { if (decodedBlocks.length != channelCount) { throw new IllegalArgumentException(format("Unexpected number of decoded blocks %d. It should be %d.", decodedBlocks.length, channelCount)); } if (positionCount == 0) { return; } if (channelCount == 0) { bufferedRowCount += positionCount; return; } initializeBlockEncodingBuffers(decodedBlocks); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setupDecodedBlocksAndPositions(decodedBlocks[i], positions, positionCount); } int[] serializedRowSizes = ensureCapacity(null, positionCount, SMALL, INITIALIZE, bufferAllocator); try { populateSerializedRowSizes(fixedWidthRowSize, variableWidthChannels, serializedRowSizes); int offset = 0; do { int batchSize = calculateNextBatchSize(fixedWidthRowSize, variableWidthChannels, offset, serializedRowSizes); boolean lastBatchInPage = offset + batchSize >= positionCount; for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setNextBatch(offset, batchSize); blockEncodingBuffers[i].appendDataInBatch(); } bufferedRowCount += batchSize; offset += batchSize; if (bufferFull) { flush(outputBuffer); bufferFull = false; } } while (offset < positionCount); } finally { bufferAllocator.returnArray(serializedRowSizes); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].noMoreBatches(); } } }

Target:
private void appendData(DecodedBlockNode[] decodedBlocks, int fixedWidthRowSize, List<Integer> variableWidthChannels, OutputBuffer outputBuffer) { if (decodedBlocks.length != channelCount) { throw new IllegalArgumentException(format("Unexpected number of decoded blocks %d. It should be %d.", decodedBlocks.length, channelCount)); } if (positionCount == 0) { return; } if (channelCount == 0) { bufferedRowCount += positionCount; return; } initializeBlockEncodingBuffers(decodedBlocks); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setupDecodedBlocksAndPositions(decodedBlocks[i], positions, positionCount); } int[] serializedRowSizes = ensureCapacity(null, positionCount, SMALL, INITIALIZE, bufferAllocator); try { populateSerializedRowSizes(fixedWidthRowSize, variableWidthChannels, serializedRowSizes); int offset = 0; do { int batchSize = calculateNextBatchSize(fixedWidthRowSize, variableWidthChannels, offset, serializedRowSizes); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setNextBatch(offset, batchSize); blockEncodingBuffers[i].appendDataInBatch(); } bufferedRowCount += batchSize; offset += batchSize; if (bufferFull) { flush(outputBuffer); bufferFull = false; } } while (offset < positionCount); } finally { bufferAllocator.returnArray(serializedRowSizes); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].noMoreBatches(); } } }
Source:
public void addToOrderBook(Order order) { if (order instanceof BuyOrder) { if (buyOrders.containsKey(order.getStockSymbol())) { buyOrders.get(order.getStockSymbol()).add(order); } else { ArrayList<Order> list = new ArrayList<Order>(); list.add(order); buyOrders.put(order.getStockSymbol(), list); } } else { if (sellOrders.containsKey(order.getStockSymbol())) { sellOrders.get(order.getStockSymbol()).add(order); } else { ArrayList<Order> list = new ArrayList<Order>(); list.add(order); sellOrders.put(order.getStockSymbol(), list); } } }

Target:
public void addToOrderBook(Order order) { if (order instanceof BuyOrder) { if (buyOrders.containsKey(order.getStockSymbol())) { buyOrders.get(order.getStockSymbol()).add(order); } else { ArrayList<Order> buyOrderList = new ArrayList<Order>(); buyOrderList.add(order); buyOrders.put(order.getStockSymbol(), buyOrderList); } } else { if (sellOrders.containsKey(order.getStockSymbol())) { sellOrders.get(order.getStockSymbol()).add(order); } else { ArrayList<Order> sellOrderlist = new ArrayList<Order>(); sellOrderlist.add(order); sellOrders.put(order.getStockSymbol(), sellOrderlist); } } }
Source:
ReturnValueExecutableValidationContext( ConstraintValidatorManager constraintValidatorManager, ConstraintValidatorFactory constraintValidatorFactory, ValidatorScopedContext validatorScopedContext, TraversableResolver traversableResolver, HibernateConstraintValidatorInitializationContext constraintValidatorInitializationContext, T rootBean, Class<T> rootBeanClass, BeanMetaData<T> rootBeanMetaData, Executable executable, Optional<ExecutableMetaData> executableMetaData, Object executableReturnValue ) { super( constraintValidatorManager, constraintValidatorFactory, validatorScopedContext, traversableResolver, constraintValidatorInitializationContext, rootBean, rootBeanClass, rootBeanMetaData, buildDisableAlreadyValidatedBeanTracking( executableMetaData ) ); this.executable = executable; this.executableReturnValue = executableReturnValue; this.executableMetaData = executableMetaData; }

Target:
ReturnValueExecutableValidationContext( ConstraintValidatorManager constraintValidatorManager, ConstraintValidatorFactory constraintValidatorFactory, ValidatorScopedContext validatorScopedContext, TraversableResolver traversableResolver, HibernateConstraintValidatorInitializationContext constraintValidatorInitializationContext, T rootBean, Class<T> rootBeanClass, BeanMetaData<T> rootBeanMetaData, Executable executable, Optional<ExecutableMetaData> executableMetaData, Object executableReturnValue ) { super( constraintValidatorManager, constraintValidatorFactory, validatorScopedContext, traversableResolver, constraintValidatorInitializationContext, rootBean, rootBeanClass, rootBeanMetaData, buildDisableAlreadyValidatedBeanTracking( executableMetaData ) ); this.executable = executable; this.executableMetaData = executableMetaData; this.executableReturnValue = executableReturnValue; }
Source:
public ReplicationWorker(final ZooKeeper zkc, final ServerConfiguration conf, StatsLogger statsLogger) throws CompatibilityException, KeeperException, InterruptedException, IOException { this.zkc = zkc; this.conf = conf; LedgerManagerFactory mFactory = LedgerManagerFactory .newLedgerManagerFactory( this.conf, new ZkLayoutManager(zkc, conf.getZkLedgersRootPath(), ZkUtils.getACLs(conf))); this.underreplicationManager = mFactory .newLedgerUnderreplicationManager(); try { this.bkc = BookKeeper.forConfig(new ClientConfiguration(conf)) .statsLogger(statsLogger.scope(BK_CLIENT_SCOPE)) .build(); } catch (BKException e) { throw new IOException("Failed to instantiate replication worker", e); } this.admin = new BookKeeperAdmin(bkc, statsLogger); this.ledgerChecker = new LedgerChecker(bkc); this.workerThread = new BookieThread(this, "ReplicationWorker"); this.openLedgerRereplicationGracePeriod = conf .getOpenLedgerRereplicationGracePeriod(); this.rwRereplicateBackoffMs = conf.getRwRereplicateBackoffMs(); this.pendingReplicationTimer = new Timer("PendingReplicationTimer"); this.statsLogger = statsLogger; this.rereplicateOpStats = this.statsLogger.getOpStatsLogger(REREPLICATE_OP); this.numLedgersReplicated = this.statsLogger.getCounter(NUM_FULL_OR_PARTIAL_LEDGERS_REPLICATED); this.exceptionCounters = new HashMap<String, Counter>(); }

Target:
public ReplicationWorker(final ZooKeeper zkc, final ServerConfiguration conf, StatsLogger statsLogger) throws CompatibilityException, KeeperException, InterruptedException, IOException { this.zkc = zkc; this.conf = conf; try { this.bkc = BookKeeper.forConfig(new ClientConfiguration(conf)) .statsLogger(statsLogger.scope(BK_CLIENT_SCOPE)) .build(); } catch (BKException e) { throw new IOException("Failed to instantiate replication worker", e); } LedgerManagerFactory mFactory = LedgerManagerFactory .newLedgerManagerFactory( this.conf, bkc.getRegClient().getLayoutManager()); this.underreplicationManager = mFactory .newLedgerUnderreplicationManager(); this.admin = new BookKeeperAdmin(bkc, statsLogger); this.ledgerChecker = new LedgerChecker(bkc); this.workerThread = new BookieThread(this, "ReplicationWorker"); this.openLedgerRereplicationGracePeriod = conf .getOpenLedgerRereplicationGracePeriod(); this.rwRereplicateBackoffMs = conf.getRwRereplicateBackoffMs(); this.pendingReplicationTimer = new Timer("PendingReplicationTimer"); this.statsLogger = statsLogger; this.rereplicateOpStats = this.statsLogger.getOpStatsLogger(REREPLICATE_OP); this.numLedgersReplicated = this.statsLogger.getCounter(NUM_FULL_OR_PARTIAL_LEDGERS_REPLICATED); this.exceptionCounters = new HashMap<String, Counter>(); }
Source:
public void testReadAcrossReadahead() throws Throwable { Path path = path("testReadAcrossReadahead"); writeTestDataset(path); FileSystem fs = getFileSystem(); try (FSDataInputStream in = fs.open(path)) { final byte[] temp = new byte[5]; in.readByte(); int offset = READAHEAD - 1; in.readFully(offset, temp); assertDatasetEquals(offset, "read spanning boundary", temp, temp.length); } try (FSDataInputStream in = fs.open(path)) { final byte[] temp = new byte[5]; readAtEndAndReturn(in); assertEquals("current position", 1, (int)(in.getPos())); in.readFully(READAHEAD, temp); assertDatasetEquals(READAHEAD, "read across boundary", temp, temp.length); } }

Target:
public void testReadAcrossReadahead() throws Throwable { describe("Sets up a read which will span the active readahead" + " and the rest of the file."); Path path = path("testReadAcrossReadahead"); writeTestDataset(path); FileSystem fs = getFileSystem(); try (FSDataInputStream in = fs.open(path)) { final byte[] temp = new byte[5]; in.readByte(); int offset = READAHEAD - 1; in.readFully(offset, temp); assertDatasetEquals(offset, "read spanning boundary", temp, temp.length); } try (FSDataInputStream in = fs.open(path)) { final byte[] temp = new byte[5]; readAtEndAndReturn(in); assertEquals("current position", 1, (int)(in.getPos())); in.readFully(READAHEAD, temp); assertDatasetEquals(READAHEAD, "read exactly on boundary", temp, temp.length); } }
Source:
public static State createInstance(long startTime, long endTime, long lastUpdatedTime, int numTrail, int numSuccess, int numFailure, int numIgnored, boolean isPaused, int rampStage, boolean isActive) { return new State() .setStartTime(startTime) .setEndTime(endTime) .setLastUpdatedTime(lastUpdatedTime) .setNumOfTrail(numTrail) .setNumOfSuccess(numSuccess) .setNumOfFailure(numFailure) .setNumOfIgnored(numIgnored) .setPaused(isPaused) .setRampStage(rampStage) .setActive(isActive); }

Target:
public static final State createInstance(long startTime, long endTime, long lastUpdatedTime, int numTrail, int numSuccess, int numFailure, int numIgnored, boolean isPaused, int rampStage, boolean isActive) { return new State() .setStartTime(startTime) .setEndTime(endTime) .setLastUpdatedTime(lastUpdatedTime) .setNumOfTrail(numTrail) .setNumOfSuccess(numSuccess) .setNumOfFailure(numFailure) .setNumOfIgnored(numIgnored) .setPaused(isPaused) .setRampStage(rampStage) .setActive(isActive); }
Source:
protected GlusterVolume postPopulate(GlusterVolume model) { model.setAccessProtocols("GLUSTER,NFS"); return model; }

Target:
protected GlusterVolume postPopulate(GlusterVolume model) { model.setVolumeType(GlusterVolumeType.DISTRIBUTE.name()); List<String> transportTypes = model.getTransportTypes().getTransportTypes(); transportTypes.clear(); transportTypes.add(TransportType.TCP.name()); List<String> accessProtocols = model.getAccessProtocols().getAccessProtocols(); accessProtocols.clear(); accessProtocols.add(AccessProtocol.GLUSTER.name()); accessProtocols.add(AccessProtocol.NFS.name()); return model; }
Source:
void presentForList(int position, String listName) { this.position = position; String dialogContent = dialog.getContext().getString(R.string.confirm_deletion_message," \"" + listName + "\""); dialog.setContent(dialogContent); }

Target:
void presentForList(int position, String listName) { this.position = position; String dialogContent = dialog.getContext().getString(R.string.confirm_deletion_message, " \"" + listName + "\""); dialog.setContent(dialogContent); dialog.show(); }
Source:
public Builder providerConfigurationMetadata(Map<String, Object> configurationMetadata) { this.configurationMetadata = configurationMetadata; return this; }

Target:
public Builder providerConfigurationMetadata(Map<String, Object> configurationMetadata) { if (configurationMetadata != null) { this.configurationMetadata = new LinkedHashMap<>(configurationMetadata); } return this; }
Source:
public ListenableFuture<?> enqueue(OrganizationSet organizationSet) { log.info("enqueue organizationSet: %s", organizationSet); shardsInProgress.putAll(organizationSet.getShardsMap()); ListenableFuture<?> listenableFuture = prioritizedFifoExecutor.submit(jobFactory.create(organizationSet)); listenableFuture.addListener( () -> { for (UUID uuid : organizationSet.getShardsMap().keySet()) { shardsInProgress.remove(uuid); } }, MoreExecutors.directExecutor()); Futures.addCallback( listenableFuture, new FutureCallback<Object>() { @Override public void onSuccess(Object o) { successCount.update(1); } @Override public void onFailure(Throwable throwable) { log.warn(throwable, "Error running organization job"); failureCount.update(1); } }, MoreExecutors.directExecutor()); return listenableFuture; }

Target:
public ListenableFuture<?> enqueue(OrganizationSet organizationSet) { log.info("enqueue organizationSet: %s", organizationSet); shardsInProgress.putAll(organizationSet.getShardsMap()); deltaCountInProgress = shardsInProgress.values().stream().filter(Optional::isPresent).collect(toSet()).size(); ListenableFuture<?> listenableFuture = prioritizedFifoExecutor.submit(jobFactory.create(organizationSet)); listenableFuture.addListener( () -> { for (UUID uuid : organizationSet.getShardsMap().keySet()) { shardsInProgress.remove(uuid); deltaCountInProgress = shardsInProgress.values().stream().filter(Optional::isPresent).collect(toSet()).size(); } }, MoreExecutors.directExecutor()); Futures.addCallback( listenableFuture, new FutureCallback<Object>() { @Override public void onSuccess(Object o) { successCount.update(1); } @Override public void onFailure(Throwable throwable) { log.warn(throwable, "Error running organization job"); failureCount.update(1); } }, MoreExecutors.directExecutor()); return listenableFuture; }
Source:
public static InetAddress intToInetAddress(int hostAddress) { InetAddress inetAddress; String hostName; hostName = Integer.toString(0xff & hostAddress) + "." + Integer.toString(0xff & (hostAddress >> 8)) + "." + Integer.toString(0xff & (hostAddress >> 16)) + "." + Integer.toString(0xff & (hostAddress >> 24)); try { inetAddress = InetAddress.getByName(hostName); } catch (UnknownHostException e) { return null; } return inetAddress; }

Target:
public static InetAddress intToInetAddress(int hostAddress) { InetAddress inetAddress; String hostName; hostName = "" + (0xff & hostAddress) + "." + (0xff & (hostAddress >> 8)) + "." + (0xff & (hostAddress >> 16)) + "." + (0xff & (hostAddress >> 24)); try { inetAddress = InetAddress.getByName(hostName); } catch (UnknownHostException e) { return null; } return inetAddress; }
Source:
public AttributeDetail(final AbstractBuild<?, ?> owner, final DetailFactory detailFactory, final Collection<FileAnnotation> annotations, final String defaultEncoding, final String header, final String name) { super(owner, detailFactory, annotations, defaultEncoding, header, Hierarchy.PROJECT); attributeName = name; }

Target:
public AttributeDetail(final AbstractBuild<?, ?> owner, final DetailFactory detailFactory, final Collection<FileAnnotation> annotations, final String defaultEncoding, final String header, final String name) { this((Run<?, ?>) owner, detailFactory, annotations, defaultEncoding, header, name); }
Source:
public void shouldUpdateChargeToCaptured_IfEpdqStatusIs9AndChargeIsHistoric() throws QueueException { charge = getCharge(true); final String payload = notificationPayloadForTransaction(payId, EPDQ_PAYMENT_REQUESTED); when(mockGatewayAccountService.getGatewayAccount(charge.getGatewayAccountId())).thenReturn(Optional.of(gatewayAccountEntity)); when(mockChargeService.findByProviderAndTransactionIdFromDbOrLedger(EPDQ.getName(), payId)).thenReturn(Optional.of(charge)); ArgumentCaptor<ZonedDateTime> eventTimeStamp = ArgumentCaptor.forClass(ZonedDateTime.class); notificationService.handleNotificationFor(payload); verify(mockChargeNotificationProcessor).processCaptureNotificationForExpungedCharge(gatewayAccountEntity, payId, charge, CAPTURED); }

Target:
public void shouldUpdateChargeToCaptured_IfEpdqStatusIs9AndChargeIsHistoric() throws QueueException { charge = getCharge(true); final String payload = notificationPayloadForTransaction(payId, EPDQ_PAYMENT_REQUESTED); when(mockGatewayAccountService.getGatewayAccount(charge.getGatewayAccountId())).thenReturn(Optional.of(gatewayAccountEntity)); when(mockChargeService.findByProviderAndTransactionIdFromDbOrLedger(EPDQ.getName(), payId)).thenReturn(Optional.of(charge)); notificationService.handleNotificationFor(payload); verify(mockChargeNotificationProcessor).processCaptureNotificationForExpungedCharge(gatewayAccountEntity, payId, charge, CAPTURED); }
Source:
private void writeHeader(final LittleEndianOutputStream dos) throws IOException { dos.writeInt(MAGIC_NUMBER); dos.writeInt(getType()); dos.writeInt(version); dos.writeString(indexedPath.toString()); dos.writeLong(indexedFileSize); dos.writeLong(indexedFileTS); dos.writeString(indexedFileMD5); dos.writeInt(flags); dos.writeInt(properties.size()); for (final Map.Entry<String, String> prop : properties.entrySet()) { dos.writeString(prop.getKey()); dos.writeString(prop.getValue()); } }

Target:
private void writeHeader(final LittleEndianOutputStream dos) throws IOException { dos.writeInt(MAGIC_NUMBER); dos.writeInt(getType()); dos.writeInt(version); dos.writeString(indexedPath.toUri().toString()); dos.writeLong(indexedFileSize); dos.writeLong(indexedFileTS); dos.writeString(indexedFileMD5); dos.writeInt(flags); dos.writeInt(properties.size()); for (final Map.Entry<String, String> prop : properties.entrySet()) { dos.writeString(prop.getKey()); dos.writeString(prop.getValue()); } }
Source:
public void setup() { provider = (ParanamerNameProvider) Factories.createParameterNameProvider(); }

Target:
public void setup() { CacheStore<AccessibleObject, Parameter[]> cache = new DefaultCacheStore<>(); provider = new ParanamerNameProvider(cache); }
Source:
public void createTopic(final String topic, final String zkUrl) { KafkaZkClient zkClient = null; try { zkClient = getZkClient(zkUrl); final AdminZkClient adminZkClient = new AdminZkClient(zkClient); adminZkClient.createTopic(topic, 1, 1, new Properties(), RackAwareMode.Safe$.MODULE$); } finally { if (zkClient != null) { zkClient.close(); } } }

Target:
public void createTopic(final String topic, final String zkUrl) { try (KafkaZkClient zkClient = createZkClient(zkUrl)) { final AdminZkClient adminZkClient = new AdminZkClient(zkClient); adminZkClient.createTopic(topic, 1, 1, new Properties(), RackAwareMode.Safe$.MODULE$); } }
Source:
public String expression(final String nodeIdentifier) { final Filter filter = this.getFilter(); return String.format("toLower(%s.`%s`) %s toLower({ `%s` }) ", nodeIdentifier, filter.getPropertyName(), filter.getComparisonOperator().getValue(), filter.uniqueParameterName()); }

Target:
public String expression(final String nodeIdentifier) { final Filter filter = this.getFilter(); return String.format("toLower(%s.`%s`) %s toLower({ `%s` }) ", nodeIdentifier, filter.getPropertyName(), ComparisonOperator.EQUALS.getValue(), filter.uniqueParameterName()); }
Source:
public void shoultTestCustomApiKeyValidation() { System.out.println("Exectute custom API key validation test for: " + this.customApiKeyParam); CustomApiKeyObject customApiKeyObject = new CustomApiKeyObject(this.customApiKeyParam); Set<ConstraintViolation<CustomApiKeyObject>> violations = validator.validate(customApiKeyObject); Assert.assertEquals(violations.size(), this.violationSize); if (violationSize > 0) { Assert.assertTrue(violations.stream().anyMatch( v -> v.getMessage().equals(message))); } }

Target:
public void shoultTestCustomApiKeyValidation() { LOGGER.info("Exectute custom API key validation test for: " + this.customApiKeyParam); CustomApiKeyObject customApiKeyObject = new CustomApiKeyObject(this.customApiKeyParam); Set<ConstraintViolation<CustomApiKeyObject>> violations = validator.validate(customApiKeyObject); Assert.assertEquals(violations.size(), this.violationSize); if (violationSize > 0) { Assert.assertTrue(violations.stream().anyMatch( v -> v.getMessage().equals(message))); } }
Source:
public synchronized <K> KeyQueryMetadata getKeyQueryMetadataForKey(final String storeName, final K key, final StreamPartitioner<? super K, ?> partitioner) { Objects.requireNonNull(storeName, "storeName can't be null"); Objects.requireNonNull(key, "key can't be null"); Objects.requireNonNull(partitioner, "partitioner can't be null"); if (!isInitialized()) { return KeyQueryMetadata.NOT_AVAILABLE; } if (globalStores.contains(storeName)) { if (thisHost == UNKNOWN_HOST) { return new KeyQueryMetadata(allMetadata.get(0).hostInfo(), Collections.emptySet(), -1); } return new KeyQueryMetadata(myMetadata.hostInfo(), Collections.emptySet(), -1); } final SourceTopicsInfo sourceTopicsInfo = getSourceTopicsInfo(storeName); if (sourceTopicsInfo == null) { return null; } return getKeyQueryMetadataForKey(storeName, key, partitioner, sourceTopicsInfo); }

Target:
public synchronized <K> KeyQueryMetadata getKeyQueryMetadataForKey(final String storeName, final K key, final StreamPartitioner<? super K, ?> partitioner) { Objects.requireNonNull(storeName, "storeName can't be null"); Objects.requireNonNull(key, "key can't be null"); Objects.requireNonNull(partitioner, "partitioner can't be null"); if (!isInitialized()) { return KeyQueryMetadata.NOT_AVAILABLE; } if (globalStores.contains(storeName)) { if (thisHost == UNKNOWN_HOST) { return new KeyQueryMetadata(allMetadata.get(0).hostInfo(), Collections.emptySet(), -1); } return new KeyQueryMetadata(localMetadata.hostInfo(), Collections.emptySet(), -1); } final SourceTopicsInfo sourceTopicsInfo = getSourceTopicsInfo(storeName); if (sourceTopicsInfo == null) { return null; } return getKeyQueryMetadataForKey(storeName, key, partitioner, sourceTopicsInfo); }
Source:
public void onLoadFinished(boolean success) { if (!success) { ToastUtil.showError(getActivity(), R.string.error_load_project); return; } refreshFragment(); }

Target:
public void onLoadFinished(boolean success) { if (!success) { ToastUtil.showError(getActivity(), R.string.error_load_project); return; } adapter.setItems(ProjectManager.getInstance().getCurrentProject().getSceneList()); }
Source:
private boolean isCardHidden(@NonNull Card card) { int cardType = FeedRecyclerAdapter.getCardType(card); for (HiddenCard hiddenCard : hiddenCards) { if (hiddenCard.getType() == cardType && hiddenCard.getHashCode() == card.hashCode()) { return true; } } return false; }

Target:
private boolean isCardHidden(@NonNull Card card) { int cardType = FeedRecyclerAdapter.getCardType(card); for (HiddenCard hiddenCard : hiddenCards) { if (hiddenCard.getType() == cardType && hiddenCard.hashCode() == card.hashCode()) { return true; } } return false; }
Source:
public static synchronized BrandingManager getInstance() { if (instance == null) { instance = new BrandingManager(); } return instance; }

Target:
public static BrandingManager getInstance() { return getInstance(EngineLocalConfig.getInstance().getEtcDir()); }
Source:
public void savePlayer(Player player) throws Exception { try (Connection connection = connections.get()) { Email email = Email.of(player.getCredentials().getUsername()); String displayName = player.getCredentials().getUsername(); putRank(connection, email, player.getPrivilegeLevel()); putPlayer(connection, email, player); putAppearance(connection, displayName, player.getAppearance()); putStats(connection, displayName, player.getSkillSet()); putInventory(connection, displayName, ITEM_BAG_ID, player.getInventory()); putInventory(connection, displayName, WORN_EQUIPMENT_ID, player.getEquipment()); putInventory(connection, displayName, BANK_ID, player.getBank()); putAttributes(connection, displayName, player.getAttributes()); } }

Target:
public void savePlayer(Player player) throws Exception { Connection connection = null; Savepoint savepoint = null; try { connection = dataSource.getConnection(); connection.setAutoCommit(false); savepoint = connection.setSavepoint(); String email = player.getCredentials().getUsername(); String displayName = player.getCredentials().getUsername(); putRank(connection, email, player.getPrivilegeLevel()); putPlayer(connection, email, player); putAppearance(connection, displayName, player.getAppearance()); putStats(connection, displayName, player.getSkillSet()); putInventory(connection, displayName, ITEM_BAG_ID, player.getInventory()); putInventory(connection, displayName, WORN_EQUIPMENT_ID, player.getEquipment()); putInventory(connection, displayName, BANK_ID, player.getBank()); putAttributes(connection, displayName, player.getAttributes()); connection.commit(); connection.setAutoCommit(true); } catch (SQLException e) { e.printStackTrace(); connection.rollback(savepoint); } }
Source:
public void onItemClick(AdapterView<?> adapter, View view, int position, long id) { Intent intent = new Intent(HistoryActivity.this, SingleRunHistoryActivity.class); SingleRun selectedValue = (SingleRun) adapter.getItemAtPosition(position); intent.putExtra("id", selectedValue.getRunID()); startActivity(intent); overridePendingTransition(R.anim.in_left_anim, R.anim.out_left_anim); }

Target:
public void onItemClick(AdapterView<?> adapter, View view, int position, long id) { Intent intent = new Intent(HistoryActivity.this, SingleRunHistoryActivity.class); SingleRun selectedValue = (SingleRun) adapter.getItemAtPosition(position); intent.putExtra(ID_TAG, selectedValue.getRunID()); startActivity(intent); overridePendingTransition(R.anim.in_left_anim, R.anim.out_left_anim); }
Source:
public double getAOCorrectedFWHM(boolean doThrow) { switch (source.getProfileType()) { case POINT: final int IQ20 = 20, IQ70 = 70, IQ85 = 85; final int iq = (int) (imageQualityPercentile * 100); switch (strehlBand.charAt(0)) { case 'J': switch (iq) { case IQ20: return 0.08; case IQ70: return 0.13; case IQ85: return 0.15; } break; case 'H': switch (iq) { case IQ20: return 0.07; case IQ70: return 0.10; case IQ85: return 0.13; } break; case 'K': switch (iq) { case IQ20: return 0.06; case IQ70: return 0.09; case IQ85: return 0.12; } break; default: throw new IllegalArgumentException("GeMS does not support band " + strehlBand); } break; case GAUSSIAN: return source.getFWHM(); default: return 0.0; } if (doThrow) { throw new IllegalArgumentException("GeMS cannot be used in IQ=Any conditions"); } else { return getAOCorrectedFWHM_oldVersion(); } }

Target:
public double getAOCorrectedFWHM(boolean doThrow) { switch (source.getProfileType()) { case POINT: final int IQ20 = 20, IQ70 = 70, IQ85 = 85; final int iq = (int) (imageQualityPercentile * 100); switch (strehlBand.charAt(0)) { case 'J': switch (iq) { case IQ20: return 0.08; case IQ70: return 0.13; case IQ85: return 0.15; } break; case 'H': switch (iq) { case IQ20: return 0.07; case IQ70: return 0.10; case IQ85: return 0.13; } break; case 'K': switch (iq) { case IQ20: return 0.06; case IQ70: return 0.09; case IQ85: return 0.12; } break; default: throw new IllegalArgumentException("Current ITC implementation for GeMS does not support band " + strehlBand); } break; case GAUSSIAN: return source.getFWHM(); default: return 0.0; } if (doThrow) { throw new IllegalArgumentException("GeMS cannot be used in IQ=Any conditions"); } else { return getAOCorrectedFWHM_oldVersion(); } }
Source:
public static Slice varcharToCharSaturatedFloorCast(@LiteralParameter("y") long y, @SqlType("varchar(x)") Slice slice) { List<Integer> codePoints = new ArrayList<>(toCodePoints(slice)); if (codePoints.size() >= y) { trimTrailingSpaces(codePoints); List<Integer> codePointsTruncated = codePoints.stream() .limit(y) .collect(toImmutableList()); return codePointsToSliceUtf8(codePointsTruncated); } int lastNonZeroCharIndex = codePoints.size() - 1; while (lastNonZeroCharIndex >= 0 && codePoints.get(lastNonZeroCharIndex) == 0) { codePoints.remove(lastNonZeroCharIndex); lastNonZeroCharIndex--; } if (lastNonZeroCharIndex < 0) { return codePointsToSliceUtf8(nCopies(toIntExact(y), 0)); } codePoints.set(lastNonZeroCharIndex, codePoints.get(lastNonZeroCharIndex) - 1); verify(codePoints.size() == lastNonZeroCharIndex + 1); codePoints.addAll(nCopies(toIntExact(y) - codePoints.size(), Character.MAX_CODE_POINT)); verify(!codePoints.isEmpty()); verify(codePoints.get(codePoints.size() - 1) != ' '); return codePointsToSliceUtf8(codePoints); }

Target:
public static Slice varcharToCharSaturatedFloorCast(@LiteralParameter("y") long y, @SqlType("varchar(x)") Slice slice) { List<Integer> codePoints = new ArrayList<>(toCodePoints(slice)); if (codePoints.size() >= y) { codePoints = trimTrailing(codePoints, ' '); List<Integer> codePointsTruncated = codePoints.stream() .limit(y) .collect(toImmutableList()); return codePointsToSliceUtf8(codePointsTruncated); } codePoints = trimTrailing(codePoints, '\0'); if (codePoints.isEmpty()) { return codePointsToSliceUtf8(nCopies(toIntExact(y), (int) '\0')); } codePoints = new ArrayList<>(codePoints); codePoints.set(codePoints.size() - 1, codePoints.get(codePoints.size() - 1) - 1); codePoints.addAll(nCopies(toIntExact(y) - codePoints.size(), Character.MAX_CODE_POINT)); verify(codePoints.get(codePoints.size() - 1) != ' '); return codePointsToSliceUtf8(codePoints); }
Source:
private String prepareStringBindValue(String filter, String value) { if (!(criteria.isStrict() || (null != criteria.getStrictFilters() && Arrays.asList(criteria.getStrictFilters()) .contains(filter)))) { value = "%" + QueryUtility.escapeSearchParameter(value) + "%"; } if (!(criteria.isCaseSensitive() || (null != criteria.getCaseSensitiveFilters() && Arrays.asList( criteria.getCaseSensitiveFilters()).contains(filter)))) { value = value.toLowerCase(); } return value; }

Target:
private String prepareStringBindValue(String filter, String value) { if (!criteria.isStrict() && !arrayContains(criteria.getStrictFilters(), filter)) { value = "%" + QueryUtility.escapeSearchParameter(value) + "%"; } if (!criteria.isCaseSensitive() && !arrayContains(criteria.getCaseSensitiveFilters(), filter)) { value = value.toLowerCase(); } return value; }
Source:
private void emitLineage(BatchSourceContext context) { Schema schema = sourceConfig.getSchema(context.getFailureCollector()); LineageRecorder lineageRecorder = new LineageRecorder(context, sourceConfig.referenceName); lineageRecorder.createExternalDataset(schema); if (schema != null && schema.getFields() != null) { lineageRecorder.recordRead("Read", "Read from DB.", schema.getFields().stream().map(Schema.Field::getName).collect( Collectors.toList())); } }

Target:
private void emitLineage(BatchSourceContext context) { Schema schema = sourceConfig.getSchema(context.getFailureCollector()); if (schema == null) { schema = context.getOutputSchema(); } LineageRecorder lineageRecorder = new LineageRecorder(context, sourceConfig.referenceName); lineageRecorder.createExternalDataset(schema); if (schema != null && schema.getFields() != null) { lineageRecorder.recordRead("Read", "Read from DB.", schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList())); } }
Source:
public void VETemplateTests_004_CheckBlockedTransclusion() { articleName = PageContent.articleNamePrefix + base.getTimeStamp(); VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName, wikiURL); String selectText = PageContent.articleText.substring(12, 13); int numBlockTransclusion = ve.getNumberOfBlockTransclusion(); int numInlineTransclusion = ve.getNumberOfInlineTransclusion(); ve.typeTextArea(PageContent.articleText); ve.selectText(selectText); VisualEditorInsertTemplateDialog templateDialog = (VisualEditorInsertTemplateDialog) ve.openDialogFromMenu(InsertDialog.TEMPLATE); VisualEditorEditTemplateDialog editTemplateDialog = templateDialog.selectResultTemplate("book", 0); ve = editTemplateDialog.clickDone(); ve.verifyNumberOfBlockTransclusion(++numBlockTransclusion); ve.verifyNumberOfInlineTransclusion(numInlineTransclusion); templateDialog = (VisualEditorInsertTemplateDialog) ve.openDialogFromMenu(InsertDialog.TEMPLATE); editTemplateDialog = templateDialog.selectResultTemplate("book", 0); ve = editTemplateDialog.clickDone(); ve.verifyNumberOfBlockTransclusion(++numBlockTransclusion); ve.verifyNumberOfInlineTransclusion(numInlineTransclusion); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); ArticlePageObject article = saveDialog.savePage(); article.verifyVEPublishComplete(); article.logOut(wikiURL); }

Target:
public void VETemplateTests_004_CheckBlockedTransclusion() { articleName = PageContent.articleNamePrefix + base.getTimeStamp(); VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName, wikiURL); String selectText = PageContent.articleText.substring(12, 13); int numBlockTransclusion = ve.getNumberOfBlockTransclusion(); int numInlineTransclusion = ve.getNumberOfInlineTransclusion(); ve.typeTextArea(PageContent.articleText); ve.selectText(selectText); VisualEditorInsertTemplateDialog templateDialog = (VisualEditorInsertTemplateDialog) ve.openDialogFromMenu(InsertDialog.TEMPLATE); VisualEditorEditTemplateDialog editTemplateDialog = templateDialog.selectResultTemplate(VEContent.templateSearchStr5, 0); ve = editTemplateDialog.clickDone(); ve.verifyNumberOfBlockTransclusion(++numBlockTransclusion); ve.verifyNumberOfInlineTransclusion(numInlineTransclusion); templateDialog = (VisualEditorInsertTemplateDialog) ve.openDialogFromMenu(InsertDialog.TEMPLATE); editTemplateDialog = templateDialog.selectResultTemplate(VEContent.templateSearchStr5, 0); ve = editTemplateDialog.clickDone(); ve.verifyNumberOfBlockTransclusion(++numBlockTransclusion); ve.verifyNumberOfInlineTransclusion(numInlineTransclusion); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); ArticlePageObject article = saveDialog.savePage(); article.verifyVEPublishComplete(); article.logOut(wikiURL); }
Source:
private static void loadAllStateItems() { if (stateItems.size() > 0) { return; } List<IConfigurationElement> elements = ExtensionPoints.getExtensionElements("org.eclipse.osee.ats.core.client.AtsStateItemCore", "AtsStateItemCore"); String classname = null; String bundleName = null; for (IConfigurationElement el : elements) { if (el.getName().equals("AtsStateItemCore")) { classname = el.getAttribute("classname"); bundleName = el.getContributor().getName(); if (classname != null && bundleName != null) { Bundle bundle = Platform.getBundle(bundleName); try { Class taskClass = bundle.loadClass(classname); Object obj = taskClass.newInstance(); if (obj == null) { OseeLog.log(Activator.class, Level.SEVERE, "Error Instantiating AtsStateItemCore extension \"" + classname + "\"", null); } else { stateItems.add((IAtsStateItemCore) obj); } } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, "Error loading AtsStateItemCore extension", ex); } } } } }

Target:
private static void loadAllStateItems() { if (stateItems.size() > 0) { return; } stateItems = new ExtensionDefinedObjects<IAtsStateItemCore>("org.eclipse.osee.ats.core.client.AtsStateItemCore", "AtsStateItemCore", "classname").getObjects(); }
Source:
public Uri decode(Context context, Payload payload) throws PayloadDecodeException, PayloadNotFoundException { File file; if (payload instanceof LocalUriPayload) { file = new File(context.getFilesDir() + "/tempFile_" + System.currentTimeMillis()); InputStream resource = (InputStream) payload.prepare(context); OutputStream output = null; try { output = context.openFileOutput(file.getName(), Context.MODE_PRIVATE); byte[] buffer = new byte[4 * 1024]; int read; while ((read = resource.read(buffer)) != -1) { output.write(buffer, 0, read); } output.flush(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { resource.close(); if (output != null) { output.close(); } } catch (IOException ignored) { } } } else if (payload instanceof FilePayload) { file = (File) payload.prepare(context); } else { throw new PayloadDecodeException(); } return Uri.fromFile(file); }

Target:
public Uri decode(Context context, Payload payload) throws PayloadDecodeException, PayloadNotFoundException { Uri uri; if (payload instanceof LocalUriPayload) { uri = ((LocalUriPayload) payload).getData(); } else if (payload instanceof FilePayload) { File file = (File) payload.prepare(context); uri = Uri.fromFile(file); } else { throw new PayloadDecodeException(); } return uri; }
Source:
public BootstrapContextImpl clone() throws CloneNotSupportedException { BootstrapContextImpl bcbc = (BootstrapContextImpl)super.clone(); bcbc.setTransactionSynchronizationRegistry(getTransactionSynchronizationRegistry()); bcbc.setXATerminator(getXATerminator()); bcbc.setName(getName()); bcbc.setWorkManagerName(getWorkManagerName()); return bcbc; }

Target:
public BootstrapContextImpl clone() throws CloneNotSupportedException { BootstrapContextImpl bcbc = (BootstrapContextImpl)super.clone(); bcbc.setTransactionSynchronizationRegistry(getTransactionSynchronizationRegistry()); bcbc.setXATerminator(getXATerminator()); bcbc.setName(getName()); bcbc.setWorkManagerName(getWorkManagerName()); bcbc.setValidatorFactory(getValidatorFactory()); return bcbc; }
Source:
protected ValidationResult validate(Artifact artToValidate, IProgressMonitor monitor) throws OseeCoreException { Collection<String> errorMessages = new ArrayList<>(); boolean validationPassed = true; try { if (isDeleted(artToValidate)) { artToValidate.getRelatedArtifact(CoreRelationTypes.Default_Hierarchical__Parent); errorMessages.add(ValidationReportOperation.getRequirementHyperlink( artToValidate) + " (" + artToValidate.getGammaId() + ")" + " is deleted but still has a parent relation. Please delete the relation."); validationPassed = false; } } catch (ArtifactDoesNotExist ex) { } return new ValidationResult(errorMessages, validationPassed); }

Target:
protected ValidationResult validate(Artifact artToValidate, IProgressMonitor monitor) throws OseeCoreException { Collection<String> errorMessages = new ArrayList<>(); boolean validationPassed = true; if (artToValidate.isDeleted()) { Artifact relatedArtifact = artToValidate.getRelatedArtifactOrNull(CoreRelationTypes.Default_Hierarchical__Parent); if (relatedArtifact != null) { errorMessages.add(ValidationReportOperation.getRequirementHyperlink( artToValidate) + " (" + artToValidate.getGammaId() + ")" + " is deleted but still has a parent relation. Please delete the relation."); validationPassed = false; } } return new ValidationResult(errorMessages, validationPassed); }
Source:
public boolean hasMatchingOpSig(String name, JavaOperationSigMask mask) { for (Entry<JavaOperationSignature, Set<String>> entry : operations.entrySet()) { if (mask.covers(entry.getKey())) { if (operations.get(entry.getKey()).contains(name)) { return true; } } } return false; }

Target:
public boolean hasMatchingOpSig(String name, JavaOperationSigMask mask) { for (Entry<JavaOperationSignature, Set<String>> entry : operations.entrySet()) { if (mask.covers(entry.getKey())) { if (entry.getValue().contains(name)) { return true; } } } return false; }