auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void handle(Long minToken, Long maxToken, CObjectTokenVisitor visitor, Integer partitionId) { visitor.setUp(); List<Map<String, Object>> results = executeStatement(objectType, minToken, maxToken, batchSize); while(results != null && results.size() > 0) { visitResults(results, visitor); String minUuid = String.valueOf(results.get(results.size() - 1).get("id")); results = executeStatement(objectType, minUuid, maxToken, batchSize); } <START> if (this.savepointWriters != null) { <END> this.savepointWriters[partitionId].append(maxToken.toString()); this.savepointWriters[partitionId].append("\n"); } visitor.cleanUp(); shutdownLatch.countDown(); }</code><technical_language>saving progress while loop</technical_language>

Target:
public void handle(Long minToken, Long maxToken, CObjectTokenVisitor visitor, Integer partitionId) { visitor.setUp(); List<Map<String, Object>> results = executeStatement(objectType, minToken, maxToken, batchSize); while(results != null && results.size() > 0) { visitResults(results, visitor); String minUuid = String.valueOf(results.get(results.size() - 1).get("id")); results = executeStatement(objectType, minUuid, maxToken, batchSize); if (this.savepointWriters != null) { this.savepointWriters[partitionId].append(minUuid); this.savepointWriters[partitionId].append("\n"); } } visitor.cleanUp(); shutdownLatch.countDown(); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_login, container, false); textView = (TextView)view.findViewById(R.id.textView1); final Button button = (Button)view.findViewById(R.id.buttonLogin); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { buttonClicked(v); } }); if (mResult != null && mResult.getUserInfo() != null && mResult.getUserInfo().getDisplayableId() != null) { textView.setText(mResult.getUserInfo().getDisplayableId()); <START> button.setText("LogOut"); <END> } return view; }</code><technical_language>set Logout if a displayable id is present? ADFS</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_login, container, false); textView = (TextView)view.findViewById(R.id.textView1); final Button button = (Button)view.findViewById(R.id.buttonLogin); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { buttonClicked(v); } }); if (mResult != null && mResult.getUserInfo() != null && mResult.getUserInfo().getDisplayableId() != null) { textView.setText(mResult.getUserInfo().getDisplayableId()); } return view; }
Source:
<code>public void releaseWhenCompositeCumulateThrows() { final Error error = new Error(); ByteBuf cumulation = new CompositeByteBuf(UnpooledByteBufAllocator.DEFAULT, false, 64) { @Override public CompositeByteBuf addComponent(boolean increaseWriterIndex, ByteBuf buffer) { throw error; } }; <START> cumulation.writeByte(1); <END> ByteBuf in = Unpooled.buffer().writeZero(12); try { ByteToMessageDecoder.COMPOSITE_CUMULATOR.cumulate(UnpooledByteBufAllocator.DEFAULT, cumulation, in); fail(); } catch (Error expected) { assertSame(error, expected); assertEquals(0, in.refCnt()); } }</code><technical_language>is this needed</technical_language>

Target:
public void releaseWhenCompositeCumulateThrows() { final Error error = new Error(); ByteBuf cumulation = new CompositeByteBuf(UnpooledByteBufAllocator.DEFAULT, false, 64) { @Override public CompositeByteBuf addComponent(boolean increaseWriterIndex, ByteBuf buffer) { throw error; } }; cumulation.writeByte(1); ByteBuf in = Unpooled.buffer().writeZero(12); try { COMPOSITE_CUMULATOR.cumulate(UnpooledByteBufAllocator.DEFAULT, cumulation, in); fail(); } catch (Error expected) { assertSame(error, expected); assertEquals(0, in.refCnt()); } }
Source:
<code>public void closesPullRequestForRebaseMode() throws Exception { final Repo repo = new MkGithub().randomRepo(); final Issue issue = repo.issues().create("", ""); final Profile profile = new Profile.Fixed( new XMLDocument( StringUtils.join( "<p><entry key='merge'>", "<entry key='rebase'>true</entry>", "</entry></p>" ) ) ); <START> final Agent agent = new ClosePullRequest(profile, repo.github()); <END> final Talk talk = ClosePullRequestTest.createTalk(repo, issue); agent.execute(talk); MatcherAssert.assertThat( new Issue.Smart(issue).state(), Matchers.is("closed") ); }</code><technical_language>@vkuchyn time variable, inlined</technical_language>

Target:
public void closesPullRequestForRebaseMode() throws Exception { final Repo repo = new MkGithub().randomRepo(); final Issue issue = repo.issues().create("", ""); final Profile profile = new Profile.Fixed( new XMLDocument( StringUtils.join( "<p><entry key='merge'>", "<entry key='rebase'>true</entry>", "</entry></p>" ) ) ); final Talk talk = ClosePullRequestTest.talk(repo, issue); new ClosePullRequest(profile, repo.github()).execute(talk); final Issue.Smart smart = new Issue.Smart(issue); MatcherAssert.assertThat( smart.state(), Matchers.is("closed") ); MatcherAssert.assertThat( new Comment.Smart(smart.comments().get(1)).body(), Matchers.containsString( StringUtils.join( "Rultor closed this pull request for you because your ", ".rultor.yml specified the use of rebasing before ", "merging. GitHub does not mark rebased pull requests as ", "merged, because rebasing entails a change in commit ", "hashes. Nevertheless all your files have been merged ", "exactly as they would have been merged without the ", "rebase option set." ) ) ); }
Source:
<code>public void deleteVNFRecord(String idNsr, String idVnf, String projectId) throws NotFoundException { NetworkServiceRecord nsr = nsrRepository.findFirstById(idNsr); if (nsr == null) throw new NotFoundException("No NSR found with ID: " + idNsr); if (!nsr.getProjectId().equals(projectId)) { throw new UnauthorizedUserException( "NSR not under the project chosen, are you trying to hack us? Just kidding, it's a bug :)"); } VirtualNetworkFunctionRecord vnfr = vnfrRepository.findOne(idVnf); if (vnfr == null) throw new NotFoundException("No VNFR found with ID: " + idVnf); <START> if (!vnfr.getProjectId().equals(projectId)) <END> throw new UnauthorizedUserException("VNFR not contained in the chosen project."); nsrRepository.deleteVNFRecord(idNsr, idVnf); }</code><technical_language>Another check good if requested VNFR is part of NSR</technical_language>

Target:
public void deleteVNFRecord(String idNsr, String idVnf, String projectId) throws NotFoundException { NetworkServiceRecord nsr = nsrRepository.findFirstById(idNsr); if (nsr == null) throw new NotFoundException("No NSR found with ID: " + idNsr); if (!nsr.getProjectId().equals(projectId)) { throw new UnauthorizedUserException( "NSR not under the project chosen, are you trying to hack us? Just kidding, it's a bug :)"); } VirtualNetworkFunctionRecord vnfr = vnfrRepository.findOne(idVnf); if (vnfr == null) throw new NotFoundException("No VNFR found with ID: " + idVnf); if (!vnfr.getParent_ns_id().equals(idNsr)) throw new NotFoundException("Not found VNFR " + idVnf + " in the given NSR " + idNsr); if (!vnfr.getProjectId().equals(projectId)) throw new UnauthorizedUserException("VNFR not contained in the chosen project."); nsrRepository.deleteVNFRecord(idNsr, idVnf); }
Source:
<code>private static List<Type> listSupertypes(Type... types) { List<Type> supertypes = new ArrayList<Type>(); <START> List<Type> next = new ArrayList<Type>(); <END> Collections.addAll(next, types); while (!next.isEmpty()) { Type type = next.remove(0); for (Type sType : Type.byName.values()) { if (type.subTypes.contains(type)) { supertypes.add(sType); next.add(sType); } } } return supertypes; }</code><technical_language>a list here: Queue<Type> next = new ArrayDeque<Type>();</technical_language>

Target:
private static Collection<Type> listSupertypes(Type... types) { Set<Type> supertypes = new HashSet<Type>(); Deque<Type> next = new ArrayDeque<Type>(); Collections.addAll(next, types); while (!next.isEmpty()) { Type type = next.remove(); for (Type sType : Type.byName.values()) { if (type.subTypes.contains(type) && supertypes.add(sType)) next.add(sType); } } return supertypes; }
Source:
<code>public void testUpdateTag(){ <START> ArrayList<TagObject> tagList = mProductBacklogMapper.getTagList(); <END> for(int listIndex = 0; listIndex < tagList.size(); listIndex++){ assertEquals(listIndex+1, tagList.get(listIndex).getId()); assertEquals(TEST_TAG_NAME+Integer.toString(listIndex+1), tagList.get(listIndex).getName()); } for(int listIndex = 0; listIndex < tagList.size(); listIndex++){ mMantisTagService.updateTag(tagList.get(listIndex).getId(), "TEST_UPDATE_TAG_"+Integer.toString(listIndex+1),mCP.getProjectList().get(0).getName()); } tagList = mProductBacklogMapper.getTagList(); for(int listIndex = 0; listIndex < tagList.size(); listIndex++){ assertEquals("TEST_UPDATE_TAG_"+Integer.toString(listIndex+1), tagList.get(listIndex).getName()); } }</code><technical_language>tags</technical_language>

Target:
public void testUpdateTag(){ ArrayList<TagObject> tags = mProductBacklogMapper.getTagList(); for(int listIndex = 0; listIndex < tags.size(); listIndex++){ assertEquals(listIndex+1, tags.get(listIndex).getId()); assertEquals(TEST_TAG_NAME+Integer.toString(listIndex+1), tags.get(listIndex).getName()); } for(int listIndex = 0; listIndex < tags.size(); listIndex++){ mMantisTagService.updateTag(tags.get(listIndex).getId(), "TEST_UPDATE_TAG_"+Integer.toString(listIndex+1),mCP.getProjectList().get(0).getName()); } tags = mProductBacklogMapper.getTagList(); for(int listIndex = 0; listIndex < tags.size(); listIndex++){ assertEquals("TEST_UPDATE_TAG_"+Integer.toString(listIndex+1), tags.get(listIndex).getName()); } }
Source:
<code>public void selectCellIfRequired(final int uiRowIndex, final int uiColumnIndex, final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) { GridWidget _gridWidget = gridWidget; int _uiRowIndex = uiRowIndex; int _uiColumnIndex = uiColumnIndex; if (_gridWidget instanceof LiteralExpressionGrid) { final LiteralExpressionGrid grid = (LiteralExpressionGrid) _gridWidget; _gridWidget = grid.getParentInformation().getGridWidget(); _uiRowIndex = grid.getParentInformation().getRowIndex(); _uiColumnIndex = grid.getParentInformation().getColumnIndex(); } else if (_gridWidget instanceof UndefinedExpressionGrid) { <START> final UndefinedExpressionGrid grid = (UndefinedExpressionGrid) _gridWidget; <END> _gridWidget = grid.getParentInformation().getGridWidget(); _uiRowIndex = grid.getParentInformation().getRowIndex(); _uiColumnIndex = grid.getParentInformation().getColumnIndex(); } final int rowIndex = _uiRowIndex; final GridData gridData = _gridWidget.getModel(); final GridColumn<?> column = gridData.getColumns().get(_uiColumnIndex); final Stream<SelectedCell> modelColumnSelectedCells = gridData.getSelectedCells().stream().filter(sc -> sc.getColumnIndex() == column.getIndex()); final boolean isContextMenuCellSelectedCell = modelColumnSelectedCells.map(SelectedCell::getRowIndex).anyMatch(ri -> ri == rowIndex); if (!isContextMenuCellSelectedCell) { selectCell(_uiRowIndex, _uiColumnIndex, _gridWidget, isShiftKeyDown, isControlKeyDown); } }</code><technical_language>this work? java if (_gridWidget instanceof LiteralExpressionGrid || _gridWidget instanceof UndefinedExpressionGrid) { final BaseExpressionGrid grid = (BaseExpressionGrid) _gridWidget; _gridWidget = grid.getParentInformation().getGridWidget(); _uiRowIndex = grid.getParentInformation().getRowIndex(); _uiColumnIndex = grid.getParentInformation().getColumnIndex(); }</technical_language>

Target:
public void selectCellIfRequired(final int uiRowIndex, final int uiColumnIndex, final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) { GridWidget _gridWidget = gridWidget; int _uiRowIndex = uiRowIndex; int _uiColumnIndex = uiColumnIndex; if (_gridWidget instanceof LiteralExpressionGrid || _gridWidget instanceof UndefinedExpressionGrid) { final BaseExpressionGrid grid = (BaseExpressionGrid) _gridWidget; _gridWidget = grid.getParentInformation().getGridWidget(); _uiRowIndex = grid.getParentInformation().getRowIndex(); _uiColumnIndex = grid.getParentInformation().getColumnIndex(); } final int rowIndex = _uiRowIndex; final GridData gridData = _gridWidget.getModel(); final GridColumn<?> column = gridData.getColumns().get(_uiColumnIndex); final Stream<SelectedCell> modelColumnSelectedCells = gridData.getSelectedCells().stream().filter(sc -> sc.getColumnIndex() == column.getIndex()); final boolean isContextMenuCellSelectedCell = modelColumnSelectedCells.map(SelectedCell::getRowIndex).anyMatch(ri -> ri == rowIndex); if (!isContextMenuCellSelectedCell) { selectCell(_uiRowIndex, _uiColumnIndex, _gridWidget, isShiftKeyDown, isControlKeyDown); } }
Source:
<code>public void logCheckedExceptionAsError(LogLevel logLevelToConfigure, boolean logContainsMessage, boolean logContainsStackTrace) { String exceptionMessage = "An exception message"; IOException ioException = createIOException(exceptionMessage); String originalLogLevel = setupLogLevel(logLevelToConfigure.getLogLevel()); try { throw new ClientLogger(ClientLoggerTests.class).logCheckedExceptionAsError(ioException); <START> } catch (Throwable throwable) { <END> assertTrue(throwable instanceof IOException); } setPropertyToOriginalOrClear(originalLogLevel); String logValues = new String(logCaptureStream.toByteArray(), StandardCharsets.UTF_8); assertEquals(logContainsMessage, logValues.contains(exceptionMessage + System.lineSeparator())); assertEquals(logContainsStackTrace, logValues.contains(ioException.getStackTrace()[0].toString())); }</code><technical_language>this changed catch IOException instead</technical_language>

Target:
public void logCheckedExceptionAsError(LogLevel logLevelToConfigure, boolean logContainsMessage, boolean logContainsStackTrace) { String exceptionMessage = "An exception message"; IOException ioException = createIOException(exceptionMessage); String originalLogLevel = setupLogLevel(logLevelToConfigure.getLogLevel()); try { throw new ClientLogger(ClientLoggerTests.class).logThrowableAsError(ioException); } catch (Throwable throwable) { assertTrue(throwable instanceof IOException); } setPropertyToOriginalOrClear(originalLogLevel); String logValues = new String(logCaptureStream.toByteArray(), StandardCharsets.UTF_8); assertEquals(logContainsMessage, logValues.contains(exceptionMessage + System.lineSeparator())); assertEquals(logContainsStackTrace, logValues.contains(ioException.getStackTrace()[0].toString())); }
Source:
<code>private boolean pingLeader() { Optional<PingableLeader> maybeLeader = getSuspectedLeader(true ); if (!maybeLeader.isPresent()) { return false; } final PingableLeader leader = maybeLeader.get(); final HostAndPort leaderName = potentialLeadersToHosts.get(leader); CompletionService<Boolean> pingCompletionService = new ExecutorCompletionService<Boolean>( executor); pingCompletionService.submit(new Callable<Boolean>() { @Override public Boolean call() throws Exception { leaderLog.trace("Pinging suspected leader " + leaderName); return leader.ping(); } }); try { Future<Boolean> pingFuture = pingCompletionService.poll( leaderPingResponseWaitMs, TimeUnit.MILLISECONDS); if (pingFuture != null) { if (pingFuture.get()) { leaderLog.trace("Successfully pinged " + leaderName); <START> return true; <END> } else { leaderLog.info("Pinged " + leaderName + " and it reported that it is no longer the leader"); return false; } } else { leaderLog.warn("Timed out pinging " + leaderName + " after " + leaderPingResponseWaitMs + "ms"); return false; } } catch (InterruptedException e) { leaderLog.warn("Interrupted while pinging " + leaderName); log.warn("Interrupted while pinging " + leaderName); return false; } catch (ExecutionException e) { log.warn("Cannot ping " + leaderName, e); leaderLog.warn("Cannot ping " + leaderName, e); return false; } }</code><technical_language>nit: indentation is wrong here</technical_language>

Target:
private boolean pingLeader() { Optional<PingableLeader> maybeLeader = getSuspectedLeader(true ); if (!maybeLeader.isPresent()) { return false; } final PingableLeader leader = maybeLeader.get(); final HostAndPort leaderName = potentialLeadersToHosts.get(leader); CompletionService<Boolean> pingCompletionService = new ExecutorCompletionService<Boolean>( executor); pingCompletionService.submit(new Callable<Boolean>() { @Override public Boolean call() throws Exception { leaderLog.trace("Pinging suspected leader " + leaderName); return leader.ping(); } }); try { Future<Boolean> pingFuture = pingCompletionService.poll( leaderPingResponseWaitMs, TimeUnit.MILLISECONDS); if (pingFuture == null) { leaderLog.warn("Timed out pinging after ms", leaderName, leaderPingResponseWaitMs); return false; } else if (pingFuture.get()) { leaderLog.trace("Successfully pinged {}", leaderName); return true; } else { leaderLog.info("Pinged and it reported that it is no longer the leader", leaderName); return false; } } catch (InterruptedException e) { log.warn("Interrupted while pinging {}", leaderName); leaderLog.warn("Interrupted while pinging {}", leaderName); return false; } catch (ExecutionException e) { log.warn("Cannot ping {}", leaderName, e); leaderLog.warn("Cannot ping {}", leaderName, e); return false; } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_javaservices_directions); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull MapboxMap mapboxMap) { DirectionsActivity.this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { origin = Point.fromLngLat(-3.588098, 37.176164); destination = Point.fromLngLat(-3.601845, 37.184080); initSource(); <START> initLayers(); <END> getRoute(origin, destination); } }); } }); }</code><technical_language>add style parameter 2 methods</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_javaservices_directions); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull MapboxMap mapboxMap) { DirectionsActivity.this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { origin = Point.fromLngLat(-3.588098, 37.176164); destination = Point.fromLngLat(-3.601845, 37.184080); initSource(style); initLayers(style); getRoute(style, origin, destination); } }); } }); }
Source:
<code>protected <E> Long remove( final E entity ) throws BackendlessException { if( entity == null ) throw new IllegalArgumentException( ExceptionMessage.NULL_ENTITY ); Map<String, Object> entityMap = BackendlessSerializer.serializeToMap( entity ); <START> if( !entityMap.containsKey( "objectId" ) ) <END> { String objectIdFromFootprints = FootprintsManager.getInstance().getObjectId( entity ); if( objectIdFromFootprints != null ) entityMap.put( "objectId", objectIdFromFootprints ); } Object result = Invoker.invokeSync( PERSISTENCE_MANAGER_SERVER_ALIAS, "remove", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), getSimpleName( entity.getClass() ), entityMap } ); FootprintsManager.getInstance().Inner.removeFootprintForObject( entityMap, entity ); return ((Number) result).longValue(); }</code><technical_language>this logic is encapsulated in BackendlessSerializer.serializeToMap(): FootrprintsManager.Inner.putMissingPropsToEntityMap() check if works expected remove</technical_language>

Target:
protected <E> Long remove( final E entity ) throws BackendlessException { if( entity == null ) throw new IllegalArgumentException( ExceptionMessage.NULL_ENTITY ); Map<String, Object> entityMap = BackendlessSerializer.serializeToMap( entity ); FootprintsManager.getInstance().Inner.putMissingPropsToEntityMap( entity, entityMap ); Object result = Invoker.invokeSync( PERSISTENCE_MANAGER_SERVER_ALIAS, "remove", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), getSimpleName( entity.getClass() ), entityMap } ); FootprintsManager.getInstance().Inner.removeFootprintForObject( entityMap, entity ); return ((Number) result).longValue(); }
Source:
<code>public void setUp() { super.setUp(); Properties consumerDeserializerProperties = new Properties(); consumerDeserializerProperties.setProperty("key.deserializer", DEFAULT_DESERIALIZER); consumerDeserializerProperties.setProperty("value.deserializer", DEFAULT_DESERIALIZER); producer = TestUtils.createNewProducer( bootstrapServers(), 1, 60 * 1000L, 1024L * 1024L, 0, 0L, 5 * 1000L, SecurityProtocol.PLAINTEXT, null, <START> Option$.MODULE$.<Properties>apply(new Properties()), <END> new StringSerializer(), new StringSerializer(), Option$.MODULE$.<Properties>apply(new Properties())); consumer = TestUtils.createNewConsumer( bootstrapServers(), "group", "earliest", 4096L, "org.apache.kafka.clients.consumer.RangeAssignor", 30000, SecurityProtocol.PLAINTEXT, Option$.MODULE$.<File>empty(), Option$.MODULE$.<Properties>empty(), Option$.MODULE$.<Properties>apply(consumerDeserializerProperties)); }</code><technical_language>Option.apply directly, elsewhere</technical_language>

Target:
public void setUp() { super.setUp(); Properties consumerDeserializerProperties = new Properties(); consumerDeserializerProperties.setProperty("key.deserializer", DEFAULT_DESERIALIZER); consumerDeserializerProperties.setProperty("value.deserializer", DEFAULT_DESERIALIZER); producer = TestUtils.createNewProducer( bootstrapServers(), 1, 60 * 1000L, 1024L * 1024L, 0, 0L, 5 * 1000L, SecurityProtocol.PLAINTEXT, null, Option.apply(new Properties()), new StringSerializer(), new StringSerializer(), Option.apply(new Properties())); consumer = TestUtils.createNewConsumer( bootstrapServers(), "group", "earliest", 4096L, "org.apache.kafka.clients.consumer.RangeAssignor", 30000, SecurityProtocol.PLAINTEXT, Option$.MODULE$.<File>empty(), Option$.MODULE$.<Properties>empty(), Option$.MODULE$.<Properties>apply(consumerDeserializerProperties)); }
Source:
<code>public static DocumentModel moveContentToColdStorage(CoreSession session, DocumentRef documentRef) { DocumentModel documentModel = session.getDocument(documentRef); log.debug("Move to cold storage the main content of document: {}", documentModel); Serializable mainContent = documentModel.getPropertyValue(FILE_CONTENT_PROPERTY); if (mainContent == null) { throw new NuxeoException(String.format("There is no main content for document: %s.", documentModel), SC_NOT_FOUND); } if (documentModel.hasFacet(FacetNames.COLD_STORAGE) && documentModel.getPropertyValue(COLD_STORAGE_CONTENT_PROPERTY) != null) { throw new NuxeoException( String.format("The main content for document: %s is already in cold storage.", documentModel), SC_CONFLICT); } documentModel.addFacet(FacetNames.COLD_STORAGE); documentModel.setPropertyValue(COLD_STORAGE_CONTENT_PROPERTY, mainContent); <START> Blob thumbnail = Framework.getService(ThumbnailService.class).getThumbnail(documentModel, session); <END> documentModel.setPropertyValue(FILE_CONTENT_PROPERTY, (Serializable) thumbnail); return session.saveDocument(documentModel); }</code><technical_language>I helper's role decide replacement content a thumbnail. convinced other cases want replacements computed differently. move this caller, in operation</technical_language>

Target:
public static DocumentModel moveContentToColdStorage(CoreSession session, DocumentRef documentRef) { DocumentModel documentModel = session.getDocument(documentRef); log.debug("Move to cold storage the main content of document: {}", documentModel); if (documentModel.hasFacet(FacetNames.COLD_STORAGE) && documentModel.getPropertyValue(COLD_STORAGE_CONTENT_PROPERTY) != null) { throw new NuxeoException( String.format("The main content for document: %s is already in cold storage.", documentModel), SC_CONFLICT); } Serializable mainContent = documentModel.getPropertyValue(FILE_CONTENT_PROPERTY); if (mainContent == null) { throw new NuxeoException(String.format("There is no main content for document: %s.", documentModel), SC_NOT_FOUND); } documentModel.addFacet(FacetNames.COLD_STORAGE); documentModel.setPropertyValue(COLD_STORAGE_CONTENT_PROPERTY, mainContent); documentModel.setPropertyValue(FILE_CONTENT_PROPERTY, null); return documentModel; }
Source:
<code>public void scanFile(JavaFileScannerContext context) { this.context = context; statementSet.clear(); <START> scan(context.getTree()); <END> }</code><technical_language>clear set scan to, references IfStatementTree for scanning process. Actually, I prefer avoid a set altogether parent retrieve else keyword (i.e. if parent is a IfStatementTree current if is else statement of parent). do think</technical_language>

Target:
public void scanFile(JavaFileScannerContext context) { this.context = context; scan(context.getTree()); }
Source:
<code>@Test public void testTransitiveInferenceConjunctInPullUp() throws Exception { final String sql = "select 1 from sales.emp d" + " inner join sales.emp e on d.deptno = e.deptno" <START> + " where d.deptno in (7, 9) or d.deptno > 10"; <END> transitiveInference(sql); }</code><technical_language>Add new line character in break string in code</technical_language>

Target:
@Test public void testTransitiveInferenceConjunctInPullUp() throws Exception { final String sql = "select 1 from sales.emp d\n" + "inner join sales.emp e on d.deptno = e.deptno\n" + "where d.deptno in (7, 9) or d.deptno > 10"; sql(sql).withPre(getTransitiveProgram()) .withRule(JoinPushTransitivePredicatesRule.INSTANCE).check(); }
Source:
<code>protected Object convertMap(Object value) { Map map = (Map) value; if (map.isEmpty()) { return null; } Map<Object, Object> convertedMap = new HashMap<>(); <START> for (Object key : map.keySet()) { <END> Object convertedValue = null; if (key != null) { convertedValue = convert(map.get(key)); } convertedMap.put(convertSingleValue(key), convertedValue); } return convertedMap; }</code><technical_language>map.entrySet() avoid unnecessary lookups</technical_language>

Target:
protected Object convertMap(Object value) { Map<Object, Object> map = (Map) value; if (map.isEmpty()) { return null; } Map<Object, Object> convertedMap = new HashMap<>(); for (Map.Entry<Object, Object> entry : map.entrySet()) { Object mapKey = entry.getKey(); Object mapValue = entry.getValue(); if (mapKey != null) { Object convertedMapValue = null; if (mapValue != null) { convertedMapValue = convert(mapValue); } if (convertedMapValue != null) { convertedMap.put(convertSingleValue(entry.getKey()), convertedMapValue); } } } if (convertedMap.isEmpty()) { return null; } return convertedMap; }
Source:
<code>public void buildCallbacksForEntity(String entityClassName, CallbackRegistrar callbackRegistrar) { final boolean debugEnabled = log.isDebugEnabled(); try { final XClass entityXClass = reflectionManager.classForName( entityClassName ); final Class entityClass = reflectionManager.toClass( entityXClass ); for ( CallbackType callbackType : CallbackType.values() ) { if ( callbackRegistrar.hasRegisteredCallbacks( entityClass, callbackType ) ) { if ( debugEnabled ) { log.debugf( "CallbackRegistry reported that Class [%s] already had %s callbacks registered; " + "assuming this means the class was mapped twice " + "(using hbm.xml entity-name support) - skipping subsequent registrations", entityClassName, callbackType.getCallbackAnnotation().getSimpleName() ); } continue; } <START> final Callback[] callbacks = AccessController.doPrivileged( new PrivilegedAction<Callback[]>() { <END> @Override public Callback[] run() { return resolveEntityCallbacks( entityXClass, callbackType, reflectionManager ); } } ); callbackRegistrar.registerCallbacks( entityClass, callbacks ); } } catch (ClassLoadingException e) { throw new MappingException( "entity class not found: " + entityClassName, e ); } }</code><technical_language>granularity of this call</technical_language>

Target:
public void buildCallbacksForEntity(String entityClassName, CallbackRegistrar callbackRegistrar) { final boolean debugEnabled = log.isDebugEnabled(); try { final XClass entityXClass = reflectionManager.classForName( entityClassName ); final Class entityClass = reflectionManager.toClass( entityXClass ); for ( CallbackType callbackType : CallbackType.values() ) { if ( callbackRegistrar.hasRegisteredCallbacks( entityClass, callbackType ) ) { if ( debugEnabled ) { log.debugf( "CallbackRegistry reported that Class [%s] already had %s callbacks registered; " + "assuming this means the class was mapped twice " + "(using hbm.xml entity-name support) - skipping subsequent registrations", entityClassName, callbackType.getCallbackAnnotation().getSimpleName() ); } continue; } final Callback[] callbacks = resolveEntityCallbacks( entityXClass, callbackType, reflectionManager ); callbackRegistrar.registerCallbacks( entityClass, callbacks ); } } catch (ClassLoadingException e) { throw new MappingException( "entity class not found: " + entityClassName, e ); } }
Source:
<code>private void waitForRedirectIfAny() { String loginRedirectUrl = Config.APP_URL + "/_"; <START> WebDriverWait wait = new WebDriverWait(browser.driver, TestProperties.TEST_TIMEOUT); <END> wait.until((WebDriver d) -> { String url = d.getCurrentUrl(); boolean isTeammatesPage = url.startsWith(Config.APP_URL) && !url.startsWith(loginRedirectUrl); boolean isApprovalPage = d.getPageSource().contains(EXPECTED_SNIPPET_APPROVAL); return isTeammatesPage || isApprovalPage; }); }</code><technical_language>wanna I I finally lambda arrow in TEAMMATES code base</technical_language>

Target:
private void waitForRedirectIfAny() { String loginRedirectUrl = TestProperties.TEAMMATES_URL + "/_ah/conflogin"; WebDriverWait wait = new WebDriverWait(browser.driver, TestProperties.TEST_TIMEOUT); wait.until((WebDriver d) -> { String url = d.getCurrentUrl(); boolean isTeammatesPage = url.startsWith(TestProperties.TEAMMATES_URL) && !url.startsWith(loginRedirectUrl); boolean isApprovalPage = d.getPageSource().contains(EXPECTED_SNIPPET_APPROVAL); return isTeammatesPage || isApprovalPage; }); }
Source:
<code>public void failureOriginMetrics() { navigation.selectRow().invoke("View"); Application.waitUntilVisible(); <START> <END> MetricsAreaFragment metricsArea = tmPage.getFailureOriginMetricsArea(); MetricsFragment appFailuresMetrics = metricsArea.getMetricsFragment(APPLICATION_FAILURES); MetricsFragment resFailuresMetrics = metricsArea.getMetricsFragment(RESOURCE_FAILURES); assertEquals(metricsArea.getMetricNumber(APPLICATION_FAILURES), appFailuresMetrics.getCurrentValue(), DELTA); assertEquals(metricsArea.getMetricNumber(RESOURCE_FAILURES), resFailuresMetrics.getCurrentValue(), DELTA); }</code><technical_language>Please move this end of before() method</technical_language>

Target:
public void failureOriginMetrics(){ MetricsAreaFragment metricsArea = tmPage.getFailureOriginMetricsArea(); MetricsFragment appFailuresMetrics = metricsArea.getMetricsFragment(APPLICATION_FAILURES); MetricsFragment resFailuresMetrics = metricsArea.getMetricsFragment(RESOURCE_FAILURES); assertEquals(metricsArea.getMetricNumber(APPLICATION_FAILURES), appFailuresMetrics.getCurrentValue(), DELTA); assertEquals(metricsArea.getMetricNumber(RESOURCE_FAILURES), resFailuresMetrics.getCurrentValue(), DELTA); }
Source:
<code><START> public Parameter(String name, Type type, boolean mappingTarget, boolean targetType, boolean mappingContext) { <END> this.name = "values".equals( name ) ? "values_" : name; this.originalName = name; this.type = type; this.mappingTarget = mappingTarget; this.targetType = targetType; this.mappingContext = mappingContext; }</code><technical_language>wondering create sub-types instead of booleans</technical_language>

Target:
private Parameter(String name, Type type, boolean mappingTarget, boolean targetType, boolean mappingContext) { this.name = "values".equals( name ) ? "values_" : name; this.originalName = name; this.type = type; this.mappingTarget = mappingTarget; this.targetType = targetType; this.mappingContext = mappingContext; }
Source:
<code>public void testDeployment() throws Exception { final ModelControllerClient client = managementClient.getControllerClient(); final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client); try (final InputStream is = testDeploymentFile.getInputStream()){ Future<?> future = manager.execute( <START> manager.newDeploymentPlan().add(testDeploymentFile.getName(), is).deploy(testDeploymentFile.getName()).build()); <END> awaitDeploymentExecution(future); } ModelNode findDeployment = Util.createEmptyOperation(READ_RESOURCE_OPERATION, PathAddress.pathAddress(DEPLOYMENT, testDeploymentFile.getName())); Assert.assertTrue( managementClient.executeForResult(findDeployment).isDefined()); Future<?> future = manager.execute(manager.newDeploymentPlan().undeploy(testDeploymentFile.getName()).remove(testDeploymentFile.getName()).build()); awaitDeploymentExecution(future); ModelNode result = client.execute(findDeployment); Assert.assertEquals(FAILED, result.get(OUTCOME).asString()); }</code><technical_language>removing ".deploy(testDeploymentFile.getName())" eliminate DUPs test</technical_language>

Target:
public void testDeployment() throws Exception { final ModelControllerClient client = managementClient.getControllerClient(); final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client); Future<?> future = manager.execute( manager.newDeploymentPlan().add(testDeploymentFile.getName(), testDeploymentFile.getFile()).deploy(testDeploymentFile.getName()).build()); awaitDeploymentExecution(future); ModelNode findDeployment = Util.createEmptyOperation(READ_RESOURCE_OPERATION, PathAddress.pathAddress(DEPLOYMENT, testDeploymentFile.getName())); Assert.assertTrue( managementClient.executeForResult(findDeployment).isDefined()); future = manager.execute(manager.newDeploymentPlan().undeploy(testDeploymentFile.getName()).remove(testDeploymentFile.getName()).build()); awaitDeploymentExecution(future); ModelNode result = client.execute(findDeployment); Assert.assertEquals(FAILED, result.get(OUTCOME).asString()); }
Source:
<code>public void postCollectionDefaultBitstreamReadGroupCreateDefaultBitstreamReadGroupDcTitleUnprocessable() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); metadataRest.put("dc.title", new MetadataValueRest("testTitle")); groupRest.setMetadata(metadataRest); AtomicReference<UUID> idRef = new AtomicReference<>(); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); <START> <END> }</code><technical_language>double check group created default anonymous permission</technical_language>

Target:
public void postCollectionDefaultBitstreamReadGroupCreateDefaultBitstreamReadGroupDcTitleUnprocessable() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); metadataRest.put("dc.title", new MetadataValueRest("testTitle")); groupRest.setMetadata(metadataRest); AtomicReference<UUID> idRef = new AtomicReference<>(); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); Group anon = groupService.findByName(context, Group.ANONYMOUS); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(anon.getID(), anon.getName()))); }
Source:
<code><START> public void onDownload(final Supplier<Path> pathSupplier) { <END> final String downloadURL = getFileDownloadURL(pathSupplier); open(downloadURL); }</code><technical_language>@yesamer changed _public_ ? understand</technical_language>

Target:
protected void onDownload(final Supplier<Path> pathSupplier) { final String downloadURL = getFileDownloadURL(pathSupplier); open(downloadURL); }
Source:
<code>public NamingStrategy(NamingConvention javaConvention, NamingConvention cassandraConvention) { <START> setJavaConvention(javaConvention); <END> setCassandraConvention(cassandraConvention); enable(); }</code><technical_language>call public setters a constructor, assign fields directly</technical_language>

Target:
public NamingStrategy(NamingConvention javaConvention, NamingConvention cassandraConvention) { if (javaConvention == null || cassandraConvention == null) { throw new IllegalArgumentException("input/output NamingConvention cannot be null"); } this.javaConvention = javaConvention; this.cassandraConvention = cassandraConvention; this.enabled = true; }
Source:
<code>private static long getNumOfPartitions(TableDescriptor td) throws StandardException { String tableId = Long.toString(td.getBaseConglomerateDescriptor().getConglomerateNumber()); byte[] table = Bytes.toBytes(tableId); <START> Partition root = null; try { long result = 1; root = SIDriver.driver().getTableFactory().getTable(table); if (root != null) result = root.subPartitions(true).size(); return result; } catch (Exception ioe) { throw StandardException.plainWrapException(ioe); } finally { try { if (root != null) root.close(); } catch (IOException e) { throw StandardException.plainWrapException(e); } } } <END></code><technical_language>I a try-with-resources simplify code a bit: try (Partition root = SIDriver.driver().getTableFactory().getTable(table)) { return root != null ? root.subPartitions(true).size() : 1; } catch (Exception ioe) { throw StandardException.plainWrapException(ioe); } If mistaken catch block catch exception root.close()</technical_language>

Target:
private static long getNumOfPartitions(TableDescriptor td) throws StandardException { String tableId = Long.toString(td.getBaseConglomerateDescriptor().getConglomerateNumber()); byte[] table = Bytes.toBytes(tableId); try (Partition root = SIDriver.driver().getTableFactory().getTable(table)) { return root != null ? root.subPartitions(true).size() : 1; } catch (Exception ioe) { throw StandardException.plainWrapException(ioe); } }
Source:
<code>public ByteBuf copy(int index, int length) { checkIndex(index, length); UnpooledHeapByteBuf copy = new UnpooledHeapByteBuf(alloc(), length, maxCapacity()); <START> System.arraycopy(array, index, copy.array, 0, length); <END> return copy.writerIndex(length); }</code><technical_language>@njhill 100 % safe use: ? System.arraycopy(array, index, copy.array, copy.arrayOffset(), length);</technical_language>

Target:
public ByteBuf copy(int index, int length) { checkIndex(index, length); return alloc().heapBuffer(length, maxCapacity()).writeBytes(array, index, length); }
Source:
<code>private SortedSet<ActionParameterRequest> buildActionParameters(FormSchemaJson form) { SortedSet<ActionParameterRequest> parameters = new TreeSet<>(); int order = 0; ActionParameterRequestBuilder builder; for (FormSchemaQuestionJson question : form.getQuestions()) { builder = new ActionParameterRequestBuilder(); String displayName = StringUtils.isBlank(question.getQuestionLabel()) ? question.getQuestionValue() : question.getQuestionLabel(); if (displayName.length() > MAX_LABEL_LENGTH) { displayName = displayName.substring(0, MAX_LABEL_LENGTH); } builder.setDisplayName(displayName) .setKey(question.getQuestionValue()) .setOrder(order++); if (question.getOptions() != null && !question.getOptions().isEmpty()) { builder.setType(ParameterType.SELECT.getValue()); builder.setOptions(convertCommcareoptionsToTaskActionOptions(question.getOptions())); } else { builder.setType(ParameterType.UNICODE.getValue()); } parameters.add(builder.createActionParameterRequest()); } builder = new ActionParameterRequestBuilder(); builder.setValue(form.getXmlns()) .setDisplayName("xmlns") .setKey("xmlns") .setOrder(order++) .setType(ParameterType.UNICODE.getValue()) .setHidden(true); <START> parameters.add(builder.createActionParameterRequest()); <END> return parameters; }</code><technical_language>move this logic private method 'addXmlnsParameter'</technical_language>

Target:
private SortedSet<ActionParameterRequest> buildActionParameters(FormSchemaJson form) { SortedSet<ActionParameterRequest> parameters = new TreeSet<>(); int order = 0; ActionParameterRequestBuilder builder; for (FormSchemaQuestionJson question : form.getQuestions()) { builder = new ActionParameterRequestBuilder(); String displayName = StringUtils.isBlank(question.getQuestionLabel()) ? question.getQuestionValue() : question.getQuestionLabel(); if (displayName.length() > MAX_LABEL_LENGTH) { displayName = displayName.substring(0, MAX_LABEL_LENGTH); } builder.setDisplayName(displayName) .setKey(question.getQuestionValue()) .setOrder(order++); if (question.getOptions() != null && !question.getOptions().isEmpty()) { builder.setType(ParameterType.SELECT.getValue()); builder.setOptions(convertCommcareoptionsToTaskActionOptions(question.getOptions())); } else { builder.setType(ParameterType.UNICODE.getValue()); } parameters.add(builder.createActionParameterRequest()); } parameters.add(addXmlnsParameter(form, order)); return parameters; }
Source:
<code><START> public Group(String name, Id id, List<User> connectedUsers) throws NodeException { <END> super(name, id); if (connectedUsers == null){ throw new NodeException("Error, null list in Group constructor"); } this.connectedUsers = new ArrayList<>(connectedUsers); }</code><technical_language>do checked exception</technical_language>

Target:
public Group(String name, Id id, List<User> connectedUsers){ super(name, id); Objects.requireNonNull(connectedUsers); this.connectedUsers = new ArrayList<>(connectedUsers); }
Source:
<code>private static <T> T doGetMapper(Class<T> clazz, ClassLoader classLoader) throws NoSuchMethodException { try { @SuppressWarnings("unchecked") Class<T> implementation = (Class<T>) classLoader.loadClass( clazz.getName() + IMPLEMENTATION_SUFFIX ); <START> Constructor<T> constructor = implementation.getDeclaredConstructor((Class<?>[]) null); <END> constructor.setAccessible(true); return constructor.newInstance((Object[]) null); } catch (ClassNotFoundException e) { ServiceLoader<T> loader = ServiceLoader.load( clazz, classLoader ); if ( loader != null ) { for ( T mapper : loader ) { if ( mapper != null ) { return mapper; } } } return null; } catch (InstantiationException e) { throw new RuntimeException( e ); } catch (IllegalAccessException e) { throw new RuntimeException( e ); } catch (InvocationTargetException e) { throw new RuntimeException( e ); } }</code><technical_language>is (Class<?>[]) null passed? necessary</technical_language>

Target:
private static <T> T doGetMapper(Class<T> clazz, ClassLoader classLoader) throws NoSuchMethodException { try { @SuppressWarnings( "unchecked" ) Class<T> implementation = (Class<T>) classLoader.loadClass( clazz.getName() + IMPLEMENTATION_SUFFIX ); Constructor<T> constructor = implementation.getDeclaredConstructor(); constructor.setAccessible( true ); return constructor.newInstance(); } catch (ClassNotFoundException e) { ServiceLoader<T> loader = ServiceLoader.load( clazz, classLoader ); if ( loader != null ) { for ( T mapper : loader ) { if ( mapper != null ) { return mapper; } } } return null; } catch (InstantiationException e) { throw new RuntimeException( e ); } catch (IllegalAccessException e) { throw new RuntimeException( e ); } catch (InvocationTargetException e) { throw new RuntimeException( e ); } }
Source:
<code>public Set<RexNode> getExpressionLineage(Calc calc, RelMetadataQuery mq, RexNode outputExpression) { final RelNode input = calc.getInput(); final RexBuilder rexBuilder = calc.getCluster().getRexBuilder(); final ImmutableBitSet inputFieldsUsed = extractInputRefs(outputExpression); final Map<RexInputRef, Set<RexNode>> mapping = new LinkedHashMap<>(); Pair<ImmutableList<RexNode>, ImmutableList<RexNode>> calcFilterAndProjects = <START> calc.getProgram().split(); <END> for (int idx : inputFieldsUsed) { final RexNode inputExpr = calcFilterAndProjects.getKey().get(idx); final Set<RexNode> originalExprs = mq.getExpressionLineage(input, inputExpr); if (originalExprs == null) { return null; } final RexInputRef ref = RexInputRef.of(idx, calc.getRowType().getFieldList()); mapping.put(ref, originalExprs); } return createAllPossibleExpressions(rexBuilder, outputExpression, mapping); }</code><technical_language>calcFilterAndProjects -> calcProjectsAndFilter ? projects key part</technical_language>

Target:
public Set<RexNode> getExpressionLineage(Calc calc, RelMetadataQuery mq, RexNode outputExpression) { final RelNode input = calc.getInput(); final RexBuilder rexBuilder = calc.getCluster().getRexBuilder(); final ImmutableBitSet inputFieldsUsed = extractInputRefs(outputExpression); final Map<RexInputRef, Set<RexNode>> mapping = new LinkedHashMap<>(); Pair<ImmutableList<RexNode>, ImmutableList<RexNode>> calcProjectsAndFilter = calc.getProgram().split(); for (int idx : inputFieldsUsed) { final RexNode inputExpr = calcProjectsAndFilter.getKey().get(idx); final Set<RexNode> originalExprs = mq.getExpressionLineage(input, inputExpr); if (originalExprs == null) { return null; } final RexInputRef ref = RexInputRef.of(idx, calc.getRowType().getFieldList()); mapping.put(ref, originalExprs); } return createAllPossibleExpressions(rexBuilder, outputExpression, mapping); }
Source:
<code>public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } IterableMappingMethod other = (IterableMappingMethod) obj; if ( !getResultType().equals( other.getResultType() ) ) { return false; } if ( getSourceParameters().size() != other.getSourceParameters().size() ) { return false; } for ( int i = 0; i < getSourceParameters().size(); i++ ) { List<Type> thisTypeParameters = getSourceParameters().get( i ).getType().getTypeParameters(); List<Type> otherTypeParameters = other.getSourceParameters().get( i ).getType().getTypeParameters(); if ( !thisTypeParameters.equals( otherTypeParameters ) ) { return false; } } if ( this.selectionParameters != null ) { if ( !this.selectionParameters.equals( other.selectionParameters ) ) { return false; } } <START> else if ( other.selectionParameters == null ) { <END> return false; } return true; }</code><technical_language>I this needs a !=...</technical_language>

Target:
public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } IterableMappingMethod other = (IterableMappingMethod) obj; if ( !getResultType().equals( other.getResultType() ) ) { return false; } if ( getSourceParameters().size() != other.getSourceParameters().size() ) { return false; } for ( int i = 0; i < getSourceParameters().size(); i++ ) { List<Type> thisTypeParameters = getSourceParameters().get( i ).getType().getTypeParameters(); List<Type> otherTypeParameters = other.getSourceParameters().get( i ).getType().getTypeParameters(); if ( !thisTypeParameters.equals( otherTypeParameters ) ) { return false; } } if ( this.selectionParameters != null ) { if ( !this.selectionParameters.equals( other.selectionParameters ) ) { return false; } } else if ( other.selectionParameters != null ) { return false; } return true; }