auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static ImmutableSet<C_Type> getArrayStructMemberTypes(final ImmutableList<Struct> allOrderedStructs) { final ImmutableSet.Builder<C_Type> arrayStructMemberTypesBuilder = ImmutableSet.builder(); for (final Struct currentStruct : allOrderedStructs) { currentStruct.getStructMembers().stream() .filter(currentStructMember -> currentStructMember.getType().isArray()) .map(StructMember::getType) .collect(Collectors.toCollection(HashSet::new)) .forEach(arrayStructMemberTypesBuilder::add); } return arrayStructMemberTypesBuilder.build(); }

Target:
public static ImmutableSet<C_Type> getArrayStructMemberTypes(final ImmutableList<Struct> allOrderedStructs) { final ImmutableSet.Builder<C_Type> arrayStructMemberTypesBuilder = ImmutableSet.builder(); for (final Struct currentStruct : allOrderedStructs) { currentStruct.getStructMembers().stream() .filter(currentStructMember -> currentStructMember.getType().isArray()) .map(StructMember::getType) .forEach(arrayStructMemberTypesBuilder::add); } return arrayStructMemberTypesBuilder.build(); }
Source:
public int compare(Tuple tuple, Tuple tuple2) { int levels1 = getLevels(tuple); int levels2 = getLevels(tuple2); ComparisonChain comparisonChain = ComparisonChain.start().compare(levels1, levels2); for(int i = 0; i < levels1; i++) { Pair<Integer, Integer> pair1 = hasArrayIndex(tuple.getMetadata(), i)? new Pair<Integer, Integer>(i, getArrayIndex(tuple.getMetadata(), i)) : new Pair(-1, -1); Pair<Integer, Integer> pair2 = hasArrayIndex(tuple2.getMetadata(), i) ? new Pair<Integer, Integer>(i, getArrayIndex(tuple2.getMetadata(), i)) : new Pair(-1, -1); comparisonChain = comparisonChain.compare(pair1.getOne(), pair2.getOne()); comparisonChain = comparisonChain.compare(pair1.getTwo(), pair2.getTwo()); } comparisonChain = comparisonChain.compare(tuple.getKey(), tuple2.getKey()); return comparisonChain.result(); }

Target:
public int compare(Tuple tuple, Tuple tuple2) { int levels1 = getLevels(tuple); int levels2 = getLevels(tuple2); ComparisonChain comparisonChain = ComparisonChain.start(); for(int i = 0; i < Math.max(levels1, levels2); i++) { Pair<Integer, Integer> pair1 = hasArrayIndex(tuple.getMetadata(), i)? new Pair<Integer, Integer>(i, getArrayIndex(tuple.getMetadata(), i)) : DEFAULT_PAIR; Pair<Integer, Integer> pair2 = hasArrayIndex(tuple2.getMetadata(), i) ? new Pair<Integer, Integer>(i, getArrayIndex(tuple2.getMetadata(), i)) : DEFAULT_PAIR; comparisonChain = comparisonChain.compare(pair1.getOne(), pair2.getOne()); comparisonChain = comparisonChain.compare(pair1.getTwo(), pair2.getTwo()); } comparisonChain = comparisonChain.compare(levels1, levels2) .compare(tuple.getKey(), tuple2.getKey()); return comparisonChain.result(); }
Source:
private void processComponentConfig(final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final ComponentDescription description, DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final Class<?> componentClass; try { componentClass = ClassLoadingUtils.loadClass(description.getComponentClassName(), deploymentUnit); } catch (Exception e) { return; } handleAnnotations(applicationClasses, deploymentReflectionIndex, componentClass, description); }

Target:
private void processComponentConfig(final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final ComponentDescription description, DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final Class<?> componentClass; try { componentClass = ClassLoadingUtils.loadClass(description.getComponentClassName(), deploymentUnit); } catch (Throwable e) { return; } handleAnnotations(applicationClasses, deploymentReflectionIndex, componentClass, description); }
Source:
private String getCacheSubcommandDesc(CacheCommand cmd) { switch (cmd) { case LIST: return "Show information about caches, groups or sequences that match a regular expression. When executed without parameters, this subcommand prints the list of caches."; case CONTENTION: return "Show the keys that are point of contention for multiple transactions."; case IDLE_VERIFY: return "Verify counters and hash sums of primary and backup partitions for the specified caches on an idle cluster and print out the differences, if any. " + "Cache filtering options configure the set of caches that will be processed by idle_verify command. " + "Default value for the set of cache names is all caches. Default value for --exclude-caches is empty set. " + "Default value for --cache-filter is no filtering. Therefore, the set of all caches is consequently filtered by cache name " + "regexps, by cache type and after all by exclude regexps."; case VALIDATE_INDEXES: return "Validate indexes on an idle cluster and print out the keys that are missing in the indexes."; case DISTRIBUTION: return "Prints the information about partition distribution."; case RESET_LOST_PARTITIONS: return "Reset the state of lost partitions for the specified caches."; default: throw new IllegalArgumentException("Unknown command: " + cmd); } }

Target:
private String getCacheSubcommandDesc(CacheCommand cmd) { switch (cmd) { case LIST: return "Show information about caches, groups or sequences that match a regular expression. When executed without parameters, this subcommand prints the list of caches."; case CONTENTION: return "Show the keys that are point of contention for multiple transactions."; case IDLE_VERIFY: return "Verify counters and hash sums of primary and backup partitions for the specified caches/cache groups on an idle cluster and print out the differences, if any. " + "Cache filtering options configure the set of caches that will be processed by " + IDLE_VERIFY + " command. " + "Default value for the set of cache names (or cache group names) is all cache groups. Default value for " + EXCLUDE_CACHES + " is empty set. " + "Default value for " + CACHE_FILTER + " is no filtering. Therefore, the set of all caches is sequently filtered by cache name " + "regexps, by cache type and after all by exclude regexps."; case VALIDATE_INDEXES: return "Validate indexes on an idle cluster and print out the keys that are missing in the indexes."; case DISTRIBUTION: return "Prints the information about partition distribution."; case RESET_LOST_PARTITIONS: return "Reset the state of lost partitions for the specified caches."; default: throw new IllegalArgumentException("Unknown command: " + cmd); } }
Source:
public void testAddMultipleClients() throws Exception { final IClientSession session1 = Mockito.mock(IClientSession.class); final IClientSession session2 = Mockito.mock(IClientSession.class); TestMultiClientSessionCookieStore cookieStore = new TestMultiClientSessionCookieStore(); cookieStore.setTestClientSession(session1); cookieStore.add(TESTURI1, COOKIE1); cookieStore.setTestClientSession(session2); cookieStore.add(TESTURI2, COOKIE2); cookieStore.setTestClientSession(session1); List<HttpCookie> storedCookies = cookieStore.get(TESTURI1); assertNotNull(storedCookies); assertEquals(1, storedCookies.size()); checkCookieDeepEquality(COOKIE1, CollectionUtility.firstElement(storedCookies)); cookieStore.setTestClientSession(session2); List<HttpCookie> storedCookies2 = cookieStore.get(TESTURI2); assertNotNull(storedCookies2); assertEquals(1, storedCookies2.size()); checkCookieDeepEquality(COOKIE2, CollectionUtility.firstElement(storedCookies2)); }

Target:
public void testAddMultipleClients() throws Exception { TestMultiClientSessionCookieStore cookieStore = new TestMultiClientSessionCookieStore(); cookieStore.setTestClientSession(SESSION1); cookieStore.add(s_testuri1, COOKIE1); cookieStore.setTestClientSession(SESSION2); cookieStore.add(s_testuri2, COOKIE2); cookieStore.setTestClientSession(SESSION1); List<HttpCookie> storedCookies = cookieStore.get(s_testuri1); assertNotNull(storedCookies); assertEquals(1, storedCookies.size()); assertCookieEquals(COOKIE1, CollectionUtility.firstElement(storedCookies)); cookieStore.setTestClientSession(SESSION2); List<HttpCookie> storedCookies2 = cookieStore.get(s_testuri2); assertNotNull(storedCookies2); assertEquals(1, storedCookies2.size()); assertCookieEquals(COOKIE2, CollectionUtility.firstElement(storedCookies2)); }
Source:
private void testAddCommentsToQuestionsWithResponses() throws IOException { ______TS("add new comments on questions with responses and verify add comments without responses action"); submitPage = loginToInstructorEditStudentFeedbackPage( "IESFPTCourseinstr", "student1InIESFPTCourse@gmail.tmt", "session1InIESFPTCourse"); submitPage.waitForPageToLoad(); submitPage.addFeedbackResponseComment("-3-0", "New MCQ Comment 1"); submitPage.submitWithoutConfirmationEmail(); submitPage.verifyAndCloseSuccessfulSubmissionModal(""); submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED); submitPage.verifyHtmlMainContent("/instructorEditStudentFeedbackPageModifiedAddedCommentOnResponses.html"); }

Target:
private void testAddCommentsToQuestionsWithResponses() { submitPage = loginToInstructorEditStudentFeedbackPage( "IESFPTCourseinstr", "student1InIESFPTCourse@gmail.tmt", "session1InIESFPTCourse"); submitPage.waitForPageToLoad(); submitPage.chooseMcqOption(3, 0, "It's good"); submitPage.addFeedbackParticipantComment("-3-0", "New MCQ Comment 1"); submitPage.submitWithoutConfirmationEmail(); submitPage.verifyAndCloseSuccessfulSubmissionModal("2."); submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "2."); submitPage.verifyCommentRowContent("-3-0", "New MCQ Comment 1"); }
Source:
private void init() { if (!appInit.compareAndSet(false, true)) { logger.info("ZEP already initialized"); return; } logger.info("Initializing ZEP"); long sleep = 5; boolean done = false; try { while (!done) { try { this.config = configDao.getConfig(); done = true; } catch (Exception e) { logger.warn("Could not get config dao; {}; {}", e.getMessage(), e.getCause() != null ? e.getMessage() : ""); Thread.sleep(Math.max(sleep, 1)); sleep = sleep * 2; } } if (!done) { logger.error("Could not start ZEP"); } this.applicationEventPublisher.publishEvent(new ZepConfigUpdatedEvent(this, config)); this.pluginService.initializePlugins(); initializePartitions(); this.eventSummaryRebuilder.init(); this.eventArchiveRebuilder.init(); startEventSummaryAging(); startEventSummaryArchiving(); startEventArchivePurging(); startEventTimePurging(); startDbMaintenance(); startHeartbeatProcessing(); startQueueListeners(); logger.info("Completed ZEP initialization"); } catch (Exception e) { logger.error("Could not start ZEP", e); } }

Target:
private void init() { if (!appInit.compareAndSet(false, true)) { logger.info("ZEP already initialized"); return; } logger.info("Initializing ZEP"); long sleep = 1; boolean done = false; try { while (!done) { try { this.config = configDao.getConfig(); done = true; } catch (Exception e) { logger.warn("Could not get config dao; {}; {}", e.getMessage(), e.getCause() != null ? e.getMessage() : ""); Thread.sleep(Math.min(sleep, 5000)); sleep = sleep * 2; } } if (!done) { logger.error("Could not start ZEP"); } this.applicationEventPublisher.publishEvent(new ZepConfigUpdatedEvent(this, config)); this.pluginService.initializePlugins(); initializePartitions(); this.eventSummaryRebuilder.init(); this.eventArchiveRebuilder.init(); startEventSummaryAging(); startEventSummaryArchiving(); startEventArchivePurging(); startEventTimePurging(); startDbMaintenance(); startHeartbeatProcessing(); startQueueListeners(); logger.info("Completed ZEP initialization"); } catch (Exception e) { logger.error("Could not start ZEP", e); } }
Source:
public boolean extractQuestionDetails( Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { String isNotSureAllowedString = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_CONTRIBISNOTSUREALLOWED); Boolean isNotSureAllowed = (isNotSureAllowedString == null) ? false : (isNotSureAllowedString.equals("on") ? true : false); this.setContributionQuestionDetails(isNotSureAllowed); return true; }

Target:
public boolean extractQuestionDetails( Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { String isNotSureAllowedString = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_CONTRIBISNOTSUREALLOWED); Boolean isNotSureAllowed; if (isNotSureAllowedString == null) { isNotSureAllowed = false; } else { isNotSureAllowed = isNotSureAllowedString.equals("on"); } this.setContributionQuestionDetails(isNotSureAllowed); return true; }
Source:
public void tearDown() { IServer[] all = ServerCore.getServers(); for( int i = 0; i < all.length; i++ ) { try { all[i].delete(); } catch(CoreException ce) { ce.printStackTrace(); } } }

Target:
public void tearDown() { OpenShiftServerTestUtility.cleanup(); }
Source:
protected JoinGroupRequestData.JoinGroupRequestProtocolCollection metadata() { log.debug("Joining group with current subscription: {}", subscriptions.subscription()); this.joinedSubscription = subscriptions.subscription(); JoinGroupRequestData.JoinGroupRequestProtocolCollection protocolSet = new JoinGroupRequestData.JoinGroupRequestProtocolCollection(); for (PartitionAssignor assignor : assignors) { Subscription subscription = assignor.subscription(joinedSubscription); subscription.setOwnedPartitions(new ArrayList<>(subscriptions.assignedPartitions())); ByteBuffer metadata = ConsumerProtocol.serializeSubscription(subscription); protocolSet.add(new JoinGroupRequestData.JoinGroupRequestProtocol() .setName(assignor.name()) .setMetadata(Utils.toArray(metadata))); } return protocolSet; }

Target:
protected JoinGroupRequestData.JoinGroupRequestProtocolCollection metadata() { log.debug("Joining group with current subscription: {}", subscriptions.subscription()); this.joinedSubscription = subscriptions.subscription(); JoinGroupRequestData.JoinGroupRequestProtocolCollection protocolSet = new JoinGroupRequestData.JoinGroupRequestProtocolCollection(); List<String> topics = new ArrayList<>(joinedSubscription); for (ConsumerPartitionAssignor assignor : assignors) { Subscription subscription = new Subscription(topics, assignor.subscriptionUserData(joinedSubscription), subscriptions.assignedPartitionsList()); ByteBuffer metadata = ConsumerProtocol.serializeSubscription(subscription); protocolSet.add(new JoinGroupRequestData.JoinGroupRequestProtocol() .setName(assignor.name()) .setMetadata(Utils.toArray(metadata))); } return protocolSet; }
Source:
private Champ copyAndSetValue(final int setIndex, final int payloadIndex, final MaybeMultihash val) { final HashPrefixPayload[] src = this.contents; final HashPrefixPayload[] dst = new HashPrefixPayload[src.length]; System.arraycopy(src, 0, dst, 0, src.length); HashPrefixPayload existing = dst[setIndex]; KeyElement[] updated = new KeyElement[existing.mappings.length]; System.arraycopy(existing.mappings, 0, updated, 0, existing.mappings.length); updated[payloadIndex] = new KeyElement(existing.mappings[payloadIndex].key, val); dst[setIndex] = new HashPrefixPayload(updated, null); return new Champ(dataMap, nodeMap, dst); }

Target:
private Champ copyAndSetValue(final int setIndex, final int payloadIndex, final MaybeMultihash val) { final HashPrefixPayload[] src = this.contents; final HashPrefixPayload[] dst = Arrays.copyOf(src, src.length); HashPrefixPayload existing = dst[setIndex]; KeyElement[] updated = new KeyElement[existing.mappings.length]; System.arraycopy(existing.mappings, 0, updated, 0, existing.mappings.length); updated[payloadIndex] = new KeyElement(existing.mappings[payloadIndex].key, val); dst[setIndex] = new HashPrefixPayload(updated); return new Champ(dataMap, nodeMap, dst); }
Source:
private TemporalValue attachTimeZone( TemporalValue temporal, ZoneId zoneIdToAttach ) { if ( temporal.isSupported( ChronoField.MONTH_OF_YEAR ) ) { return datetime( ZonedDateTime.of( temporal.getDatePart(), temporal.getLocalTimePart(), zoneIdToAttach ) ); } else { if ( zoneIdToAttach instanceof ZoneOffset ) { return time( OffsetTime.of( temporal.getLocalTimePart(), (ZoneOffset) zoneIdToAttach ) ); } else { throw new UnsupportedTemporalUnitException( "Should only attach offsets to local times, not zone ids." ); } } }

Target:
private TemporalValue attachTimeZone( TemporalValue temporal, ZoneId zoneIdToAttach ) { if ( temporal.isSupported( ChronoField.MONTH_OF_YEAR ) ) { return datetime( ZonedDateTime.of( temporal.getDatePart(), temporal.getLocalTimePart(), zoneIdToAttach ) ); } else { if ( zoneIdToAttach instanceof ZoneOffset ) { return time( OffsetTime.of( temporal.getLocalTimePart(), (ZoneOffset) zoneIdToAttach ) ); } else { throw new IllegalStateException( "Should only attach offsets to local times, not zone ids." ); } } }
Source:
public int parseArguments(final Parameters params) throws CmdLineException { final String name = params.getParameter(0); if (new File(name).isDirectory()) { setter.addValue(new FileTreeIterator(new File(name), FS.DETECTED, new WorkingTreeOptions(false))); return 1; } if (new File(name).isFile()) { final DirCache dirc; try { dirc = DirCache.read(new File(name), FS.DETECTED); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e); } setter.addValue(new DirCacheIterator(dirc)); return 1; } final ObjectId id; try { id = clp.getRepository().resolve(name); } catch (IOException e) { throw new CmdLineException(e.getMessage()); } if (id == null) throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); final CanonicalTreeParser p = new CanonicalTreeParser(); final ObjectReader curs = clp.getRepository().newObjectReader(); try { p.reset(curs, clp.getRevWalk().parseTree(id)); } catch (MissingObjectException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IncorrectObjectTypeException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); } finally { curs.release(); } setter.addValue(p); return 1; }

Target:
public int parseArguments(final Parameters params) throws CmdLineException { final String name = params.getParameter(0); if (new File(name).isDirectory()) { setter.addValue(new FileTreeIterator(new File(name), FS.DETECTED, WorkingTreeOptions.createDefaultInstance())); return 1; } if (new File(name).isFile()) { final DirCache dirc; try { dirc = DirCache.read(new File(name), FS.DETECTED); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e); } setter.addValue(new DirCacheIterator(dirc)); return 1; } final ObjectId id; try { id = clp.getRepository().resolve(name); } catch (IOException e) { throw new CmdLineException(e.getMessage()); } if (id == null) throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); final CanonicalTreeParser p = new CanonicalTreeParser(); final ObjectReader curs = clp.getRepository().newObjectReader(); try { p.reset(curs, clp.getRevWalk().parseTree(id)); } catch (MissingObjectException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IncorrectObjectTypeException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); } finally { curs.release(); } setter.addValue(p); return 1; }
Source:
private int runCurrentRecords() { List<RunnableRecord> current = getCurrentRecords(); int executedNum = 0; myRunning = true; try { for (RunnableRecord r : current) { executedNum++; r.myRunnable.run(); } } finally { myRunning = false; myRecords.removeAll(current.subList(0, executedNum)); } return executedNum; }

Target:
private int runCurrentRecords() { List<RunnableRecord> current = getCurrentRecords(); int executedNum = 0; myRunning = true; try { for (RunnableRecord r : current) { executedNum++; try { r.myRunnable.run(); } catch (Exception e) { ThrowableHandlers.handle(e); } } } finally { myRunning = false; myRecords.removeAll(current.subList(0, executedNum)); } return executedNum; }
Source:
public void validateFullRepresentation() throws Exception { super.validateFullRepresentation(); assertPropEquals("uuid", getObject().getUuid()); assertPropEquals("condition", getObject().getCondition()); assertPropEquals("clinicalStatus", getObject().getClinicalStatus()); assertPropEquals("verificationStatus", getObject().getVerificationStatus()); assertPropEquals("previousVersion", getObject().getPreviousVersion()); assertPropEquals("onsetDate", getObject().getOnsetDate()); assertPropEquals("additionalDetail", getObject().getAdditionalDetail()); assertPropEquals("voided", getObject().getVoided()); assertPropEquals("voided_by", getObject().getVoidedBy()); }

Target:
public void validateFullRepresentation() throws Exception { super.validateFullRepresentation(); assertPropEquals("condition", getObject().getCondition()); assertPropEquals("clinicalStatus", getObject().getClinicalStatus()); assertPropEquals("verificationStatus", getObject().getVerificationStatus()); assertPropEquals("previousVersion", getObject().getPreviousVersion()); assertPropEquals("onsetDate", getObject().getOnsetDate()); assertPropEquals("additionalDetail", getObject().getAdditionalDetail()); assertPropEquals("voided", getObject().getVoided()); }
Source:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { return super.getConfiguration(igniteInstanceName) .setCacheConfiguration(new CacheConfiguration("cache") .setCacheMode(CacheMode.PARTITIONED) .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) .setRebalanceMode(CacheRebalanceMode.SYNC) .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) .setMaxConcurrentAsyncOperations(0) .setBackups(0)); }

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration cacheCfg = new CacheConfiguration("cache"); cacheCfg.setCacheMode(CacheMode.PARTITIONED); cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); cacheCfg.setRebalanceMode(CacheRebalanceMode.SYNC); cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); cacheCfg.setMaxConcurrentAsyncOperations(0); cacheCfg.setBackups(0); cfg.setCacheConfiguration(cacheCfg); return cfg; }
Source:
public static int compare(StarlarkInt x, StarlarkInt y) { if (x instanceof Int32 && y instanceof Int32) { return Integer.compare(((Int32) x).v, ((Int32) y).v); } try { return Long.compare(x.toLongFast(), y.toLongFast()); } catch (OverflowException ignore) { } return x.toBigInteger().compareTo(y.toBigInteger()); }

Target:
public static int compare(StarlarkInt x, StarlarkInt y) { if (x instanceof Int32 && y instanceof Int32) { return Integer.compare(((Int32) x).v, ((Int32) y).v); } try { return Long.compare(x.toLongFast(), y.toLongFast()); } catch (Overflow unused) { } return x.toBigInteger().compareTo(y.toBigInteger()); }
Source:
private XmlSuite getXmlSuite() { XmlSuite testSuite = new XmlSuite(); testSuite.setName("tempto-tests"); testSuite.setFileName("tempto-tests"); XmlTest test = new XmlTest(testSuite); test.setName("all"); XmlPackage testPackage = new XmlPackage(options.getTestsPackage()); List<XmlPackage> testPackages = new ArrayList<>(); testPackages.add(testPackage); test.setPackages(testPackages); XmlClass conventionBasedTestsClass = new XmlClass("com.teradata.tempto.internal.convention.ConventionBasedTestFactory"); List<XmlClass> classes = new ArrayList<>(); classes.add(conventionBasedTestsClass); test.setClasses(classes); return testSuite; }

Target:
private XmlSuite getXmlSuite() { XmlSuite testSuite = new XmlSuite(); testSuite.setName("tempto-tests"); testSuite.setFileName("tempto-tests"); XmlTest test = new XmlTest(testSuite); test.setName("all"); XmlPackage testPackage = new XmlPackage(options.getTestsPackage()); List<XmlPackage> testPackages = newArrayList(testPackage); test.setPackages(testPackages); XmlClass conventionBasedTestsClass = new XmlClass("com.teradata.tempto.internal.convention.ConventionBasedTestFactory"); List<XmlClass> classes = newArrayList(conventionBasedTestsClass); test.setClasses(classes); return testSuite; }
Source:
public void run() { int adminPort = VoltDB.DEFAULT_ADMIN_PORT; if (m_deployment.getAdminMode() != null) { if (m_isRejoin == false) { if (m_deployment.getAdminMode().isAdminstartup()) { m_rvdb.setStartMode(OperationMode.PAUSED); } } adminPort = m_deployment.getAdminMode().getPort(); } if (m_config.m_adminPort > 0) adminPort = m_config.m_adminPort; m_config.m_adminPort = adminPort; if (m_config.m_isPaused.get()) { m_rvdb.setStartMode(OperationMode.PAUSED); } }

Target:
public void run() { int adminPort = VoltDB.DEFAULT_ADMIN_PORT; if (m_deployment.getAdminMode() != null) { if (m_isRejoin == false) { if (m_deployment.getAdminMode().isAdminstartup()) { m_rvdb.setStartMode(OperationMode.PAUSED); } } adminPort = m_deployment.getAdminMode().getPort(); } if (m_config.m_adminPort > 0) adminPort = m_config.m_adminPort; m_config.m_adminPort = adminPort; }
Source:
AesCipher(AesMode mode, byte[] keyBytes) throws IllegalArgumentException, IOException { if (null == keyBytes) { throw new IllegalArgumentException("Null key bytes"); } aesKey = new EncryptionKey(keyBytes); randomGenerator = new SecureRandom(); localNonce = new byte[NONCE_LENGTH]; wipedOut = false; }

Target:
AesCipher(AesMode mode, byte[] keyBytes) throws IllegalArgumentException, IOException { if (null == keyBytes) { throw new IllegalArgumentException("Null key bytes"); } boolean allZeroKey = true; for (byte kb : keyBytes) { if (kb != 0) { allZeroKey = false; break; } } if (allZeroKey) { throw new IllegalArgumentException("All key bytes are zero"); } aesKey = new SecretKeySpec(keyBytes, "AES"); randomGenerator = new SecureRandom(); localNonce = new byte[NONCE_LENGTH]; }
Source:
private void lookupNonPaginatedGetChildren() { try { _getChildrenMethod = ZooKeeper.class.getMethod("getChildren", String.class, boolean.class); } catch (NoSuchMethodException e2) { LOG.error("getChildren is not supported in this zookeeper version!"); } }

Target:
private Method lookupNonPaginatedGetChildren() { try { return ZooKeeper.class.getMethod("getChildren", String.class, boolean.class); } catch (NoSuchMethodException e) { throw ExceptionUtil.convertToRuntimeException(e.getCause()); } }
Source:
protected void initializeExecutors() { final int maxPendingPersists = config.getMaxPendingPersists(); if (persistExecutor == null) { persistExecutor = Execs.newBlockingSingleThreaded( "plumber_persist_%d", maxPendingPersists, Thread.MIN_PRIORITY ); } if (mergeExecutor == null) { mergeExecutor = Execs.newBlockingSingleThreaded( "plumber_merge_%d", 1, Thread.MIN_PRIORITY ); } if (scheduledExecutor == null) { scheduledExecutor = Executors.newScheduledThreadPool( 1, Execs.makeThreadFactory("plumber_scheduled_%d", Thread.MIN_PRIORITY) ); } }

Target:
protected void initializeExecutors() { final int maxPendingPersists = config.getMaxPendingPersists(); if (persistExecutor == null) { persistExecutor = Execs.newBlockingSingleThreaded( "plumber_persist_%d", maxPendingPersists, TaskThreadPriority.getThreadPriorityFromTaskPriority(config.getPersistThreadPriority()) ); } if (mergeExecutor == null) { mergeExecutor = Execs.newBlockingSingleThreaded( "plumber_merge_%d", 1, TaskThreadPriority.getThreadPriorityFromTaskPriority(config.getMergeThreadPriority()) ); } if (scheduledExecutor == null) { scheduledExecutor = Execs.scheduledSingleThreaded("plumber_scheduled_%d"); } }
Source:
public Optional<Image> loadImage(final String imageName) { final URL url = getResource(imageName); if (url == null) { return Optional.empty(); } try { return Optional.ofNullable(ImageIO.read(url)); } catch (final IOException e) { log.log(Level.SEVERE, "Image loading failed: " + imageName, e); return Optional.empty(); } }

Target:
public Optional<Image> loadImage(final String imageName) { final URL url = getResource(imageName); if (url == null) { return Optional.empty(); } try { final BufferedImage bufferedImage = ImageIO.read(url); if (bufferedImage == null) { log.severe("Unsupported Image Format: " + url); } return Optional.ofNullable(bufferedImage); } catch (final IOException e) { log.log(Level.SEVERE, "Image loading failed: " + imageName, e); return Optional.empty(); } }
Source:
private String appendDomainRealms(List<String> realms) throws AuthenticationException { StringBuffer text = new StringBuffer(" [domain_realm]\n"); if (!domainRealmMappingFileExits()) { for (String realm : realms) { text.append("\t" + realm.toLowerCase() + " = " + realm.toUpperCase() + "\n"); } } else { try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(domainRealmMappingFile), "UTF-8"))) { while (true) { String readLine = reader.readLine(); if (readLine == null) { break; } text.append("\t").append(readLine).append("\n"); } } catch (FileNotFoundException e) { } catch (IOException e) { } } return text.toString(); }

Target:
private String appendDomainRealms(List<String> realms) throws AuthenticationException { StringBuffer text = new StringBuffer(" [domain_realm]\n"); if (!domainRealmMappingFileExits()) { for (String realm : realms) { text.append("\t" + realm.toLowerCase() + " = " + realm.toUpperCase() + "\n"); } } else { try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(domainRealmMappingFile), java.nio.charset.Charset.defaultCharset().displayName()))) { while (true) { String readLine = reader.readLine(); if (readLine == null) { break; } text.append("\t").append(readLine).append("\n"); } } catch (FileNotFoundException e) { } catch (IOException e) { } } return text.toString(); }
Source:
public Contentlet findContentletForLanguage(long languageId, Identifier contentletId) throws DotDataException, DotSecurityException { try { return findContentletByIdentifier(contentletId.getId(), false, languageId, APILocator.systemUser(), false); } catch (DotContentletStateException dcs) { Logger.debug(this, "No working contentlet found for language: "+ languageId); } return null; }

Target:
public Contentlet findContentletForLanguage(long languageId, Identifier contentletId) throws DotDataException, DotSecurityException { try { return findContentletByIdentifier(contentletId.getId(), false, languageId, APILocator.systemUser(), false); } catch (DotContentletStateException dcs) { Logger.debug(this, ()->String.format("No working contentlet found for language: %d and identifier: %s ", languageId, null != contentletId ? contentletId.getId() : "Unkown")); } return null; }
Source:
public synchronized ITmfStateInterval doSingularQuery(long t, int attributeQuark) throws TimeRangeException, StateSystemDisposedException { ITmfStateInterval ret = super.doSingularQuery(t, attributeQuark); if (ret != null) { return ret; } for (HTInterval interval : fCurrentChunk) { if (interval.getAttribute() == attributeQuark && interval.intersects(t)) { return interval; } } for (Iterable<HTInterval> intervals : intervalQueue) { for (HTInterval interval : intervals) { if (interval.getAttribute() == attributeQuark && interval.intersects(t)) { return interval; } } } return super.doSingularQuery(t, attributeQuark); }

Target:
public ITmfStateInterval doSingularQuery(long t, int attributeQuark) throws TimeRangeException, StateSystemDisposedException { ITmfStateInterval ret = super.doSingularQuery(t, attributeQuark); if (ret != null) { return ret; } fRwl.readLock().lock(); for (HTInterval interval : fCurrentChunk) { if (interval.getAttribute() == attributeQuark && interval.intersects(t)) { return interval; } } fRwl.readLock().unlock(); for (Iterable<HTInterval> intervals : intervalQueue) { for (HTInterval interval : intervals) { if (interval.getAttribute() == attributeQuark && interval.intersects(t)) { return interval; } } } return super.doSingularQuery(t, attributeQuark); }
Source:
public AsyncDataToken execute(ExecutorService executor) throws QueryStoreException { if (!validate()) { throw new QueryStoreException(QueryStoreException.ErrorCode.NO_SUCH_TABLE, "Table/s not found"); } executor.submit(this); return new AsyncDataToken(cacheToken, cacheKey()); }

Target:
public AsyncDataToken execute(ExecutorService executor) throws QueryStoreException { validate(); executor.submit(this); return new AsyncDataToken(cacheToken, cacheKey()); }
Source:
private IgniteCache<RowColMatrixKey, Map<Integer, Double>> newCache() { CacheConfiguration<RowColMatrixKey, Map<Integer, Double>> cfg = new CacheConfiguration<>(); cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC); cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC); cfg.setEvictionPolicy(null); cfg.setCopyOnRead(false); cfg.setCacheMode(CacheMode.PARTITIONED); cfg.setReadFromBackup(false); cfg.setName(CACHE_NAME); return Ignition.localIgnite().getOrCreateCache(cfg); }

Target:
private IgniteCache<RowColMatrixKey, Map<Integer, Double>> newCache() { CacheConfiguration<RowColMatrixKey, Map<Integer, Double>> cfg = new CacheConfiguration<>(); cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC); cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC); cfg.setEvictionPolicy(null); cfg.setCopyOnRead(false); cfg.setCacheMode(CacheMode.PARTITIONED); cfg.setName(CACHE_NAME); return Ignition.localIgnite().getOrCreateCache(cfg); }
Source:
public void LightboxTest_011_filepage_image() { WikiBasePageObject base = new WikiBasePageObject(driver); SpecialNewFilesPageObject specialNewFiles = base.openSpecialNewFiles(wikiURL); int itemNumber = 0; String fileUrl = specialNewFiles.getFileUrl(wikiURL, itemNumber); LightboxComponentObject lightbox = specialNewFiles.openLightboxForGridVideo(itemNumber); lightbox.verifyLightboxPopup(); lightbox.verifyLightboxImage(); lightbox.verifyTitleUrl(fileUrl); lightbox.verifyMoreInfoUrl(fileUrl); FilePagePageObject filePage = lightbox.clickTitle(); filePage.verifyTabsExistImage(); }

Target:
public void LightboxTest_011_filepage_image() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); SpecialNewFilesPageObject specialNewFiles = base.openSpecialNewFiles(wikiURL); int itemNumber = 0; String fileUrl = specialNewFiles.getFileUrl(wikiURL, itemNumber); LightboxComponentObject lightbox = specialNewFiles.openLightbox(itemNumber); lightbox.verifyLightboxPopup(); lightbox.verifyLightboxImage(); FilePagePageObject filePage = lightbox.clickTitle(); filePage.verifyTabsExistImage(); }
Source:
public static String validatePathCapabilityArgs( final Path path, final String capability) { checkArgument(path != null, "null path"); checkArgument(capability != null && !capability.isEmpty(), "null/empty capability"); return capability.toLowerCase(Locale.ENGLISH); }

Target:
public static String validatePathCapabilityArgs( final Path path, final String capability) { checkArgument(path != null, "null path"); checkArgument(capability != null, "capability parameter is null"); checkArgument(!capability.isEmpty(), "capability parameter is empty string"); return capability.toLowerCase(Locale.ENGLISH); }
Source:
private void startWarmup() { try { long start = System.nanoTime(); pageCacheWarmer.reheat().ifPresent( pagesLoaded -> { long elapsedMillis = NANOSECONDS.toMillis( System.nanoTime() - start ); monitor.warmupCompleted( elapsedMillis, pagesLoaded ); log.debug( "Active page cache warmup took " + Format.duration( elapsedMillis ) + " to load " + pagesLoaded + " pages." ); } ); } catch ( Exception e ) { log.debug( "Active page cache warmup failed, " + "so it may take longer for the cache to be populated with hot data.", e ); } scheduleProfile(); }

Target:
private void startWarmup() { if ( !available ) { return; } try { pageCacheWarmer.reheat().ifPresent( monitor::warmupCompleted ); } catch ( Exception e ) { log.debug( "Active page cache warmup failed, " + "so it may take longer for the cache to be populated with hot data.", e ); } scheduleProfile(); }
Source:
public void rollbackToSavepoint(String name, GridNearTxLocal tx) throws IgniteCheckedException { assert tx != null; ListIterator<TxSavepoint> spIter = findSP(name); if (spIter == null) throw new IllegalArgumentException("No such savepoint."); rollbackToSavepoint(spIter.next(), tx); releaseNextSPs(spIter); }

Target:
public void rollbackToSavepoint(String name, GridNearTxLocal tx) throws IgniteCheckedException { assert name != null; assert tx != null; ListIterator<TxSavepoint> spIter = findSP(name); if (spIter == null) throw new IllegalArgumentException("No such savepoint. [name=" + name + ']'); rollbackToSavepoint(spIter.next(), tx); savepoints.subList(spIter.nextIndex(), savepoints.size()).clear(); }
Source:
public void testMultiConditionalBind_cat() { props.setProperty("animal.type", "cat"); Injector injector = Guice.createInjector(new Module() { @Override public void configure(Binder binder) { ConditionalMultibind.create(props, binder, Animal.class) .conditionBinder(ANIMAL_TYPE, Predicates.equalTo("cat"), Cat.class) .conditionBinder(ANIMAL_TYPE, Predicates.equalTo("dog"), Dog.class); } }); Set<Animal> animalSet = injector.getInstance(Key.get(new TypeLiteral<Set<Animal>>(){})); Assert.assertEquals(1, animalSet.size()); Assert.assertEquals(animalSet, ImmutableSet.<Animal>of(new Cat())); }

Target:
public void testMultiConditionalBind_cat() { props.setProperty("animal.type", "cat"); Injector injector = Guice.createInjector(new Module() { @Override public void configure(Binder binder) { ConditionalMultibind.create(props, binder, Animal.class) .addConditionBinding(ANIMAL_TYPE, Predicates.equalTo("cat"), Cat.class) .addConditionBinding(ANIMAL_TYPE, Predicates.equalTo("dog"), Dog.class); } }); Set<Animal> animalSet = injector.getInstance(Key.get(new TypeLiteral<Set<Animal>>() { })); Assert.assertEquals(1, animalSet.size()); Assert.assertEquals(animalSet, ImmutableSet.<Animal>of(new Cat())); }
Source:
public void executeStoredProcedureWithScriptLoggingEnabled() throws Exception { CosmosStoredProcedureProperties storedProcedure = new CosmosStoredProcedureProperties( UUID.randomUUID().toString(), "function() {" + " var mytext = \"x\";" + " var myval = 1;" + " try {" + " console.log(\"The value of %s is %s.\", mytext, myval);" + " getContext().getResponse().setBody(\"Success!\");" + " }" + " catch(err) {" + " getContext().getResponse().setBody(\"inline err: [\" + err.number + \"] \" + err);" + " }" + "}"); container.getScripts().createStoredProcedure(storedProcedure); CosmosStoredProcedureRequestOptions options = new CosmosStoredProcedureRequestOptions(); options.setScriptLoggingEnabled(true); options.setPartitionKey(PartitionKey.NONE); CosmosStoredProcedureResponse executeResponse = container.getScripts() .getStoredProcedure(storedProcedure.getId()) .execute(null, options); String logResult = "The value of x is 1."; assertThat(URLDecoder.decode(executeResponse.getScriptLog(), StandardCharsets.UTF_8)).isEqualTo(logResult); }

Target:
public void executeStoredProcedureWithScriptLoggingEnabled() throws Exception { CosmosStoredProcedureProperties storedProcedure = new CosmosStoredProcedureProperties( UUID.randomUUID().toString(), "function() {" + " var mytext = \"x\";" + " var myval = 1;" + " try {" + " console.log(\"The value of %s is %s.\", mytext, myval);" + " getContext().getResponse().setBody(\"Success!\");" + " }" + " catch(err) {" + " getContext().getResponse().setBody(\"inline err: [\" + err.number + \"] \" + err);" + " }" + "}"); container.getScripts().createStoredProcedure(storedProcedure); CosmosStoredProcedureRequestOptions options = new CosmosStoredProcedureRequestOptions(); options.setScriptLoggingEnabled(true); options.setPartitionKey(PartitionKey.NONE); CosmosStoredProcedureResponse executeResponse = container.getScripts() .getStoredProcedure(storedProcedure.getId()) .execute(null, options); String logResult = "The value of x is 1."; assertThat(executeResponse.getScriptLog()).isEqualTo(logResult); }
Source:
public void testEqualityAndCopyConstructor() { RankedBitVectorImpl bv0 = new RankedBitVectorImpl(); for (int i = 0; i < 0x100000; i++) { boolean value = (i % 3) == 0; bv0.addBit(value); } RankedBitVectorImpl bv1 = new RankedBitVectorImpl(); for (int i = 0; i < 0x100000; i++) { boolean value = (i % 3) == 0; bv1.addBit(value); } assertEqualsForBitVector(bv0, bv1); bv1.setBit(0x12345, false); Assert.assertFalse(bv0.equals(bv1)); Assert.assertFalse(bv1.equals(bv0)); bv1.setBit(0x12346, true); Assert.assertFalse(bv0.equals(bv1)); Assert.assertFalse(bv1.equals(bv0)); RankedBitVectorImpl bv2 = new RankedBitVectorImpl(bv1); for (int i = 0; i < 0x100000; i++) { boolean value = (i % 3) == 0; bv1.addBit(value); } bv2.setBit(0x12345, true); Assert.assertFalse(bv0.equals(bv2)); Assert.assertFalse(bv2.equals(bv0)); Assert.assertFalse(bv1.equals(bv2)); Assert.assertFalse(bv2.equals(bv1)); bv2.setBit(0x12346, false); assertEqualsForBitVector(bv0, bv2); for (int i = 0; i < 0x100000; i++) { if ((i % 0x6785) == 0) { assertCorrectCount(bv2, i); } } }

Target:
public void testEqualityAndCopyConstructor() { final long aLargeNumber = 0x100000; RankedBitVectorImpl bv0 = new RankedBitVectorImpl(); RankedBitVectorImpl bv1 = new RankedBitVectorImpl(); PseudorandomBooleanGenerator generator = new PseudorandomBooleanGenerator( 0x1234); for (int i = 0; i < aLargeNumber; i++) { boolean value = generator.getPseudorandomBoolean(); bv0.addBit(value); bv1.addBit(value); } assertEqualsForBitVector(bv0, bv1); RankedBitVectorImpl bv2 = new RankedBitVectorImpl(bv1); assertEqualsForBitVector(bv0, bv2); }
Source:
public AuditAssociationQuery<? extends AuditAssociationQuery<Q>> traverseRelation( String associationName, JoinType joinType, String alias) { AbstractAuditAssociationQuery<AbstractAuditAssociationQuery<Q>> result = associationQueryMap.get(associationName ); if ( result == null ) { result = new EntitiesAtRevisionAssociationQuery<>( enversService, auditReader, this, queryBuilder, associationName, joinType, aliasToEntityNameMap, this.alias, alias ); associationQueries.add( (EntitiesAtRevisionAssociationQuery<Q>) result ); associationQueryMap.put( associationName, result ); } return result; }

Target:
public AuditAssociationQuery<? extends AuditAssociationQuery<Q>> traverseRelation( String associationName, JoinType joinType, String alias) { return associationQueryMap.computeIfAbsent( associationName, name -> { AbstractAuditAssociationQuery<AbstractAuditAssociationQuery<Q>> query = new EntitiesAtRevisionAssociationQuery<>( enversService, auditReader, this, queryBuilder, associationName, joinType, aliasToEntityNameMap, this.alias, alias ); associationQueries.add( query ); return query; } ); }
Source:
public LatLng androidGeocode(String addressText) { List<Address> addresses; Geocoder g = new Geocoder(this.context); try { addresses = g.getFromLocationName(addressText, 10); } catch (IOException e) { e.printStackTrace(); return null; } double iRadius, iLat, iLng; try { iRadius = currentInstance.getRadius(); iLat = currentInstance.getLat(); iLng = currentInstance.getLon(); } catch (Exception e) { e.printStackTrace(); Log.e(App.LOG_TAG, "Required instance data not found. Exiting android geocoder", e); return null; } for (Address address : addresses) { float[] results = new float[1]; Location.distanceBetween(iLat, iLng, address.getLatitude(), address.getLongitude(), results); if (results[0] <= iRadius) { return new LatLng(address.getLatitude(), address.getLongitude()); } } return null; }

Target:
public LatLng androidGeocode(String addressText) { List<Address> addresses; Geocoder g = new Geocoder(this.context); try { addresses = g.getFromLocationName(addressText, 10); } catch (IOException e) { e.printStackTrace(); return null; } double instanceRadius, instanceLat, instanceLng; try { instanceRadius = currentInstance.getRadius(); instanceLat = currentInstance.getLat(); instanceLng = currentInstance.getLon(); } catch (Exception e) { Log.e(App.LOG_TAG, "Required instance data not found. Exiting android geocoder", e); return null; } for (Address address : addresses) { float[] results = new float[1]; Location.distanceBetween(instanceLat, instanceLng, address.getLatitude(), address.getLongitude(), results); if (results[0] <= instanceRadius) { return new LatLng(address.getLatitude(), address.getLongitude()); } } return null; }
Source:
public ICompletableFuture<V> getAsync(K key) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); return new DelegatingFuture<V>(getAsyncInternal(key), getSerializationService()); }

Target:
public ICompletableFuture<V> getAsync(K key) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); return new ClientDelegatingFuture<V>(getAsyncInternal(key), getSerializationService(), GET_ASYNC_RESPONSE_DECODER); }
Source:
private boolean init(ChangeBoundsRequest request, GraphicalEditPart hostGraphicalEditPart) { List<?> editParts = request.getEditParts(); DDiagram parentDiagram = (DDiagram) hostGraphicalEditPart.getNotationView().getDiagram().getElement(); boolean layoutingModeActivated = parentDiagram.isIsInLayoutingMode(); for (Object editPart : editParts) { if (editPart instanceof DragAndDropWrapper) { DragAndDropWrapper dragAndDropWrapperToDrop = (DragAndDropWrapper) editPart; elementsFromEclipseViewToDrop.add(dragAndDropWrapperToDrop); } else if (editPart instanceof IGraphicalEditPart) { IGraphicalEditPart graphicalEditPartToDrop = (IGraphicalEditPart) editPart; if (!(graphicalEditPartToDrop.getParent() == hostGraphicalEditPart || hostGraphicalEditPart instanceof CompartmentEditPart && graphicalEditPartToDrop.getParent() == hostGraphicalEditPart.getParent()) && graphicalEditPartToDrop.resolveSemanticElement() instanceof DSemanticDecorator) { EObject elementFromDiagramToDrop = graphicalEditPartToDrop.resolveSemanticElement(); DDiagramElement dDiagramElementTopDrop = (DDiagramElement) elementFromDiagramToDrop; elementsFromDiagramToDrop.add(dDiagramElementTopDrop); editPartsFromDiagramToDrop.add(graphicalEditPartToDrop); if (layoutingModeActivated && graphicalEditPartToDrop instanceof IDiagramBorderNodeEditPart) { return false; } } } } return true; }

Target:
private boolean init(ChangeBoundsRequest request, GraphicalEditPart hostGraphicalEditPart) { List<?> editParts = request.getEditParts(); for (Object editPart : editParts) { if (editPart instanceof DragAndDropWrapper) { DragAndDropWrapper dragAndDropWrapperToDrop = (DragAndDropWrapper) editPart; elementsFromEclipseViewToDrop.add(dragAndDropWrapperToDrop); } else if (editPart instanceof IGraphicalEditPart) { IGraphicalEditPart graphicalEditPartToDrop = (IGraphicalEditPart) editPart; if (!(graphicalEditPartToDrop.getParent() == hostGraphicalEditPart || hostGraphicalEditPart instanceof CompartmentEditPart && graphicalEditPartToDrop.getParent() == hostGraphicalEditPart.getParent()) && graphicalEditPartToDrop.resolveSemanticElement() instanceof DSemanticDecorator) { EObject elementFromDiagramToDrop = graphicalEditPartToDrop.resolveSemanticElement(); DDiagramElement dDiagramElementTopDrop = (DDiagramElement) elementFromDiagramToDrop; elementsFromDiagramToDrop.add(dDiagramElementTopDrop); editPartsFromDiagramToDrop.add(graphicalEditPartToDrop); if (isInLayoutingMode(hostGraphicalEditPart) && graphicalEditPartToDrop instanceof IDiagramBorderNodeEditPart) { return false; } } } } return true; }
Source:
public int compareTo(final DayProfile other) { return other.dayId.compareTo(this.dayId); }

Target:
public int compareTo(final DayProfile other) { return this.dayId.compareTo(other.dayId); }
Source:
public void testSubstVarsTwoLevelsWithDefault() { context.putProperty("APP_NAME", "LOGBACK"); context.putProperty("ARCHIVE_SUFFIX", "archive.log"); context.putProperty("LOG_HOME", "${logfilepath.default:-logs}"); context.putProperty("LOG_PATH", "${LOG_HOME}/${APP_NAME}"); context.putProperty("ARCHIVE_PATH", "${LOG_HOME}/archive/${APP_NAME}"); String result = OptionHelper.substVars("${ARCHIVE_PATH}_trace_${ARCHIVE_SUFFIX}", context); assertEquals("logs/archive/LOGBACK_trace_archive.log", result); }

Target:
public void testSubstVarsTwoLevelsWithDefault() { context.putProperty("APP_NAME", "LOGBACK"); context.putProperty("ARCHIVE_SUFFIX", "archive.log"); context.putProperty("LOG_HOME", "${logfilepath.default:-logs}"); context.putProperty("ARCHIVE_PATH", "${LOG_HOME}/archive/${APP_NAME}"); String result = OptionHelper.substVars("${ARCHIVE_PATH}_trace_${ARCHIVE_SUFFIX}", context); assertEquals("logs/archive/LOGBACK_trace_archive.log", result); }