auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void collapseOrExpandContainer(SWTBotGefEditPart container) { ICondition editPartResizedCondition = new CheckEditPartResized(container); AbstractDiagramElementContainerEditPart part = (AbstractDiagramElementContainerEditPart) container.part(); GraphicalHelper.getAbsoluteBoundsIn100Percent(part); Point top = GraphicalHelper.getAbsoluteBoundsIn100Percent(part).getTop(); editor.click(top.getTranslated(0, 40)); <START> bot.waitUntil(new ICondition() { <END> @Override public boolean test() throws Exception { IFigure handleLayer = LayerManager.Helper.find(part).getLayer(LayerConstants.HANDLE_LAYER); Point toggleFigureLocation; if (handleLayer != null) { for (Object figure : handleLayer.getChildren()) { if (figure instanceof CompartmentCollapseHandle) { toggleFigureLocation = ((CompartmentCollapseHandle) figure).getLocation(); if (toggleFigureLocation.x != 0 && toggleFigureLocation.y != 0) { Dimension size = ((CompartmentCollapseHandle) figure).getSize(); toggleFigureLocation.translate(size.width / 2, size.height / 2); editor.click(toggleFigureLocation); return true; } } } } return false; } @Override public void init(SWTBot bot) { } @Override public String getFailureMessage() { return "The collapse button has not been found after region selection."; } }); bot.waitUntil(editPartResizedCondition); SWTBotUtils.waitAllUiEvents(); }</code><technical_language>waiting condition triggers a modification. this check if is a "toggle" figure test click it? avoid 2 consecutive waiting conditions "looks strange"</technical_language>

Target:
private void collapseOrExpandContainer(SWTBotGefEditPart container) { ICondition editPartResizedCondition = new CheckEditPartResized(container); AbstractDiagramElementContainerEditPart part = (AbstractDiagramElementContainerEditPart) container.part(); GraphicalHelper.getAbsoluteBoundsIn100Percent(part); Point top = GraphicalHelper.getAbsoluteBoundsIn100Percent(part).getTop(); editor.click(top.getTranslated(0, 40)); bot.waitUntil(new DefaultCondition() { @Override public boolean test() throws Exception { IFigure handleLayer = LayerManager.Helper.find(part).getLayer(LayerConstants.HANDLE_LAYER); Point toggleFigureLocation; if (handleLayer != null) { for (Object figure : handleLayer.getChildren()) { if (figure instanceof CompartmentCollapseHandle) { toggleFigureLocation = ((CompartmentCollapseHandle) figure).getLocation(); if (toggleFigureLocation.x != 0 && toggleFigureLocation.y != 0) { Dimension size = ((CompartmentCollapseHandle) figure).getSize(); toggleFigureLocation.translate(size.width / 2, size.height / 2); editor.click(toggleFigureLocation); return true; } } } } return false; } @Override public String getFailureMessage() { return "The collapse button has not been found after region selection."; } }); bot.waitUntil(editPartResizedCondition); SWTBotUtils.waitAllUiEvents(); }
Source:
<code>JobResultImpl(JobResultData data) throws IOException, ClassNotFoundException { JobIdData id = data.getId(); jobId = new JobIdImpl(id.getId(), id.getReadableName()); allResults = createTaskResultMap(data.getAllResults()); preciousResults = createTaskResultMap(data.getPreciousResults()); exceptionResults = createTaskResultMap(data.getExceptionResults()); <START> resultMap = ObjectByteConverter.mapOfBase64StringToSerializable(data.getSerializedResultMap()); <END> jobInfo = data.getJobInfo(); }</code><technical_language>handle exception ? is throw exception in method prototype other method JobResultImpl handle exceptions. i.e toJobResult</technical_language>

Target:
JobResultImpl(JobResultData data) { JobIdData id = data.getId(); jobId = new JobIdImpl(id.getId(), id.getReadableName()); allResults = createTaskResultMap(data.getAllResults()); preciousResults = createTaskResultMap(data.getPreciousResults()); exceptionResults = createTaskResultMap(data.getExceptionResults()); resultMap = ObjectByteConverter.mapOfBase64StringToSerializable(data.getSerializedResultMap()); jobInfo = data.getJobInfo(); }
Source:
<code>private List<Integer> recoverPartitions(AbstractTopology topology, String haGroup) { List<Integer>partitions = null; AbstractTopology recoveredTopo = AbstractTopology.mutateRecoverTopology(topology, m_messenger.getLiveHostIds(), m_messenger.getHostId(), haGroup); <START> if (recoveredTopo != null) { <END> partitions = recoveredTopo.getPartitionIdList(m_messenger.getHostId()); if (partitions != null && partitions.size() == m_catalogContext.getNodeSettings().getLocalSitesCount()) { TopologyZKUtils.updateTopologyToZK(m_messenger.getZK(), recoveredTopo); } } return partitions; }</code><technical_language>early return NULL</technical_language>

Target:
private List<Integer> recoverPartitions(AbstractTopology topology, String haGroup) { AbstractTopology recoveredTopo = AbstractTopology.mutateRecoverTopology(topology, m_messenger.getLiveHostIds(), m_messenger.getHostId(), haGroup); if (recoveredTopo == null) { return null; } List<Integer> partitions = recoveredTopo.getPartitionIdList(m_messenger.getHostId()); if (partitions != null && partitions.size() == m_catalogContext.getNodeSettings().getLocalSitesCount()) { TopologyZKUtils.updateTopologyToZK(m_messenger.getZK(), recoveredTopo); return partitions; } return null; }
Source:
<code>protected @Nullable String getSegmentType(@NonNull ISegment segment) { if (segment instanceof ICalledFunction) { ICalledFunction calledFunction = (ICalledFunction) segment; <START> ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); <END> if (trace != null) { Object symbol = calledFunction.getSymbol(); return String.valueOf(symbol); } } return null; }</code><technical_language>do need trace here</technical_language>

Target:
protected @Nullable String getSegmentType(@NonNull ISegment segment) { if (segment instanceof ICalledFunction) { ICalledFunction calledFunction = (ICalledFunction) segment; return String.valueOf(calledFunction.getSymbol()); } return null; }
Source:
<code>Call<RbRelatedPages> request(@NonNull Service service, @NonNull String title, int limit, @NonNull Callback cb) { Call<RbRelatedPages> call = service.fetch(title); call.enqueue(new retrofit2.Callback<RbRelatedPages>() { @Override public void onResponse(@NonNull Call<RbRelatedPages> call, @NonNull Response<RbRelatedPages> response) { if (response.body() != null && response.body().success()) { cb.success(call, limit < 0 ? response.body().getPages() : response.body().getPages(limit)); } <START> else if (response.body().hasError()) { cb.failure(call, new Throwable(response.body().getErrorMessage())); } else <END> { cb.failure(call, new IOException("An unknown error occurred.")); } } @Override public void onFailure(@NonNull Call<RbRelatedPages> call, @NonNull Throwable t) { cb.failure(call, t); } }); return call; }</code><technical_language>Handled automatically</technical_language>

Target:
Call<RbRelatedPages> request(@NonNull Service service, @NonNull String title, int limit, @NonNull Callback cb) { Call<RbRelatedPages> call = service.fetch(title); call.enqueue(new retrofit2.Callback<RbRelatedPages>() { @Override public void onResponse(@NonNull Call<RbRelatedPages> call, @NonNull Response<RbRelatedPages> response) { if (response.body() != null && response.body().getPages() != null) { cb.success(call, limit < 0 ? response.body().getPages() : response.body().getPages(limit)); } else { cb.failure(call, new IOException("An unknown error occurred.")); } } @Override public void onFailure(@NonNull Call<RbRelatedPages> call, @NonNull Throwable t) { cb.failure(call, t); } }); return call; }
Source:
<code>public static void deselectAll(final ISelection selection) { if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) selection; if (structuredSelection.getFirstElement() instanceof EditPart) { <START> ((EditPart) structuredSelection.getFirstElement()).getViewer().deselectAll(); <END> } } }</code><technical_language>if in this context, test getViewer() return null (the return contract is "the EditPartViewer null") calling deselectAll()</technical_language>

Target:
public static void deselectAll(final ISelection selection) { if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) selection; if (structuredSelection.getFirstElement() instanceof EditPart) { EditPartViewer viewer = ((EditPart) structuredSelection.getFirstElement()).getViewer(); if (viewer != null) { viewer.deselectAll(); } } } }
Source:
<code>private void baseInitialization(String menuIndex) { add(new Link<Object>("lang.en") { @Override public void onClick() { getSession().setLocale(Locale.ENGLISH); } }); add(new Link<Object>("lang.de") { @Override public void onClick() { getSession().setLocale(Locale.GERMAN); } }); HeaderTemplate.menuIndex = menuIndex; add(new BookmarkablePageLink<Index>("logo", Index.class)); if (openengsbVersionService == null || openengsbVersionService.size() == 0) { if (openengsbVersion == null) { <START> add(new Label("version", "UNKNOWN version")); <END> } else { add(new Label("version", openengsbVersion.getVersionNumber())); } return; } else { add(new Label("version", openengsbVersionService.get(0).getOpenEngSBVersion())); } }</code><technical_language>localize</technical_language>

Target:
private void baseInitialization(String menuIndex) { add(new Link<Object>("lang.en") { @Override public void onClick() { getSession().setLocale(Locale.ENGLISH); } }); add(new Link<Object>("lang.de") { @Override public void onClick() { getSession().setLocale(Locale.GERMAN); } }); HeaderTemplate.menuIndex = menuIndex; add(new BookmarkablePageLink<Index>("logo", Index.class)); if (openengsbVersionService == null || openengsbVersionService.size() == 0) { if (openengsbVersion == null) { add(new Label("version", new StringResourceModel("unknown.version", this, null))); } else { add(new Label("version", openengsbVersion.getVersionNumber())); } return; } else { add(new Label("version", openengsbVersionService.get(0).getOpenEngSBVersion())); } }
Source:
<code>private synchronized boolean addExecCommandToQueue(final ExecutableCommand cmd, long delayTime) { <START> if (cmd.getConfiguration() <END> .getConfigurationDescription() .getMetaData(ShardHelper.LOCAL_SHARDED_KEY) == null) { if (isShutdown()) { return false; } } if (delayTime > 0) { mSleepingCommands.add(cmd); Runnable delayCommand = new Runnable() { @Override public void run() { synchronized (CommandScheduler.this) { if (mSleepingCommands.remove(cmd)) { mReadyCommands.add(cmd); mCommandProcessWait.signalEventReceived(); } } } }; mCommandTimer.schedule(delayCommand, delayTime, TimeUnit.MILLISECONDS); } else { mReadyCommands.add(cmd); mCommandProcessWait.signalEventReceived(); } return true; }</code><technical_language>I easier read if switch nesting order of ifs e.g. if (isShutdown()) { if (not sharded one) { return false; } }</technical_language>

Target:
private synchronized boolean addExecCommandToQueue(final ExecutableCommand cmd, long delayTime) { if (isShutdown()) { if (cmd.getConfiguration() .getConfigurationDescription() .getMetaData(ConfigurationDescriptor.LOCAL_SHARDED_KEY) == null) { return false; } } if (delayTime > 0) { mSleepingCommands.add(cmd); Runnable delayCommand = new Runnable() { @Override public void run() { synchronized (CommandScheduler.this) { if (mSleepingCommands.remove(cmd)) { mReadyCommands.add(cmd); mCommandProcessWait.signalEventReceived(); } } } }; mCommandTimer.schedule(delayCommand, delayTime, TimeUnit.MILLISECONDS); } else { mReadyCommands.add(cmd); mCommandProcessWait.signalEventReceived(); } return true; }
Source:
<code>public List<Map<String, Object>> getLoginAsUser() throws Exception { final Map<String, String> filterParams = map( "start", "0", "limit", "30", "includeAnonymous", "false", "includeDefault", "false"); <START> List<User> users = userAPI.getUsersByNameOrEmailOrUserID("", 1, 30, false, false); <END> List<Map<String, Object>> userList = new ArrayList<>(); List<String> rolesId = new ArrayList<>(); rolesId.add( roleAPI.loadRoleByKey(Role.ADMINISTRATOR).getId() ); rolesId.add( roleAPI.loadCMSAdminRole().getId() ); for (User user : users) { Map<String, Object> userMap = user.toMap(); String id = user.getUserId(); boolean hasPermissions = roleAPI.doesUserHaveRoles(id, rolesId); if ( hasPermissions ){ userMap.put("requestPassword", true); } userList.add(userMap); } return userList; }</code><technical_language>StringUtils.BLANK constants</technical_language>

Target:
public List<Map<String, Object>> getLoginAsUser() throws Exception { List<User> users = userAPI.getUsersByNameOrEmailOrUserID(StringPool.BLANK, 1, 30, false, false); List<Map<String, Object>> userList = new ArrayList<>(); List<String> rolesId = list( roleAPI.loadRoleByKey(Role.ADMINISTRATOR).getId(), roleAPI.loadCMSAdminRole().getId() ); for (User user : users) { Map<String, Object> userMap = user.toMap(); String id = user.getUserId(); boolean hasPermissions = roleAPI.doesUserHaveRoles(id, rolesId); if ( hasPermissions ){ userMap.put("requestPassword", true); } userList.add(userMap); } return userList; }
Source:
<code>public void init(IViewSite site, IMemento memento) throws PartInitException { super.init(site, memento); if (memento != null) { fInitialConnections= new ArrayList<>(); for(int i=0; ; i++) { String id= memento.getString("rc_id_" + i); String name= memento.getString("rc_name_" + i); if (id == null || name == null) { break; } IRemoteServices rs = RemoteServices.getRemoteServices(id); if (rs != null) { <START> IRemoteConnection rc = rs.getConnectionManager().getConnection(name); <END> if (rc != null) { fInitialConnections.add(rc); } } } } }</code><technical_language>This opens dialog enter password for secure storage. This startup of Eclipse Control View open previously connection. I avoid users want enter a password startup</technical_language>

Target:
public void init(IViewSite site, IMemento memento) throws PartInitException { super.init(site, memento); if (memento != null) { fInitialConnections = new ArrayList<>(); for(int i = 0; ; i++) { String id = memento.getString("rc_id_" + i); String name = memento.getString("rc_name_" + i); if (id == null || name == null) { break; } if (!Workaround_Bug449362.triggerRSEStartup(id)) { } else { IRemoteServices rs = RemoteServices.getRemoteServices(id); if (rs != null) { IRemoteConnection rc = rs.getConnectionManager().getConnection(name); if (rc != null) { fInitialConnections.add(rc); } } } } } }
Source:
<code>public IUser findUserByProviderUserId(String userId, String provider) throws QuadrigaStorageException { try { return userDeepMapper.findUserByProviderUserId(userId, provider); } catch (Exception ex) { <START> throw new QuadrigaStorageException(); <END> } }</code><technical_language>things: - catch Exception explicitly thrown (always specific) - catching a QuadrigaStorageException if do is throw a new QuadrigaStorageException? - swallow exceptions (once this is thrown, log actual issue throw ex away)</technical_language>

Target:
public IUser findUserByProviderUserId(String userId, String provider) { return userDeepMapper.findUserByProviderUserId(userId, provider); }
Source:
<code>public HdfsWriter(HdfsSinkConnectorConfig connectorConfig) { writers = new HashMap<TopicPartition, RecordWriter<Long, SinkRecord>>(); recordCounters = new HashMap<TopicPartition, Integer>(); url = connectorConfig.getString(HdfsSinkConnectorConfig.HDFS_URL_CONFIG); topicsDir = connectorConfig.getString(HdfsSinkConnectorConfig.TOPIC_DIR_CONFIG); conf = new Configuration(); try { fs = FileSystem.newInstance(URI.create(url), conf); Path path = new Path(url + "/" + topicsDir); if (!fs.exists(path)) { fs.mkdirs(path); } } catch (IOException e) { throw new CopycatRuntimeException(e); } try { offsets = readOffsets(); } catch (CopycatException e) { throw new CopycatRuntimeException(e); } try { writerProviderClass = (Class<RecordWriterProvider>) Class.forName(connectorConfig.getString(HdfsSinkConnectorConfig.RECORD_WRITER_PROVIDER_CLASS_CONFIG)); <START> } catch (ClassNotFoundException e) { <END> throw new CopycatRuntimeException("RecordWriterProvider class not found", e); } flushSize = connectorConfig.getInt(HdfsSinkConnectorConfig.FLUSH_SIZE_CONFIG); }</code><technical_language>I this easier read if combine try block. a couple of exceptions catch. note readOffsets</technical_language>

Target:
public HdfsWriter(HdfsSinkConnectorConfig connectorConfig) { try { writers = new HashMap<TopicPartition, RecordWriter<Long, SinkRecord>>(); recordCounters = new HashMap<TopicPartition, Integer>(); flushSize = connectorConfig.getInt(HdfsSinkConnectorConfig.FLUSH_SIZE_CONFIG); url = connectorConfig.getString(HdfsSinkConnectorConfig.HDFS_URL_CONFIG); topicsDir = connectorConfig.getString(HdfsSinkConnectorConfig.TOPIC_DIR_CONFIG); conf = new Configuration(); fs = FileSystem.newInstance(URI.create(url), conf); Path path = new Path(url + "/" + topicsDir); if (!fs.exists(path)) { fs.mkdirs(path); } offsets = readOffsets(); writerProviderClass = (Class<RecordWriterProvider>) Class.forName(connectorConfig.getString(HdfsSinkConnectorConfig.RECORD_WRITER_PROVIDER_CLASS_CONFIG)); } catch (IOException e) { throw new CopycatRuntimeException(e); } catch (ClassNotFoundException e) { throw new CopycatRuntimeException("RecordWriterProvider class not found", e); } }
Source:
<code>protected String getAbsolutePath(String relativePath) { File fileCheck = new File(relativePath); <START> if (!fileCheck.isFile()) { <END> try { throw new Exception("File doesn't exist"); } catch (Exception e) { e.printStackTrace(); } } return fileCheck.getAbsolutePath(); }</code><technical_language>Is this method referring files directories acceptable? If so, please add isDirectory() check, if change method name getFileAbsolutePath</technical_language>

Target:
protected String getAbsolutePath(String relativePath) { File fileCheck = new File(relativePath); if (!fileCheck.isFile()) { throw new RuntimeException("file " + relativePath + " doesn't exists"); } return fileCheck.getAbsolutePath(); }
Source:
<code>public Observable<List<T>> createObservable() { <START> try { <END> throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return storIOContentResolver .observeChangesOfUri(query.uri()) .map(MapSomethingToExecuteAsBlocking.newInstance(this)) .startWith(Observable.create(OnSubscribeExecuteAsBlocking.newInstance(this))) .subscribeOn(Schedulers.io()); } catch (Throwable throwable) { throw new StorIOException(throwable); } }</code><technical_language>need in try/catch here</technical_language>

Target:
public Observable<List<T>> createObservable() { throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return storIOContentResolver .observeChangesOfUri(query.uri()) .map(MapSomethingToExecuteAsBlocking.newInstance(this)) .startWith(Observable.create(OnSubscribeExecuteAsBlocking.newInstance(this))) .subscribeOn(Schedulers.io()); }
Source:
<code>public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { validateServletEnvironment(req, res); final HttpServletRequest baseRequest = (HttpServletRequest) req; final HttpServletResponse baseResponse = (HttpServletResponse) res; if (staticHandler.requestingStaticFile(baseRequest)) { staticHandler.deferProcessingToContainer(chain, baseRequest, baseResponse); } else { <START> logger.debug("VRaptor received a new request {}", req); <END> VRaptorRequest mutableRequest = new VRaptorRequest(baseRequest); VRaptorResponse mutableResponse = new VRaptorResponse(baseResponse); final RequestInfo request = new RequestInfo(servletContext, chain, mutableRequest, mutableResponse); try { encodingHandler.setEncoding(baseRequest, baseResponse); provider.provideForRequest(request); newRequestEvent.fire(new NewRequest()); } catch (ApplicationLogicException e) { throw new ServletException(e.getMessage(), e.getCause()); } logger.debug("VRaptor ended the request"); } }</code><technical_language>leave trace details of request... remove debug log</technical_language>

Target:
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { validateServletEnvironment(req, res); final HttpServletRequest baseRequest = (HttpServletRequest) req; final HttpServletResponse baseResponse = (HttpServletResponse) res; if (staticHandler.requestingStaticFile(baseRequest)) { staticHandler.deferProcessingToContainer(chain, baseRequest, baseResponse); } else { logger.trace("VRaptor received a new request {}", req); VRaptorRequest mutableRequest = new VRaptorRequest(baseRequest); VRaptorResponse mutableResponse = new VRaptorResponse(baseResponse); final RequestInfo request = new RequestInfo(servletContext, chain, mutableRequest, mutableResponse); try { encodingHandler.setEncoding(baseRequest, baseResponse); provider.provideForRequest(request); newRequestEvent.fire(new NewRequest()); } catch (ApplicationLogicException e) { throw new ServletException(e.getMessage(), e.getCause()); } logger.debug("VRaptor ended the request"); } }
Source:
<code>public String getJobName() { <START> if (this.jobName == null) { <END> throw new SamzaException("Job name was not specified. Check if the job.name configuration is missing."); } return this.jobName; }</code><technical_language>throw construction time instead</technical_language>

Target:
public String getJobName() { return this.jobName; }
Source:
<code>void eliminateWeakInequalities(PBody body) { for (Inequality inequality : body.getConstraintsOfType(Inequality.class)){ <START> if (inequality.isEliminable()){ <END> inequality.eliminateWeak(); derivativeRemoved(inequality); } } }</code><technical_language>Ok, I fine this added condition here, real reason for API break. I wanted "fix" unrelated bite in future, I this is equivalent here. Thanks for clarification</technical_language>

Target:
void eliminateWeakInequalities(PBody body) { for (Inequality inequality : body.getConstraintsOfType(Inequality.class)){ if (inequality.isEliminable()){ inequality.eliminateWeak(); derivativeRemoved(inequality, new PConstraintListRemovalReason(inequality)); } } }
Source:
<code>protected void configureOauthCredentials() { if (appExtSecurePropertiesFile != null) { M_log.debug("oauthCredentials were injected"); } if (appExtSecurePropertiesFile == null) { <START> M_log.debug("try to set oauth credentials from url"); <END> appExtSecurePropertiesFile = Utils.loadProperties(CCM_SECURE_PROPERTY_FILE_PATH); } if (appExtSecurePropertiesFile == null) { M_log.debug("try to set oauth credentials from default."); appExtSecurePropertiesFile = new Properties(); appExtSecurePropertiesFile.put("lmsng.school.edu.secret", "secret"); } oacf = new OauthCredentialsFactory(appExtSecurePropertiesFile); }</code><technical_language>clarify "from url"</technical_language>

Target:
protected void configureOauthCredentials() { if (appExtSecurePropertiesFile != null) { M_log.debug("oauthCredentials were injected"); } else{ M_log.debug("try to set oauth credentials from properties url"); appExtSecurePropertiesFile = Utils.loadProperties(CCM_SECURE_PROPERTY_FILE_PATH); } if (appExtSecurePropertiesFile == null) { M_log.debug("try to set oauth credentials from default."); appExtSecurePropertiesFile = new Properties(); appExtSecurePropertiesFile.put("lmsng.school.edu.secret", "secret"); } oacf = new OauthCredentialsFactory(appExtSecurePropertiesFile); }
Source:
<code>void toto() { new Handler(){ @Override public String handle() { return "handled"; } }.handle(); new Handler(){ private String myMethod(){ return "plop"; } @Override public String handle() { return myMethod(); } }.handle(); new Handler(){ @Override public String handle() { return this.toString(); } }.handle(); new Handler(){ @Override public String handle() { class C{ String meth(){ return ""; } String fun(){ return this.meth(); } } return new C().fun(); } }; new Handler(){ int myVar; @Override public String handle() { return ""; } }; new Handler(){ @Override public String handle() { return ""; }; }; new Handler (){ @Override public String handle() { return A.this.toStr(); } }; new B() { @Override public void bar() { } }; new C() { @Override public void foo() { } }; new D() {}; <START> new D() { END> @Override public void foo2() }; }</code><technical_language>This is wrong. write D d3 = () -> {}. D is a SAM</technical_language>

Target:
void toto() { new Handler(){ @Override public String handle() { return "handled"; } }.handle(); new Handler(){ private String myMethod(){ return "plop"; } @Override public String handle() { return myMethod(); } }.handle(); new Handler(){ @Override public String handle() { return this.toString(); } }.handle(); new Handler(){ @Override public String handle() { class C{ String meth(){ return ""; } String fun(){ return this.meth(); } } return new C().fun(); } }; new Handler(){ int myVar; @Override public String handle() { return ""; } }; new Handler(){ @Override public String handle() { return ""; }; }; new Handler (){ @Override public String handle() { return A.this.toStr(); } }; }
Source:
<code><START> public void resolveVersionRangeWithX() { <END> Dependency dependency1 = Dependency.withId("foo1", "com.acme", "foo1", "0.3.0.RELEASE"); dependency1.setVersionRange("[1.1.0.RELEASE, 1.2.x.RELEASE)"); dependency1.resolve(); assertThat(dependency1.getVersionRange()) .isEqualTo("[1.1.0.RELEASE,1.2.999.RELEASE)"); Dependency dependency2 = Dependency.withId("foo2", "com.acme", "foo2", "0.3.0.RELEASE"); dependency2.setVersionRange("1.1.x.RELEASE"); dependency2.resolve(); assertThat(dependency2.getVersionRange()).isEqualTo("1.1.999.RELEASE"); }</code><technical_language>this separate tests</technical_language>

Target:
public void resolveVersionRangeWithX() { Dependency dependency = Dependency.withId("foo1", "com.acme", "foo1", "0.3.0.RELEASE"); dependency.setVersionRange("[1.1.0.RELEASE, 1.2.x.RELEASE)"); dependency.resolve(); assertThat(dependency.getVersionRange()) .isEqualTo("[1.1.0.RELEASE,1.2.999.RELEASE)"); }
Source:
<code>public ImmutableCollection<E> loadAll() { final RecordStorage<I> storage = recordStorage(); final Map<I, EntityStorageRecord> recordMap = storage.readAll(); final ImmutableCollection<E> entities = FluentIterable.from(recordMap.entrySet()) <START> .transform(new Function<Map.Entry<I, EntityStorageRecord>, E>() { <END> @Nullable @Override public E apply(@Nullable Map.Entry<I, EntityStorageRecord> input) { Preconditions.checkNotNull(input); return toEntity(input.getKey(), input.getValue()); } }) .toList(); return entities; }</code><technical_language>Please a factory method for a function. improve readability a lot</technical_language>

Target:
public ImmutableCollection<E> loadAll() { final RecordStorage<I> storage = recordStorage(); final Map<I, EntityStorageRecord> recordMap = storage.readAll(); final ImmutableCollection<E> entities = FluentIterable.from(recordMap.entrySet()) .transform(storageRecordToEntityTransformer()) .toList(); return entities; }
Source:
<code>public void test_invalid_index() throws Exception { File batchJar = temp.newFile("sonar-scanner-api-batch.jar"); when(jarExtractor.extractToTemp("sonar-scanner-api-batch")).thenReturn(batchJar.toPath()); when(connection.downloadString("/batch/index")).thenReturn( "cpd.jar\n"); Jars jars = new Jars(fileCache, connection, jarExtractor, mock(Logger.class)); try { jars.download(); <START> fail(); <END> } catch (RuntimeException e) { assertThat(e).hasMessage("Fail to bootstrap from server. Bootstrap index was:\ncpd.jar\n"); } }</code><technical_language>org.junit.rules.ExpectedException rule instead of rule try catch, more readable</technical_language>

Target:
public void test_invalid_index() throws Exception { File batchJar = temp.newFile("sonar-scanner-api-batch.jar"); when(jarExtractor.extractToTemp("sonar-scanner-api-batch")).thenReturn(batchJar.toPath()); when(connection.downloadString("/batch/index")).thenReturn( "cpd.jar\n"); Jars jars = new Jars(fileCache, connection, jarExtractor, mock(Logger.class)); thrown.expect(IllegalStateException.class); thrown.expectMessage("Fail to bootstrap from server. Bootstrap index was:\ncpd.jar\n"); jars.download(); }
Source:
<code>public void send(ProcessEngineEvent newEvent) { <START> System.out.println("Sending Event: " + newEvent); <END> producer.send(MessageBuilder.withPayload(newEvent).build()); }</code><technical_language>@erdemedeiros remove system outs</technical_language>

Target:
public void send(ProcessEngineEvent newEvent) { producer.send(MessageBuilder.withPayload(newEvent).build()); }
Source:
<code>public void init() { super.init(); for (int i = 0; 12 != i; i++) { new GuiTab("Tab1", new ItemStack(Blocks.BEDROCK), TestGui.class) { @Override public void onTabClicked() { GuiTabsTest.INSTANCE.sendToServer(new TabMessageHandler.TabMessage(0)); } }.setTargetGui(TestGui.class).addTo(GuiInventory.class); } for (int i = 0; 13 != i; i++) { new GuiTab("Tab2", new ResourceLocation("textures/blocks/tnt_side.png"), GuiChest.class) { @Override public void onTabClicked() { GuiTabsTest.INSTANCE.sendToServer(new TabMessageHandler.TabMessage(1)); } }.setTargetGui(GuiChest.class).addTo(GuiInventory.class); } for (int i = 0; 13 != i; i++) { <START> new GuiTab("Tab3", new ItemStack(Blocks.FURNACE), TestGui2.class) { <END> @Override public void onTabClicked() { GuiTabsTest.INSTANCE.sendToServer(new TabMessageHandler.TabMessage(2)); } }.setTargetGui(TestGui2.class).addTo(TestGui.class); } }</code><technical_language>tested items enchantment glint</technical_language>

Target:
public void init() { super.init(); new GuiTab("Tab1", new ItemStack(Blocks.BEDROCK), TestGui.class) { @Override public void onTabClicked(GuiContainer guiContainer) { super.onTabClicked(guiContainer); GuiTabsTest.INSTANCE.sendToServer(new TabMessageHandler.TabMessage(0)); } }.setTargetGui(TestGui.class).addTo(GuiInventory.class); new GuiTab("Tab2", new ResourceLocation("textures/blocks/tnt_side.png"), GuiChest.class) { @Override public void onTabClicked(GuiContainer guiContainer) { super.onTabClicked(guiContainer); GuiTabsTest.INSTANCE.sendToServer(new TabMessageHandler.TabMessage(1)); } }.setTargetGui(GuiChest.class).addTo(GuiFurnace.class); ItemStack is = new ItemStack(Items.APPLE); is.addEnchantment(new net.minecraft.enchantment.EnchantmentProtection(Enchantment.Rarity.COMMON, EnchantmentProtection.Type.FALL, null), 1); new GuiTab("Tab3", is, TestGui2.class) { @Override public void onTabClicked(GuiContainer guiContainer) { super.onTabClicked(guiContainer); GuiTabsTest.INSTANCE.sendToServer(new TabMessageHandler.TabMessage(2)); } }.setTargetGui(TestGui2.class).addTo(GuiInventory.class); }
Source:
<code>private ImmutableSet<HuId> retrieveSelectedHuIds() { final DocumentIdsSelection selectedRowIds = getSelectedRowIds(); final ImmutableList<PPOrderLineRow> selectedRows = getView().streamByIds(selectedRowIds) .collect(ImmutableList.toImmutableList()); final List<HuId> huIds = new ArrayList<HuId>(); <START> selectedRows.forEach(row -> { <END> final PPOrderLineType type = row.getType(); if (type.isMainProduct()) { final ImmutableList<PPOrderLineRow> includedRows = row.getIncludedRows(); includedRows.stream().map(PPOrderLineRow::getHuId).collect(Collectors.toCollection(() -> huIds)); } else { huIds.add(row.getHuId()); } }); final ImmutableSet<HuId> distinctHuIds = huIds.stream().filter(Objects::nonNull).distinct() .collect(ImmutableSet.toImmutableSet()); return distinctHuIds; }</code><technical_language>for sake of readability pls a classic for. about: PPOrderLineRow::getHuId * check consider lines HUs, i.e. ppOrderLineRow.getType().isHUOrHUStorage() * guard null for getHuId() * add huIds a Set, instead of adding a list converting a Set</technical_language>

Target:
private Set<HuId> retrieveSelectedHuIds() { final DocumentIdsSelection selectedRowIds = getSelectedRowIds(); final ImmutableList<PPOrderLineRow> selectedRows = getView() .streamByIds(selectedRowIds) .collect(ImmutableList.toImmutableList()); final Set<HuId> huIds = new HashSet<HuId>(); for (final PPOrderLineRow row : selectedRows) { final PPOrderLineType type = row.getType(); if (type.isMainProduct()) { final ImmutableList<PPOrderLineRow> includedRows = row.getIncludedRows(); includedRows.stream() .filter(ppOrderLineRow -> ppOrderLineRow.getType().isHUOrHUStorage()) .map(PPOrderLineRow::getHuId) .filter(Objects::nonNull) .forEach(huIds::add); } else if (row.getHuId() != null && type.isHUOrHUStorage()) { huIds.add(row.getHuId()); } } return huIds; }
Source:
<code>public void setMateReferenceIndex(final int mateReferenceIndex) { if (mateReferenceIndex == NO_ALIGNMENT_REFERENCE_INDEX) { mMateReferenceIndex = NO_ALIGNMENT_REFERENCE_INDEX; mMateReferenceName = NO_ALIGNMENT_REFERENCE_NAME; } else if (null == mHeader) { <START> throw new IllegalArgumentException("A non-null SAMFileHeader is required to resolve the mate reference index"); <END> } else { SAMSequenceRecord samSequence = mHeader.getSequence(mateReferenceIndex); if (null != samSequence) { mMateReferenceIndex = mateReferenceIndex; mMateReferenceName = samSequence.getSequenceName(); } else { throw new IllegalArgumentException("Reference index " + mateReferenceIndex + " not found in sequence dictionary."); } } }</code><technical_language>IllegalStateException</technical_language>

Target:
public void setMateReferenceIndex(final int mateReferenceIndex) { if (mateReferenceIndex == NO_ALIGNMENT_REFERENCE_INDEX) { mMateReferenceIndex = NO_ALIGNMENT_REFERENCE_INDEX; mMateReferenceName = NO_ALIGNMENT_REFERENCE_NAME; } else if (null == mHeader) { throw new IllegalStateException("A non-null SAMFileHeader is required to resolve the mate reference index"); } else { SAMSequenceRecord samSequence = mHeader.getSequence(mateReferenceIndex); if (null != samSequence) { mMateReferenceIndex = mateReferenceIndex; mMateReferenceName = samSequence.getSequenceName(); } else { throw new IllegalArgumentException("Reference index " + mateReferenceIndex + " not found in sequence dictionary."); } } }
Source:
<code>public void testBufferSmallPages() throws Exception { int singlePageRowCount = 10; Page page = createSequencePage(TYPES, singlePageRowCount * 2); List<Page> splits = splitPage(page, page.getSizeInBytes() / 2); MergingPageOutput output = new MergingPageOutput(TYPES, toIntExact(page.getSizeInBytes() + 1), page.getPositionCount() + 1, Integer.MAX_VALUE); assertTrue(output.needsInput()); assertNull(output.getOutput()); output.addInput(createPageProcessorOutput(splits.get(0))); <START> assertFalse(output.needsInput()); <END> assertNull(output.getOutput()); assertTrue(output.needsInput()); output.addInput(createPageProcessorOutput(splits.get(1))); assertFalse(output.needsInput()); assertNull(output.getOutput()); output.finish(); assertFalse(output.needsInput()); assertPageEquals(TYPES, output.getOutput(), page); }</code><technical_language>write similar test single PageProcessorOutput pages</technical_language>

Target:
public void testBufferSmallPages() throws Exception { int singlePageRowCount = 10; Page page = createSequencePage(TYPES, singlePageRowCount * 2); List<Page> splits = splitPage(page, page.getSizeInBytes() / 2); MergingPageOutput output = new MergingPageOutput(TYPES, page.getSizeInBytes() + 1, page.getPositionCount() + 1, Integer.MAX_VALUE); assertTrue(output.needsInput()); assertNull(output.getOutput()); output.addInput(createPageProcessorOutput(splits.get(0))); assertFalse(output.needsInput()); assertNull(output.getOutput()); assertTrue(output.needsInput()); output.addInput(createPageProcessorOutput(splits.get(1))); assertFalse(output.needsInput()); assertNull(output.getOutput()); output.finish(); assertFalse(output.needsInput()); assertPageEquals(TYPES, output.getOutput(), page); }
Source:
<code>private List<String> wrapLineComments( List<String> lines, int column0, JavaFormatterOptions options) { List<String> result = new ArrayList<>(); for (String line : lines) { Matcher matcher = LINE_COMMENT_PREFIX.matcher(line); if (matcher.find()) { int length = matcher.group(1).length(); boolean hasNoSuppression = (line.length() > length + 12) <START> && line.substring(length, length + 12).equals("noinspection"); <END> if (!hasNoSuppression) { line = Strings.repeat("/", length) + " " + line.substring(length); } } while (line.length() + column0 > options.maxLineLength()) { int idx = options.maxLineLength() - column0; while (idx >= 2 && !CharMatcher.whitespace().matches(line.charAt(idx))) { idx--; } if (idx <= 2) { break; } result.add(line.substring(0, idx)); line = " } result.add(line); } return result; }</code><technical_language>regionMatches</technical_language>

Target:
private List<String> wrapLineComments( List<String> lines, int column0, JavaFormatterOptions options) { List<String> result = new ArrayList<>(); for (String line : lines) { Matcher matcher = LINE_COMMENT_PREFIX.matcher(line); if (matcher.find()) { int length = matcher.group(1).length(); boolean hasNoInspection = line.regionMatches(length, "noinspection", 0, 12); if (!hasNoInspection) { line = Strings.repeat("/", length) + " " + line.substring(length); } } while (line.length() + column0 > options.maxLineLength()) { int idx = options.maxLineLength() - column0; while (idx >= 2 && !CharMatcher.whitespace().matches(line.charAt(idx))) { idx--; } if (idx <= 2) { break; } result.add(line.substring(0, idx)); line = " } result.add(line); } return result; }
Source:
<code>public static Collection<Object[]> data() { Object[][] data = new Object[][] { <START> {SYNC, (Function<Transaction, Transaction>) GetSynchronousDelegate::new}, <END> {ASYNC, (Function<Transaction, Transaction>) GetAsyncDelegate::new} }; return Arrays.asList(data); }</code><technical_language>nit: UnaryOperator<Transaction> board save a bit of repetition</technical_language>

Target:
public static Collection<Object[]> data() { Object[][] data = new Object[][] { {SYNC, (UnaryOperator<Transaction>) GetSynchronousDelegate::new}, {ASYNC, (UnaryOperator<Transaction>) GetAsyncDelegate::new} }; return Arrays.asList(data); }
Source:
<code>public void setup() throws ForceReattemptException { message = spy(new ClearPRMessage()); region = mock(PartitionedRegion.class); dataStore = mock(PartitionedRegionDataStore.class); when(region.getDataStore()).thenReturn(dataStore); bucketRegion = mock(BucketRegion.class); <START> when(dataStore.getInitializedBucketForId(any(), any())).thenReturn(bucketRegion); <END> }</code><technical_language>worth including tests confirm initMessage() correctly sets processorId call enableSevereAlertProcessing() ReplyProcessor if processor is null, a test confirm send() throws exception if putOutgoing(this) returns a non-null set, a test confirm operateOnPartitionedRegion() calls sendReply() correct arguments if a ForceReattemptException is thrown doLocalClear(), a test confirm call endPartitionMessagesProcessing() in sendReply() a test confirm call replyProcessor.process() in ClearReplyMessage.process() replyProcessor is null</technical_language>

Target:
public void setup() throws ForceReattemptException { message = spy(new ClearPRMessage()); region = mock(PartitionedRegion.class, RETURNS_DEEP_STUBS); dataStore = mock(PartitionedRegionDataStore.class); when(region.getDataStore()).thenReturn(dataStore); bucketRegion = mock(BucketRegion.class); when(dataStore.getInitializedBucketForId(any(), any())).thenReturn(bucketRegion); }
Source:
<code>public void start(String baseDir) { Properties properties = createProperties(); Charset charset; { String s = (String) properties.get("encoding"); if (null == s) { <START> charset = Charset.forName("UTF-8"); <END> properties.put("encoding", charset.name()); } else { charset = Charset.forName(s); } } try { if (toConsole) { writer = new BufferedWriter(new OutputStreamWriter(System.out, charset)); } if (toFile != null) { writer = getToFileWriter(baseDir, toFile, charset); } renderer = createRenderer(); renderer.setWriter(writer); renderer.start(); } catch (IOException ioe) { throw new BuildException(ioe.getMessage(), ioe); } }</code><technical_language>[StandardCharsets.UTF8](<LINK_0> instead</technical_language>

Target:
public void start(String baseDir) { Properties properties = createProperties(); Charset charset; { String s = (String) properties.get("encoding"); if (null == s) { if (toConsole) { s = getConsoleEncoding(); if (null == s) { s = System.getProperty("file.encoding"); } } if (null == s) { charset = StandardCharsets.UTF_8; } else { charset = Charset.forName(s); } final Parameter parameter = new Parameter(); parameter.setName("encoding"); parameter.setValue(charset.name()); parameters.add(parameter); } else { charset = Charset.forName(s); } } try { if (toConsole) { writer = new BufferedWriter(new OutputStreamWriter(System.out, charset)); } if (toFile != null) { writer = getToFileWriter(baseDir, toFile, charset); } renderer = createRenderer(); renderer.setWriter(writer); renderer.start(); } catch (IOException ioe) { throw new BuildException(ioe.getMessage(), ioe); } }
Source:
<code>public ExprEval getObject() { List<String> arrayBindings = unknownColumns.stream() <START> .filter(x -> !baseExprBindingDetails.getArrayVariables().contains(x) && isBindingArray(x)) <END> .collect(Collectors.toList()); if (ignoredColumns.size() > 0) { unknownColumns.removeAll(ignoredColumns); ignoredColumns.clear(); } if (arrayBindings.size() > 0) { final int key = arrayBindings.hashCode(); if (transformedCache.containsKey(key)) { return transformedCache.get(key).eval(bindings); } Expr transformed = Parser.applyUnappliedIdentifiers(expression, baseExprBindingDetails, arrayBindings); transformedCache.put(key, transformed); return transformed.eval(bindings); } return expression.eval(bindings); }</code><technical_language>baseExprBindingDetails.getArrayVariables().contains(x) change rows? If not, moved out of per-row logic</technical_language>

Target:
public ExprEval getObject() { List<String> arrayBindings = unknownColumns.stream().filter(this::isBindingArray).collect(Collectors.toList()); if (ignoredColumns.size() > 0) { unknownColumns.removeAll(ignoredColumns); ignoredColumns.clear(); } if (arrayBindings.size() > 0) { final int key = arrayBindings.hashCode(); if (transformedCache.containsKey(key)) { return transformedCache.get(key).eval(bindings); } Expr transformed = Parser.applyUnappliedIdentifiers(expression, baseExprBindingDetails, arrayBindings); transformedCache.put(key, transformed); return transformed.eval(bindings); } return expression.eval(bindings); }
Source:
<code>public boolean isEnableForComponent(Component invoker) { TreePath[] paths = this.extAlert.getAlertPanel().getTreeAlert().getSelectionPaths(); <START> for(int i = 0; i < paths.length; i++ ){ <END> DefaultMutableTreeNode alertNode = (DefaultMutableTreeNode)paths[i].getLastPathComponent(); if(alertNode.getUserObject() == null) { return false; } } if(this.extAlert == null) { return false; } if ("treeAlert".equals(invoker.getName())) { int count = this.extAlert.getAlertPanel().getTreeAlert().getSelectionCount(); setEnabled(isButtonEnabledForNumberOfSelectedAlerts(count)); return true; } return false; }</code><technical_language>node a user object is root node checked, for example: Java this.extAlert.getAlertPanel().getTreeAlert().isRowSelected(0) This check done for enabled state of menu item (below calling setEnabled) ~~not~~ decide menu is shown (they shown in alerts tree disabled)</technical_language>

Target:
public boolean isEnableForComponent(Component invoker) { if(this.extAlert == null) { return false; } if ("treeAlert".equals(invoker.getName())) { int count = this.extAlert.getAlertPanel().getTreeAlert().getSelectionCount(); setEnabled(!this.extAlert.getAlertPanel().getTreeAlert().isRowSelected(0) && isButtonEnabledForNumberOfSelectedAlerts(count)); return true; } return false; }
Source:
<code>public Response removeCredentials() { String user = authenticationService.getPrincipal(); <START> LOGGER.info("removeCredentials credentials for user ", user); <END> UserCredentials uc; try { uc = credentials.removeUserCredentials(user); if (uc == null) { return new JsonResponse<>(Status.NOT_FOUND).build(); } return new JsonResponse<>(Status.OK).build(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); return new JsonResponse<>(Status.INTERNAL_SERVER_ERROR).build(); } }</code><technical_language>> removeCredentials for user {}</technical_language>

Target:
public Response removeCredentials() { String user = authenticationService.getPrincipal(); LOGGER.info("removeCredentials for user ", user); UserCredentials uc; try { uc = credentials.removeUserCredentials(user); if (uc == null) { return new JsonResponse<>(Status.NOT_FOUND).build(); } return new JsonResponse<>(Status.OK).build(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); return new JsonResponse<>(Status.INTERNAL_SERVER_ERROR).build(); } }
Source:
<code>public Collection<EObject> eRemoveInverseCrossReferences(EObject eObject, ECrossReferenceAdapter xref, EReferencePredicate isReferencesToIgnorePredicate) { <START> Collection<EObject> impactedEObjects = new ArrayList<EObject>(); <END> for (final IMetamodelExtender extender : getActivatedExtenders()) { impactedEObjects.addAll(extender.eRemoveInverseCrossReferences(eObject, xref, isReferencesToIgnorePredicate)); } return impactedEObjects; }</code><technical_language>Set (HashSet LinkedHashSet EcoreIntrinsicExtender). do want duplicates here</technical_language>

Target:
public Collection<EObject> eRemoveInverseCrossReferences(EObject eObject, ECrossReferenceAdapter xref, EReferencePredicate isReferencesToIgnorePredicate) { Collection<EObject> impactedEObjects = new LinkedHashSet<EObject>(); for (final IMetamodelExtender extender : getActivatedExtenders()) { impactedEObjects.addAll(extender.eRemoveInverseCrossReferences(eObject, xref, isReferencesToIgnorePredicate)); } return impactedEObjects; }
Source:
<code>Stamp(long stamp, long gcStamp) { long b= stamp & ColumnConstants.PREFIX_MASK ; <START> Preconditions.checkArgument(b==0?true:false, "should be zero"); <END> long c= gcStamp & ColumnConstants.PREFIX_MASK ; Preconditions.checkArgument(c==0?true:false, "should be zero"); this.txStamp = stamp; this.gcStamp = gcStamp; }</code><technical_language>I b==0?true:false replaced b==0. nice include more info in error message, somethingl ike timestamp prefix zero</technical_language>

Target:
Stamp(long stamp, long gcStamp) { long b = stamp & ColumnConstants.PREFIX_MASK; Preconditions.checkArgument(b == 0, "timestamp prefix should be zero"); long c = gcStamp & ColumnConstants.PREFIX_MASK; Preconditions.checkArgument(c == 0, "timestamp prefix should be zero"); this.txStamp = stamp; this.gcStamp = gcStamp; }
Source:
<code>public void onMessage(ResponseBody message) throws IOException { int type = message.byteStream().read(); String msg = message.string(); <START> switch ( type ) { <END> case 1: listener.onStdOut(msg); break; case 2: listener.onStdErr(msg); break; case 3: listener.onExecErr(msg); break; default: LOG.warn("Unable to deliver exec message of type [%d]: %s", type, msg ); } }</code><technical_language>more useful extract constants for more meaning</technical_language>

Target:
public void onMessage(ResponseBody message) throws IOException { int channel = message.byteStream().read(); String msg = message.string(); deliver( channel, msg ); }
Source:
<code>public List<RuleRuntime> getRulesRuntime() { final List<Rule> rules = rulesProcessor.getRules(); final List<RuleRuntime> rulesRuntime = new ArrayList<>(); if (rules != null) { for (Rule rule : rules) { ruleRuntimeBuilder.setRule(rule); RuleRuntime ruleRuntime = null; if (rule.getCondition() != null) { ruleRuntimeBuilder.buildExpression(); ruleRuntimeBuilder.buildScriptEngine(); ruleRuntimeBuilder.buildScript(); } ruleRuntimeBuilder.buildActions(); <START> ruleRuntime = ruleRuntimeBuilder.buildRuleRuntime(); <END> rulesRuntime.add(ruleRuntime); LOG.trace("Added {}", ruleRuntime); } LOG.debug("Finished building. [{}]", this); } return rulesRuntime; }</code><technical_language>RuleRuntime defined here, difference changing it</technical_language>

Target:
public List<RuleRuntime> getRulesRuntime() { final List<Rule> rules = rulesProcessor.getRules(); final List<RuleRuntime> rulesRuntime = new ArrayList<>(); if (rules != null) { for (Rule rule : rules) { ruleRuntimeBuilder.setRule(rule); if (rule.getCondition() != null) { ruleRuntimeBuilder.buildExpression(); ruleRuntimeBuilder.buildScriptEngine(); ruleRuntimeBuilder.buildScript(); } ruleRuntimeBuilder.buildActions(); RuleRuntime ruleRuntime = ruleRuntimeBuilder.buildRuleRuntime(); rulesRuntime.add(ruleRuntime); LOG.trace("Added {}", ruleRuntime); } LOG.debug("Finished building. [{}]", this); } return rulesRuntime; }