auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>static ImageLoadListener getImageLoadListener(ImageView view) { if(view != null) { ViewData data = (ViewData) view.getTag(); if(data != null) { return data.mListener; } } <START> return null; <END> }</code><technical_language>null object pattern caller worry if this function return null</technical_language>

Target:
static ImageLoadListener getImageLoadListener(ImageView view) { if(view != null) { ViewData data = (ViewData) view.getTag(); if(data != null) { return data.mListener; } } return NULL_LISTENER; }
Source:
<code>public void onMapReady(MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; addRadar(mapboxMap); refreshGeoJsonRunnable = new RefreshGeoJsonRunnable(); <START> do { <END> handler.postDelayed(refreshGeoJsonRunnable, 1000); } while (index == 39); }</code><technical_language>this do/while statements here</technical_language>

Target:
public void onMapReady(MapboxMap mapboxMap) { addRadar(mapboxMap); refreshGeoJsonRunnable = new RefreshGeoJsonRunnable(); do { handler.postDelayed(refreshGeoJsonRunnable, 1000); } while (index == 39); }
Source:
<code>public void shouldParseComplexAggregateQuery() { NativeQueryParser parser = Parboiled.createParser( NativeQueryParser.class ); String match = "{ '$match': { 'NAME':{'$regex':'Bangalore', '$options': 'i'}}}"; String unwind = "{'$unwind': '$clicks'}"; String group = "{ '$group': {'_id' : '$_id' ,'clicks' : $push: $clicks ,'token' : { '$push': '$TOKEN' } } }"; String sort = "{ '$sort': { '_id' : -1 } }"; String nativeQuery = "db.UserFactualContent.aggregate([" + match + "," + unwind + "," + group + "," + sort + "])"; ParsingResult<MongoDBQueryDescriptor> run = new ReportingParseRunner<MongoDBQueryDescriptor>( parser.Query() ).run( nativeQuery ); MongoDBQueryDescriptor queryDescriptor = run.resultValue; assertThat( queryDescriptor.getCollectionName() ).isEqualTo( "UserFactualContent" ); assertThat( queryDescriptor.getOperation() ).isEqualTo( Operation.AGGREGATE_PIPELINE ); assertThat( queryDescriptor.getPipeline() ).containsExactly( Document.parse( match ), Document.parse( unwind ), Document.parse( group ), <START> Document.parse( sort ) ); <END> }</code><technical_language>Please avoid reformat automatically files. difficult find real changes in there. fix it, IDE compare versions bring changes purely reformatting. Thanks</technical_language>

Target:
public void shouldParseComplexAggregateQuery() { NativeQueryParser parser = Parboiled.createParser( NativeQueryParser.class ); String match = "{ '$match': { 'NAME':{'$regex':'Bangalore', '$options': 'i'}}}"; String unwind = "{'$unwind': '$clicks'}"; String group = "{ '$group': {'_id' : '$_id' ,'clicks' : $push: $clicks ,'token' : { '$push': '$TOKEN' } } }"; String sort = "{ '$sort': { '_id' : -1 } }"; String nativeQuery = "db.UserFactualContent.aggregate([" + match + "," + unwind + "," + group + "," + sort + "])"; ParsingResult<MongoDBQueryDescriptor> run = new BasicParseRunner<MongoDBQueryDescriptor>( parser.Query() ).run( nativeQuery ); MongoDBQueryDescriptor queryDescriptor = run.resultValue; assertThat( queryDescriptor.getCollectionName() ).isEqualTo( "UserFactualContent" ); assertThat( queryDescriptor.getOperation() ).isEqualTo( Operation.AGGREGATE_PIPELINE ); assertThat( queryDescriptor.getPipeline() ) .containsExactly( Document.parse( match ) , Document.parse( unwind ) , Document.parse( group ) , Document.parse( sort ) ); }
Source:
<code>public void removeItemsSelected() { <START> mItemsSelected = new SparseBooleanArray(); <END> notifyDataSetChanged(); }</code><technical_language>I call clear() mItemsSelected, final</technical_language>

Target:
public void removeItemsSelected() { mItemsSelected.clear(); notifyDataSetChanged(); }
Source:
<code>protected boolean existsColumnWithSameName(GridColumnPreference gridColumnPreference, List<ColumnMeta<T>> columns) { <START> for (ColumnMeta<T> columnMeta : columns) { <END> if (columnMeta.getCaption().equals(gridColumnPreference.getName())) { return true; } } return false; }</code><technical_language>suggestion return columns.stream().filter(meta -> meta.getCaption().equals(gridColumnPreference.getName())).findFirst().isPresent();</technical_language>

Target:
protected boolean existsColumnWithSameName(GridColumnPreference gridColumnPreference, List<ColumnMeta<T>> columns) { return columns.stream().filter(meta -> meta.getCaption().equals(gridColumnPreference.getName())).findFirst().isPresent(); }
Source:
<code>public Config(final String defaultConfigFilename, final String overrideConfigFilename) { final File defaultConfigFile = new File(defaultConfigFilename); final Environment defaultEnvironment = new ImmutableEnvironment(defaultConfigFile.getParent()); final ConfigurationSource defaultConfigSource = new FilesConfigurationSource(() -> Paths.get(defaultConfigFile.getName()) ); final ConfigurationProvider defaultConfigProvider = new ConfigurationProviderBuilder() .withEnvironment(defaultEnvironment) .withConfigurationSource(defaultConfigSource) .build(); final File overrideConfigFile = new File(overrideConfigFilename); final Environment overrideEnvironment = new ImmutableEnvironment(defaultConfigFile.getParent()); <START> if (new File(overrideConfigFilename).exists()) { <END> final ConfigurationSource configSource = new MergeConfigurationSource( defaultConfigSource, new FilesConfigurationSource(() -> Paths.get(overrideConfigFile.getName()))); configProvider = new ConfigurationProviderBuilder() .withEnvironment(overrideEnvironment) .withConfigurationSource(configSource) .build(); } else { configProvider = defaultConfigProvider; } }</code><technical_language>a file object! need for a new</technical_language>

Target:
public Config(final String defaultConfigFilename, final String overrideConfigFilename) { final File defaultConfigFile = new File(defaultConfigFilename); final Environment defaultEnvironment = new ImmutableEnvironment(defaultConfigFile.getParent()); final ConfigurationSource defaultConfigSource = new FilesConfigurationSource(() -> Paths.get(defaultConfigFile.getName()) ); final ConfigurationProvider defaultConfigProvider = new ConfigurationProviderBuilder() .withEnvironment(defaultEnvironment) .withConfigurationSource(defaultConfigSource) .build(); final File overrideConfigFile = new File(overrideConfigFilename); final Environment overrideEnvironment = new ImmutableEnvironment(defaultConfigFile.getParent()); if (overrideConfigFile.exists()) { final ConfigurationSource configSource = new MergeConfigurationSource( defaultConfigSource, new FilesConfigurationSource(() -> Paths.get(overrideConfigFile.getName()))); configProvider = new ConfigurationProviderBuilder() .withEnvironment(overrideEnvironment) .withConfigurationSource(configSource) .build(); } else { configProvider = defaultConfigProvider; } }
Source:
<code>public static boolean createSlackMessage(List<FoundFailureCause> foundCauseList, boolean notifySlackOfAllFailures, List<String> slackFailureCauseCategories, String buildName, String buildNum, String buildUrl, PrintStream scanLog) { boolean notifySlackOfFailure = false; StringBuffer bufBuildFailCause = new StringBuffer(); for (int i = 0; i < foundCauseList.size(); i++) { if (!notifySlackOfAllFailures) { List<String> categories = foundCauseList.get(i).getCategories(); if (categories != null) { for (int j = 0; j < categories.size(); j++) { String category = categories.get(j); if (failureCategoryMatches(category, slackFailureCauseCategories)) { notifySlackOfFailure = true; break; } } } } <START> if (bufBuildFailCause.length() == 0) { <END> bufBuildFailCause.append(foundCauseList.get(i).getName()); } else { bufBuildFailCause.append("\n"); bufBuildFailCause.append(foundCauseList.get(i).getName()); } } if (notifySlackOfAllFailures || notifySlackOfFailure) { SlackMessageProvider slack = new SlackMessageProvider(); StringBuilder s = new StringBuilder("Job *\"" + buildName + "\"*"); s.append(" build *#" + buildNum + "* FAILED due to following failure causes: \n```"); s.append(bufBuildFailCause.toString() + "```\nSee "); s.append(buildUrl + " for details."); slack.postToSlack(s.toString(), scanLog); return true; } return false; }</code><technical_language>suggestion if (bufBuildFailCause.isEmpty()) {</technical_language>

Target:
public static boolean createSlackMessage(List<FoundFailureCause> foundCauseList, boolean notifySlackOfAllFailures, List<String> slackFailureCauseCategories, String buildName, String buildNum, String buildUrl, PrintStream scanLog) { boolean notifySlackOfFailure = false; StringBuilder bufBuildFailCause = new StringBuilder(); for (FoundFailureCause foundCause : foundCauseList) { if (!notifySlackOfAllFailures) { List<String> categories = foundCause.getCategories(); if (categories != null) { for (String category : categories) { if (failureCategoryMatches(category, slackFailureCauseCategories)) { notifySlackOfFailure = true; break; } } } } if (bufBuildFailCause.length() == 0) { bufBuildFailCause.append(foundCause.getName()); } else { bufBuildFailCause.append("\n"); bufBuildFailCause.append(foundCause.getName()); } } if (notifySlackOfAllFailures || notifySlackOfFailure) { SlackMessageProvider slack = new SlackMessageProvider(); StringBuilder s = new StringBuilder("Job *\"" + buildName + "\"*"); s.append(" build *#" + buildNum + "* FAILED due to following failure causes: \n```"); s.append(bufBuildFailCause.toString() + "```\nSee "); s.append(buildUrl + " for details."); slack.postToSlack(s.toString(), scanLog); return true; } return false; }
Source:
<code><START> public Map<String, String> getConfiguredAttributesMap(RealmConfiguration realmConfiguration) { <END> Map<String, String> attributeMap = new HashMap<>(); if (realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.groupIDAttribute) != null) { attributeMap.put(UserStoreConfigConstants.groupIDAttribute, realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.groupIDAttribute)); } if (realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.groupCreatedDateAttribute) != null) { attributeMap.put(UserStoreConfigConstants.groupCreatedDateAttribute, realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.groupCreatedDateAttribute)); } if (realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.groupModifiedDateAttribute) != null) { attributeMap.put(UserStoreConfigConstants.groupModifiedDateAttribute, realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.groupModifiedDateAttribute)); } return attributeMap; }</code><technical_language>add a method description(java-doc) here</technical_language>

Target:
public static Map<String, String> getConfiguredAttributesMap(RealmConfiguration realmConfiguration) { Map<String, String> attributeMap = new HashMap<>(); if (realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.GROUP_ID_ATTRIBUTE) != null) { attributeMap.put(UserStoreConfigConstants.GROUP_ID_ATTRIBUTE, realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.GROUP_ID_ATTRIBUTE)); } if (realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.GROUP_CREATED_DATE_ATTRIBUTE) != null) { attributeMap.put(UserStoreConfigConstants.GROUP_CREATED_DATE_ATTRIBUTE, realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.GROUP_CREATED_DATE_ATTRIBUTE)); } if (realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.GROUP_MODIFIED_DATE_ATTRIBUTE) != null) { attributeMap.put(UserStoreConfigConstants.GROUP_MODIFIED_DATE_ATTRIBUTE, realmConfiguration.getUserStoreProperty(UserStoreConfigConstants.GROUP_MODIFIED_DATE_ATTRIBUTE)); } return attributeMap; }
Source:
<code>public NetworkView getEntity() { <START> return (NetworkView) ((super.getEntity() instanceof NetworkView) ? super.getEntity() : null); <END> }</code><technical_language>is this check required? super.getEntity() instanceof NetworkView, if this is a subtab of networks main tab</technical_language>

Target:
public NetworkView getEntity() { return (NetworkView) super.getEntity(); }
Source:
<code>public void testAbsentEntityRetrievalFails() throws Throwable { Connection client = CLUSTER.newConnection(); try { <START> EntityRef<EhcacheClientEntity, ClusteredTierManagerConfiguration> ref = client.getEntityRef(EhcacheClientEntity.class, EhcacheEntityVersion.ENTITY_VERSION, "testAbsentEntityRetrievalFails"); <END> try { ref.fetchEntity(); fail("Expected EntityNotFoundException"); } catch (EntityNotFoundException e) { } } finally { client.close(); } }</code><technical_language>please extract a method retrieve test name a Rule</technical_language>

Target:
public void testAbsentEntityRetrievalFails() throws Throwable { Connection client = CLUSTER.newConnection(); try { EntityRef<EhcacheClientEntity, ClusteredTierManagerConfiguration> ref = getEntityRef(client); try { ref.fetchEntity(); fail("Expected EntityNotFoundException"); } catch (EntityNotFoundException e) { } } finally { client.close(); } }
Source:
<code>FrameworkLogEntry createLogEntry(IStatus status) { Throwable t = status.getException(); ArrayList childlist = new ArrayList(); int stackCode = t instanceof CoreException ? 1 : 0; if (stackCode == 1) { IStatus coreStatus = ((CoreException) t).getStatus(); if (coreStatus != null) { childlist.add(createLogEntry(coreStatus)); } } if (status.isMultiStatus()) { IStatus[] children = status.getChildren(); for (IStatus <START> element : <END> children) { childlist.add(createLogEntry(element)); } } FrameworkLogEntry[] children = (FrameworkLogEntry[]) (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()])); return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children); }</code><technical_language>rename 'child'</technical_language>

Target:
FrameworkLogEntry createLogEntry(IStatus status) { Throwable t = status.getException(); ArrayList childlist = new ArrayList(); int stackCode = t instanceof CoreException ? 1 : 0; if (stackCode == 1) { IStatus coreStatus = ((CoreException) t).getStatus(); if (coreStatus != null) { childlist.add(createLogEntry(coreStatus)); } } if (status.isMultiStatus()) { for (IStatus child : status.getChildren()) { childlist.add(createLogEntry(child)); } } FrameworkLogEntry[] children = (FrameworkLogEntry[]) (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()])); return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children); }
Source:
<code>public List<Registration> getRegistrations() { return Arrays.asList(new Registration[] { new Registration(MessageHeaders.class, new MessageHeadersSerializer(), MESSAGEHEADERS_ID), new Registration(MutableMessageHeaders.class, new MutableMessageHeadersSerializer(), MUTABLE_MESSAGEHEADERS_ID) <START> }); <END> }</code><technical_language>![redundant array](<LINK_0> I I agree IDEA in this context</technical_language>

Target:
public List<Registration> getRegistrations() { return Arrays.asList( new Registration(MessageHeaders.class, new MessageHeadersSerializer(), this.messageHeadersRegistrationId), new Registration(MutableMessageHeaders.class, new MutableMessageHeadersSerializer(), this.mutableMessageHeadersRegistrationId)); }
Source:
<code>public void test() throws IOException, InterruptedException { <START> try (final DockerClient client = DockerClientFactory.instance().client()) { <END> Instant startTime = Instant.now(); final AtomicBoolean received = new AtomicBoolean(false); EventsResultCallback callback = new EventsResultCallback() { @Override public void onNext(Event event) { if (event.getFrom().equals("alpine:latest") && event.getStatus().equals("create")) { received.set(true); } } }; GenericContainer container = new GenericContainer<>("alpine:latest") .withCommand("/bin/sh", "-c", "sleep 0") .withStartupCheckStrategy(new OneShotStartupCheckStrategy()); container.start(); Instant endTime = Instant.now(); client.eventsCmd() .withImageFilter("alpine:latest") .withEventFilter("create") .withSince(Long.toString(startTime.getEpochSecond())) .withUntil(Long.toString(endTime.getEpochSecond())) .exec(callback) .awaitCompletion() .close(); VisibleAssertions.assertTrue("Events has been captured", received.get()); } }</code><technical_language>I try-with-resources client is global</technical_language>

Target:
public void test() throws IOException, InterruptedException { CountDownLatch latch = new CountDownLatch(1); try ( GenericContainer container = new GenericContainer<>() .withCommand("true") .withStartupCheckStrategy(new OneShotStartupCheckStrategy()) ) { container.start(); String createdAt = container.getContainerInfo().getCreated(); try ( EventsResultCallback response = DockerClientFactory.instance().client().eventsCmd() .withContainerFilter(container.getContainerId()) .withEventFilter("create") .withSince(Instant.parse(createdAt).getEpochSecond() + "") .exec(new EventsResultCallback() { @Override public void onNext(@NotNull Event event) { if (event.getId().equals(container.getContainerId()) && event.getStatus().equals("create")) { latch.countDown(); } } }) ) { response.awaitStarted(5, TimeUnit.SECONDS); latch.await(5, TimeUnit.SECONDS); } } }
Source:
<code>private void handleMessageRetry(final ProtocolResponseMessage message, final ScheduledTask scheduledTask) { final String errorMessage = this.determineErrorMessage(message); <START> scheduledTask.setFailed(errorMessage); <END> scheduledTask.retryOn(message.getRetryHeader().getScheduledRetryTime()); this.scheduledTaskRepository.save(scheduledTask); }</code><technical_language>Replace lines with: scheduledTask.setFailed(this.determineErrorMessage(message));</technical_language>

Target:
private void handleMessageRetry(final ProtocolResponseMessage message, final ScheduledTask scheduledTask) { scheduledTask.setFailed(this.determineErrorMessage(message)); scheduledTask.retryOn(message.getRetryHeader().getScheduledRetryTime()); this.scheduledTaskRepository.save(scheduledTask); }
Source:
<code>public void testNativeQueryWithAliasSyntax() throws Exception { doInHibernate( this::sessionFactory, session -> { NativeQuery query = session.createNativeQuery( "SELECT ft.id as {ft.id}, ft.locationStart as {ft.locationStart}, ft.locationEnd as {ft.locationEnd}, abs(ft.locationEnd - locationStart) as {ft.distance} FROM foo_table ft") .addEntity( "ft", Foo.class ); Map<String,String> props = new HashMap<>(); props.put( "distance", "distance" ); <START> query.setProperties( props ); <END> List<Foo> list = query.getResultList(); assertEquals( 3, list.size() ); } ); }</code><technical_language>simplify a bit query.setProperties( Collections.singletonMap( "distance", "distance" ) )</technical_language>

Target:
public void testNativeQueryWithAliasSyntax() throws Exception { doInHibernate( this::sessionFactory, session -> { NativeQuery query = session.createNativeQuery( "SELECT ft.id as {ft.id}, ft.locationStart as {ft.locationStart}, ft.locationEnd as {ft.locationEnd}, abs(ft.locationEnd - locationStart) as {ft.distance} FROM foo_table ft") .addEntity( "ft", Foo.class ); query.setProperties( Collections.singletonMap( "distance", "distance" ) ); List<Foo> list = query.getResultList(); assertEquals( 3, list.size() ); } ); }
Source:
<code><START> public long getVersion() { <END> return version; }</code><technical_language>change this - other getters @Nullable public Long return objects instead of primitives</technical_language>

Target:
public Long getVersion() { return version; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof InstalledIUElement)) return false; if (iu == null) return false; if (!iu.equals(((InstalledIUElement) obj).getIU())) return false; Object parent = getParent(this); Object objParent = ((InstalledIUElement) obj).getParent(obj); if (parent == this && objParent == obj) <START> return true; <END> else if (parent != null && objParent != null) return parent.equals(objParent); else if (parent == null && objParent == null) return true; return false; }</code><technical_language>if I get it: this object cycle other object cycle, this object is other object. this object another object equal? cycles? return false here</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof InstalledIUElement)) return false; if (iu == null) return false; if (!iu.equals(((InstalledIUElement) obj).getIU())) return false; Object parent = getParent(this); Object objParent = ((InstalledIUElement) obj).getParent(obj); if (parent == this) return objParent == obj; else if (parent != null && objParent != null) return parent.equals(objParent); else if (parent == null && objParent == null) return true; return false; }
Source:
<code>protected TableViewerSWTBuilder createTableViewerSWTBuilder(Composite parent, @SuppressWarnings("rawtypes") IObservableList list, @SuppressWarnings("rawtypes") IObservableValue labelText, @SuppressWarnings("rawtypes") IObservableValue labelTooltipText, TableViewerCompositeBuilder compositeBuilder, ObservableListContentProvider cp, ECPTableViewerComparator comparator, TableActionBar<? extends AbstractTableViewer> actionBar) { <START> return createTableViewerSWTBuilder(parent, list, labelText, labelTooltipText, compositeBuilder, cp, comparator, <END> actionBar); }</code><technical_language>Deprecation is good, thanks! this method calls itself, work. I need create a ViewerComparator ECPTableViewerComparator</technical_language>

Target:
protected TableViewerSWTBuilder createTableViewerSWTBuilder(Composite parent, @SuppressWarnings("rawtypes") IObservableList list, @SuppressWarnings("rawtypes") IObservableValue labelText, @SuppressWarnings("rawtypes") IObservableValue labelTooltipText, TableViewerCompositeBuilder compositeBuilder, ObservableListContentProvider cp, ECPTableViewerComparator comparator, TableActionBar<? extends AbstractTableViewer> actionBar) { return createTableViewerSWTBuilder(parent, list, labelText, labelTooltipText, compositeBuilder, cp, (ViewerComparator) comparator, actionBar); }
Source:
<code>protected void configure() { super.configure(); bind(new TypeLiteral<ComputeServiceAdapter<VagrantNode, Hardware, Box, Location>>() { }).to(VagrantComputeServiceAdapter.class); bind(new TypeLiteral<Function<VagrantNode, NodeMetadata>>() { }).to(MachineToNodeMetadata.class); bind(new TypeLiteral<Function<MachineState, Status>>() { }).to(MachineStateToJcloudsStatus.class); bind(new TypeLiteral<Function<Box, Image>>() { }).to(BoxToImage.class); bind(new TypeLiteral<Function<Hardware, Hardware>>() { }).to(this.<Hardware>getIdentityFunction()); bind(new TypeLiteral<Function<Location, Location>>() { }).to(this.<Location>getIdentityFunction()); <START> bind(PopulateDefaultLoginCredentialsForImageStrategy.class).to(VagrantDefaultImageCredentials.class); <END> }</code><technical_language>Consider adding support for arbitrary cpu ram configurations: <LINK_0></technical_language>

Target:
protected void configure() { super.configure(); bind(new TypeLiteral<ComputeServiceAdapter<VagrantNode, Hardware, Box, Location>>() { }).to(new TypeLiteral<VagrantComputeServiceAdapter<Box>>() {}); bind(new TypeLiteral<Function<VagrantNode, NodeMetadata>>() { }).to(MachineToNodeMetadata.class); bind(new TypeLiteral<Function<Box, Image>>() { }).to(BoxToImage.class); bind(new TypeLiteral<Supplier<? extends Map<String, Hardware>>>() { }).to(VagrantHardwareSupplier.class).in(Singleton.class); bind(new TypeLiteral<Function<Hardware, Hardware>>() { }).to(this.<Hardware>castIdentityFunction()); bind(new TypeLiteral<Function<Location, Location>>() { }).to(this.<Location>castIdentityFunction()); bind(new TypeLiteral<Function<Collection<Box>, Collection<Box>>>() { }).to(OutdatedBoxesFilter.class); install(new FactoryModuleBuilder() .implement(new TypeLiteral<VagrantApiFacade<Box>>() {}, VagrantCliFacade.class) .build(new TypeLiteral<VagrantApiFacade.Factory<Box>>() {})); bind(PopulateDefaultLoginCredentialsForImageStrategy.class).to(VagrantDefaultImageCredentials.class); bind(TemplateBuilderImpl.class).to(ArbitraryCpuRamTemplateBuilderImpl.class); bind(CommandIOListener.class).to(VagrantWireLogger.class).in(Singleton.class); }
Source:
<code>public void launchExperiment(AuthzToken authzToken, final String airavataExperimentId, String gatewayId) throws AuthorizationException, AiravataSystemException, TException { RegistryService.Client regClient = registryClientPool.getResource(); SharingRegistryService.Client sharingClient = sharingClientPool.getResource(); try { ExperimentModel experiment = regClient.getExperiment(airavataExperimentId); String userId = authzToken.getClaimsMap().get(Constants.USER_NAME); <START> String entityId = experiment.getExecutionId(); <END> if (!sharingClient.userHasAccess(gatewayId, userId + "@" + gatewayId, entityId,gatewayId + ":READ")) { logger.error(airavataExperimentId, "User does not have access to application module {}.", entityId); throw new AuthorizationException("User does not have permission to access this resource"); } if (experiment == null) { logger.error(airavataExperimentId, "Error while launching experiment, experiment doesn't exist.", airavataExperimentId); throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system.."); } submitExperiment(gatewayId, airavataExperimentId); registryClientPool.returnResource(regClient); sharingClientPool.returnResource(sharingClient); } catch (Exception e1) { logger.error(airavataExperimentId, "Error while instantiate the registry instance", e1); AiravataSystemException exception = new AiravataSystemException(); exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR); exception.setMessage("Error while instantiate the registry instance. More info : " + e1.getMessage()); registryClientPool.returnBrokenResource(regClient); throw exception; } }</code><technical_language>execution id is application interface id. need fetch application interface get application module id it, check if user access application module id</technical_language>

Target:
public void launchExperiment(AuthzToken authzToken, final String airavataExperimentId, String gatewayId) throws TException { RegistryService.Client regClient = registryClientPool.getResource(); try { ExperimentModel experiment = regClient.getExperiment(airavataExperimentId); if (experiment == null) { logger.error(airavataExperimentId, "Error while launching experiment, experiment doesn't exist.", airavataExperimentId); throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system.."); } submitExperiment(gatewayId, airavataExperimentId); registryClientPool.returnResource(regClient); } catch (Exception e1) { logger.error(airavataExperimentId, "Error while instantiate the registry instance", e1); AiravataSystemException exception = new AiravataSystemException(); exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR); exception.setMessage("Error while instantiate the registry instance. More info : " + e1.getMessage()); registryClientPool.returnBrokenResource(regClient); throw exception; } }
Source:
<code>public CompactionDetails getCompactionDetails(long totalCapacity, long usedCapacity, long segmentCapacity, long segmentHeaderSize, List<String> logSegmentsNotInJournal, BlobStoreStats blobStoreStats) throws StoreException { CompactionDetails details = null; if (usedCapacity >= (storeConfig.storeMinUsedCapacityToTriggerCompactionInPercentage / 100.0) * totalCapacity) { if (logSegmentsNotInJournal != null) { <START> Pair<Long, NavigableMap<String, Long>> validDataPerLogSegments = blobStoreStats.getValidDataSizeByLogSegment( <END> new TimeRange(time.milliseconds() - messageRetentionTimeInMs, 0)); Iterator<Map.Entry<String, Long>> validEntryIterator = validDataPerLogSegments.getSecond().entrySet().iterator(); while (validEntryIterator.hasNext()) { Map.Entry<String, Long> validEntry = validEntryIterator.next(); if (!logSegmentsNotInJournal.contains(validEntry.getKey())) { validEntryIterator.remove(); } } CostBenefitInfo bestCandidateToCompact = getBestCandidateToCompact(validDataPerLogSegments.getSecond(), segmentCapacity, segmentHeaderSize, blobStoreStats.getMaxBlobSize()); if (bestCandidateToCompact != null) { List<String> segmentsToCompact = new ArrayList<>(validDataPerLogSegments.getSecond() .subMap(bestCandidateToCompact.getFirstLogSegmentName(), true, bestCandidateToCompact.getLastLogSegmentName(), true) .keySet()); details = new CompactionDetails(validDataPerLogSegments.getFirst(), segmentsToCompact); } } } return details; }</code><technical_language>name function i.e validDataSizeByLogSegment</technical_language>

Target:
public CompactionDetails getCompactionDetails(long totalCapacity, long usedCapacity, long segmentCapacity, long segmentHeaderSize, List<String> logSegmentsNotInJournal, BlobStoreStats blobStoreStats) throws StoreException { CompactionDetails details = null; if (usedCapacity >= (storeConfig.storeMinUsedCapacityToTriggerCompactionInPercentage / 100.0) * totalCapacity) { if (logSegmentsNotInJournal != null) { Pair<Long, NavigableMap<String, Long>> validDataSizeByLogSegment = blobStoreStats.getValidDataSizeByLogSegment( new TimeRange(time.milliseconds() - messageRetentionTimeInMs - ERROR_MARGIN_MS, ERROR_MARGIN_MS)); NavigableMap<String, Long> potentialLogSegmentValidSizeMap = validDataSizeByLogSegment.getSecond() .subMap(logSegmentsNotInJournal.get(0), true, logSegmentsNotInJournal.get(logSegmentsNotInJournal.size() - 1), true); CostBenefitInfo bestCandidateToCompact = getBestCandidateToCompact(potentialLogSegmentValidSizeMap, segmentCapacity, segmentHeaderSize, blobStoreStats.getMaxBlobSize()); if (bestCandidateToCompact != null) { details = new CompactionDetails(validDataSizeByLogSegment.getFirst(), bestCandidateToCompact.getSegmentsToCompact()); } } } return details; }
Source:
<code>public static CheckpointedInputGate createCheckpointedInputGate( AbstractInvokable toNotifyOnCheckpoint, StreamConfig config, SubtaskCheckpointCoordinator checkpointCoordinator, IndexedInputGate[] inputGates, TaskIOMetricGroup taskIOMetricGroup, String taskName) { return createCheckpointedMultipleInputGate( toNotifyOnCheckpoint, config, checkpointCoordinator, taskIOMetricGroup, taskName, <START> Arrays.asList(inputGates))[0]; <END> }</code><technical_language>add a check returned is a single-element array prevent future bugs</technical_language>

Target:
public static CheckpointedInputGate createCheckpointedInputGate( AbstractInvokable toNotifyOnCheckpoint, StreamConfig config, SubtaskCheckpointCoordinator checkpointCoordinator, IndexedInputGate[] inputGates, TaskIOMetricGroup taskIOMetricGroup, String taskName) { CheckpointedInputGate[] checkpointedInputGates = createCheckpointedMultipleInputGate( toNotifyOnCheckpoint, config, checkpointCoordinator, taskIOMetricGroup, taskName, Arrays.asList(inputGates)); return Iterables.getOnlyElement(Arrays.asList(checkpointedInputGates)); }
Source:
<code>private void notifyRejected(@CheckForNull Class<?> clazz, @CheckForNull String clazzName, String message) { Throwable cause = null; <START> if (LOGGER.isLoggable(Level.INFO)) { <END> cause = new SecurityException("Class rejected by the class filter: " + (clazz != null ? clazz.getName() : clazzName)); } LOGGER.log(Level.WARNING, message, cause); }</code><technical_language>this FINE, this PR default introduce noise</technical_language>

Target:
private void notifyRejected(@CheckForNull Class<?> clazz, @CheckForNull String clazzName, String message) { Throwable cause = null; if (LOGGER.isLoggable(Level.FINE)) { cause = new SecurityException("Class rejected by the class filter: " + (clazz != null ? clazz.getName() : clazzName)); } LOGGER.log(Level.WARNING, message, cause); }
Source:
<code>public void testSetSubject() throws Exception { doReturn(ExchangeVersion.Exchange2010_SP2).when(exchangeService).getRequestedServerVersion(); Appointment appointment = new Appointment(exchangeService); final String subject = "Lorem Ipsum"; appointment.setSubject(subject); <START> assertThat(appointment.getSubject(), allOf(not(isEmptyOrNullString()), equalTo(subject))); <END> }</code><technical_language>Do need null check? is equal subject</technical_language>

Target:
public void testSetSubject() throws Exception { doReturn(ExchangeVersion.Exchange2010_SP2).when(exchangeService).getRequestedServerVersion(); Appointment appointment = new Appointment(exchangeService); final String subject = "Lorem Ipsum"; appointment.setSubject(subject); assertThat(appointment.getSubject(), is(equalTo(subject))); }
Source:
<code>public int hashCode() { int hashCode = (int)version ^ "getblocks".hashCode() ^ stopHash.hashCode(); <START> return locator.hashCode(hashCode); <END> }</code><technical_language>..so pass "intial hashcode" location.hashCode(...) instead mix hash codes here. Guava Objects.hashCode() help</technical_language>

Target:
public int hashCode() { int hashCode = (int) version ^ "getblocks".hashCode() ^ stopHash.hashCode(); return hashCode ^= locator.hashCode(); }
Source:
<code>public void newSinkPerThread() throws Exception { List<Thread> threads = new ArrayList<>(); <START> Set<FluxSink> sinks = new HashSet<>(); <END> for (int i = 0; i < THREAD_TEST; i++) { Thread thread = new Thread(() -> { Transaction tx = mock(Transaction.class); try { try { TransactionCoordination.getInstance().bindTransaction(tx); FluxSink sink = txSupplier.get(); assertThat(txSupplier.get(), is(sink)); synchronized (sinks) { sinks.add(sink); } } finally { TransactionCoordination.getInstance().unbindTransaction(tx); } } catch (TransactionException e) { } }); threads.add(thread); } for (Thread t : threads) { t.start(); } for (Thread t : threads) { t.join(); } assertThat(sinks, hasSize(THREAD_TEST)); }</code><technical_language>this a synchronizedSet instead of synchronizing trhead</technical_language>

Target:
public void newSinkPerThread() throws Exception { List<Thread> threads = new ArrayList<>(); Set<FluxSink> sinks = synchronizedSet(new HashSet<>()); for (int i = 0; i < THREAD_TEST; i++) { Thread thread = new Thread(() -> { Transaction tx = mock(Transaction.class); try { try { TransactionCoordination.getInstance().bindTransaction(tx); FluxSink sink = txSupplier.get(); assertThat(txSupplier.get(), is(sink)); sinks.add(sink); } finally { TransactionCoordination.getInstance().unbindTransaction(tx); } } catch (TransactionException e) { } }); threads.add(thread); } for (Thread t : threads) { t.start(); } for (Thread t : threads) { t.join(); } assertThat(sinks, hasSize(THREAD_TEST)); }
Source:
<code>public ValidationResult validateMacAddress(List<? extends VmNic> vmNics) { for (VmNic iface : vmNics) { String <START> str = <END> iface.getMacAddress(); if (str != null) { if (!VALIDATE_MAC_ADDRESS.matcher(iface.getMacAddress()).matches()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_NETWORK_INTERFACE_MAC_INVALID, String.format("$IfaceName %1$s", iface.getName()), String.format("$MacAddress %1$s", iface.getMacAddress())); } } } return ValidationResult.VALID; }</code><technical_language>please inline this variable</technical_language>

Target:
public ValidationResult validateMacAddress(List<? extends VmNic> vmNics) { for (VmNic iface : vmNics) { if (iface.getMacAddress() != null) { if (!VALIDATE_MAC_ADDRESS.matcher(iface.getMacAddress()).matches()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_NETWORK_INTERFACE_MAC_INVALID, String.format("$IfaceName %1$s", iface.getName()), String.format("$MacAddress %1$s", iface.getMacAddress())); } } } return ValidationResult.VALID; }
Source:
<code>public void testLogReturnDoesntLogWhenNoAnnotation() throws Exception { Log log = mock(Log.class); <START> LoggedUtils.logReturn(log, "", new Object(), new Object()); <END> }</code><technical_language>Need verify interactions log</technical_language>

Target:
public void testLogReturnDoesntLogWhenNoAnnotation() throws Exception { Log log = mock(Log.class); LoggedUtils.logReturn(log, "", new Object(), new Object()); verifyZeroInteractions(log); }
Source:
<code>public ChaosZKClient(String quorum) { this.quorum = quorum; try { this.createNewZKConnection(); } catch (IOException e) { <START> LOG.error("Error creating ZooKeeper Connection: " + e); <END> } }</code><technical_language>Exception argument</technical_language>

Target:
public ChaosZKClient(String quorum) { this.quorum = quorum; try { this.createNewZKConnection(); } catch (IOException e) { LOG.error("Error creating ZooKeeper Connection: ", e); } }
Source:
<code>public static void beforeClass() { SWTBotUtils.initialize(); Thread.currentThread().setName("SWTBotTest"); SWTBotPreferences.TIMEOUT = 60000; SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; SWTWorkbenchBot bot = new SWTWorkbenchBot(); SWTBotUtils.closeView("welcome", bot); <START> prepareWorkspace(); <END> WaitUtils.waitForJobs(); SWTBotUtils.createProject(PROJECT_NAME); }</code><technical_language>Implementing classes able override this method do stuff prepare workspace. static, is do so</technical_language>

Target:
public void beforeClass() { SWTBotUtils.initialize(); Thread.currentThread().setName("SWTBotTest"); SWTBotPreferences.TIMEOUT = 60000; SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; SWTWorkbenchBot bot = new SWTWorkbenchBot(); SWTBotUtils.closeView("welcome", bot); prepareWorkspace(); WaitUtils.waitForJobs(); SWTBotUtils.createProject(PROJECT_NAME); }
Source:
<code>private void launchZendeskMyTickets() { if (isFinishing() || getIntent() == null) { return; } mBottomNav.setCurrentPosition(PAGE_ME); initSelectedSite(); <START> ActivityLauncher.viewZendeskTickets( <END> this, getSelectedSite(), null); }</code><technical_language>Nitpick: This is 120 chars, I need separate parameters in lines. done generally recommended separate one, able follow pattern</technical_language>

Target:
private void launchZendeskMyTickets() { if (isFinishing()) { return; } mBottomNav.setCurrentPosition(PAGE_ME); initSelectedSite(); ActivityLauncher.viewZendeskTickets(this, getSelectedSite()); }
Source:
<code>private ClientConfiguration buildClientConfig(Properties properties) { ClientConfiguration clientConfig = new ClientConfiguration(); String proxyHost = ""; int proxyPort = 0; if (properties.getProperty("http.proxyHost") != null) { LOG.info("Getting proxy info from properties file."); proxyHost = properties.getProperty("http.proxyHost"); proxyPort = Integer.parseInt(properties.getProperty("http.proxyPort")); } else if (System.getProperty("http.proxyHost") != null) { LOG.info("Getting proxy info from java system properties"); proxyHost = System.getProperty("http.proxyHost"); proxyPort = Integer.parseInt(System.getProperty("http.proxyPort")); } else if (System.getenv("http_proxy") != null) { LOG.info("Getting proxy info environment settings"); try { URI proxyAddr = new URI(System.getenv("http_proxy")); proxyHost = proxyAddr.getHost(); proxyPort = proxyAddr.getPort(); } catch (URISyntaxException e) { LOG.error("System proxy not set correctly"); } } <START> if (!proxyHost.equals("") && proxyPort > 0) <END> clientConfig = clientConfig.withProxyHost(proxyHost).withProxyPort(proxyPort); else LOG.info("Not configuring proxy as none specified"); return clientConfig; }</code><technical_language>StringUtils instead of equals java StringUtils.isNotEmpty(proxyHost)</technical_language>

Target:
private ClientConfiguration buildClientConfig(Properties properties) { ClientConfiguration clientConfig = new ClientConfiguration(); String proxyHost = null; int proxyPort = 0; if (properties.getProperty(PROXY_HOST_PROP) != null) { LOG.debug("Getting proxy info from properties file."); proxyHost = properties.getProperty(PROXY_HOST_PROP); proxyPort = Integer.parseInt(properties.getProperty(PROXY_PORT_PROP)); } else if (System.getProperty(PROXY_HOST_PROP) != null) { LOG.debug("Getting proxy info from java system properties"); proxyHost = System.getProperty(PROXY_HOST_PROP); proxyPort = Integer.parseInt(System.getProperty(PROXY_PORT_PROP)); } else if (System.getenv(HTTP_PROXY_ENV_VAR) != null) { LOG.debug("Getting proxy info environment settings"); try { URI proxyAddr = new URI(System.getenv(HTTP_PROXY_ENV_VAR)); proxyHost = proxyAddr.getHost(); proxyPort = proxyAddr.getPort(); } catch (URISyntaxException e) { LOG.error("System proxy not set correctly", e); } } if (StringUtils.isNotEmpty(proxyHost) && proxyPort > 0) { clientConfig = clientConfig.withProxyHost(proxyHost).withProxyPort(proxyPort); } else { LOG.debug("Not configuring proxy as none specified"); } return clientConfig; }
Source:
<code>private User getCurrentUser() { final Context context = ContextAccessor.current(); <START> return context.getAuthInfo().getUser() != null ? context.getAuthInfo().getUser() : User.ANONYMOUS; <END> }</code><technical_language>requireNonNullElse is</technical_language>

Target:
private User getCurrentUser() { return Objects.requireNonNullElse( ContextAccessor.current().getAuthInfo().getUser(), User.ANONYMOUS ); }
Source:
<code>public static void createViews(final PrintWriter writer, final PgSchema oldSchema, final PgSchema newSchema, final SearchPathHelper searchPathHelper) { for (final PgView newView : newSchema.getViews()) { <START> PgView oldView; if (oldSchema != null) { oldView = oldSchema.getView(newView.getName()); } else { oldView = null; } <END> if (oldSchema == null || !oldSchema.containsView(newView.getName()) || isViewModified(oldView, newView)) { searchPathHelper.outputSearchPath(writer); writer.println(); writer.println(newView.getCreationSQL()); if (newView.getOwnerTo() != null && oldView == null) { writer.println(); writer.println("ALTER VIEW " + PgDiffUtils.getQuotedName(newView.getName()) + " OWNER TO " + newView.getOwnerTo() + ";"); } for (PgRelationPrivilege viewPrivilege : newView.getPrivileges()) { writer.println("REVOKE ALL ON TABLE " + PgDiffUtils.getQuotedName(newView.getName()) + " FROM " + viewPrivilege.getRoleName() + ";"); if (!"".equals(viewPrivilege.getPrivilegesSQL(true))) { writer.println("GRANT " + viewPrivilege.getPrivilegesSQL(true) + " ON TABLE " + PgDiffUtils.getQuotedName(newView.getName()) + " TO " + viewPrivilege.getRoleName() + " WITH GRANT OPTION;"); } if (!"".equals(viewPrivilege.getPrivilegesSQL(false))) { writer.println("GRANT " + viewPrivilege.getPrivilegesSQL(false) + " ON TABLE " + PgDiffUtils.getQuotedName(newView.getName()) + " TO " + viewPrivilege.getRoleName() + ";"); } } } } }</code><technical_language>do a more neatly I think. suggestion PgView oldView = (oldSchema == null ? null : oldSchema.getView(newView.getName()));</technical_language>

Target:
public static void createViews(final PrintWriter writer, final PgSchema oldSchema, final PgSchema newSchema, final SearchPathHelper searchPathHelper) { for (final PgView newView : newSchema.getViews()) { PgView oldView = (oldSchema == null ? null : oldSchema.getView(newView.getName())); if (oldSchema == null || !oldSchema.containsView(newView.getName()) || isViewModified(oldView, newView)) { searchPathHelper.outputSearchPath(writer); writer.println(); writer.println(newView.getCreationSQL()); if (newView.getOwnerTo() != null && oldView == null) { writer.println(); writer.println("ALTER VIEW " + PgDiffUtils.getQuotedName(newView.getName()) + " OWNER TO " + newView.getOwnerTo() + ";"); } for (PgRelationPrivilege viewPrivilege : newView.getPrivileges()) { writer.println("REVOKE ALL ON TABLE " + PgDiffUtils.getQuotedName(newView.getName()) + " FROM " + viewPrivilege.getRoleName() + ";"); if (!"".equals(viewPrivilege.getPrivilegesSQL(true))) { writer.println("GRANT " + viewPrivilege.getPrivilegesSQL(true) + " ON TABLE " + PgDiffUtils.getQuotedName(newView.getName()) + " TO " + viewPrivilege.getRoleName() + " WITH GRANT OPTION;"); } if (!"".equals(viewPrivilege.getPrivilegesSQL(false))) { writer.println("GRANT " + viewPrivilege.getPrivilegesSQL(false) + " ON TABLE " + PgDiffUtils.getQuotedName(newView.getName()) + " TO " + viewPrivilege.getRoleName() + ";"); } } } } }
Source:
<code>public void isNotExactlyInstanceOf_should_check_the_original_spliterator() { assertThat(stringSpliterator).isNotExactlyInstanceOf(Spliterator.class); try { <START> assertThat(stringSpliterator).isNotExactlyInstanceOf(StringSpliterator.class); <END> } catch (AssertionError e) { return; } failBecauseExpectedAssertionErrorWasNotThrown(); }</code><technical_language>replace more elegant: // import static org.assertj.core.util.AssertionsUtil.expectAssertionError; expectAssertionError(() -> assertThat(stringSpliterator).isNotExactlyInstanceOf(StringSpliterator.class)).doesNotThrowAnyException();</technical_language>

Target:
public void isNotExactlyInstanceOf_should_check_the_original_spliterator() { assertThat(stringSpliterator).isNotExactlyInstanceOf(Spliterator.class); expectAssertionError(() -> assertThat(stringSpliterator).isNotExactlyInstanceOf(StringSpliterator.class)); }
Source:
<code>public void testOfferAfterFinish() throws Exception { AsyncQueue<String> queue = new AsyncQueue<>(4, executor); queue.offer("1"); queue.offer("2"); queue.offer("3"); queue.offer("4"); queue.finish(); <START> queue.offer("5"); <END> queue.offer("6"); queue.offer("7"); assertFalse(queue.isFinished()); assertEquals(queue.getBatchAsync(100).get(), ImmutableList.of("1", "2", "3", "4")); assertTrue(queue.isFinished()); }</code><technical_language>check return</technical_language>

Target:
public void testOfferAfterFinish() throws Exception { AsyncQueue<String> queue = new AsyncQueue<>(4, executor); assertTrue(queue.offer("1").isDone()); assertTrue(queue.offer("2").isDone()); assertTrue(queue.offer("3").isDone()); assertFalse(queue.offer("4").isDone()); queue.finish(); assertTrue(queue.offer("5").isDone()); assertTrue(queue.offer("6").isDone()); assertTrue(queue.offer("7").isDone()); assertFalse(queue.isFinished()); assertEquals(queue.getBatchAsync(100).get(), ImmutableList.of("1", "2", "3", "4")); assertTrue(queue.isFinished()); }
Source:
<code>public Timestamp fromLong(Long millisFromEpoch, Schema schema, LogicalType type) { <START> if (millisFromEpoch < 0) { <END> throw new IllegalArgumentException("given value is negative"); } long seconds = millisFromEpoch / THOUSAND; int nanos = (int) (millisFromEpoch - seconds * THOUSAND) * MILLION; return Timestamp.newBuilder().setSeconds(seconds).setNanos(nanos).build(); }</code><technical_language>this check? I timestamps Unix epoch allowed here, Protobuf allows negative values too. check instead verify seconds part is allowed range [here](<LINK_0></technical_language>

Target:
public Timestamp fromLong(Long millisFromEpoch, Schema schema, LogicalType type) throws IllegalArgumentException { return ProtoConversions.fromLong(millisFromEpoch, TimestampPrecise.Millis); }
Source:
<code>protected void initModel(String projectName, String modelName, Bundle bundle) throws CoreException, IOException { project = ProjectUtils.createProject(projectName); diModelFile = PapyrusProjectUtils.copyPapyrusModel(project, bundle, getSourcePath(), modelName); if(diModelFile!=null){ <START> System.out.println("jhghg"); <END> } }</code><technical_language>removed</technical_language>

Target:
protected void initModel(String projectName, String modelName, Bundle bundle) throws CoreException, IOException { project = ProjectUtils.createProject(projectName); diModelFile = PapyrusProjectUtils.copyPapyrusModel(project, bundle, getSourcePath(), modelName); }
Source:
<code>public void setReadOnly(boolean readOnly) throws SQLException { checkClosed(); <START> if (readOnly == this.readOnly && cacheXactState) { <END> return; } if (queryExecutor.getTransactionState() != TransactionState.IDLE) { throw new PSQLException( GT.tr("Cannot change transaction read-only property in the middle of a transaction."), PSQLState.ACTIVE_SQL_TRANSACTION); } String readOnlySql = "SET SESSION CHARACTERISTICS AS TRANSACTION " + (readOnly ? "READ ONLY" : "READ WRITE"); execSQLUpdate(readOnlySql); this.readOnly = readOnly; LOGGER.log(Level.FINE, " setReadOnly = {0}", readOnly); }</code><technical_language>move code? changes semantics, a reason for code motion</technical_language>

Target:
public void setReadOnly(boolean readOnly) throws SQLException { checkClosed(); if (queryExecutor.getTransactionState() != TransactionState.IDLE) { throw new PSQLException( GT.tr("Cannot change transaction read-only property in the middle of a transaction."), PSQLState.ACTIVE_SQL_TRANSACTION); } if (this.readOnly == readOnly && cacheReadOnlyState) { return; } String readOnlySql = "SET SESSION CHARACTERISTICS AS TRANSACTION " + (readOnly ? "READ ONLY" : "READ WRITE"); execSQLUpdate(readOnlySql); this.readOnly = readOnly; LOGGER.log(Level.FINE, " setReadOnly = {0}", this.readOnly); }