auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object execute() throws Exception { System.out.println("testCommit"); if (tm == null) { System.out.println("Can not get transaction manager"); } else { DummyXAResource xa1 = new DummyXAResource(); DummyXAResource xa2 = new DummyXAResource(); tm.begin(); Transaction transaction = tm.getTransaction(); <START> transaction.enlistResource(xa1); <END> transaction.enlistResource(xa2); tm.commit(); } return null; }</code><technical_language>Is this recommended in Karaf - do equivalent of JCA I wonder? I guess for dummyxaresource this try a H2 datasource somehow</technical_language>

Target:
public Object execute() throws Exception { System.out.println("testCommit"); if (tm == null) { System.out.println("Can not get transaction manager"); } else { DummyXAResource xa = new DummyXAResource(); Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup("osgi:service/test"); Connection conn = null; Statement stmt = null; try { tm.begin(); Transaction transaction = tm.getTransaction(); transaction.enlistResource(xa); conn = ds.getConnection(); stmt = conn.createStatement(); stmt.execute("CREATE TABLE IF NOT EXISTS example ( id varchar(10), name varchar(32) )"); stmt.execute("insert into example values (1, 'commit')"); tm.commit(); } catch (SQLException e) { System.out.println(e); tm.rollback(); } finally { stmt.close(); conn.close(); } } return null; }
Source:
<code>public int indexOfByte(int b) { <START> checkArgument((b >> Byte.SIZE) == 0, "byte value out of range"); <END> for (int i = 0; i < size; i++) { if (getByteUnchecked(i) == b) { return i; } } return -1; }</code><technical_language>if advantage of this compare 0 <= b && b < 256</technical_language>

Target:
public int indexOfByte(int b) { checkArgument((b >> Byte.SIZE) == 0, "byte value out of range"); return indexOfByte((byte) b); }
Source:
<code>public static void input( @AggregationState EntropyState state, @SqlType(StandardTypes.BIGINT) long count) { if (count == 0) { return; } if (count < 0) { state.setNull(true); return; } <START> final double countVal = count; <END> state.setSumC(state.getSumC() + countVal); state.setSumCLogC(state.getSumCLogC() + countVal * Math.log(countVal)); }</code><technical_language>countVal is necessary. state.setSumC(State.getSumC() + count) directly</technical_language>

Target:
public static void input( @AggregationState EntropyState state, @SqlType(StandardTypes.BIGINT) long count) { if (count < 0) { throw new PrestoException( INVALID_FUNCTION_ARGUMENT, "Entropy count argument must be non-negative"); } if (count == 0) { return; } state.setSumC(state.getSumC() + count); state.setSumCLogC(state.getSumCLogC() + count * Math.log(count)); }
Source:
<code>public static boolean containsLetters(String parameter) { <START> byte[] byteArray = parameter.getBytes(); <END> for (int i = 0; i < byteArray.length; i++){ if (!((byteArray[i] >= '0') && (byteArray[i] <= '9'))) return true; } return false; }</code><technical_language>Check if parameter is null</technical_language>

Target:
public static boolean containsLetters(String parameter) { if (parameter == null) throw new NullPointerException("Parameter cannot be null."); byte[] byteArray = parameter.getBytes(); for (int i = 0; i < byteArray.length; i++){ if (!((byteArray[i] >= '0') && (byteArray[i] <= '9'))) return true; } return false; }
Source:
<code>public void enqueue(final DeferredSerialization ds) { synchronized (this) { if (m_isShutdown) { ds.cancel(); return; } updateLastPendingWriteTimeAndQueueBackpressure(); if (m_isSSLConfigured) { Iterator<DeferredSerialization> dsIter = new SSLDeferredSerializationIterator(m_sslEngine, ds); while (dsIter.hasNext()) { <START> m_queuedWrites.offer(dsIter.next()); <END> } } else { m_queuedWrites.offer(ds); } m_port.setInterests( SelectionKey.OP_WRITE, 0); } }</code><technical_language>this more implemented [drainTo](<LINK_0> strategy</technical_language>

Target:
public void enqueue(final DeferredSerialization ds) { synchronized (this) { if (m_isShutdown) { ds.cancel(); return; } updateLastPendingWriteTimeAndQueueBackpressure(); m_queuedWrites.offer(ds); m_port.setInterests( SelectionKey.OP_WRITE, 0); } }
Source:
<code>public <R extends RestResponse, E extends Named> Map<String, E> retrieveItems(IOperationMonitor monitor, String path, TypeToken typeToken) throws BugzillaRestException { R response = new BugzillaRestAuthenticatedGetRequest<R>(client, path, typeToken).run(monitor); <START> Named[] members = new Function<R, Named[]>() { <END> public Named[] apply(R input) { return input.getArray(); } }.apply(response); return Maps.uniqueIndex((ArrayList<E>) Lists.newArrayList(members), new Function<E, String>() { public String apply(E input) { return input.getName(); }; }); }</code><technical_language>call response.getArray()</technical_language>

Target:
public <R extends RestResponse<E>, E extends Named> Map<String, E> retrieveItems(IOperationMonitor monitor, String path, TypeToken typeToken) throws BugzillaRestException { R response = new BugzillaRestAuthenticatedGetRequest<R>(client, path, typeToken).run(monitor); E[] members = response.getArray(); return Maps.uniqueIndex(Lists.newArrayList(members), new Function<E, String>() { public String apply(E input) { return input.getName(); }; }); }
Source:
<code>private static boolean shouldMoveATask(final ClientState sourceClientState, final ClientState destinationClientState) { final double assignedTasksPerStreamThreadAtDestination = 1.0 * destinationClientState.assignedTasks().size() / destinationClientState.capacity(); final double assignedTasksPerStreamThreadAtSource = 1.0 * sourceClientState.assignedTasks().size() / sourceClientState.capacity(); final double skew = assignedTasksPerStreamThreadAtSource - assignedTasksPerStreamThreadAtDestination; if (skew <= 0) { return false; } final double proposedAssignedTasksPerStreamThreadAtDestination = <START> (destinationClientState.assignedTasks().size() + 1.0) / destinationClientState.capacity(); <END> final double proposedAssignedTasksPerStreamThreadAtSource = (sourceClientState.assignedTasks().size() - 1.0) / sourceClientState.capacity(); final double proposedSkew = proposedAssignedTasksPerStreamThreadAtSource - proposedAssignedTasksPerStreamThreadAtDestination; if (proposedSkew < 0) { return false; } return proposedSkew < skew; }</code><technical_language>req: Please assignedTaskCount() instead of assignedTasks().size()</technical_language>

Target:
private static boolean shouldMoveATask(final ClientState sourceClientState, final ClientState destinationClientState) { final double skew = sourceClientState.assignedTaskLoad() - destinationClientState.assignedTaskLoad(); if (skew <= 0) { return false; } final double proposedAssignedTasksPerStreamThreadAtDestination = (destinationClientState.assignedTaskCount() + 1.0) / destinationClientState.capacity(); final double proposedAssignedTasksPerStreamThreadAtSource = (sourceClientState.assignedTaskCount() - 1.0) / sourceClientState.capacity(); final double proposedSkew = proposedAssignedTasksPerStreamThreadAtSource - proposedAssignedTasksPerStreamThreadAtDestination; if (proposedSkew < 0) { return false; } return proposedSkew < skew; }
Source:
<code><START> public static <T extends CommandBase<?>> List<T> findChildCommands(Guid commandId) { <END> final List<Guid> childCommandIds = getChildCommandIds(commandId); final List<T> childCommands = childCommandIds .stream() .map(CommandCoordinatorUtil::<T> retrieveCommand) .collect(Collectors.toList()); return childCommands; }</code><technical_language>change get child commands CommandEntity CommandBase, slimmer (doesn't require build command objects) contains data in calling class</technical_language>

Target:
public static List<CommandEntity> findChildCommands(Guid commandId) { final List<Guid> childCommandIds = getChildCommandIds(commandId); final List<CommandEntity> childCommands = childCommandIds .stream() .map(CommandCoordinatorUtil::getCommandEntity) .collect(Collectors.toList()); return childCommands; }
Source:
<code>public long getHeaderLength() throws NitfFormatException, IOException { long headerLength = DataExtensionConstants.DE.length() + DataExtensionConstants.DESID_LENGTH + DataExtensionConstants.DESVER_LENGTH + getSecurityMetadata().getSerialisedLength(); if (isTreOverflowNitf20() || isTreOverflowNitf21()) { headerLength += DataExtensionConstants.DESOFLW_LENGTH; headerLength += DataExtensionConstants.DESITEM_LENGTH; } headerLength += DataExtensionConstants.DESSHL_LENGTH; headerLength += getUserDefinedSubheaderField().length(); return headerLength; <START> } <END></code><technical_language>I static imports</technical_language>

Target:
public long getHeaderLength() throws NitfFormatException, IOException { long headerLength = DE.length() + DESID_LENGTH + DESVER_LENGTH + getSecurityMetadata().getSerialisedLength(); if (isTreOverflowNitf20() || isTreOverflowNitf21()) { headerLength += DESOFLW_LENGTH; headerLength += DESITEM_LENGTH; } headerLength += DESSHL_LENGTH; headerLength += getUserDefinedSubheaderField().length(); return headerLength; }
Source:
<code>private RelationalSymbolicValue(Kind kind, SymbolicValue leftOp, SymbolicValue rightOp) { <START> super(leftOp, rightOp); <END> this.kind = kind; }</code><technical_language>operands initialized : this.leftOp = leftOp; super() constructor is required</technical_language>

Target:
private RelationalSymbolicValue(Kind kind, SymbolicValue leftOp, SymbolicValue rightOp) { this.kind = kind; this.leftOp = leftOp; this.rightOp = rightOp; }
Source:
<code>public PlanNodeCostEstimate visitSpatialJoin(SpatialJoinNode node, Void context) { return calculateJoinCost( node.getLeft(), node.getRight(), <START> Objects.equals(node.getDistributionType(), SpatialJoinNode.DistributionType.REPLICATED)); <END> }</code><technical_language>node.getDistributionType() == SpatialJoinNode.DistributionType.REPLICATED</technical_language>

Target:
public PlanNodeCostEstimate visitSpatialJoin(SpatialJoinNode node, Void context) { return calculateJoinExchangeCost( node.getLeft(), node.getRight(), stats, types, node.getDistributionType() == SpatialJoinNode.DistributionType.REPLICATED, taskCountEstimator.estimateSourceDistributedTaskCount()); }
Source:
<code>public View display(final Context context, int position, View v) { <START> if (v == null) { <END> if (appPojo.displayTags.isEmpty()) { v = inflateFromId(context, R.layout.item_app); } else { v = inflateFromId(context, R.layout.item_app_with_tags); TextView tagsView = (TextView) v.findViewById(R.id.item_app_tag); tagsView.setText(enrichText(appPojo.displayTags)); } } TextView appName = (TextView) v.findViewById(R.id.item_app_name); appName.setText(enrichText(appPojo.displayName)); final ImageView appIcon = (ImageView) v.findViewById(R.id.item_app_icon); if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("icons-hide", false)) { if (position < 15 || Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) { appIcon.setImageDrawable(this.getDrawable(context)); } else { Handler handler = new Handler(); handler.post(new Runnable() { @Override public void run() { appIcon.setImageDrawable(getDrawable(context)); } }); } } else { appIcon.setVisibility(View.INVISIBLE); } return v; }</code><technical_language>this work List View recycle Results for performance, inflating reused for another app tags (or tags). This crash system reuse a tag-less holder for a tagged app get a NullPointerException need define a completely new Result type, a linearlayout Visibility.GONE correct gravity get result for :)</technical_language>

Target:
public View display(final Context context, int position, View v) { if (v == null) { v = inflateFromId(context, R.layout.item_app); } TextView appName = (TextView) v.findViewById(R.id.item_app_name); appName.setText(enrichText(appPojo.displayName)); TextView tagsView = (TextView) v.findViewById(R.id.item_app_tag); if (appPojo.displayTags.isEmpty()) { tagsView.setVisibility(View.GONE); } else { tagsView.setVisibility(View.VISIBLE); } tagsView.setText(enrichText(appPojo.displayTags)); final ImageView appIcon = (ImageView) v.findViewById(R.id.item_app_icon); if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("icons-hide", false)) { if (position < 15 || Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) { appIcon.setImageDrawable(this.getDrawable(context)); } else { Handler handler = new Handler(); handler.post(new Runnable() { @Override public void run() { appIcon.setImageDrawable(getDrawable(context)); } }); } } else { appIcon.setVisibility(View.INVISIBLE); } return v; }
Source:
<code>FrameworkField(Field field) { if (field == null) { <START> throw new IllegalArgumentException( <END> "FrameworkField cannot be created without an underlying field."); } fField = field; }</code><technical_language>I more common throw a NullPointerException if a parameter is unexpectedly null</technical_language>

Target:
FrameworkField(Field field) { if (field == null) { throw new NullPointerException( "FrameworkField cannot be created without an underlying field."); } fField = field; }
Source:
<code>public void checkinUsers(List<User> users) { EKBCommit commit = getEKBCommit(); preparePersistenceAccess(); for (User user : users) { <START> List<User> result = queryService.queryByString(User.class, "username:\"" + user.getUsername() + "\""); <END> if (result.size() == 0) { LOGGER.info("Create User " + user.getUsername()); commit.addInsert(user); } else if (result.size() == 1) { LOGGER.info("Update User " + user.getUsername()); commit.addUpdate(user); } else { LOGGER.error("Error: Duplicate users in EngSB"); commit.addUpdate(user); } } persistService.commit(commit); revokePersistenceAccess(); }</code><technical_language>query(QueryRequest) method</technical_language>

Target:
public void checkinUsers(List<User> users) { EKBCommit commit = getEKBCommit(); preparePersistenceAccess(); for (User user : users) { List<User> result = queryService.query(User.class, QueryRequest.query("username", user.getUsername())); if (result.size() == 0) { LOGGER.info("Create User " + user.getUsername()); commit.addInsert(user); } else if (result.size() == 1) { LOGGER.info("Update User " + user.getUsername()); commit.addUpdate(user); } else { LOGGER.warn("Error: Duplicate users in EngSB"); commit.addUpdate(user); } } persistService.commit(commit); revokePersistenceAccess(); }
Source:
<code>private List<CreateMessage> produce(int messageNum) { <START> StringBuilder bodyBuilder = new StringBuilder(); <END> bodyBuilder.append(format("%s=%s%n", PRODUCER_NAME, producerName)); bodyBuilder.append(format("%s=%d%n", MESSAGE_NUM, messageNum)); bodyBuilder.append(format("%s=%s%n", MESSAGE_TEXT, "Queue This Way")); CreateMessage message = CreateMessage.builder().ttl(300).body(bodyBuilder.toString()).build(); System.out.format(" Producer %s Message %s:%d%n", producerName, producerName, messageNum); return ImmutableList.of(message); }</code><technical_language>tee hee ;-)</technical_language>

Target:
private List<CreateMessage> produce(int messageNum) { StringBuilder bodyBuilder = new StringBuilder(); bodyBuilder.append(format("%s=%s%n", PRODUCER_NAME, producerName)) .append(format("%s=%d%n", MESSAGE_NUM, messageNum)) .append(format("%s=%s%n", MESSAGE_TEXT, "Queue This Way")); CreateMessage message = CreateMessage.builder().ttl(300).body(bodyBuilder.toString()).build(); System.out.format(" Producer %s Message %s:%d%n", producerName, producerName, messageNum); return ImmutableList.of(message); }
Source:
<code>public static WebArchive deployment() { return ShrinkWrap.create(WebArchive.class, "http-test.war") .addPackage(HttpInvocationInContainerTestCase.class.getPackage()) .addAsManifestResource(createPermissionsXmlAsset( <START> new SocketPermission("localhost:8080", "connect,resolve") <END> ), "permissions.xml"); }</code><technical_language>@hkalina host port overridden some properties, this is guaranteed correct always. Do <LINK_0> instead</technical_language>

Target:
public static WebArchive deployment() { String SERVER_HOST_PORT = TestSuiteEnvironment.getHttpAddress() + ":" + TestSuiteEnvironment.getHttpPort(); return ShrinkWrap.create(WebArchive.class, "http-test.war") .addPackage(HttpInvocationInContainerTestCase.class.getPackage()) .addAsManifestResource(createPermissionsXmlAsset( new SocketPermission(SERVER_HOST_PORT, "connect,resolve") ), "permissions.xml"); }
Source:
<code>public String getLabel(long time){ try { int quark = fValuechange.handleEntry(fBaseQuark, time); ITmfStateInterval value = fSs.querySingleState(time, quark); if (value != null && !value.getStateValue().isNull()) { ITmfStateValue state = value.getStateValue(); return state.toString(); } } catch (StateValueTypeException | TimeRangeException | AttributeNotFoundException | StateSystemDisposedException e) { } return null; <START> <END> }</code><technical_language>extra blank line</technical_language>

Target:
public String getLabel(long time){ if (fValuechange == null) { return null; } try { int quark = fValuechange.handleEntry(fBaseQuark, time); ITmfStateInterval value = fSs.querySingleState(time, quark); if (value != null && !value.getStateValue().isNull()) { ITmfStateValue state = value.getStateValue(); return state.toString(); } } catch (StateValueTypeException | TimeRangeException | AttributeNotFoundException | StateSystemDisposedException e) { } return null; }
Source:
<code>public void setValue_serialize_to_xml() throws Exception { final SProcessContractData saProcessContractData = new SProcessContractData(); final MyPojo theName = new MyPojo("theName", "theValue".getBytes()); saProcessContractData.setValue(theName); final Serializable value = saProcessContractData.value; assertThat(value).isInstanceOf(String.class); final Serializable unserializedValue = saProcessContractData.getValue(); assertThat(unserializedValue).isInstanceOf(MyPojo.class); assertThat(((MyPojo) unserializedValue).getName()).isEqualTo("theName"); assertThat(((MyPojo) unserializedValue).getContent()).isEqualTo("theValue".getBytes()); <START> assertThat(value).isEqualTo("<?xml version=\"1.0\" ?><org.bonitasoft.engine.core.contract.data.MyPojo><name>theName</name><content>dGhlVmFsdWU=</content></org.bonitasoft.engine.core.contract.data.MyPojo>"); <END> }</code><technical_language>independant XStream implementation in tests</technical_language>

Target:
public void setValue_serialize_to_xml() throws Exception { final SProcessContractData saProcessContractData = new SProcessContractData(); final MyPojo myPojo = new MyPojo("theName", "theValue".getBytes()); saProcessContractData.setValue(myPojo); final Serializable value = saProcessContractData.value; assertThat(value).isInstanceOf(String.class); final Serializable unserializedValue = saProcessContractData.getValue(); assertThat(unserializedValue).isInstanceOf(MyPojo.class); assertThat(((MyPojo) unserializedValue).getName()).isEqualTo("theName"); assertThat(((MyPojo) unserializedValue).getContent()).isEqualTo("theValue".getBytes()); assertThat(value).isEqualTo(XStreamFactory.getXStream().toXML(myPojo)); }
Source:
<code>public String toString() { <START> return "DelimitedParserSchema [delimiterChar=" + delimiterChar + ", quoteChar=" + quoteChar + ", lineDelimiter=" <END> + lineDelimiter + ", fields=" + fields + "]"; }</code><technical_language>DelimitedParserSchema => DelimitedSchema? IDE generated toString() method</technical_language>

Target:
public String toString() { return "DelimitedSchema [delimiterChar=" + delimiterChar + ", quoteChar=" + quoteChar + ", lineDelimiter=" + lineDelimiter + ", fieldNames=" + fieldNames + ", fields=" + fields + "]"; }
Source:
<code>public static VirtualFile convertToVirtualFile( @NotNull IResource resource) { if (resource instanceof IProject) { throw new IllegalArgumentException( "The given resource must be a file or a folder. resource: " + resource); } <START> IntelliJProjectImplV2 sarosProject = (IntelliJProjectImplV2) resource <END> .getProject().getAdapter(IntelliJProjectImplV2.class); return sarosProject.findVirtualFile(resource.getProjectRelativePath()); }</code><technical_language>module instead of sarosProject</technical_language>

Target:
public static VirtualFile convertToVirtualFile( @NotNull IResource resource) { if (resource instanceof IProject) { throw new IllegalArgumentException( "The given resource must be a file or a folder. resource: " + resource); } IntelliJProjectImplV2 wrappedModule = (IntelliJProjectImplV2) resource .getProject().getAdapter(IntelliJProjectImplV2.class); return wrappedModule.findVirtualFile(resource.getProjectRelativePath()); }
Source:
<code>public void close(boolean wait) { for (int i = 0; i < clients.length; i++) { clients[i].close(wait); <START> if (null != clientsV3) { <END> clientsV3[i].close(wait); } } }</code><technical_language>suggestion if (clients != clientsV3) {</technical_language>

Target:
public void close(boolean wait) { for (int i = 0; i < clients.length; i++) { clients[i].close(wait); if (clients != clientsV3Enforced) { clientsV3Enforced[i].close(wait); } } }
Source:
<code>public ATNSimulator setProfile(boolean profile) { ParserATNSimulator previous = getInterpreter(); if ( profile ) { setInterpreter(new ProfilingATNSimulator(this)); } else { <START> if ( previous!=null ) { <END> ParserATNSimulator interp = new ParserATNSimulator(this, getATN(), previous.decisionToDFA, previous.getSharedContextCache()); setInterpreter(interp); } } return previous; }</code><technical_language>This read: java if (previous instanceof ProfilingATNSimulator)</technical_language>

Target:
public void setProfile(boolean profile) { ParserATNSimulator interp = getInterpreter(); if ( profile ) { if (!(interp instanceof ProfilingATNSimulator)) { setInterpreter(new ProfilingATNSimulator(this)); } } else if (interp instanceof ProfilingATNSimulator) { setInterpreter(new ParserATNSimulator(this, getATN(), interp.decisionToDFA, interp.getSharedContextCache())); } }
Source:
<code><START> protected byte[] readIncludedConfig(String relPath) <END> throws ConfigInvalidException { final File file; if (relPath.startsWith("~/")) { file = fs.resolve(fs.userHome(), relPath.substring(2)); } else { file = fs.resolve(configFile.getParentFile(), relPath); } if (!file.exists()) return null; try { return IO.readFully(file); } catch (IOException ioe) { throw new ConfigInvalidException(MessageFormat .format(JGitText.get().cannotReadFile, relPath), ioe); } }</code><technical_language>missing @since 4.10 tag</technical_language>

Target:
protected byte[] readIncludedConfig(String relPath) throws ConfigInvalidException { final File file; if (relPath.startsWith("~/")) { file = fs.resolve(fs.userHome(), relPath.substring(2)); } else { file = fs.resolve(configFile.getParentFile(), relPath); } if (!file.exists()) { return null; } try { return IO.readFully(file); } catch (IOException ioe) { throw new ConfigInvalidException(MessageFormat .format(JGitText.get().cannotReadFile, relPath), ioe); } }
Source:
<code>public boolean startWork(String id) { <START> synchronized (mLock) <END> { return startWork(id, null); } }</code><technical_language>Nit: need synchronized here</technical_language>

Target:
public boolean startWork(String id) { return startWork(id, null); }
Source:
<code>public void addDependency(final ProcessorGraphNode node) { <START> assert node != this; <END> this.dependencies.add(node); node.addRequirement(this); }</code><technical_language>language asserts, tend end in runtime</technical_language>

Target:
public void addDependency(final ProcessorGraphNode node) { Assert.isTrue(node != this, "A processor can't depends on himself"); this.dependencies.add(node); node.addRequirement(this); }
Source:
<code>public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } <START> model.setPromisc(entity.isPromisc()); <END> return entity; }</code><technical_language>potential NPE, please check if element set assignment</technical_language>

Target:
public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } if (model.isSetPromisc()) { model.setPromisc(entity.isPromisc()); } return entity; }
Source:
<code>protected void doExecute() { Collection<EObject> impactedEObjects = new ArrayList<EObject>(); DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); for (EObject eObject : toRemoveXRefFrom) { ECrossReferenceAdapter filteredCrossReferencer = new <START> SiriusCrossReferenceAdapter(domain.getResourceSet(), <END> (DAnalysisSessionImpl) session) { @Override public Collection<Setting> getInverseReferences(EObject eObject, boolean resolve) { Collection<Setting> settings = xReferencer.getInverseReferences(eObject, resolve); Collection<Setting> settingsToTryToUnset = new ArrayList<>(); for (Setting s : settings) { if (!toRemoveXRefFrom.contains(s.getEObject())) { settingsToTryToUnset.add(s); } } return settingsToTryToUnset; } }; impactedEObjects.addAll(modelAccessor.eRemoveInverseCrossReferences(eObject, filteredCrossReferencer, isReferenceToIgnorePredicate)); } for (EObject impactedEObject : impactedEObjects) { Resource resource = impactedEObject.eResource(); if (semanticResources.contains(resource)) { refreshEditorsPrecommitListener.disable(); break; } } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); toRemoveXRefFrom.clear(); modelAccessor = null; xReferencer = null; semanticResources = null; refreshEditorsPrecommitListener = null; }</code><technical_language>Here, possibility avoid referenced/referencing resource lookup</technical_language>

Target:
protected void doExecute() { Collection<EObject> impactedEObjects = new ArrayList<EObject>(); DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); for (EObject eObject : toRemoveXRefFrom) { ECrossReferenceAdapter filteredCrossReferencer = new SiriusCrossReferenceAdapter((DAnalysisSessionImpl) session) { @Override public Collection<Setting> getInverseReferences(EObject eObject, boolean resolve) { Collection<Setting> settings = xReferencer.getInverseReferences(eObject, resolve); Collection<Setting> settingsToTryToUnset = new ArrayList<>(); for (Setting s : settings) { if (!toRemoveXRefFrom.contains(s.getEObject())) { settingsToTryToUnset.add(s); } } return settingsToTryToUnset; } }; impactedEObjects.addAll(modelAccessor.eRemoveInverseCrossReferences(eObject, filteredCrossReferencer, isReferenceToIgnorePredicate)); } for (EObject impactedEObject : impactedEObjects) { Resource resource = impactedEObject.eResource(); if (semanticResources.contains(resource)) { refreshEditorsPrecommitListener.disable(); break; } } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); toRemoveXRefFrom.clear(); modelAccessor = null; xReferencer = null; semanticResources = null; refreshEditorsPrecommitListener = null; }
Source:
<code>public void shouldNotSupportMultipleProvidersWithSameDescriptor() { IndexProvider.Descriptor descriptor = new IndexProvider.Descriptor( "provider", "1.2" ); IndexProvider provider1 = mock( IndexProvider.class ); when( provider1.getProviderDescriptor() ).thenReturn( descriptor ); IndexProvider provider2 = mock( IndexProvider.class ); when( provider2.getProviderDescriptor() ).thenReturn( descriptor ); <START> try <END> { new DefaultIndexProviderMap( provider1, singletonList( provider2 ) ); fail( "Should have failed" ); } catch ( IllegalArgumentException e ) { } }</code><technical_language>started improving code, replace assertThrows()</technical_language>

Target:
public void shouldNotSupportMultipleProvidersWithSameDescriptor() { Descriptor descriptor = new Descriptor( "provider", "1.2" ); IndexProvider provider1 = mock( IndexProvider.class ); when( provider1.getProviderDescriptor() ).thenReturn( descriptor ); IndexProvider provider2 = mock( IndexProvider.class ); when( provider2.getProviderDescriptor() ).thenReturn( descriptor ); assertThrows( IllegalArgumentException.class, () -> new DefaultIndexProviderMap( provider1, singletonList( provider2 ) ) ); }
Source:
<code>public void setList_managedRealmList() { dynamicRealm.executeTransaction(new DynamicRealm.Transaction() { @Override public void execute(DynamicRealm realm) { realm.deleteAll(); DynamicRealmObject allTypes = realm.createObject(AllTypes.CLASS_NAME); allTypes.setString(AllTypes.FIELD_STRING, "bender"); DynamicRealmObject anotherAllTypes; { anotherAllTypes = realm.createObject(AllTypes.CLASS_NAME); anotherAllTypes.setString(AllTypes.FIELD_STRING, "bender2"); DynamicRealmObject dog = realm.createObject(Dog.CLASS_NAME); dog.setString(Dog.FIELD_NAME, "nibbler"); anotherAllTypes.getList(AllTypes.FIELD_REALMLIST).add(dog); } allTypes.setList(AllTypes.FIELD_REALMLIST, anotherAllTypes.getList(AllTypes.FIELD_REALMLIST)); } }); DynamicRealmObject allTypes = dynamicRealm.where(AllTypes.CLASS_NAME) .equalTo(AllTypes.FIELD_STRING, "bender") .findFirst(); assertEquals(1, allTypes.getList(AllTypes.FIELD_REALMLIST).size()); assertEquals("nibbler", allTypes.getList(AllTypes.FIELD_REALMLIST).first().get(Dog.FIELD_NAME)); dynamicRealm.executeTransaction(new DynamicRealm.Transaction() { @Override public void execute(DynamicRealm realm) { DynamicRealmObject anotherAllTypes = dynamicRealm.where(AllTypes.CLASS_NAME) .equalTo(AllTypes.FIELD_STRING, "bender2") .findFirst(); <START> anotherAllTypes.getList(AllTypes.FIELD_REALMLIST).get(0).setString(Dog.FIELD_NAME, "nibbler_modified"); <END> } }); assertEquals("nibbler_modified", allTypes.getList(AllTypes.FIELD_REALMLIST).first().get(Dog.FIELD_NAME)); }</code><technical_language>minor: replace get(0) first() for consistency</technical_language>

Target:
public void setList_managedRealmList() { dynamicRealm.executeTransaction(new DynamicRealm.Transaction() { @Override public void execute(DynamicRealm realm) { realm.deleteAll(); DynamicRealmObject allTypes = realm.createObject(AllTypes.CLASS_NAME); allTypes.setString(AllTypes.FIELD_STRING, "bender"); DynamicRealmObject anotherAllTypes; { anotherAllTypes = realm.createObject(AllTypes.CLASS_NAME); anotherAllTypes.setString(AllTypes.FIELD_STRING, "bender2"); DynamicRealmObject dog = realm.createObject(Dog.CLASS_NAME); dog.setString(Dog.FIELD_NAME, "nibbler"); anotherAllTypes.getList(AllTypes.FIELD_REALMLIST).add(dog); } allTypes.setList(AllTypes.FIELD_REALMLIST, anotherAllTypes.getList(AllTypes.FIELD_REALMLIST)); } }); DynamicRealmObject allTypes = dynamicRealm.where(AllTypes.CLASS_NAME) .equalTo(AllTypes.FIELD_STRING, "bender") .findFirst(); assertEquals(1, allTypes.getList(AllTypes.FIELD_REALMLIST).size()); assertEquals("nibbler", allTypes.getList(AllTypes.FIELD_REALMLIST).first().get(Dog.FIELD_NAME)); dynamicRealm.executeTransaction(new DynamicRealm.Transaction() { @Override public void execute(DynamicRealm realm) { DynamicRealmObject anotherAllTypes = dynamicRealm.where(AllTypes.CLASS_NAME) .equalTo(AllTypes.FIELD_STRING, "bender2") .findFirst(); anotherAllTypes.getList(AllTypes.FIELD_REALMLIST).first() .setString(Dog.FIELD_NAME, "nibbler_modified"); } }); assertEquals("nibbler_modified", allTypes.getList(AllTypes.FIELD_REALMLIST).first().get(Dog.FIELD_NAME)); }
Source:
<code>Common(ForgeConfigSpec.Builder builder) { builder.comment("Common configuration settings") .push("common"); versionCheck = builder.comment("Check for new versions of Vampirism on startup").define("versionCheck", true); collectStats = builder.comment("Send mod version, MC version and mod count to mod author").define("collectStats", true); disableVampireForest = builder.comment("Disable vampire forest generation").define("disableVampireForest", false); <START> disableHunterTentGen = builder.comment("Disable hunter camp generation").define("disableHunterTentGen", false); <END> builder.pop(); }</code><technical_language>I put disableVampireForest here. options server config</technical_language>

Target:
Common(ForgeConfigSpec.Builder builder) { builder.comment("Common configuration settings") .push("common"); versionCheck = builder.comment("Check for new versions of Vampirism on startup").define("versionCheck", true); collectStats = builder.comment("Send mod version, MC version and mod count to mod author").define("collectStats", true); builder.pop(); }
Source:
<code>public String getName() { <START> if (getClass().getPackage().getImplementationTitle() == null) { <END> return "Glowstone"; } else { return getClass().getPackage().getImplementationTitle(); } }</code><technical_language>Store in a variable</technical_language>

Target:
public String getName() { if (isNameNull) { return "Glowstone"; } else { return getClass().getPackage().getImplementationTitle(); } }
Source:
<code>private void waitFor( ForsetiLockManager.Lock lock, ResourceType type, long resourceId, int tries ) { waitingForLock = lock; clearWaitList(); lock.copyHolderWaitListsInto( waitList ); applyWaitStrategy( type, tries ); int b = lock.detectDeadlock( id() ); if ( b != -1 && deadlockResolutionStrategy.shouldAbort( this, clientById.apply( b ) ) ) { UnsafeUtil.loadFence(); String message = this + " can't acquire " + lock + " on " + type + "(" + resourceId + "), because holders of that lock " + "are waiting for " + this + ".\n Wait list:" + lock.describeWaitList(); if ( lock.detectDeadlock( id() ) != -1 ) { if ( isDeadlockReal( lock, tries ) ) { waitList.clear(); waitingForLock = null; <START> throw new DeadlockDetectedException( message ); <END> } } } waitingForLock = null; }</code><technical_language>a full check collect clients locks wait for another, produce a error message - message produced community lock manager</technical_language>

Target:
private void waitFor( ForsetiLockManager.Lock lock, ResourceType type, long resourceId, int tries ) { waitingForLock = lock; clearWaitList(); lock.copyHolderWaitListsInto( waitList ); applyWaitStrategy( type, tries ); int b = lock.detectDeadlock( id() ); if ( b != -1 && deadlockResolutionStrategy.shouldAbort( this, clientById.apply( b ) ) ) { UnsafeUtil.loadFence(); String message = this + " can't acquire " + lock + " on " + type + "(" + resourceId + "), because holders of that lock " + "are waiting for " + this + ".\n Wait list:" + lock.describeWaitList(); if ( lock.detectDeadlock( id() ) != -1 ) { if ( isDeadlockReal( lock, tries ) ) { throw new DeadlockDetectedException( message ); } } } }
Source:
<code>public RecurrentAttentionLayer build() { if(!this.projectInput && this.nHeads != 1){ throw new IllegalArgumentException("projectInput must be true when nHeads != 1"); } if(!this.projectInput && nIn != nOut){ throw new IllegalArgumentException("nIn must be equal to nOut when projectInput is false"); } if(this.projectInput && nOut == 0){ throw new IllegalArgumentException("nOut must be specified when projectInput is true"); } <START> if(this.nOut % nHeads != 0 && headSize == 0){ throw new IllegalArgumentException("nOut isn't divided by nHeads cleanly. Specify the headSize manually."); } <END> return new RecurrentAttentionLayer(this); }</code><technical_language>a big deal, Preconditions class cleaner</technical_language>

Target:
public RecurrentAttentionLayer build() { Preconditions.checkArgument(this.projectInput || this.nHeads == 1, "projectInput must be true when nHeads != 1"); Preconditions.checkArgument(this.projectInput || nIn == nOut, "nIn must be equal to nOut when projectInput is false"); Preconditions.checkArgument(!this.projectInput || nOut != 0, "nOut must be specified when projectInput is true"); Preconditions.checkArgument(this.nOut % nHeads == 0 || headSize > 0, "nOut isn't divided by nHeads cleanly. Specify the headSize manually."); return new RecurrentAttentionLayer(this); }
Source:
<code>public List<Entity> resolve(Location location) throws IllegalArgumentException { <START> Preconditions.checkArgument(this.requiresLocation == true && location == null); <END> return PlayerSelector.func_179656_b(MinecraftServer.getServer(), this.asString(), net.minecraft.entity.Entity.class); }</code><technical_language>!this.requiresLocation || location != null. Also, Preconditions statically imported</technical_language>

Target:
public List<Entity> resolve(Location location) throws IllegalArgumentException { checkArgument(!this.requiresLocation || location != null); return PlayerSelector.func_179656_b(new FakeCommandSender(location), this.asString(), net.minecraft.entity.Entity.class); }
Source:
<code>public void createControl(Composite parent, final FormToolkit toolkit) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); if (reviews.size() == 0) { return; } reviewContainers = new ArrayList<TaskReview>(); <START> populateReviews(reviewContainers); <END> selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, hasIncoming); section.setText(section.getText()); expandSection(toolkit, section); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent event) { if (reviewContainers == null) { expandSection(toolkit, section); getTaskEditorPage().reflow(); } } }); setSection(toolkit, section); }</code><technical_language>a bug (alebit; a small potential one) if integer fails parse component built empty populateReviews call populate nothing</technical_language>

Target:
public void createControl(Composite parent, final FormToolkit toolkit) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); if (reviews.size() == 0) { return; } reviewContainers = new ArrayList<TaskReview>(); try { populateReviews(reviewContainers); } catch (NumberFormatException e) { return; } selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, hasIncoming); section.setText(section.getText()); expandSection(toolkit, section); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent event) { if (reviewContainers == null) { expandSection(toolkit, section); getTaskEditorPage().reflow(); } } }); setSection(toolkit, section); }
Source:
<code>private void addMethodIfMatching(String annotationName, String method, String argumentSignature) { if (method.contains("<init>") || method.contains("<clinit>")) { return; } if (desiredAnnotations.contains( <START> Signatures.fieldDescriptorToBinaryName(annotationName.trim()))) { <END> matchingFullyQualifiedMethodSignatures.add( getFullyQualifiedMethodSignature(method, argumentSignature)); } }</code><technical_language>is call trim() necessary? If necessary, I move client</technical_language>

Target:
private void addMethodIfMatching(String annotationName, String method, String argumentSignature) { if (desiredAnnotations.contains(Signatures.fieldDescriptorToBinaryName(annotationName))) { matchingSignatures.add(getFullyQualifiedMethodSignature(method, argumentSignature)); } }
Source:
<code><START> public static boolean canShare(Metacard metacard) { <END> return metacard != null && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(SecurityAttributes.ACCESS_GROUPS, attr)) && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(SecurityAttributes.ACCESS_INDIVIDUALS, attr)) && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(CoreAttributes.METACARD_OWNER, attr)); }</code><technical_language>break of sections predicates increase readability</technical_language>

Target:
public static boolean canShare(Metacard metacard) { return metacard != null && isSharingCapable(metacard) && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(SecurityAttributes.ACCESS_GROUPS, attr)) && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(SecurityAttributes.ACCESS_INDIVIDUALS, attr)); }
Source:
<code>public Set<ByteArrayWrapper> smembers( ByteArrayWrapper key) { <START> RedisSet redisSet = region.getOrDefault(key, RedisSet.EMPTY); <END> return redisSet.smembers(); }</code><technical_language>worth refactoring this "region.getOrDefault(key, RedisSet.EMPTY)" a local private method named "getRedisSet(key)" methods a liner: "return getRedisSet(key).smembers()"</technical_language>

Target:
public Set<ByteArrayWrapper> smembers( ByteArrayWrapper key) { return getRedisSet(key).smembers(); }
Source:
<code>InternalJob toInternalJob() { JobId jobIdInstance = new JobIdImpl(getId(), getJobName()); JobInfoImpl jobInfo = createJobInfo(jobIdInstance); InternalJob internalJob = new InternalTaskFlowJob(); internalJob.setCredentials(getCredentials()); internalJob.setJobInfo(jobInfo); internalJob.setGenericInformation(getGenericInformation()); internalJob.setVariables(variablesToJobVariables()); internalJob.setProjectName(getProjectName()); internalJob.setOwner(getOwner()); internalJob.setDescription(getDescription()); internalJob.setInputSpace(getInputSpace()); internalJob.setOutputSpace(getOutputSpace()); internalJob.setGlobalSpace(getGlobalSpace()); internalJob.setUserSpace(getGlobalSpace()); internalJob.setMaxNumberOfExecution(getMaxNumberOfExecution()); internalJob.setOnTaskError(OnTaskError.getInstance(this.onTaskErrorString)); internalJob.setScheduledTimeForRemoval(getScheduledTimeForRemoval()); try { internalJob.setResultMap(SerializationUtil.deserializeVariableMap(getResultMap())); } catch (IOException | ClassNotFoundException e) { <START> e.printStackTrace(); <END> } return internalJob; }</code><technical_language>![MINOR](<LINK_1> 'Severity: MINOR') a logger log this exception. [![rule](<LINK_0>](<LINK_2></technical_language>

Target:
InternalJob toInternalJob() { JobId jobIdInstance = new JobIdImpl(getId(), getJobName()); JobInfoImpl jobInfo = createJobInfo(jobIdInstance); InternalJob internalJob = new InternalTaskFlowJob(); internalJob.setCredentials(getCredentials()); internalJob.setJobInfo(jobInfo); internalJob.setGenericInformation(getGenericInformation()); internalJob.setVariables(variablesToJobVariables()); internalJob.setProjectName(getProjectName()); internalJob.setOwner(getOwner()); internalJob.setDescription(getDescription()); internalJob.setInputSpace(getInputSpace()); internalJob.setOutputSpace(getOutputSpace()); internalJob.setGlobalSpace(getGlobalSpace()); internalJob.setUserSpace(getGlobalSpace()); internalJob.setMaxNumberOfExecution(getMaxNumberOfExecution()); internalJob.setOnTaskError(OnTaskError.getInstance(this.onTaskErrorString)); internalJob.setScheduledTimeForRemoval(getScheduledTimeForRemoval()); try { internalJob.setResultMap(SerializationUtil.deserializeVariableMap(getResultMap())); } catch (IOException | ClassNotFoundException e) { logger.error("error when serializing result map variables " + e); } return internalJob; }
Source:
<code>String cacheKeyForStageHistories(String pipelineName, String stageName) { <START> return cacheKeyGenerator.generate("stageHistories", pipelineName.toLowerCase(), stageName.toLowerCase()); <END> }</code><technical_language>consider pushing this in CacheKeyGenerator: public String generate(String identifier, Object... args) { final List<Object> allArgs = Arrays.stream(args).map(arg -> { if (isAllowed(arg)) { return arg; } throw new IllegalArgumentException("Type " + arg.getClass() + " is allowed here!"); }).map(arg -> { if (arg instanceof CaseInsensitiveString) { return ((CaseInsensitiveString) arg).toLower(); } else { return arg; } }).collect(Collectors.toList()); allArgs.add(0, clazz.getName()); allArgs.add(1, identifier); return StringUtils.join(allArgs, DELIMITER).intern(); }</technical_language>

Target:
String cacheKeyForStageHistories(String pipelineName, String stageName) { return cacheKeyGenerator.generate("stageHistories", new CaseInsensitiveString(pipelineName), new CaseInsensitiveString(stageName)); }
Source:
<code>public ExpandedQuery rewrite(ExpandedQuery query) { <START> querySeq.clear(); matchSeq.clear(); <END> visit((Query) query.getUserQuery()); if (priorMatch.isFinal()) { hasReplacement = true; querySeq.addAll(priorMatch.value); } else { if (!matchSeq.isEmpty()) { querySeq.addAll(matchSeq); } } return hasReplacement ? buildQueryFromSeqList(querySeq) : query; }</code><technical_language>I suggest create lists .clear() them. Rewriters stateful .rewrite() called once</technical_language>

Target:
public ExpandedQuery rewrite(ExpandedQuery query) { querySeq = new LinkedList<>(); matchSeq = new LinkedList<>(); visit((Query) query.getUserQuery()); if (priorMatch.isFinal()) { hasReplacement = true; querySeq.addAll(priorMatch.value); } else { if (!matchSeq.isEmpty()) { querySeq.addAll(matchSeq); } } return hasReplacement ? buildQueryFromSeqList(query, querySeq) : query; }
Source:
<code>@Override public Throwable error() { <START> if (caught != null || request == null) return caught; <END> return request.maybeError(); }</code><technical_language>I do a doubletake here, extra line this readers java if (caught != null) return caught; if (request == null) return null; return request.maybeError();</technical_language>

Target:
@Override public Throwable error() { if (caught != null) return caught; if (request == null) return null; return request.maybeError(); }
Source:
<code>public String toString() { <START> return "SslSession(alpn=" + (alpn == null ? "null" : alpn) + <END> ", npn=" + (npn == null ? "null" : npn) + ", version=" + (version == null ? "null" : version) + ", cipher=" + (cipher == null ? "null" : cipher) + ", establishedTime=" + Long.toString(establishedTime) + ", peerCert=" + (peerCert == null ? "null" : peerCert.toString()) + ")"; }</code><technical_language>is need do check for null, right? I write return "SslSession(alpn=" + alpn +..</technical_language>

Target:
public String toString() { return "SslSession(alpn=" + alpn + ", npn=" + npn + ", version=" + version + ", cipher=" + cipher + ", establishedTime=" + Long.toString(establishedTime) + ", peerCert=" + peerCert + ")"; }
Source:
<code>public List<Condition> getConditionHistory(Patient patient) { <START> Query query = sessionFactory.getCurrentSession().createQuery("select con from Condition as con inner join fetch con.concept as c where con.patient.patientId = :patientId and con.voided = false group by c.conceptId, con.conditionId order by con.dateCreated desc"); <END> query.setInteger("patientId", patient.getId()); return query.list(); }</code><technical_language>explain purpose of "group by" please? I understand here</technical_language>

Target:
public List<Condition> getConditionHistory(Patient patient) { Query query = sessionFactory.getCurrentSession().createQuery("select con from Condition as con where con.patient.patientId = :patientId and con.voided = false " + "order by con.dateCreated desc"); query.setInteger("patientId", patient.getId()); return query.list(); }