auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public MamPrefsIQ parse(XmlPullParser parser, int initialDepth) throws Exception { String iqType = parser.getAttributeValue("", "type"); String defaultField = parser.getAttributeValue("", "default"); if (iqType == null) { iqType = "result"; } List<Jid> alwaysJids = null; List<Jid> neverJids = null; boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("always")) { alwaysJids = iterateJids(parser, "always"); } if (parser.getName().equals("never")) { neverJids = iterateJids(parser, "never"); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(MamPrefsIQ.ELEMENT)) { done = true; } } } return new MamPrefsIQ(Type.fromString(iqType), alwaysJids, neverJids, defaultField); }

Target:
public MamPrefsIQ parse(XmlPullParser parser, int initialDepth) throws Exception { String iqType = parser.getAttributeValue("", "type"); String defaultField = parser.getAttributeValue("", "default"); if (iqType == null) { iqType = "result"; } List<Jid> alwaysJids = null; List<Jid> neverJids = null; outerloop: while (true) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("always")) { alwaysJids = iterateJids(parser); } if (parser.getName().equals("never")) { neverJids = iterateJids(parser); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getDepth() == initialDepth) { break outerloop; } } } return new MamPrefsIQ(Type.fromString(iqType), alwaysJids, neverJids, defaultField); }
Source:
public List<DatabaseChangeViewModel> scanForChanges() { if (database.getDatabasePath().isEmpty()) { return Collections.emptyList(); } else { try { List<DatabaseChangeViewModel> changes = new ArrayList<>(); ImportFormatPreferences importFormatPreferences = Globals.prefs.getImportFormatPreferences(); ParserResult result = new BibtexImporter(importFormatPreferences, new DummyFileUpdateMonitor()) .importDatabase(database.getDatabasePath().get(), importFormatPreferences.getEncoding()); BibDatabaseContext databaseOnDisk = result.getDatabaseContext(); BibDatabaseDiff differences = BibDatabaseDiff.compare(database, databaseOnDisk); differences.getMetaDataDifferences().ifPresent(diff -> { changes.add(new MetaDataChangeViewModel(diff)); diff.getGroupDifferences().ifPresent(groupDiff -> changes.add(new GroupChangeViewModel(groupDiff))); }); differences.getPreambleDifferences().ifPresent(diff -> changes.add(new PreambleChangeViewModel(diff))); differences.getBibStringDifferences().forEach(diff -> changes.add(createBibStringDiff(diff))); differences.getEntryDifferences().forEach(diff -> changes.add(createBibEntryDiff(diff))); return changes; } catch (IOException e) { LOGGER.warn("Error while parsing changed file.", e); return Collections.emptyList(); } } }

Target:
public List<DatabaseChangeViewModel> scanForChanges() { if (database.getDatabasePath().isEmpty()) { return Collections.emptyList(); } try { List<DatabaseChangeViewModel> changes = new ArrayList<>(); ImportFormatPreferences importFormatPreferences = Globals.prefs.getImportFormatPreferences(); ParserResult result = new BibtexImporter(importFormatPreferences, new DummyFileUpdateMonitor()) .importDatabase(database.getDatabasePath().get(), importFormatPreferences.getEncoding()); BibDatabaseContext databaseOnDisk = result.getDatabaseContext(); BibDatabaseDiff differences = BibDatabaseDiff.compare(database, databaseOnDisk); differences.getMetaDataDifferences().ifPresent(diff -> { changes.add(new MetaDataChangeViewModel(diff)); diff.getGroupDifferences().ifPresent(groupDiff -> changes.add(new GroupChangeViewModel(groupDiff))); }); differences.getPreambleDifferences().ifPresent(diff -> changes.add(new PreambleChangeViewModel(diff))); differences.getBibStringDifferences().forEach(diff -> changes.add(createBibStringDiff(diff))); differences.getEntryDifferences().forEach(diff -> changes.add(createBibEntryDiff(diff))); return changes; } catch (IOException e) { LOGGER.warn("Error while parsing changed file.", e); return Collections.emptyList(); } }
Source:
public void testParseUserAttrStringFileArguments() { List<String> cmdArgs = new ArrayList<>(DFLT_ARGS); cmdArgs.add(CommandList.TX.text()); cmdArgs.add(CommonArgParser.CMD_USER_ATTR_PATH); cmdArgs.add(IgniteUtils.resolveIgnitePath(USER_ATTRIBUTE_PATH).getAbsolutePath()); cmdArgs.add(CommonArgParser.CMD_USER_ATTR); cmdArgs.add("attr1=val1,attr3=val4"); ConnectionAndSslParameters args = parseArgs(cmdArgs); assertEquals(args.userAttributes().get("attr3"), "val4"); }

Target:
public void testParseUserAttrStringFileArguments() { List<String> cmdArgs = new ArrayList<>(DFLT_ARGS); cmdArgs.add(CommandList.TX.text()); cmdArgs.add(CommonArgParser.CMD_USER_PROPS_PATH); cmdArgs.add(IgniteUtils.resolveIgnitePath(USER_ATTRIBUTE_PATH).getAbsolutePath()); cmdArgs.add(CommonArgParser.CMD_USER_PROPS); cmdArgs.add("prop1=val1,prop3=val4"); ConnectionAndSslParameters args = parseArgs(cmdArgs); assertEquals(args.userProperties().get("prop1"), "val1"); assertEquals(args.userProperties().get("prop3"), "val4"); assertEquals(args.userProperties().get("prop4"), "mode=test"); }
Source:
public void ShouldShowWebView_WhenTermsOfUseButtonIsClicked() throws Exception{ activity.onTermsAndConditionClick(); ShadowActivity shadowActivity = shadowOf(activity); Intent startedIntent = shadowActivity.getNextStartedActivity(); assertEquals(ExternalLinkActivity.class.getName(), startedIntent.getComponent().getClassName()); }

Target:
public void ShouldShowWebView_WhenTermsOfUseButtonIsClicked() throws Exception { activity.onTermsAndConditionClick(); Intent expectedIntent = new Intent(activity, ExternalLinkActivity.class); assertThat(new Intent(RuntimeEnvironment.application, ExternalLinkActivity.class)).isEqualTo(expectedIntent); }
Source:
public void addExistsTest() throws Exception{ ExtentIndex index = new ExtentIndex(); index.configure(new Config()); index.startup(); long testIndex = 9; ExtentSummary product = new ExtentSummary(); product.setId(testIndex); product.setMaxLatitude(0.); index.addExtentSummary(product); long response = index.getLastExtentIndexId(); Assert.assertEquals(testIndex,response); Connection conn = index.connect(); PreparedStatement stmnt = conn.prepareStatement("DELETE FROM " + ExtentIndex.EXTENT_TABLE + " WHERE " + ExtentIndex.EXTENT_INDEX_ID + "=" + product.getId()); stmnt.executeUpdate(); index.shutdown(); }

Target:
public void addExistsTest() throws Exception{ ExtentIndex index = new ExtentIndex(); index.configure(new Config()); index.startup(); long testIndex = 9; ExtentSummary product = new ExtentSummary(); product.setIndexId(testIndex); product.setMaxLatitude(BigDecimal.ZERO); index.addExtentSummary(product); long response = index.getLastExtentIndexId(); Assert.assertEquals(testIndex,response); Connection conn = index.connect(); PreparedStatement stmnt = conn.prepareStatement("DELETE FROM " + ExtentIndex.EXTENT_TABLE + " WHERE " + ExtentIndex.EXTENT_INDEX_ID + "=" + product.getIndexId()); stmnt.executeUpdate(); index.shutdown(); }
Source:
public void testInvalidBenchmarkSuiteSupplier() throws Exception { Bootstrap app = new Bootstrap( ImmutableList.<Module>builder() .add(new BenchmarkSuiteModule(ImmutableSet.of("test-supplier"))) .build()); app.strictConfig() .setRequiredConfigurationProperties(ImmutableMap.<String, String>builder() .putAll(DEFAULT_CONFIGURATION_PROPERTIES) .put("benchmark-query-supplier", "unknown-supplier") .put("database", "jdbc://localhost:1080") .put("suite-name", "test") .build()) .initialize(); }

Target:
public void testInvalidBenchmarkSuiteSupplier() { Bootstrap app = new Bootstrap(ImmutableList.<Module>builder() .add(new BenchmarkSuiteModule(ImmutableSet.of("test-supplier"))) .build()); Injector injector = null; try { injector = app.strictConfig() .setRequiredConfigurationProperties(ImmutableMap.<String, String>builder() .putAll(DEFAULT_CONFIGURATION_PROPERTIES) .put("benchmark-query-supplier", "unknown-supplier") .build()) .initialize(); } finally { if (injector != null) { injector.getInstance(LifeCycleManager.class).stop(); } } }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Tuple<?> other = (Tuple<?>) obj; if (big == null) { if (other.big != null) return false; } else if (!big.equals(other.big)) return false; if (small == null) { if (other.small != null) return false; } else if (!small.equals(other.small)) return false; return true; }

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Tuple<?> other = (Tuple<?>) obj; if (!big.equals(other.big)) return false; if (!small.equals(other.small)) return false; return true; }
Source:
public void purgeDeletedKeyWithResponseSnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); keyAsyncClient.purgeDeletedKeyWithResponse("deletedKeyName") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(purgeResponse -> System.out.printf("Purge Status response %rsaPrivateExponent \n", purgeResponse.getStatusCode())); END: com.azure.security.keyvault.keys.async.keyclient.purgeDeletedKeyWithResponse#string }

Target:
public void purgeDeletedKeyWithResponseSnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); keyAsyncClient.purgeDeletedKeyWithResponse("deletedKeyName") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(purgeResponse -> System.out.printf("Purge Status response %d %n", purgeResponse.getStatusCode())); END: com.azure.security.keyvault.keys.async.keyclient.purgeDeletedKeyWithResponse#string }
Source:
public void installTrustCertificate(String alias, X509Certificate x509crt) throws GeneralSecurityException, IOException { String trustStore = this.options.getSslKeyStore(); File fTrustStore = new File(trustStore); try (InputStream tsReadStream = new FileInputStream(trustStore); FileOutputStream tsOutStream = new FileOutputStream(trustStore)) { KeyStore ts = KeyStore.getInstance(KeyStore.getDefaultType()); char[] trustStorePassword = getKeyStorePassword(); if (fTrustStore.exists()) { ts.load(tsReadStream, trustStorePassword); } else { ts.load(null, null); } ts.setCertificateEntry(alias, x509crt); ts.store(tsOutStream, trustStorePassword); } }

Target:
public void installTrustCertificate(String alias, X509Certificate x509crt) throws GeneralSecurityException, IOException { InputStream tsReadStream = null; FileOutputStream tsOutStream = null; try { String trustStore = this.options.getSslKeyStore(); KeyStore ts = KeyStore.getInstance(KeyStore.getDefaultType()); File fTrustStore = new File(trustStore); char[] trustStorePassword = getKeyStorePassword(); if (fTrustStore.exists()) { tsReadStream = new FileInputStream(trustStore); ts.load(tsReadStream, trustStorePassword); } else { ts.load(null, null); } ts.setCertificateEntry(alias, x509crt); tsOutStream = new FileOutputStream(trustStore); ts.store(tsOutStream, trustStorePassword); } finally { close(tsReadStream); close(tsOutStream); } }
Source:
public EmbeddedSolrFiles( String coreName, String configXml, String[] schemaXmls, ConfigurationFileProxy configProxy) { Validate.notNull(coreName, "invalid null Solr core name"); Validate.notNull(configXml, "invalid null Solr configuration file"); Validate.notNull(schemaXmls, "Invalid null Solr schema files"); Validate.notEmpty(schemaXmls, "missing Solr schema files"); Validate.noNullElements(schemaXmls, "invalid null Solr schema file"); Validate.notNull(configProxy, "invalid null Solr config proxy"); this.coreName = coreName; this.configName = configXml; this.configFile = EmbeddedSolrFactory.getConfigFile(configXml, configProxy, coreName); Validate.notNull(configFile, "Unable to find Solr configuration file"); File solrSchemaFile = null; String schemaXml = null; for (final String s : schemaXmls) { schemaXml = s; solrSchemaFile = EmbeddedSolrFactory.getConfigFile(schemaXml, configProxy, coreName); if (solrSchemaFile != null) { break; } } Validate.notNull(solrSchemaFile, "Unable to find Solr schema file."); this.schemaFile = solrSchemaFile; this.schemaName = schemaXml; }

Target:
public EmbeddedSolrFiles( String coreName, String configXml, String[] schemaXmls, ConfigurationFileProxy configProxy) { Validate.notNull(coreName, "invalid null Solr core name"); Validate.notNull(configXml, "invalid null Solr config file"); Validate.notNull(schemaXmls, "invalid null Solr schema files"); Validate.notEmpty(schemaXmls, "missing Solr schema files"); Validate.noNullElements(schemaXmls, "invalid null Solr schema file"); Validate.notNull(configProxy, "invalid null Solr config proxy"); this.coreName = coreName; this.configName = configXml; this.configProxy = configProxy; this.configFile = FileUtils.toFile(configProxy.getResource(configXml, coreName)); Validate.notNull(configFile, "Unable to find Solr configuration file: " + configXml); File solrSchemaFile = null; String schemaXml = null; for (final String s : schemaXmls) { schemaXml = s; solrSchemaFile = FileUtils.toFile(configProxy.getResource(schemaXml, coreName)); if (solrSchemaFile != null) { break; } } Validate.notNull( solrSchemaFile, "Unable to find Solr schema file(s): " + Arrays.toString(schemaXmls)); this.schemaFile = solrSchemaFile; this.schemaName = schemaXml; }
Source:
public static boolean IsVersionMatchStorageType(Version version, StorageType type) { return !((type == StorageType.LOCALFS && version.compareTo(new Version(2, 2)) <= 0) || (type == StorageType.POSIXFS && version.compareTo(new Version(3, 0)) <= 0) || (type == StorageType.GLUSTERFS && version.compareTo(new Version(3, 2)) <= 0)); }

Target:
public static boolean IsVersionMatchStorageType(Version version, StorageType type) { return !((type == StorageType.LOCALFS && version.compareTo(new Version(2, 2)) <= 0) || (type == StorageType.POSIXFS && version.compareTo(new Version(3, 0)) <= 0) || (type == StorageType.GLUSTERFS && version.compareTo(new Version(3, 3)) <= 0)); }
Source:
protected QueryWithParams getEntityKeyOnlyQuery(EntityAttributes attributes) { Class<?> entityClass = Account.class; String primaryKeyName = "googleId"; AccountAttributes aa = (AccountAttributes) attributes; String id = aa.googleId; Query q = getPm().newQuery(entityClass); q.declareParameters("String idParam"); q.setFilter(primaryKeyName + " == idParam"); return new QueryWithParams(q, new Object[] {id}, primaryKeyName); }

Target:
protected QueryWithParams getEntityKeyOnlyQuery(EntityAttributes attributes) { Class<?> entityClass = Account.class; String primaryKeyName = Account.PRIMARY_KEY_NAME; AccountAttributes aa = (AccountAttributes) attributes; String id = aa.googleId; Query q = getPm().newQuery(entityClass); q.declareParameters("String idParam"); q.setFilter(primaryKeyName + " == idParam"); return new QueryWithParams(q, new Object[] {id}, primaryKeyName); }
Source:
public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) { Viewer contentViewer = super.findContentViewer(oldViewer, input, parent); if (input instanceof FileItemNode) { ReviewCompareAnnotationSupport support = ReviewCompareAnnotationSupport.getAnnotationSupport(contentViewer); support.setReviewItem(((FileItemNode) input).getFileItem(), behavior); if (input.getLeft() instanceof FileRevisionTypedElement) { getCompareConfiguration().setLeftImage(((FileItemNode) input).getImage()); } else { getCompareConfiguration().setLeftImage(null); } if (input.getRight() instanceof FileRevisionTypedElement) { getCompareConfiguration().setRightImage(((FileItemNode) input).getImage()); } else { getCompareConfiguration().setRightImage(null); } } return contentViewer; }

Target:
public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) { Viewer contentViewer = super.findContentViewer(oldViewer, input, parent); if (input instanceof FileItemNode) { ReviewCompareAnnotationSupport support = ReviewCompareAnnotationSupport.getAnnotationSupport(contentViewer); support.setReviewItem(((FileItemNode) input).getFileItem(), behavior); } return contentViewer; }
Source:
public void emitAndPersistEventForRefundHistoryEntry(RefundHistory refundHistory) { Class refundEventClass = RefundStateEventMap.calculateRefundEventClass(refundHistory.getUserExternalId(), refundHistory.getStatus()); Event event = EventFactory.createRefundEvent(refundHistory, refundEventClass); Boolean emittedBefore = emittedEventDao.hasBeenEmittedBefore(event); if (doNotForceEmission && emittedBefore) { logger.info("Refund history event emitted before [refundExternalId={}] [refundHistoryId={}]", refundHistory.getExternalId(), refundHistory.getId()); } else { RefundStateTransition stateTransition = new RefundStateTransition( refundHistory.getExternalId(), refundHistory.getStatus(), refundEventClass); logger.info("Processing new refund history event: [refundExternalId={}] [refundHistoryId={}]", refundHistory.getExternalId(), refundHistory.getId()); stateTransitionQueue.offer(stateTransition); persistEventEmittedRecord(event); } }

Target:
public void emitAndPersistEventForRefundHistoryEntry(RefundHistory refundHistory) { Class refundEventClass = RefundStateEventMap.calculateRefundEventClass(refundHistory.getUserExternalId(), refundHistory.getStatus()); Event event = EventFactory.createRefundEvent(refundHistory, refundEventClass); if (shouldForceEmission) { emitRefundEvent(refundHistory, refundEventClass, event); } else { boolean emittedBefore = emittedEventDao.hasBeenEmittedBefore(event); if (emittedBefore) { logger.info("Refund history event emitted before [refundExternalId={}] [refundHistoryId={}]", refundHistory.getExternalId(), refundHistory.getId()); } else { emitRefundEvent(refundHistory, refundEventClass, event); } } }
Source:
public AlertQuery createAlertQuery(final Organization organization) { assertIsOpen(); LOGGER.debug() .setMessage("Preparing queryAlerts") .addData("organization", organization) .log(); return new DefaultAlertQuery(this, organization); }

Target:
public AlertQuery createAlertQuery(final Organization organization) { assertIsOpen(); LOGGER.debug() .setMessage("Preparing query") .addData("organization", organization) .log(); return new DefaultAlertQuery(this, organization); }
Source:
public void registerSpecialPathInfo( SpecialPathInfo pathInfo ) { registerSpecialPathInfo( pathInfo, PKG_TYPE_MAVEN ); }

Target:
public synchronized void registerSpecialPathInfo( SpecialPathInfo pathInfo ) { stdSpecialPaths.add( pathInfo ); }
Source:
public int endpointSize() { Iterator<E> iterator = endpointProvider.iterator(); int size = 0; while (iterator.hasNext()){ iterator.next(); size++; } return size; }

Target:
public int endpointSize() { return getIterableSize(endpointProvider); }
Source:
private void processKafkaMessages() throws Exception { try { m_executorService = createImporterExecutor(m_loader, this, this); if (m_args.useSuppliedProcedure) { m_log.info("Kafka Consumer from topic: " + m_args.topic + " Started using procedure: " + m_args.procedure); } else { m_log.info("Kafka Consumer from topic: " + m_args.topic + " Started for table: " + m_args.table); } m_executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (Throwable terminate) { m_log.error("Error in Kafka Consumer", terminate); System.exit(-1); } finally { close(); } }

Target:
private void processKafkaMessages() throws Exception { try { m_executorService = createImporterExecutor(this, this); if (m_args.useSuppliedProcedure) { m_log.info("Kafka Consumer from topic: " + m_args.topic + " Started using procedure: " + m_args.procedure); } else { m_log.info("Kafka Consumer from topic: " + m_args.topic + " Started for table: " + m_args.table); } m_executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (Throwable terminate) { m_log.error("Error in Kafka Consumer", terminate); } finally { close(); } System.exit(-1); }
Source:
protected void readElement(final XMLExtendedStreamReader reader, final EJB3SubsystemXMLElement element, final List<ModelNode> operations, final ModelNode ejb3SubsystemAddOperation) throws XMLStreamException { switch (element) { case APPLICATION_SECURITY_DOMAINS: { parseApplicationSecurityDomains(reader, operations); break; } case IDENTITY: { parseIdentity(reader, operations); break; } case ALLOW_EJB_NAME_REGEX: { parseAllowEjbNameRegex(reader, ejb3SubsystemAddOperation); break; } case ENABLE_GRACEFUL_TXN_SHUTDOWN: { parseEnableGracefulTxnShutdown(reader, ejb3SubsystemAddOperation); break; } case SERVER_INTERCEPTORS: { parseServerInterceptors(reader, ejb3SubsystemAddOperation); break; } default: { super.readElement(reader, element, operations, ejb3SubsystemAddOperation); } } }

Target:
protected void readElement(final XMLExtendedStreamReader reader, final EJB3SubsystemXMLElement element, final List<ModelNode> operations, final ModelNode ejb3SubsystemAddOperation) throws XMLStreamException { switch (element) { case APPLICATION_SECURITY_DOMAINS: { parseApplicationSecurityDomains(reader, operations); break; } case IDENTITY: { parseIdentity(reader, operations); break; } case ALLOW_EJB_NAME_REGEX: { parseAllowEjbNameRegex(reader, ejb3SubsystemAddOperation); break; } case ENABLE_GRACEFUL_TXN_SHUTDOWN: { parseEnableGracefulTxnShutdown(reader, ejb3SubsystemAddOperation); break; } default: { super.readElement(reader, element, operations, ejb3SubsystemAddOperation); } } }
Source:
public Iterable<Result<TimeBoundaryResultValue>> buildResult(DateTime timestamp, DateTime min, DateTime max) { List<Result<TimeBoundaryResultValue>> results = Lists.newArrayList(); Map<String, Object> result = Maps.newHashMap(); if (min != null && !bound.equalsIgnoreCase(MAX_TIME)) { result.put(MIN_TIME, min); } if (max != null && !bound.equalsIgnoreCase(MIN_TIME)) { result.put(MAX_TIME, max); } if (!result.isEmpty()) { results.add(new Result<>(timestamp, new TimeBoundaryResultValue(result))); } return results; }

Target:
public static Iterable<Result<TimeBoundaryResultValue>> buildResult(DateTime timestamp, DateTime min, DateTime max) { List<Result<TimeBoundaryResultValue>> results = Lists.newArrayList(); Map<String, Object> result = Maps.newHashMap(); if (min != null) { result.put(MIN_TIME, min); } if (max != null) { result.put(MAX_TIME, max); } if (!result.isEmpty()) { results.add(new Result<>(timestamp, new TimeBoundaryResultValue(result))); } return results; }
Source:
CompletionStage<Boolean> currentConnectionIsOpen() { if ( connectionStage == null ) { return completedWithFalse(); } return connectionStage.handle( ( connection, error ) -> error == null && connection != null && connection.isOpen() ); }

Target:
CompletionStage<Boolean> currentConnectionIsOpen() { return connectionStage.handle( ( connection, error ) -> error == null && connection != null && connection.isOpen() ); }
Source:
private List<BasicNameValuePair> getParamsList(String key, Object value) { List<BasicNameValuePair> params = new LinkedList(); if (value instanceof Map) { Map map = (Map) value; List list = new ArrayList<Object>(map.keySet()); Collections.sort(list); for (Object nestedKey : list) { if (nestedKey instanceof String) { Object nestedValue = map.get(nestedKey); if (nestedValue != null) { params.addAll(getParamsList(key == null ? (String) nestedKey : String.format("%s[%s]", key, nestedKey), nestedValue)); } } } } else if (value instanceof List) { List list = (List) value; for (int nestedValueIndex = 0; nestedValueIndex < list.size(); nestedValueIndex++) { params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), list.get(nestedValueIndex))); } } else if (value instanceof Object[]) { Object[] array = (Object[]) value; for (int nestedValueIndex = 0; nestedValueIndex < array.length; nestedValueIndex++) { params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), array[nestedValueIndex])); } } else if (value instanceof Set) { Set set = (Set) value; for (Object nestedValue : set) { params.addAll(getParamsList(key, nestedValue)); } } else if (value instanceof String) { params.add(new BasicNameValuePair(key, (String) value)); } return params; }

Target:
private List<BasicNameValuePair> getParamsList(String key, Object value) { List<BasicNameValuePair> params = new LinkedList(); if (value instanceof Map) { Map map = (Map) value; List list = new ArrayList<Object>(map.keySet()); Collections.sort(list); for (Object nestedKey : list) { if (nestedKey instanceof String) { Object nestedValue = map.get(nestedKey); if (nestedValue != null) { params.addAll(getParamsList(key == null ? (String) nestedKey : String.format("%s[%s]", key, nestedKey), nestedValue)); } } } } else if (value instanceof List) { List list = (List) value; int listSize = list.size(); for (int nestedValueIndex = 0; nestedValueIndex < listSize; nestedValueIndex++) { params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), list.get(nestedValueIndex))); } } else if (value instanceof Object[]) { Object[] array = (Object[]) value; int arrayLength = array.length; for (int nestedValueIndex = 0; nestedValueIndex < arrayLength; nestedValueIndex++) { params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), array[nestedValueIndex])); } } else if (value instanceof Set) { Set set = (Set) value; for (Object nestedValue : set) { params.addAll(getParamsList(key, nestedValue)); } } else if (value instanceof String) { params.add(new BasicNameValuePair(key, (String) value)); } return params; }
Source:
public OuiaComponentTypeAttribute ouiaComponentType() { return new OuiaComponentTypeAttribute("qe-dmn-grid-context-menu-item"); }

Target:
public OuiaComponentTypeAttribute ouiaComponentType() { return new OuiaComponentTypeAttribute("dmn-grid-context-menu-item"); }
Source:
private void validateLookupConfigurations() { String partitionInclude = configuration.get(STREAMING_SOURCE_PARTITION_INCLUDE); if (isStreamingSource()) { Preconditions.checkArgument( !configuration.contains(STREAMING_SOURCE_CONSUME_START_OFFSET), String.format( "The '%s' is not supported when set '%s' to 'latest'", STREAMING_SOURCE_CONSUME_START_OFFSET.key(), STREAMING_SOURCE_PARTITION_INCLUDE.key())); Duration monitorInterval = configuration.get(STREAMING_SOURCE_MONITOR_INTERVAL) == null ? DEFAULT_LOOKUP_MONITOR_INTERVAL : configuration.get(STREAMING_SOURCE_MONITOR_INTERVAL); if (monitorInterval.toMillis() < DEFAULT_LOOKUP_MONITOR_INTERVAL.toMillis()) { LOG.warn(String.format( "Currently the recommended value of '%s' is bigger than default value '%s' " + "when set '%s' to 'latest', but actual is '%s', this may produce big pressure to hive metastore.", STREAMING_SOURCE_MONITOR_INTERVAL.key(), DEFAULT_LOOKUP_MONITOR_INTERVAL.toMillis(), STREAMING_SOURCE_PARTITION_INCLUDE.key(), monitorInterval.toMillis())); } hiveTableReloadInterval = monitorInterval; } else { Preconditions.checkArgument( "all".equals(partitionInclude), String.format("The only supported %s for lookup is '%s' in batch source," + " but actual is '%s'", STREAMING_SOURCE_PARTITION_INCLUDE.key(), "all", partitionInclude)); hiveTableReloadInterval = configuration.get(LOOKUP_JOIN_CACHE_TTL); } }

Target:
private void validateLookupConfigurations() { String partitionInclude = configuration.get(STREAMING_SOURCE_PARTITION_INCLUDE); if (isStreamingSource()) { Preconditions.checkArgument( !configuration.contains(STREAMING_SOURCE_CONSUME_START_OFFSET), String.format( "The '%s' is not supported when set '%s' to 'latest'", STREAMING_SOURCE_CONSUME_START_OFFSET.key(), STREAMING_SOURCE_PARTITION_INCLUDE.key())); Duration monitorInterval = configuration.get(STREAMING_SOURCE_MONITOR_INTERVAL) == null ? DEFAULT_LOOKUP_MONITOR_INTERVAL : configuration.get(STREAMING_SOURCE_MONITOR_INTERVAL); if (monitorInterval.toMillis() < DEFAULT_LOOKUP_MONITOR_INTERVAL.toMillis()) { LOG.warn(String.format( "Currently the recommended value of '%s' is at least '%s' when set '%s' to 'latest'," + " but actual is '%s', this may produce big pressure to hive metastore.", STREAMING_SOURCE_MONITOR_INTERVAL.key(), DEFAULT_LOOKUP_MONITOR_INTERVAL.toMillis(), STREAMING_SOURCE_PARTITION_INCLUDE.key(), monitorInterval.toMillis())); } hiveTableReloadInterval = monitorInterval; } else { Preconditions.checkArgument( "all".equals(partitionInclude), String.format("The only supported %s for lookup is '%s' in batch source," + " but actual is '%s'", STREAMING_SOURCE_PARTITION_INCLUDE.key(), "all", partitionInclude)); hiveTableReloadInterval = configuration.get(LOOKUP_JOIN_CACHE_TTL); } }
Source:
public void start() throws InterruptedException, IOException { String bitcoindCmd = "export LD_LIBRARY_PATH=" + config.berkeleyDbLibPath + ";" + " " + config.bitcoinPath + "/bitcoind" + " -datadir=" + config.bitcoinDatadir + " -daemon"; BashCommand cmd = new BashCommand(bitcoindCmd).run(); log.info("Starting ...\n$ {}", cmd.getCommand()); if (cmd.getExitStatus() != 0) throw new IllegalStateException("Error starting bitcoind:\n" + cmd.getError()); pid = BashCommand.getPid("bitcoind"); if (!isAlive(pid)) throw new IllegalStateException("Error starting regtest bitcoind daemon:\n" + cmd.getCommand()); log.info("Running with pid {}", pid); log.info("Log {}", config.bitcoinDatadir + "/regtest/debug.log"); }

Target:
public void start() throws InterruptedException, IOException { String berkeleyDbLibPathExport = config.berkeleyDbLibPath.equals(EMPTY) ? EMPTY : "export LD_LIBRARY_PATH=" + config.berkeleyDbLibPath + "; "; String bitcoindCmd = berkeleyDbLibPathExport + config.bitcoinPath + "/bitcoind" + " -datadir=" + config.bitcoinDatadir + " -daemon" + " -regtest=1" + " -server=1" + " -txindex=1" + " -peerbloomfilters=1" + " -debug=net" + " -fallbackfee=0.0002" + " -rpcport=" + config.bitcoinRpcPort + " -rpcuser=" + config.bitcoinRpcUser + " -rpcpassword=" + config.bitcoinRpcPassword + " -blocknotify=" + config.bitcoinDatadir + "/blocknotify"; BashCommand cmd = new BashCommand(bitcoindCmd).run(); log.info("Starting ...\n$ {}", cmd.getCommand()); if (cmd.getExitStatus() != 0) { startupExceptions.add(new IllegalStateException( format("Error starting bitcoind%nstatus: %d%nerror msg: %s", cmd.getExitStatus(), cmd.getError()))); return; } pid = BashCommand.getPid("bitcoind"); if (!isAlive(pid)) throw new IllegalStateException("Error starting regtest bitcoind daemon:\n" + cmd.getCommand()); log.info("Running with pid {}", pid); log.info("Log {}", config.bitcoinDatadir + "/regtest/debug.log"); }
Source:
private void sendCommand(ReplicableCommand command, List<LuceneWork> workList, boolean sync) { CompletionStages.join(rpcManager.invokeCommand(recipients, command, VoidResponseCollector.ignoreLeavers(), rpcManager.getSyncRpcOptions())); log.workListRemotedTo(workList, masterAddress); }

Target:
private void sendCommand(ReplicableCommand command, List<LuceneWork> workList, boolean sync) { if (sync) { CompletionStage<Void> completionStage = rpcManager.invokeCommand(recipient, command, VoidResponseCollector.ignoreLeavers(), rpcManager.getSyncRpcOptions()); rpcManager.blocking(completionStage); } else { rpcManager.sendTo(recipient, command, DeliverOrder.PER_SENDER); } log.workListRemotedTo(workList, masterAddress); }
Source:
public List<RGB> sample(List<Point> samplePoints) { for (Point p : samplePoints) { if (!getBounds().contains(p)) { throw new IllegalArgumentException("Pixel outside of picture"); } } List<RGB> retVal = new ArrayList<>(samplePoints.size()); for (Point p : samplePoints) { retVal.add(getPixel(p.x, p.y)); } return retVal; }

Target:
public List<RGB> sample(List<Point> samplePoints) { for (Point p : samplePoints) { if (!getBounds().contains(p)) { throw new IllegalArgumentException("Pixel outside of the image"); } } List<RGB> retVal = new ArrayList<>(samplePoints.size()); for (Point p : samplePoints) { retVal.add(getPixel(p.x, p.y)); } return retVal; }
Source:
public void onPrepared() { isPrepared = true; if (!isResumed() || (getParentFragment() != null && !getParentFragment().getUserVisibleHint())) { freezePlayer(); return; } environment.getSegment().trackVideoLoading(videoEntry.videoId, videoEntry.eid, videoEntry.lmsUrl); clearAllErrors(); initializeClosedCaptioning(); allowSensorOrientation(); if (IS_AUTOPLAY_ENABLED && !isPaused) { handler.postDelayed(unfreezeCallback, UNFREEZE_DELAY_MS); } else { updateController("player paused"); } }

Target:
public void onPrepared() { isPrepared = true; allowSensorOrientation(); if (!isResumed() || (getParentFragment() != null && !getParentFragment().getUserVisibleHint())) { freezePlayer(); return; } clearAllErrors(); initializeClosedCaptioning(); if (IS_AUTOPLAY_ENABLED) { handler.postDelayed(unfreezeCallback, UNFREEZE_DELAY_MS); } environment.getSegment().trackVideoLoading(videoEntry.videoId, videoEntry.eid, videoEntry.lmsUrl); }
Source:
private Features(Map<String, VersionRangeType> features) { if (features == null) { throw new IllegalArgumentException("Provided features can not be null."); } this.features = features; }

Target:
private Features(Map<String, VersionRangeType> features) { Objects.requireNonNull(features, "Provided features can not be null."); this.features = features; }
Source:
private void setChangeDetails(TissueOrigin tissueOrigin) throws IOException { User user = authorizationManager.getCurrentUser(); Date now = new Date(); tissueOrigin.setUpdatedBy(user); if (tissueOrigin.getId() == Array.UNSAVED_ID) { tissueOrigin.setCreatedBy(user); if (tissueOrigin.getCreationDate() == null) { tissueOrigin.setCreationDate(now); } if (tissueOrigin.getLastUpdated() == null) { tissueOrigin.setLastUpdated(now); } } else { tissueOrigin.setLastUpdated(now); } }

Target:
private void setChangeDetails(TissueOrigin tissueOrigin) throws IOException { User user = authorizationManager.getCurrentUser(); Date now = new Date(); tissueOrigin.setUpdatedBy(user); if (tissueOrigin.getId() == TissueOrigin.UNSAVED_ID) { tissueOrigin.setCreatedBy(user); if (tissueOrigin.getCreationDate() == null) { tissueOrigin.setCreationDate(now); } if (tissueOrigin.getLastUpdated() == null) { tissueOrigin.setLastUpdated(now); } } else { tissueOrigin.setLastUpdated(now); } }
Source:
public void handle() { if (running.containsKey(task.getId())) { log.warn( "Got run notice for task [%s] that I am already running...", task.getId() ); workerCuratorCoordinator.unannounceTask(task.getId()); return; } log.info("Submitting runnable for task[%s]", task.getId()); workerCuratorCoordinator.updateAnnouncement( TaskAnnouncement.create( task, TaskStatus.running(task.getId()), TaskLocation.unknown() ) ); log.info("Affirmative. Running task [%s]", task.getId()); workerCuratorCoordinator.unannounceTask(task.getId()); final ListenableFuture<TaskStatus> future = taskRunner.run(task); addRunningTask(task, future); }

Target:
public void handle() { if (running.containsKey(task.getId())) { log.warn( "Got run notice for task [%s] that I am already running...", task.getId() ); workerCuratorCoordinator.removeTaskRunZnode(task.getId()); return; } log.info("Submitting runnable for task[%s]", task.getId()); workerCuratorCoordinator.updateTaskStatusAnnouncement( TaskAnnouncement.create( task, TaskStatus.running(task.getId()), TaskLocation.unknown() ) ); log.info("Affirmative. Running task [%s]", task.getId()); workerCuratorCoordinator.removeTaskRunZnode(task.getId()); final ListenableFuture<TaskStatus> future = taskRunner.run(task); addRunningTask(task, future); }
Source:
public void getMandatoryModules_shouldReturnMandatoryModuleIds() throws Exception { executeDataSet("org/openmrs/module/include/mandatoryModulesGlobalProperties.xml"); Assert.assertEquals(1, ModuleUtil.getMandatoryModules().size()); Assert.assertEquals("firstmodule", ModuleUtil.getMandatoryModules().get(0)); }

Target:
public void getMandatoryModules_shouldReturnMandatoryModuleIds() throws Exception { GlobalProperty gp1 = new GlobalProperty("firstmodule.mandatory", "true"); GlobalProperty gp2 = new GlobalProperty("secondmodule.mandatory", "false"); when(administrationService.getGlobalPropertiesBySuffix(".mandatory")).thenReturn(Arrays.asList(gp1, gp2)); assertThat(ModuleUtil.getMandatoryModules(), contains("firstmodule")); }
Source:
private AsyncTaskManager() { _tasks = new HashMap<Guid, SPMAsyncTask>(); SchedulerUtil scheduler = SchedulerUtilQuartzImpl.getInstance(); scheduler.scheduleAConfigurableDelayJob(this, "_timer_Elapsed", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.AsyncTaskPollingRate), ConfigValues.AsyncTaskPollingRate.toString(), TimeUnit.SECONDS); scheduler.scheduleAFixedDelayJob(this, "_cacheTimer_Elapsed", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCacheRefreshRateInSeconds), Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCacheRefreshRateInSeconds), TimeUnit.SECONDS); _cacheTimeInMinutes = Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCachingTimeInMinutes); }

Target:
private AsyncTaskManager() { _tasks = new HashMap<Guid, SPMAsyncTask>(); SchedulerUtil scheduler = SchedulerUtilQuartzImpl.getInstance(); scheduler.scheduleAConfigurableDelayJob(this, "_timer_Elapsed", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.AsyncTaskPollingRate), ConfigValues.AsyncTaskPollingRate.name(), TimeUnit.SECONDS); scheduler.scheduleAFixedDelayJob(this, "_cacheTimer_Elapsed", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCacheRefreshRateInSeconds), Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCacheRefreshRateInSeconds), TimeUnit.SECONDS); _cacheTimeInMinutes = Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCachingTimeInMinutes); }
Source:
public static PartitionStatistics createEmptyPartitionStatistics(Map<String, Type> columnTypes, Map<String, Set<ColumnStatisticType>> columnStatisticsMetadataTypes) { Map<String, HiveColumnStatistics> columnStatistics = columnStatisticsMetadataTypes.entrySet().stream() .peek(entry -> verify(columnTypes.containsKey(entry.getKey()))) .collect(toImmutableMap(Entry::getKey, entry -> createColumnStatisticsForEmptyPartition(columnTypes.get(entry.getKey()), entry.getValue()))); return new PartitionStatistics(createZeroStatistics(), columnStatistics); }

Target:
public static PartitionStatistics createEmptyPartitionStatistics(Map<String, Type> columnTypes, Map<String, Set<ColumnStatisticType>> columnStatisticsMetadataTypes) { Map<String, HiveColumnStatistics> columnStatistics = columnStatisticsMetadataTypes.entrySet().stream() .collect(toImmutableMap(Entry::getKey, entry -> createColumnStatisticsForEmptyPartition(columnTypes.get(entry.getKey()), entry.getValue()))); return new PartitionStatistics(createZeroStatistics(), columnStatistics); }
Source:
protected void configure() { install(new IndexModule(1)); bind(ChangeIndex.class).to(DummyIndex.class); listener().to(DummyIndex.class); }

Target:
protected void configure() { install(new IndexModule(1)); bind(ChangeIndex.class).toInstance(new DummyIndex()); }
Source:
private void createAmbiguousSymbols() { for (Scope scope : scopesByRootTree.values()) { Set<SymbolToUpdate> symbolsToUpdate = new HashSet<>(); for (Symbol symbol : scope.symbols()) { if (symbol.kind() == Symbol.Kind.OTHER) { List<Usage> bindingUsages = symbol.usages().stream().filter(Usage::isBindingUsage).collect(Collectors.toList()); if (bindingUsages.size() > 1) { Set<Symbol> alternativeDefinitions = getAlternativeDefinitions(symbol, bindingUsages); AmbiguousSymbol ambiguousSymbol = AmbiguousSymbolImpl.create(alternativeDefinitions); symbol.usages().forEach(usage -> ((SymbolImpl) ambiguousSymbol).addUsage(usage.tree(), usage.kind())); symbolsToUpdate.add(new SymbolToUpdate(symbol, ambiguousSymbol)); } } } symbolsToUpdate.forEach(symbolToUpdate -> scope.replaceSymbolWithAmbiguousSymbol(symbolToUpdate.symbol, symbolToUpdate.ambiguousSymbol)); } }

Target:
private void createAmbiguousSymbols() { for (Scope scope : scopesByRootTree.values()) { Set<SymbolToUpdate> symbolsToUpdate = new HashSet<>(); for (Symbol symbol : scope.symbols()) { if (symbol.kind() == Symbol.Kind.OTHER) { List<Usage> bindingUsages = symbol.usages().stream().filter(Usage::isBindingUsage).collect(Collectors.toList()); if (bindingUsages.size() > 1 && bindingUsages.stream().anyMatch(usage -> usage.kind() == Usage.Kind.FUNC_DECLARATION || usage.kind() == Usage.Kind.CLASS_DECLARATION)) { Set<Symbol> alternativeDefinitions = getAlternativeDefinitions(symbol, bindingUsages); AmbiguousSymbol ambiguousSymbol = AmbiguousSymbolImpl.create(alternativeDefinitions); symbol.usages().forEach(usage -> ((SymbolImpl) ambiguousSymbol).addUsage(usage.tree(), usage.kind())); symbolsToUpdate.add(new SymbolToUpdate(symbol, ambiguousSymbol)); } } } symbolsToUpdate.forEach(symbolToUpdate -> scope.replaceSymbolWithAmbiguousSymbol(symbolToUpdate.symbol, symbolToUpdate.ambiguousSymbol)); } }
Source:
private Channel getChannel(ChannelCachingConnectionProxy connection, boolean transactional) { LinkedList<ChannelProxy> channelList; if (this.cacheMode == CacheMode.CHANNEL) { channelList = transactional ? this.cachedChannelsTransactional : this.cachedChannelsNonTransactional; } else { channelList = transactional ? this.openConnectionTransactionalChannels.get(connection) : this.openConnectionNonTransactionalChannels.get(connection); } Channel channel = null; synchronized (channelList) { if (!channelList.isEmpty()) { channel = channelList.removeFirst(); } } if (channel != null) { if (logger.isTraceEnabled()) { logger.trace("Found cached Rabbit Channel"); } } else { channel = getCachedChannelProxy(connection, channelList, transactional); } return channel; }

Target:
private Channel getChannel(ChannelCachingConnectionProxy connection, boolean transactional) { LinkedList<ChannelProxy> channelList; if (this.cacheMode == CacheMode.CHANNEL) { channelList = transactional ? this.cachedChannelsTransactional : this.cachedChannelsNonTransactional; } else { channelList = transactional ? this.openConnectionTransactionalChannels.get(connection) : this.openConnectionNonTransactionalChannels.get(connection); } if (channelList == null) { channelList = new LinkedList<ChannelProxy>(); if (transactional) { this.openConnectionTransactionalChannels.put(connection, channelList); } else { this.openConnectionNonTransactionalChannels.put(connection, channelList); } } Channel channel = null; if (connection.isOpen()) { synchronized (channelList) { while (!channelList.isEmpty()) { channel = channelList.removeFirst(); if (channel.isOpen()) { break; } else { channel = null; } } } if (channel != null) { if (logger.isTraceEnabled()) { logger.trace("Found cached Rabbit Channel: " + channel.toString()); } } } if (channel == null) { channel = getCachedChannelProxy(connection, channelList, transactional); } return channel; }
Source:
public static boolean handleError(@NonNull HelperActivityBase activity, @NonNull Exception e) { if (e instanceof IntentRequiredException) { IntentRequiredException typed = (IntentRequiredException) e; activity.startActivityForResult(typed.getIntent(), typed.getRequestCode()); return true; } else if (e instanceof PendingIntentRequiredException) { PendingIntentRequiredException typed = (PendingIntentRequiredException) e; startIntentSenderForResult(activity, typed.getPendingIntent(), typed.getRequestCode()); return true; } else { return false; } }

Target:
public static boolean handleError(@NonNull HelperActivityBase activity, @NonNull Exception e) { if (e instanceof IntentRequiredException) { IntentRequiredException typed = (IntentRequiredException) e; activity.startActivityForResult(typed.getIntent(), typed.getRequestCode()); return true; } else if (e instanceof PendingIntentRequiredException) { PendingIntentRequiredException typed = (PendingIntentRequiredException) e; startIntentSenderForResult(activity, typed.getPendingIntent(), typed.getRequestCode()); return true; } return false; }
Source:
private void failValidationCannotPlugPassthroughVnicNoSuitableVf() { failValidation(EngineMessage.CANNOT_PLUG_PASSTHROUGH_VNIC_NO_SUITABLE_VF, String.format("$vnicName %1$s", getInterfaceName())); }

Target:
private boolean failValidationCannotPlugPassthroughVnicNoSuitableVf() { return failValidation(EngineMessage.CANNOT_PLUG_PASSTHROUGH_VNIC_NO_SUITABLE_VF, String.format("$vnicName %1$s", getInterfaceName())); }
Source:
public String updateStory(String storyJson) throws SQLException { StoryObject editStoryObj = new Gson().fromJson(storyJson, StoryObject.class); StoryObject newStoryObj = new StoryObject(mProductBacklogHelper.editStory(editStoryObj.toStoryInformation())); for (TagObject originTag : newStoryObj.tagList) { boolean isExist = false; for (TagObject editTag : editStoryObj.tagList) if (originTag.getName().equals(editTag.getName())) isExist = true; if (!isExist) { mProductBacklogHelper.removeStoryTag(newStoryObj.id, originTag.getId()); } else editStoryObj.tagList.remove(originTag); } for (TagObject editTag : editStoryObj.tagList) { System.out.println("editTag : " + editTag); mProductBacklogHelper.addStoryTag(editStoryObj.id, editTag.getId()); } newStoryObj = new StoryObject(mProductBacklogHelper.getStory(Long.parseLong(newStoryObj.id))); Gson gson = new Gson(); return gson.toJson(newStoryObj); }

Target:
public String updateStory(String storyJson) throws SQLException { StoryObject editStoryObj = new Gson().fromJson(storyJson, StoryObject.class); StoryObject newStory = new StoryObject(mProductBacklogHelper.editStory(editStoryObj.toStoryInformation())); for (TagObject originTag : newStory.tagList) { boolean isExist = false; for (TagObject editTag : editStoryObj.tagList) if (originTag.getName().equals(editTag.getName())) isExist = true; if (!isExist) { mProductBacklogHelper.removeTagFromStory(newStory.id, originTag.getId()); } else editStoryObj.tagList.remove(originTag); } for (TagObject editTag : editStoryObj.tagList) { System.out.println("editTag : " + editTag); mProductBacklogHelper.addTagToStory(editStoryObj.id, editTag.getId()); } newStory = new StoryObject(mProductBacklogHelper.getStory(Long.parseLong(newStory.id))); Gson gson = new Gson(); return gson.toJson(newStory); }
Source:
public void setWaterLevelIncrementScore(Score waterLevelIncrementScore) { this.waterLevelIncrementScore = waterLevelIncrementScore; this.waterLevelIncrementRatio = null; }

Target:
public void setWaterLevelIncrementScore(Score waterLevelIncrementScore) { this.waterLevelIncrementScore = waterLevelIncrementScore; }
Source:
public NodeMaskingFigure(IFigure decorated) { this.decorated = decorated; setLayoutManager(new XYLayout()); setOpaque(true); setFill(true); setOutline(false); IGraphicalEditPart backgroundPart = getDecoratedInterestingParent(getEditPart()); if (backgroundPart instanceof ShapeNodeEditPart) { setBackgroundColor(((IFigure) backgroundPart.getFigure().getChildren().get(0)).getBackgroundColor()); } else { setBackgroundColor(backgroundPart.getFigure().getBackgroundColor()); } setAlpha(255); }

Target:
public NodeMaskingFigure(IFigure decorated) { this.decorated = decorated; setLayoutManager(new XYLayout()); setOpaque(true); setFill(true); setOutline(false); IGraphicalEditPart backgroundPart = getDecoratedInterestingParent(getEditPart()); setBackgroundColor(getBackgroundColor(backgroundPart)); setAlpha(255); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { chain.doFilter(request,response); } catch (ServletException e) { Throwable t = e.getRootCause(); while (t != null && !(t instanceof JellyTagException)) { if (t instanceof ServletException) { t = ((ServletException) t).getRootCause(); } else { t = t.getCause(); } } if (t != null) { JellyTagException jte = (JellyTagException) t; Throwable cause = jte.getCause(); if (cause instanceof AcegiSecurityException) { AcegiSecurityException se = (AcegiSecurityException) cause; throw new ServletException(se); } } throw e; } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { chain.doFilter(request,response); } catch (ServletException e) { Throwable t = e.getRootCause(); if (t != null && !(t instanceof JellyTagException)) { if (t instanceof ServletException) { t = ((ServletException) t).getRootCause(); } else { t = t.getCause(); } } if (t != null && t instanceof JellyTagException) { JellyTagException jte = (JellyTagException) t; Throwable cause = jte.getCause(); if (cause instanceof AcegiSecurityException) { AcegiSecurityException se = (AcegiSecurityException) cause; throw new ServletException(se); } } throw e; } }