auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public SparseArray<List<NoteInfo>> findDuplicateNotes(long mid, List<String> keys) { <START> Set<Long> csum = new HashSet<>(keys.size()); <END> Map<String, List<Integer>> keyToIndexesMap = new HashMap<>(keys.size()); for (int i = 0; i < keys.size(); i++) { String key = keys.get(i); csum.add(Utils.fieldChecksum(key)); if (!keyToIndexesMap.containsKey(key)) { keyToIndexesMap.put(key, new ArrayList<Integer>()); } keyToIndexesMap.get(key).add(i); } String selection = String.format("%s=%d and %s in (%s)", Note.MID, mid, Note.CSUM, TextUtils.join(",", csum)); Cursor notesTableCursor = mResolver.query(Note.SQL_QUERY_URI, null, selection, null, null); if (notesTableCursor == null) { return null; } SparseArray<List<NoteInfo>> result = new SparseArray<>(); try { while (notesTableCursor.moveToNext()) { NoteInfo note = NoteInfo.buildFromCursor(notesTableCursor); if (note == null) { continue; } if (keyToIndexesMap.containsKey(note.getKey())) { List<Integer> outputPositions = keyToIndexesMap.get(note.getKey()); for (Integer outputPos : outputPositions) { int sparseArrayIndex = result.indexOfKey(outputPos); if (sparseArrayIndex < 0) { List<NoteInfo> duplicatesForKey = new ArrayList<>(); duplicatesForKey.add(note); result.put(outputPos, duplicatesForKey); } else { result.valueAt(sparseArrayIndex).add(note); } } } } } finally { notesTableCursor.close(); } return result; }</code><technical_language>csums surely</technical_language>

Target:
public SparseArray<List<NoteInfo>> findDuplicateNotes(long mid, List<String> keys) { Set<Long> csums = new HashSet<>(keys.size()); Map<String, List<Integer>> keyToIndexesMap = new HashMap<>(keys.size()); for (int i = 0; i < keys.size(); i++) { String key = keys.get(i); csums.add(Utils.fieldChecksum(key)); if (!keyToIndexesMap.containsKey(key)) { keyToIndexesMap.put(key, new ArrayList<Integer>()); } keyToIndexesMap.get(key).add(i); } String sel = String.format("%s=%d and %s in (%s)", Note.MID, mid, Note.CSUM, TextUtils.join(",", csums)); Cursor notesTableCursor = mResolver.query(Note.CONTENT_URI_V2, PROJECTION, sel, null, null); if (notesTableCursor == null) { return null; } SparseArray<List<NoteInfo>> result = new SparseArray<>(); try { while (notesTableCursor.moveToNext()) { NoteInfo note = NoteInfo.buildFromCursor(notesTableCursor); if (note == null) { continue; } if (keyToIndexesMap.containsKey(note.getKey())) { List<Integer> outputPositions = keyToIndexesMap.get(note.getKey()); for (Integer outputPos : outputPositions) { int sparseArrayIndex = result.indexOfKey(outputPos); if (sparseArrayIndex < 0) { List<NoteInfo> duplicatesForKey = new ArrayList<>(); duplicatesForKey.add(note); result.put(outputPos, duplicatesForKey); } else { result.valueAt(sparseArrayIndex).add(note); } } } } } finally { notesTableCursor.close(); } return result; }
Source:
<code>public void releaseSerializer(final Serializer<?> serializer) { if (!created.remove(serializer)) { throw new IllegalArgumentException("Given serializer: " + serializer.getClass().getName() + " is not managed by this provider"); } <START> if(serializer instanceof CompactPersistentJavaSerializer) { <END> try { ((CompactPersistentJavaSerializer)serializer).close(); } catch (IOException e) { throw new RuntimeException("Unable to close the serializer: " + serializer.getClass().getName()); } } }</code><technical_language>Agreed a type for this, I this is a useful customisation seam serialisers implementers hook serialiser "closed" properly</technical_language>

Target:
public void releaseSerializer(final Serializer<?> serializer) throws IOException { if (!created.remove(serializer)) { throw new IllegalArgumentException("Given serializer: " + serializer.getClass().getName() + " is not managed by this provider"); } if(serializer instanceof Closeable) { ((Closeable)serializer).close(); } }
Source:
<code>private void overlayText(Canvas canvas, Matrix matrix) { if (mOverlayParams == null || !initOverlayParams(matrix)) { return; } mOverlayParams.paint.setTextAlign(Align.LEFT); canvas.drawText(mOverlayParams.suraText, mOverlayParams.offsetX, mOverlayParams.topBaseline, mOverlayParams.paint); mOverlayParams.paint.setTextAlign(Align.RIGHT); canvas.drawText(mOverlayParams.juzText, getWidth() - mOverlayParams.offsetX, mOverlayParams.topBaseline, mOverlayParams.paint); mOverlayParams.paint.setTextAlign(Align.CENTER); canvas.drawText(mOverlayParams.pageText, getWidth() / 2.0f, mOverlayParams.bottomBaseline, mOverlayParams.paint); if (!mOverlayParams.rub3Text.equals("")) { mOverlayParams.paint.setTextAlign(Align.CENTER); canvas.drawText(mOverlayParams.rub3Text, getWidth() / 2.0f, mOverlayParams.topBaseline, mOverlayParams.paint); <START> } <END> mDidDraw = true; }</code><technical_language>space: align other lines</technical_language>

Target:
private void overlayText(Canvas canvas, Matrix matrix) { if (mOverlayParams == null || !initOverlayParams(matrix)) { return; } mOverlayParams.paint.setTextAlign(Align.LEFT); canvas.drawText(mOverlayParams.suraText, mOverlayParams.offsetX, mOverlayParams.topBaseline, mOverlayParams.paint); mOverlayParams.paint.setTextAlign(Align.CENTER); canvas.drawText(mOverlayParams.pageText, getWidth() / 2.0f, mOverlayParams.bottomBaseline, mOverlayParams.paint); mOverlayParams.paint.setTextAlign(Align.RIGHT); canvas.drawText(mOverlayParams.juzText + mOverlayParams.rub3Text, getWidth() - mOverlayParams.offsetX, mOverlayParams.topBaseline, mOverlayParams.paint); mDidDraw = true; }
Source:
<code>private static void addEmptyCD(Guid dstId) { VmDeviceUtils.addManagedDevice(new VmDeviceId(Guid.NewGuid(), dstId), VmDeviceType.DISK, VmDeviceType.CDROM, Collections.<String, Object> singletonMap(VdsProperties.Path, ""), true, true, <START> ""); <END> }</code><technical_language>please remove alias setting (should encapsulated in addManagedDevice</technical_language>

Target:
private static void addEmptyCD(Guid dstId) { VmDeviceUtils.addManagedDevice(new VmDeviceId(Guid.NewGuid(), dstId), VmDeviceType.DISK, VmDeviceType.CDROM, Collections.<String, Object> singletonMap(VdsProperties.Path, ""), true, true); }
Source:
<code>public void test() throws Exception { startDefaultMasterDontWaitForZK(new MockCuratorClientFactory(), "--zk-connection-timeout", "1"); final HeliosClient client = defaultClient(); try { client.listMasters().get().get(0); <START> Assert.fail("Exception should have been thrown, as ZK doesnt exist"); <END> } catch (ExecutionException e) { Assert.assertTrue(e.getCause() instanceof HeliosException); } }</code><technical_language>statically import fail</technical_language>

Target:
public void test() throws Exception { startDefaultMasterDontWaitForZK(new MockCuratorClientFactory(), "--zk-connection-timeout", "1"); final HeliosClient client = defaultClient(); try { client.listMasters().get().get(0); fail("Exception should have been thrown, as ZK doesnt exist"); } catch (ExecutionException e) { assertTrue(e.getCause() instanceof HeliosException); } }
Source:
<code><START> private void changeWorkingDirOwner(String containerId, LineConsumer machineLogger) throws MachineException { <END> String prepareCmd = "CHE_USER=`id -un`;" + "sudo chown -R ${CHE_USER}:docker /home/user;" + "sudo ln -s /home/user `eval echo \"~${CHE_USER}\"`"; final String[] command = {"/bin/sh", "-c", prepareCmd}; Exec exec; try { exec = docker.createExec(CreateExecParams.create(containerId, command).withDetach(false)); } catch (IOException e) { throw new MachineException(format("Error occurs while initializing command %s in docker container %s: %s", Arrays.toString(command), containerId, e.getMessage()), e); } try { docker.startExec(StartExecParams.create(exec.getId()), new LogMessagePrinter(machineLogger)); } catch (IOException e) { throw new MachineException(format("Error occurs while executing command %s in docker container %s: %s", Arrays.toString(exec.getCommand()), containerId, e.getMessage()), e); } }</code><technical_language>Please cover changed code unit tests. MachineProviderImplTest</technical_language>

Target:
private void changeWorkingDirOwner(String containerId, LineConsumer machineLogger) throws MachineException { String prepareCmd = "CHE_USER=`id -un`;" + "sudo chown -R ${CHE_USER}:docker /home/user;" + "sudo ln -s /home/user `eval echo \"~${CHE_USER}\"`"; final String[] command = {"/bin/sh", "-c", prepareCmd}; Exec exec; try { exec = docker.createExec(CreateExecParams.create(containerId, command).withDetach(false)); } catch (IOException e) { LOG.error(format("Error occurs while initializing command %s in docker container %s: %s", Arrays.toString(command), containerId, e.getMessage()), e); return; } try { docker.startExec(StartExecParams.create(exec.getId()), new LogMessagePrinter(machineLogger)); } catch (IOException e) { LOG.error(format("Error occurs while executing command %s in docker container %s: %s", Arrays.toString(exec.getCommand()), containerId, e.getMessage()), e); } }
Source:
<code>public AvailabilityType getAvailability() { <START> if (ApacheServerComponent.getUseBMX()) <END> lastKnownAvailability = getAvailabilityBMXInternal(); else lastKnownAvailability = getAvailabilityInternal(); return lastKnownAvailability; }</code><technical_language>static methods. resourceContext.getParentResourceComponent() get instance of parent apache server component instance method it</technical_language>

Target:
public AvailabilityType getAvailability() { if (resourceContext.getParentResourceComponent().getUseBMX()) lastKnownAvailability = getAvailabilityBMXInternal(); else lastKnownAvailability = getAvailabilityInternal(); return lastKnownAvailability; }
Source:
<code>public byte[][] transformToBytesValuesSV(ProjectionBlock projectionBlock) { if (_results == null) { _results = new byte[DocIdSetPlanNode.MAX_DOC_PER_CALL][]; } String[] argumentValues = _transformFunction.transformToStringValuesSV(projectionBlock); int length = projectionBlock.getNumDocs(); for (int i = 0; i < length; i++) { try { Geometry geometry = _reader.read(argumentValues[i]); Preconditions.checkArgument(geometry instanceof Polygon, "The geometry object must be polygon"); _results[i] = GeometrySerializer.serialize(geometry); } catch (ParseException e) { <START> Utils.rethrowException( new RuntimeException(String.format("Failed to parse geometry from string: %s", argumentValues[i]))); <END> } } return _results; }</code><technical_language>suggestion throw new RuntimeException(String.format("Failed parse geometry string: %s", argumentValues[i]));</technical_language>

Target:
public byte[][] transformToBytesValuesSV(ProjectionBlock projectionBlock) { if (_results == null) { _results = new byte[DocIdSetPlanNode.MAX_DOC_PER_CALL][]; } String[] argumentValues = _transformFunction.transformToStringValuesSV(projectionBlock); int length = projectionBlock.getNumDocs(); for (int i = 0; i < length; i++) { try { Geometry geometry = _reader.read(argumentValues[i]); Preconditions.checkArgument(geometry instanceof Polygon, "The geometry object must be polygon"); _results[i] = GeometrySerializer.serialize(geometry); } catch (ParseException e) { new RuntimeException(String.format("Failed to parse geometry from string: %s", argumentValues[i])); } } return _results; }
Source:
<code>public MBeanServerConnection getMBeanServerConnection(Subject delegationSubject) { throw new UnsupportedOperationException( <START> "Jolokia currently do not support connections using a subject, if you have a use case please let us know"); <END> }</code><technical_language>Please information contact (e.g. openen a GitHub issue Jolokia's repo, hardcode repo name this change in future)</technical_language>

Target:
public MBeanServerConnection getMBeanServerConnection(Subject delegationSubject) { throw new UnsupportedOperationException( "Jolokia currently do not support connections using a subject, if you have a use case, raise an issue in Jolokias github repo"); }
Source:
<code>public Response getStatus(@PathParam("nodeId") String nodeId) { Set<Node> nodes = nodeManager.getNodes(NodeState.ACTIVE); Node node = nodes.stream() .filter(n -> n.getNodeIdentifier().equals(nodeId)) .findFirst() .orElse(null); if (node == null) { return Response.status(Response.Status.NOT_FOUND).build(); } Request request = prepareGet() .setUri(uriBuilder() .scheme("http") .hostAndPort(fromParts(node.getHostAndPort().getHostText(), node.getHostAndPort().getPort())) <START> .appendPath("v1") <END> .appendPath("info") .build()) .build(); InputStream responseStream = httpClient.execute(request, new StreamingJsonResponseHandler()); return Response.ok(responseStream, APPLICATION_JSON_TYPE).build(); }</code><technical_language>this appendPath("/v1/info") easier resource</technical_language>

Target:
public Response getStatus(@PathParam("nodeId") String nodeId) { return proxyJsonResponse(nodeId, "v1/status"); }
Source:
<code>public void validate(final String uri) throws URIHandlerException { <START> if(uri!=null){ <END> try { URI uriParsed = URI.create(uri); String scheme = uriParsed.getScheme(); if(!(URIBuilder.VIEW_SCHEME.equals(scheme) || URIBuilder.DATASET_SCHEME.equals(scheme))) { LOG.error("Unexpected scheme: view, uri was {}", uri); XException xException = new XException(ErrorCode.E0904, scheme, uri); throw new URIHandlerException(xException); } } catch (IllegalArgumentException iae) { XException xException = new XException(ErrorCode.E0906, iae); throw new URIHandlerException(xException); } } }</code><technical_language>If uri == null, this throw exception. Is okay</technical_language>

Target:
public void validate(final String uri) throws URIHandlerException { try { URI uriParsed = URI.create(uri); String scheme = uriParsed.getScheme(); if(!(URIBuilder.VIEW_SCHEME.equals(scheme) || URIBuilder.DATASET_SCHEME.equals(scheme))) { LOG.error("Unexpected scheme: view, uri was "+ uri); XException xException = new XException(ErrorCode.E0904, scheme, uri); throw new URIHandlerException(xException); } } catch (IllegalArgumentException iae) { XException xException = new XException(ErrorCode.E0906, iae); throw new URIHandlerException(xException); } }
Source:
<code>public void setKeyAndIv(byte[] keyIvCombo) { if (keyIvCombo.length == 48) { this.aeskey = new byte[32]; this.iv = new byte[16]; System.arraycopy(keyIvCombo, 0, this.iv, 0, 16); System.arraycopy(keyIvCombo, 16, this.aeskey, 0, 32); } else if (keyIvCombo.length == 44) { this.aeskey = new byte[32]; this.iv = new byte[12]; System.arraycopy(keyIvCombo, 0, this.iv, 0, 12); System.arraycopy(keyIvCombo, 12, this.aeskey, 0, 32); } else if (keyIvCombo.length >= 32) { this.aeskey = new byte[32]; System.arraycopy(keyIvCombo, 0, aeskey, 0, 32); } else if (keyIvCombo.length >= 16) { this.aeskey = new byte[16]; System.arraycopy(keyIvCombo, 0, this.aeskey, 0, 16); <START> } else if (keyIvCombo.length >= 12) { <END> this.aeskey = new byte[12]; System.arraycopy(keyIvCombo, 0, this.aeskey, 0, 12); } }</code><technical_language>I understand this exception is for</technical_language>

Target:
public void setKeyAndIv(byte[] keyIvCombo) { if (keyIvCombo.length == 48) { this.aeskey = new byte[32]; this.iv = new byte[16]; System.arraycopy(keyIvCombo, 0, this.iv, 0, 16); System.arraycopy(keyIvCombo, 16, this.aeskey, 0, 32); } else if (keyIvCombo.length == 44) { this.aeskey = new byte[32]; this.iv = new byte[12]; System.arraycopy(keyIvCombo, 0, this.iv, 0, 12); System.arraycopy(keyIvCombo, 12, this.aeskey, 0, 32); } else if (keyIvCombo.length >= 32) { this.aeskey = new byte[32]; System.arraycopy(keyIvCombo, 0, aeskey, 0, 32); } }
Source:
<code>public void execute(CloudStackClient cloudStackClient, Pool pool, DelegateExecution execution) { if (execution.getVariable(ProcessVariables.NETWORK_ID) != null) { LOG.warn("Network process variable ({}) will be overwritten!", ProcessVariables.NETWORK_ID); } final String networkName = Networks.formatNameFromBusinessKey(execution.getProcessBusinessKey()); final String zoneId = pool.getOption(ProviderOptions.ZONE_ID); <START> final String networkOffering = pool.getOption(ProviderOptions.NETWORK_OFFERING); <END> Network network; try { network = Networks.getByName(cloudStackClient, networkName); LOG.info("Network with name exists.", networkName); } catch (NoSuchElementException e) { LOG.info(String.format("Creating network %s in zone %s with offering %s", networkName, zoneId, networkOffering)); network = cloudStackClient.getNetworkClient().createNetworkInZone(zoneId, networkOffering, networkName, networkName, CreateNetworkOptions.NONE); } LOG.info("Storing network id in process variable {}", network.getId(), ProcessVariables.NETWORK_ID); execution.setVariable(ProcessVariables.NETWORK_ID, network.getId()); }</code><technical_language>I expecting this pool.getProvider().getOption(...)</technical_language>

Target:
public void execute(CloudStackClient cloudStackClient, Pool pool, DelegateExecution execution) { if (execution.getVariable(ProcessVariables.NETWORK_ID) != null) { LOG.warn("Network process variable ({}) will be overwritten!", ProcessVariables.NETWORK_ID); } final String networkName = Networks.formatNameFromBusinessKey(execution.getProcessBusinessKey()); final String zoneId = pool.getProvider().getOption(ProviderOptions.ZONE_ID); final String networkOffering = pool.getProvider().getOption(ProviderOptions.NETWORK_OFFERING); Network network; try { network = Networks.getByName(cloudStackClient, networkName); LOG.info("Network with name exists.", networkName); } catch (NoSuchElementException e) { LOG.info(String.format("Creating network %s in zone %s with offering %s", networkName, zoneId, networkOffering)); network = cloudStackClient.getNetworkClient().createNetworkInZone(zoneId, networkOffering, networkName, networkName, CreateNetworkOptions.NONE); } LOG.info("Storing network id in process variable {}", network.getId(), ProcessVariables.NETWORK_ID); execution.setVariable(ProcessVariables.NETWORK_ID, network.getId()); }
Source:
<code>public ResourceTable stageUpgradeTable(ResourceTable global, ResourceTable incoming, ResourceTable recovery, String profileRef, boolean clearProgress) throws UnfullfilledRequirementsException, StorageFullException, UnresolvedResourceException { if(global.getTableReadiness() != ResourceTable.RESOURCE_TABLE_INSTALLED) { repair(global, incoming, recovery); if(global.getTableReadiness() != ResourceTable.RESOURCE_TABLE_INSTALLED) { throw new IllegalArgumentException("Global resource table was not ready for upgrading"); } <START> throw new IllegalArgumentException("Global resource table was not ready for upgrading"); <END> } if(clearProgress) { incoming.clear(); } Vector<ResourceLocation> locations = new Vector<ResourceLocation>(); locations.addElement(new ResourceLocation(Resource.RESOURCE_AUTHORITY_REMOTE, profileRef)); Resource r = new Resource(Resource.RESOURCE_VERSION_UNKNOWN, APP_PROFILE_RESOURCE_ID , locations, "Application Descriptor"); incoming.addResource(r, incoming.getInstallers().getProfileInstaller(false), null); incoming.prepareResources(global, this, APP_PROFILE_RESOURCE_ID); return incoming; }</code><technical_language>this line deleted</technical_language>

Target:
public ResourceTable stageUpgradeTable(ResourceTable global, ResourceTable incoming, ResourceTable recovery, String profileRef, boolean clearProgress) throws UnfullfilledRequirementsException, StorageFullException, UnresolvedResourceException { if(global.getTableReadiness() != ResourceTable.RESOURCE_TABLE_INSTALLED) { repair(global, incoming, recovery); if(global.getTableReadiness() != ResourceTable.RESOURCE_TABLE_INSTALLED) { throw new IllegalArgumentException("Global resource table was not ready for upgrading"); } } if(clearProgress) { incoming.clear(); } Vector<ResourceLocation> locations = new Vector<ResourceLocation>(); locations.addElement(new ResourceLocation(Resource.RESOURCE_AUTHORITY_REMOTE, profileRef)); Resource r = new Resource(Resource.RESOURCE_VERSION_UNKNOWN, APP_PROFILE_RESOURCE_ID , locations, "Application Descriptor"); incoming.addResource(r, incoming.getInstallers().getProfileInstaller(false), null); incoming.prepareResources(global, this, APP_PROFILE_RESOURCE_ID); return incoming; }
Source:
<code>private EntityRef getChestEntity(EntityRef building) { ConstructedBuildingComponent buildingComponent = building.getComponent(ConstructedBuildingComponent.class); <START> Vector3i chestPosition = buildingComponent.boundingRegions.get(0).max(); <END> return blockEntityRegistry.getBlockEntityAt(chestPosition); }</code><technical_language>a constant for 0 represents</technical_language>

Target:
private EntityRef getChestEntity(EntityRef building) { ConstructedBuildingComponent buildingComponent = building.getComponent(ConstructedBuildingComponent.class); Vector3i chestPosition = buildingComponent.boundingRegions.get(Constants.CHEST_BLOCK_INDEX).max(); return blockEntityRegistry.getBlockEntityAt(chestPosition); }
Source:
<code>public void testNotUsername() { testingClient.server("passwordPolicy").run(session -> { RealmModel realmModel = session.getContext().getRealm(); PasswordPolicyManagerProvider policyManager = session.getProvider(PasswordPolicyManagerProvider.class); <START> realmModel.setPasswordPolicy(PasswordPolicy.parse(session, NotUsernamePasswordPolicyProviderFactory.ID)); <END> Assert.assertEquals("invalidPasswordNotUsernameMessage", policyManager.validate("jdoe", "jdoe").getMessage()); assertNull(policyManager.validate("jdoe", "ab&d1234")); }); }</code><technical_language>Please remove this. Tests intent a string a constant here</technical_language>

Target:
public void testNotUsername() { testingClient.server("passwordPolicy").run(session -> { RealmModel realmModel = session.getContext().getRealm(); PasswordPolicyManagerProvider policyManager = session.getProvider(PasswordPolicyManagerProvider.class); realmModel.setPasswordPolicy(PasswordPolicy.parse(session, "notUsername")); Assert.assertEquals("invalidPasswordNotUsernameMessage", policyManager.validate("jdoe", "jdoe").getMessage()); assertNull(policyManager.validate("jdoe", "ab&d1234")); }); }
Source:
<code>public HttpMessage sendQueryByGraphQlPost(String query) { HttpMessage message = null; try { HttpRequestBody msgBody = new HttpRequestBody(query); HttpRequestHeader msgHeader = <START> new HttpRequestHeader(HttpRequestHeader.POST, endpointUrl, "HTTP/1.1"); msgHeader.setHeader("Accept", "application/json"); msgHeader.setHeader("Content-Type", "application/graphql"); <END> msgHeader.setContentLength(msgBody.length()); message = new HttpMessage(msgHeader, msgBody); send(message); } catch (IOException e) { LOG.error(e.getMessage()); } return message; }</code><technical_language>core constants for a bunch of these, check HttpHeader etc. (Maybe content types, HTTP declaration header field names pretty about). local constants for content types</technical_language>

Target:
private HttpMessage sendQueryByGraphQlPost(String query) { try { HttpRequestBody msgBody = new HttpRequestBody(query); HttpRequestHeader msgHeader = new HttpRequestHeader(HttpRequestHeader.POST, endpointUrl, HttpHeader.HTTP11); msgHeader.setHeader("Accept", HttpHeader.JSON_CONTENT_TYPE); msgHeader.setHeader(HttpHeader.CONTENT_TYPE, GRAPHQL_CONTENT_TYPE); msgHeader.setContentLength(msgBody.length()); HttpMessage message = new HttpMessage(msgHeader, msgBody); send(message); return message; } catch (IOException e) { LOG.error(e.getMessage()); } return null; }
Source:
<code>public void testBasics() throws Exception { client.create().forPath("/test"); cache.start(); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test"); assertEvent(TreeCacheEvent.Type.INITIALIZED); <START> Assert.assertEquals(cache.getCurrentChildren("/test"), Collections.emptySortedSet()); <END> client.create().forPath("/test/one", "hey there".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/one"); Assert.assertEquals(cache.getCurrentChildren("/test"), ImmutableSortedSet.of("one")); Assert.assertEquals(new String(cache.getCurrentData("/test/one").getData()), "hey there"); client.setData().forPath("/test/one", "sup!".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_UPDATED, "/test/one"); Assert.assertEquals(cache.getCurrentChildren("/test"), ImmutableSortedSet.of("one")); Assert.assertEquals(new String(cache.getCurrentData("/test/one").getData()), "sup!"); client.delete().forPath("/test/one"); assertEvent(TreeCacheEvent.Type.NODE_REMOVED, "/test/one"); Assert.assertEquals(cache.getCurrentChildren("/test"), Collections.emptySortedSet()); assertNoMoreEvents(); }</code><technical_language>Collections.emptySortedSet() is a new addition Java 1.8. Curator is building Java 1.6</technical_language>

Target:
public void testBasics() throws Exception { client.create().forPath("/test"); cache = new MyTreeCache(client, "/test", true); cache.start(); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test"); assertEvent(TreeCacheEvent.Type.INITIALIZED); Assert.assertEquals(cache.getCurrentChildren("/test").keySet(), ImmutableSet.of()); client.create().forPath("/test/one", "hey there".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/one"); Assert.assertEquals(cache.getCurrentChildren("/test").keySet(), ImmutableSet.of("one")); Assert.assertEquals(new String(cache.getCurrentData("/test/one").getData()), "hey there"); client.setData().forPath("/test/one", "sup!".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_UPDATED, "/test/one"); Assert.assertEquals(cache.getCurrentChildren("/test").keySet(), ImmutableSet.of("one")); Assert.assertEquals(new String(cache.getCurrentData("/test/one").getData()), "sup!"); client.delete().forPath("/test/one"); assertEvent(TreeCacheEvent.Type.NODE_REMOVED, "/test/one"); Assert.assertEquals(cache.getCurrentChildren("/test").keySet(), ImmutableSet.of()); assertNoMoreEvents(); }
Source:
<code>private void addCommands() { <START> UICommand tempVar = new UICommand("onRemove", this); END> tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok()); tempVar.setIsDefault(true); getCommands().add(tempVar); UICommand tempVar2 = new UICommand("cancel", this); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel()); tempVar2.setIsCancel(true); getCommands().add(tempVar2); }</code><technical_language>rename tempVar</technical_language>

Target:
private void addCommands() { getCommands().add(new UICommand("onRemove", this).setTitle(ConstantsManager.getInstance().getConstants().ok()) .setIsDefault(true)); getCommands().add(new UICommand("cancel", this).setTitle(ConstantsManager.getInstance().getConstants().cancel()) .setIsCancel(true)); }
Source:
<code>public void testNonEmpty() { Observable<String> source = Observable.just("Chicago", "Houston", "Phoenix"); final AtomicBoolean wasCalled = new AtomicBoolean(false); source.doOnEmpty(new Action0() { @Override public void call() { wasCalled.set(true); } }).subscribe(); <START> assert(!wasCalled.get()); <END> }</code><technical_language>assertTrue in unit tests assert ensure assertions run of runtime flags</technical_language>

Target:
public void testNonEmpty() { Observable<String> source = Observable.just("Chicago", "Houston", "Phoenix"); final AtomicBoolean wasCalled = new AtomicBoolean(false); source.doOnEmpty(new Action0() { @Override public void call() { wasCalled.set(true); } }).subscribe(); assertFalse(wasCalled.get()); }
Source:
<code>private JsonObject getSlotCounts() { int freeSlots = 0; int totalSlots = 0; int usedSlots = 0; for (RemoteProxy proxy : getRegistry().getAllProxies()) { <START> totalSlots += proxy.getTestSlots().size() > proxy.getMaxNumberOfConcurrentTestSessions() ? <END> proxy.getMaxNumberOfConcurrentTestSessions() : proxy.getTestSlots().size(); usedSlots += proxy.getTotalUsed(); } freeSlots = totalSlots - usedSlots; JsonObject result = new JsonObject(); result.addProperty("free", freeSlots); result.addProperty("total", totalSlots); return result; }</code><technical_language>reducing this further... get rid of other variables have: freeSlots += Math.min(proxy.getMaxNumberOfConcurrentTestSessions(), proxy.getTestSlots().size()) - proxy.getTotalUsed(); yeah, i agree need += :)</technical_language>

Target:
private JsonObject getSlotCounts() { int totalSlots = 0; int usedSlots = 0; for (RemoteProxy proxy : getRegistry().getAllProxies()) { totalSlots += Math.min(proxy.getMaxNumberOfConcurrentTestSessions(), proxy.getTestSlots().size()); usedSlots += proxy.getTotalUsed(); } JsonObject result = new JsonObject(); result.addProperty("free", totalSlots - usedSlots); result.addProperty("total", totalSlots); return result; }
Source:
<code>public SubstringDimExtractionFn( @JsonProperty("index") int index, @Nullable @JsonProperty("length") Integer length ) { <START> Preconditions.checkArgument(length == null || length >= 0, "length must be positive"); <END> this.index = index; this.length = length != null ? length : -1; this.end = index + this.length; }</code><technical_language>is length == 0 allowed? is expected "non-negative" "positive"</technical_language>

Target:
public SubstringDimExtractionFn( @JsonProperty("index") int index, @Nullable @JsonProperty("length") Integer length ) { Preconditions.checkArgument(length == null || length > 0, "length must be strictly positive"); this.index = index; this.end = length != null ? index + length : -1; }
Source:
<code>protected Object executeWithSubject() { <START> final PrintStream console = System.out; <END> final SearchFormsLoader loader; console.println(ansi().fgBrightCyan().a("Initializing Search Form Template Loader").reset()); if (SearchFormsUtil.allNull(formsDir, formsFile, resultsFile)) { console.println( ansi() .fgYellow() .a("No options selected, falling back to default directory locations.") .reset()); loader = generateLoader(catalogFramework, endpointUtil, null, null, null); } else { LOGGER.debug("Attempting loader initialization"); loader = generateLoader(catalogFramework, endpointUtil, formsDir, formsFile, resultsFile); } List<Metacard> parsedMetacards = loader.retrieveSystemTemplateMetacards(); if (!parsedMetacards.isEmpty()) { console.println( ansi() .fgYellow() .a("Loader initialized, beginning ingestion of system templates.") .reset()); loader.bootstrap(parsedMetacards); console.println(ansi().fgBrightGreen().a("System templates successfully ingested.").reset()); return null; } console.println(ansi().fgBrightRed().a("No system forms to load, halting ingest.").reset()); return null; }</code><technical_language>this class extends SubjectCommands a console member variable use</technical_language>

Target:
protected Object executeWithSubject() { console.println(ansi().fgBrightCyan().a("Initializing Search Form Template Loader").reset()); final SearchFormsLoader loader = generateLoader(catalogFramework, endpointUtil, formsDir, formsFile, resultsFile); List<Metacard> parsedMetacards = loader.retrieveSystemTemplateMetacards(); if (!parsedMetacards.isEmpty()) { printColor(Ansi.Color.GREEN, "Loader initialized, beginning ingestion of system templates."); loader.bootstrap(parsedMetacards); printColor(Ansi.Color.GREEN, "System templates successfully ingested."); } else { printColor(WARNING_COLOR, "No system forms to load, halting ingest."); } return null; }
Source:
<code>public final ProcStatCoreLoads computeLoads(final ProcStatCounters old) { ProcStatCoreLoads loads = new ProcStatCoreLoads(); float load; int diffIdle; int diffActive; OneCoreTickCounters coreCountersOld; <START> OneCoreTickCounters coreCountersNew; <END> for(String coreId: fTickCounters.keySet()) { coreCountersNew = fTickCounters.get(coreId); if (old != null) { coreCountersOld = old.fTickCounters.get(coreId); diffIdle = coreCountersNew.getIdleTicks() - coreCountersOld.getIdleTicks(); diffActive = coreCountersNew.getActiveTicks() - coreCountersOld.getActiveTicks(); load = diffActive / (float)(diffActive + diffIdle); loads.put(coreId, load * 100.0f); } else { diffIdle = coreCountersNew.getIdleTicks(); diffActive = coreCountersNew.getActiveTicks(); load = diffActive / (float)(diffActive + diffIdle); loads.put(coreId, load * 100.0f); } } return loads; }</code><technical_language>Please move close used. This avoids risk of making mistake of a variable exist for some parts of code</technical_language>

Target:
public final ProcStatCoreLoads computeLoads(final ProcStatCounters old) { ProcStatCoreLoads loads = new ProcStatCoreLoads(); for(String coreId: fTickCounters.keySet()) { OneCoreTickCounters coreCountersNew = fTickCounters.get(coreId); if (old != null) { OneCoreTickCounters coreCountersOld = old.fTickCounters.get(coreId); int diffIdle = coreCountersNew.getIdleTicks() - coreCountersOld.getIdleTicks(); int diffActive = coreCountersNew.getActiveTicks() - coreCountersOld.getActiveTicks(); float load; if (diffIdle + diffActive != 0) { load = diffActive / (float)(diffActive + diffIdle); } else { load = 0; } loads.put(coreId, load * 100.0f); } else { int diffIdle = coreCountersNew.getIdleTicks(); int diffActive = coreCountersNew.getActiveTicks(); assert (diffActive + diffIdle != 0); float load = diffActive / (float)(diffActive + diffIdle); loads.put(coreId, load * 100.0f); } } return loads; }
Source:
<code>private void doQueryCursorSpliteratorCalls(Query<?> qry) { Ignite client = grid(0); IgniteCache<Object, String> cache = client.getOrCreateCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME)); try (QueryCursor<?> cur = cache.query(qry)) { <START> cur.iterator(); <END> cur.spliterator(); GridTestUtils.assertThrows(log, IgniteException.class, "Iterator is already fetched or query was cancelled.", cur, "iterator"); } }</code><technical_language>Iterator<Object> iter = (Iterator<Object>)cur.iterator(); Spliterator<Object> spliter = (Spliterator<Object>)cur.spliterator(); Set<Object> iterData = new HashSet<>(); Set<Object> spliterData = new HashSet<>(); while (iter.hasNext()) iterData.add(iter.next()); spliter.forEachRemaining(spliterData::add); assertEqualsCollections(iterData, spliterData);</technical_language>

Target:
private void doQueryCursorSpliteratorCalls(Query<?> qry) { Ignite client = grid(0); IgniteCache<Object, String> cache = client.getOrCreateCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME)); Set<Object> iterData = new HashSet<>(); Set<Object> spliterData = new HashSet<>(); try (QueryCursor<?> cur = cache.query(qry)) { Iterator<Object> iter = (Iterator<Object>)cur.iterator(); while (iter.hasNext()) iterData.add(iter.next()); assertEquals(iterData.size(), 3); Spliterator<Object> spliter = (Spliterator<Object>)cur.spliterator(); assertEquals(spliter.getExactSizeIfKnown(), -1); GridTestUtils.assertThrows(log, IgniteException.class, "Iterator is already fetched or query was cancelled.", cur, "iterator"); } try (QueryCursor<?> cur = cache.query(qry)) { Spliterator<Object> spliter = (Spliterator<Object>)cur.spliterator(); assertEquals(spliter.getExactSizeIfKnown(), -1); spliter.forEachRemaining(spliterData::add); assertEquals(spliterData.size(), 3); Iterator<Object> iter = (Iterator<Object>)cur.iterator(); assertFalse((qry instanceof ScanQuery) && iter.hasNext()); GridTestUtils.assertThrows(log, IgniteException.class, "Iterator is already fetched or query was cancelled.", cur, "iterator"); } assertEquals(iterData.size(), spliterData.size()); }
Source:
<code>public static Kind fromValue(final String value) { for (Kind kind : Kind.values()) { <START> if (kind.value.equals(value)) { <END> return kind; } } throw new IllegalArgumentException(value); }</code><technical_language>Please replace Objects.equals</technical_language>

Target:
public static Kind fromValue(final String value) { for (Kind kind : Kind.values()) { if (Objects.equals(kind.value, value)) { return kind; } } throw new IllegalArgumentException("FunctionKind [" + value + "] is not supported."); }
Source:
<code>public GlusterVolumeEntity() { options = new LinkedHashMap<String, GlusterVolumeOptionEntity>(); bricks = new ArrayList<GlusterBrickEntity>(); status = GlusterStatus.DOWN; accessProtocols = new LinkedHashSet<AccessProtocol>(Arrays.asList(new AccessProtocol[]{ AccessProtocol.GLUSTER, AccessProtocol.NFS})); transportTypes = new LinkedHashSet<TransportType>(); volumeType = GlusterVolumeType.DISTRIBUTE; <START> asyncTask = new GlusterAsyncTask(); <END> }</code><technical_language>Initialize advancedDetails too</technical_language>

Target:
public GlusterVolumeEntity() { options = new LinkedHashMap<String, GlusterVolumeOptionEntity>(); bricks = new ArrayList<GlusterBrickEntity>(); status = GlusterStatus.DOWN; accessProtocols = new LinkedHashSet<AccessProtocol>(Arrays.asList(new AccessProtocol[]{ AccessProtocol.GLUSTER, AccessProtocol.NFS})); transportTypes = new LinkedHashSet<TransportType>(); volumeType = GlusterVolumeType.DISTRIBUTE; asyncTask = new GlusterAsyncTask(); advancedDetails = new GlusterVolumeAdvancedDetails(); }
Source:
<code>protected void addView(TextAnnotation ta) throws AnnotatorException { Annotation document = new Annotation(ta.text); pipeline.annotate(document); SpanLabelView vu = new SpanLabelView(viewName, ta); String outputString = ""; for (CoreMap sentence : document.get(CoreAnnotations.SentencesAnnotation.class)) { for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) { String truecase = token.get(CoreAnnotations.TrueCaseTextAnnotation.class); <START> outputString += " " + truecase; <END> } } Constituent c = new Constituent(outputString, viewName, ta,0, ta.getTokens().length); vu.addConstituent(c); ta.addView(viewName, vu); }</code><technical_language>If annotator annotates token, output a TokenLabelView a constituent token in source TextAnnotation. I misunderstood TrueCase annotator works, raising a concern</technical_language>

Target:
protected void addView(TextAnnotation ta) throws AnnotatorException { Annotation document = new Annotation(ta.text); pipeline.annotate(document); TokenLabelView vu = new TokenLabelView(viewName, ta); for (CoreMap sentence : document.get(CoreAnnotations.SentencesAnnotation.class)) { for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) { String trueCase = token.get(CoreAnnotations.TrueCaseTextAnnotation.class); int beginCharOffsetS = token.beginPosition(); int endCharOffset = token.endPosition() - 1; List<Constituent> overlappingCons = ta.getView(ViewNames.TOKENS).getConstituentsOverlappingCharSpan(beginCharOffsetS, endCharOffset); int endIndex = overlappingCons.stream().max(Comparator.comparing(Constituent::getEndSpan)).get().getEndSpan(); Constituent c = new Constituent(trueCase, viewName, ta, endIndex - 1, endIndex); vu.addConstituent(c); } } ta.addView(viewName, vu); }
Source:
<code>public int hashCode() { <START> return this.deviceIdentification != null ? this.deviceIdentification.hashCode() : 0; <END> }</code><technical_language>equals, this hashCode fine, a if prefer: return Objects.hashCode(this.deviceIdentification); match equals</technical_language>

Target:
public int hashCode() { return Objects.hashCode(this.deviceIdentification); }
Source:
<code>protected void resolveLineTagLocations(String sourceName, String... tags) throws IOException { try (BufferedReader reader = new BufferedReader(new FileReader(SOURCE_PATH + sourceName))) { Set<String> tagsToFind = new HashSet<>(Arrays.asList(tags)); Set<String> tagsFound = new HashSet<>(); String line; int lineNumber = 1; fTagLocations.clear(); line = reader.readLine(); while (line != null) { for (String tag : tagsToFind) { if (line.contains(tag)) { if (tagsFound.contains(tag)) { throw new RuntimeException("Tag " + tag + " was found twice in " + sourceName); } fTagLocations.put(tag, lineNumber); <START> tagsFound.add(tag); <END> break; } } lineNumber++; line = reader.readLine(); } if (tagsToFind.size() != tagsFound.size()) { throw new RuntimeException( "Some tags were not found in " + sourceName); } } }</code><technical_language>do need another set? fTagLocations check if is</technical_language>

Target:
protected void resolveLineTagLocations(String sourceName, String... tags) throws IOException { try (BufferedReader reader = new BufferedReader(new FileReader(SOURCE_PATH + sourceName))) { Set<String> tagsToFind = new HashSet<>(Arrays.asList(tags)); String line; int lineNumber = 1; fTagLocations.clear(); line = reader.readLine(); while (line != null) { for (String tag : tagsToFind) { if (line.contains(tag)) { if (fTagLocations.containsKey(tag)) { throw new RuntimeException("Tag " + tag + " was found twice in " + sourceName); } fTagLocations.put(tag, lineNumber); tagsToFind.remove(tag); break; } } lineNumber++; line = reader.readLine(); } if (tagsToFind.size() > 0) { throw new RuntimeException( "Some tags were not found in " + sourceName); } } }
Source:
<code><START> public ClusterDataToSamConverter withMolecularIndexQualityTag(final String molecularIndexQualityTag) { <END> this.molecularIndexQualityTag = molecularIndexQualityTag; return this; }</code><technical_language>null check</technical_language>

Target:
public ClusterDataToSamConverter withMolecularIndexQualityTag(final String molecularIndexQualityTag) { if (molecularIndexQualityTag == null) throw new IllegalArgumentException("Molecular index quality tag was null"); this.molecularIndexQualityTag = molecularIndexQualityTag; return this; }
Source:
<code>private static void addPublicationTypes(Result result, String... types) { <START> for (String type : types) { <END> Instance instance = new Instance(); Qualifier instanceType = new Qualifier(); instanceType.setClassid(type); instance.setInstancetype(instanceType); if (result.getInstance() == null) { result.setInstance(Lists.newArrayList()); } result.getInstance().add(instance); } }</code><technical_language>I stream iteration :)</technical_language>

Target:
private static void addPublicationTypes(Result result, String... types) { if (types.length > 0) { if (result.getInstance() == null) { result.setInstance(Lists.newArrayList()); } Arrays.asList(types).stream().map(type -> { Instance instance = new Instance(); Qualifier instanceType = new Qualifier(); instanceType.setClassid(type); instance.setInstancetype(instanceType); return instance; }).forEach(result.getInstance()::add); } }
Source:
<code><START> private List<DiskImage> initializeListForCopiedImages() { <END> List<DiskImage> clonedDiskImages = new ArrayList<>(getImages()); ArrayList<Guid> storageDomains = new ArrayList<>(); for (DiskImage clonedDiskImage : clonedDiskImages) { clonedDiskImage.setStorageIds(storageDomains); } return clonedDiskImages; }</code><technical_language>elaborate done here? a list elements of getImages() is created wrong . disks in list assigned storageDomains list, is wrong well, of list changing domains of affect other. i missed point,,can explain this method</technical_language>

Target:
private List<DiskImage> initializeListForCopiedImages() { List<DiskImage> clonedDiskImages = getClonedDiskImagesList(); ArrayList<Guid> storageDomains = new ArrayList<>(); for (DiskImage clonedDiskImage : clonedDiskImages) { clonedDiskImage.setStorageIds(storageDomains); } return clonedDiskImages; }
Source:
<code>private void receiveAndReply() { byte[] value = null; try { value = this.boundListOperations.rightPop(this.receiveTimeout, TimeUnit.MILLISECONDS); } catch (Exception e) { handlePopException(e); return; } String uuid = null; if (value != null) { uuid = stringSerializer.deserialize(value); try { value = template.boundListOps(uuid).rightPop(this.receiveTimeout, TimeUnit.MILLISECONDS); } catch (Exception e) { handlePopException(e); return; } <START> Object messageBody = null; <END> if (value != null) { if (this.expectMessage) { if (this.serializer != null) { try { messageBody = this.serializer.deserialize(value); } catch (Exception e) { throw new MessagingException("Deserialization of Message failed.", e); } } else { messageBody = value; } } else { Object payload = value; if (this.serializer != null) { payload = this.serializer.deserialize(value); } messageBody = this.getMessageBuilderFactory().withPayload(payload).build(); } Message<?> replyMessage = this.sendAndReceiveMessage(messageBody); if (replyMessage != null) { if (!(replyMessage.getPayload() instanceof byte[])) { if (replyMessage.getPayload() instanceof String && !serializerExplicitlySet) { value = stringSerializer.serialize((String) replyMessage.getPayload()); } else { value = ((RedisSerializer<Object>) serializer).serialize(replyMessage.getPayload()); } } else { value = (byte[]) replyMessage.getPayload(); } template.boundListOps(uuid + ".reply").leftPush(value); } } } }</code><technical_language>Wrong name for variable. Message</technical_language>

Target:
private void receiveAndReply() { byte[] value = null; try { value = this.boundListOperations.rightPop(this.receiveTimeout, TimeUnit.MILLISECONDS); } catch (Exception e) { handlePopException(e); return; } String uuid = null; if (value != null) { uuid = stringSerializer.deserialize(value); try { value = template.boundListOps(uuid).rightPop(this.receiveTimeout, TimeUnit.MILLISECONDS); } catch (Exception e) { handlePopException(e); return; } Message<Object> requestMessage = null; if (value != null) { if (this.extractPayload) { Object payload = value; if (this.serializer != null) { payload = this.serializer.deserialize(value); } requestMessage = this.getMessageBuilderFactory().withPayload(payload).build(); } else { try { requestMessage = (Message<Object>) this.serializer.deserialize(value); } catch (Exception e) { throw new MessagingException("Deserialization of Message failed.", e); } } Message<?> replyMessage = this.sendAndReceiveMessage(requestMessage); if (replyMessage != null) { if (this.extractPayload == true) { if (!(replyMessage.getPayload() instanceof byte[])) { if (replyMessage.getPayload() instanceof String && !serializerExplicitlySet) { value = stringSerializer.serialize((String) replyMessage.getPayload()); } else { value = ((RedisSerializer<Object>) serializer).serialize(replyMessage.getPayload()); } } else { value = (byte[]) replyMessage.getPayload(); } template.boundListOps(uuid + ".reply").leftPush(value); } else { if (this.serializer != null) { value = ((RedisSerializer<Object>) serializer).serialize(replyMessage); template.boundListOps(uuid + ".reply").leftPush(value); } } } } } }
Source:
<code>public void dispose() { app.getChildren().remove(windowModel); coolBarManager.dispose(); menuManager.dispose(); <START> statusLineManager.dispose(); <END> windowModel.setToBeRendered(false); ((Shell) windowModel.getWidget()).dispose(); }</code><technical_language>Please new context created is destroyed</technical_language>

Target:
public void dispose() { app.getChildren().remove(windowModel); coolBarManager.dispose(); menuManager.dispose(); statusLineManager.dispose(); windowModel.setToBeRendered(false); windowModel.getContext().deactivate(); windowModel.getContext().dispose(); ((Shell) windowModel.getWidget()).dispose(); }
Source:
<code>public TmfAttributePool(ITmfStateSystemBuilder ss, Integer baseQuark, QueueType type) { fSs = ss; try { <START> ss.getParentAttributeQuark(baseQuark); <END> fBaseQuark = baseQuark; } catch (IndexOutOfBoundsException e) { throw new IllegalArgumentException("The quark used as base for the attribute pool is out of bounds"); } switch (type) { case DEFAULT: case FIFO: fAvailableQuarks = new LinkedList<>(); break; case PRIORITY: fAvailableQuarks = new PriorityQueue<>(); break; default: throw new IllegalArgumentException("Wrong queue type"); } }</code><technical_language>a good idea quark is valid construction, accessed (although technically create a pool based a quark exist in future, a bit far-fetched). ss.getQuarkRelative(baseQuark); catching AttributeNotFoundException instead clearer, closer intended of methods</technical_language>

Target:
public TmfAttributePool(ITmfStateSystemBuilder ss, Integer baseQuark, QueueType type) { fSs = ss; try { ss.getParentAttributeQuark(baseQuark); fBaseQuark = baseQuark; } catch (IndexOutOfBoundsException e) { throw new IllegalArgumentException("The quark used as base for the attribute pool does not exist"); } switch (type) { case FIFO: fAvailableQuarks = new LinkedList<>(); break; case PRIORITY: fAvailableQuarks = new PriorityQueue<>(); break; default: throw new IllegalArgumentException("Wrong queue type"); } }