auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ServerRepository() { try { portREST=Integer.parseInt(AREProperties.instance.getProperty(ARE_WEBSERVICE_PORT_REST_KEY, String.valueOf(DEFAULT_PORT_REST))); AREProperties.instance.setProperty(ARE_WEBSERVICE_PORT_REST_KEY, String.valueOf(portREST)); <START> }catch(NumberFormatException e) { <END> AstericsErrorHandling.instance.getLogger().logp(Level.WARNING, this.getClass().getName(), "ServerRepository()", "Configured port for REST service invalid: "+ e.getMessage(),e); } try { portWebsocket=Integer.parseInt(AREProperties.instance.getProperty(ARE_WEBSERVICE_PORT_WEBSOCKET_KEY, String.valueOf(DEFAULT_PORT_WEBSOCKET))); AREProperties.instance.setProperty(ARE_WEBSERVICE_PORT_WEBSOCKET_KEY, String.valueOf(portWebsocket)); }catch(NumberFormatException e) { AstericsErrorHandling.instance.getLogger().logp(Level.WARNING, this.getClass().getName(), "ServerRepository()", "Configured port for Websocket service invalid: "+e.getMessage(),e); } }</code><technical_language>auto-format this file? is space { = spaces</technical_language>

Target:
private ServerRepository() { try { portREST = Integer.parseInt(AREProperties.instance.getProperty(ARE_WEBSERVICE_PORT_REST_KEY, String.valueOf(DEFAULT_PORT_REST))); } catch (NumberFormatException e) { AstericsErrorHandling.instance.getLogger().logp(Level.WARNING, this.getClass().getName(), "ServerRepository()", "Configured port for REST service invalid: " + e.getMessage(), e); } try { portWebsocket = Integer.parseInt(AREProperties.instance.getProperty(ARE_WEBSERVICE_PORT_WEBSOCKET_KEY, String.valueOf(DEFAULT_PORT_WEBSOCKET))); } catch (NumberFormatException e) { AstericsErrorHandling.instance.getLogger().logp(Level.WARNING, this.getClass().getName(), "ServerRepository()", "Configured port for Websocket service invalid: " + e.getMessage(), e); } }
Source:
<code>public void checkTimeoutOnPendingOperations() { for (int i = 0; i < clients.length; i++) { clients[i].checkTimeoutOnPendingOperations(); <START> if (null != clientsV3) { <END> clientsV3[i].checkTimeoutOnPendingOperations(); } } }</code><technical_language>suggestion if (clients != clientsV3) {</technical_language>

Target:
public void checkTimeoutOnPendingOperations() { for (int i = 0; i < clients.length; i++) { clients[i].checkTimeoutOnPendingOperations(); if (clients != clientsV3Enforced) { clientsV3Enforced[i].checkTimeoutOnPendingOperations(); } } }
Source:
<code>public void mouseMove(MouseEvent e) { <START> copyDragActive = (e.stateMask & SWT.SHIFT) != 0 && lastSelection != null && lastSelection.size() > 1 <END> && masterObject != null; }</code><technical_language>standard copy modifier Mac platform is Option key (Alt), Shift</technical_language>

Target:
public void mouseMove(MouseEvent e) { copyDragActive = isCopyModifierPressed(e) && lastSelection != null && lastSelection.size() > 1 && masterObject != null; }
Source:
<code>public List<TextSource> getLabels() { if (proto.getLabelCount() == 0) { return Collections.<TextSource>emptyList(); } ArrayList<TextSource> points = new ArrayList<TextSource>(proto.getLabelCount()); for (LabelElementProto element : proto.getLabelList()) { points.add(new TextSourceImpl(getCoords(element.getLocation()), <START> "TestElement", <END> element.getColor(), element.getOffset(), element.getFontSize())); } return points; }</code><technical_language>this change</technical_language>

Target:
public List<TextSource> getLabels() { if (proto.getLabelCount() == 0) { return Collections.<TextSource>emptyList(); } ArrayList<TextSource> points = new ArrayList<TextSource>(proto.getLabelCount()); for (LabelElementProto element : proto.getLabelList()) { points.add(new TextSourceImpl(getCoords(element.getLocation()), resources.getString(element.getStringIndex()), element.getColor(), element.getOffset(), element.getFontSize())); } return points; }
Source:
<code><START> public Builder setCharset(Charset charset) { <END> if (charset != null) { this.charset = charset; } return this; }</code><technical_language>Do need this public</technical_language>

Target:
Builder setCharset(Charset charset) { if (charset != null) { this.charset = charset; } return this; }
Source:
<code>public PartETag uploadPart(File file, String key, String uploadId, int partNum) throws IOException { <START> InputStream inputStream = null; <END> try { inputStream = new FileInputStream(file); } finally { if (inputStream != null) { inputStream.close(); } } return uploadPart(inputStream, key, uploadId, partNum, file.length()); }</code><technical_language>broken, L262 get a closed stream</technical_language>

Target:
public PartETag uploadPart(File file, String key, String uploadId, int partNum) throws IOException { InputStream inputStream = null; try { inputStream = new FileInputStream(file); } finally { if (inputStream != null) { return uploadPart(inputStream, key, uploadId, partNum, file.length()); } } return null; }
Source:
<code><START> public CacheQuota(String identity, Optional<DataSize> quota) <END> { this(md5().hashString(identity, UTF_8).asLong(), quota); }</code><technical_language>This called coordinator. concern is complexity of md5(). if md5() is more expensive shipping identity is..... save, I move this part of logic getIdentifier() call</technical_language>

Target:
public CacheQuota(String identity, Optional<DataSize> quota) { this.identifier = md5().hashString(identity, UTF_8).asLong(); this.quota = requireNonNull(quota, "quota is null"); }
Source:
<code>protected boolean isIgnoredReference(Match match, EReference reference) { if (reference != null) { if (!reference.isDerived() && !reference.isContainer() && !reference.isTransient()) { boolean isGenericTypeWithoutArguments = false; boolean isGenericType = reference.getEType() == EcorePackage.eINSTANCE.getEGenericType(); if (isGenericType) { isGenericTypeWithoutArguments = IS_EGENERIC_TYPE_WITHOUT_PARAMETERS .apply(match.getLeft()) || IS_EGENERIC_TYPE_WITHOUT_PARAMETERS.apply(match.getRight()) <START> || IS_EGENERIC_TYPE_WITHOUT_PARAMETERS.apply(match.getOrigin()); <END> } return isGenericTypeWithoutArguments || !referenceIsSet(reference, match); } } return true; }</code><technical_language>if type parameter added side? I this "none of sides a type parameter" risk detect strange differences prevent merging altogether</technical_language>

Target:
protected boolean isIgnoredReference(Match match, EReference reference) { if (reference != null) { if (!reference.isDerived() && !reference.isContainer() && !reference.isTransient()) { boolean isGenericTypeWithoutArguments = false; boolean isGenericType = reference.getEType() == EcorePackage.eINSTANCE.getEGenericType(); if (isGenericType) { isGenericTypeWithoutArguments = IS_EGENERIC_TYPE_WITHOUT_PARAMETERS .apply(match.getLeft()) && IS_EGENERIC_TYPE_WITHOUT_PARAMETERS.apply(match.getRight()) && IS_EGENERIC_TYPE_WITHOUT_PARAMETERS.apply(match.getOrigin()); } return isGenericTypeWithoutArguments || !referenceIsSet(reference, match); } } return true; }
Source:
<code>public void startRegionOperation(Operation op) throws IOException { boolean isInterruptableOp = false; switch (op) { case GET: case SCAN: checkReadsEnabled(); case INCREMENT: case APPEND: case PUT: case DELETE: case BATCH_MUTATE: case CHECK_AND_MUTATE: isInterruptableOp = true; default: break; } if (op == Operation.MERGE_REGION || op == Operation.SPLIT_REGION || op == Operation.COMPACT_REGION || op == Operation.COMPACT_SWITCH) { return; } if (this.closing.get()) { throw new NotServingRegionException(getRegionInfo().getRegionNameAsString() + " is closing"); } lock(lock.readLock()); Thread thisThread = Thread.currentThread(); if (isInterruptableOp) { <START> regionLockHolders.put(thisThread.hashCode(), thisThread); <END> } if (this.closed.get()) { lock.readLock().unlock(); throw new NotServingRegionException(getRegionInfo().getRegionNameAsString() + " is closed"); } if (op == Operation.SNAPSHOT) { stores.values().forEach(HStore::preSnapshotOperation); } try { if (coprocessorHost != null) { coprocessorHost.postStartRegionOperation(op); } } catch (Exception e) { regionLockHolders.remove(thisThread.hashCode()); lock.readLock().unlock(); throw new IOException(e); } }</code><technical_language>Collections.newSetFromMap(new ConcurrentHashMap<>()) here</technical_language>

Target:
public void startRegionOperation(Operation op) throws IOException { boolean isInterruptableOp = false; switch (op) { case GET: case SCAN: isInterruptableOp = true; checkReadsEnabled(); break; case INCREMENT: case APPEND: case PUT: case DELETE: case BATCH_MUTATE: case CHECK_AND_MUTATE: isInterruptableOp = true; break; default: break; } if (op == Operation.MERGE_REGION || op == Operation.SPLIT_REGION || op == Operation.COMPACT_REGION || op == Operation.COMPACT_SWITCH) { return; } if (this.closing.get()) { throw new NotServingRegionException(getRegionInfo().getRegionNameAsString() + " is closing"); } lock(lock.readLock()); Thread thisThread = Thread.currentThread(); if (isInterruptableOp) { regionLockHolders.put(thisThread, true); } if (this.closed.get()) { lock.readLock().unlock(); throw new NotServingRegionException(getRegionInfo().getRegionNameAsString() + " is closed"); } if (op == Operation.SNAPSHOT) { stores.values().forEach(HStore::preSnapshotOperation); } try { if (coprocessorHost != null) { coprocessorHost.postStartRegionOperation(op); } } catch (Exception e) { if (isInterruptableOp) { regionLockHolders.remove(thisThread); } lock.readLock().unlock(); throw new IOException(e); } }
Source:
<code>protected AbstractCompositeByteBufTest(ByteOrder order) { ObjectUtil.checkNotNull(order, "order"); <START> this.order = order; <END> }</code><technical_language>nit: merge lines checkNotNull return argument</technical_language>

Target:
protected AbstractCompositeByteBufTest(ByteOrder order) { this.order = ObjectUtil.checkNotNull(order, "order"); }
Source:
<code>public boolean canMatchTrace(ITmfTrace trace) { if (!(trace instanceof LttngKernelTrace)) { return false; } LttngKernelTrace ktrace = (LttngKernelTrace) trace; String[] events = { TcpEventStrings.INET_SOCK_LOCAL_IN, TcpEventStrings.INET_SOCK_LOCAL_OUT }; <START> return (ktrace.hasAtLeastOneOfEvents(events)); <END> }</code><technical_language>outer parentheses needed</technical_language>

Target:
public boolean canMatchTrace(ITmfTrace trace) { if (!(trace instanceof LttngKernelTrace)) { return false; } LttngKernelTrace ktrace = (LttngKernelTrace) trace; String[] events = { TcpEventStrings.INET_SOCK_LOCAL_IN, TcpEventStrings.INET_SOCK_LOCAL_OUT }; return ktrace.hasAtLeastOneOfEvents(events); }
Source:
<code>public boolean isTable(String sourceName) { String[] sourceComponents = sourceName.split("\\."); <START> return sourceComponents[sourceComponents.length - 1].toLowerCase().equals(SAMZA_SQL_QUERY_TABLE_KEYWORD); <END> }</code><technical_language>I confuse is "$table" keyword, beginning end</technical_language>

Target:
public boolean isTable(String sourceName) { String[] sourceComponents = sourceName.split("\\."); return sourceComponents[sourceComponents.length - 1].equalsIgnoreCase(SAMZA_SQL_QUERY_TABLE_KEYWORD); }
Source:
<code>private void onSortExpenseResult(Intent data) { Comparator<ExpenseClaim> comparator = (Comparator<ExpenseClaim>)data.getSerializableExtra(ExpenseClaimSortActivity.EXPENSE_CLAIM_SORT); listModel.setComparator(comparator); <START> if(checkFilteredTags()) { <END> setFilteredClaims(); filteredListModel.setComparator(comparator); } }</code><technical_language>Style inconsistency: space if</technical_language>

Target:
private void onSortExpenseResult(Intent data) { Comparator<ExpenseClaim> comparator = (Comparator<ExpenseClaim>)data.getSerializableExtra(ExpenseClaimSortActivity.EXPENSE_CLAIM_SORT); listModel.setComparator(comparator); if (!filteredTagsList.isEmpty()) { setFilteredClaims(); filteredListModel.setComparator(comparator); } }
Source:
<code>public Authentication findAuthentication(String type, URI uri, String realm) { if (authentication.matches(type, uri, realm)) { return authentication; } <START> throw new UnsupportedOperationException(String.format("Authentication type %s is not supported", type)); <END> }</code><technical_language>Static import format</technical_language>

Target:
public Authentication findAuthentication(String type, URI uri, String realm) { if (authentication.matches(type, uri, realm)) { return authentication; } return null; }
Source:
<code>public Container(String name, Map<String, String> attributes) { Assert.hasText(name); this.name = name; <START> this.attributes = new ContainerAttributes(Collections.unmodifiableMap(new HashMap<String, String>(attributes))); <END> String groupList = attributes.get("groups"); if (groupList == null) { groups = Collections.emptySet(); } else { Set<String> set = new HashSet<String>(); Collections.addAll(set, StringUtils.tokenizeToStringArray(groupList, ",")); this.groups = Collections.unmodifiableSet(set); } }</code><technical_language>I wrap attributes map (including read-only wrapper) - responsibility of ContainerAttributes decide do contents of map handed it. This simplified passing attributes map ContainerAttributes constructor</technical_language>

Target:
public Container(String name, Map<String, String> attributes) { Assert.hasText(name); this.name = name; this.attributes = new ContainerAttributes(attributes); String groupList = attributes.get("groups"); if (groupList == null) { groups = Collections.emptySet(); } else { Set<String> set = new HashSet<String>(); Collections.addAll(set, StringUtils.tokenizeToStringArray(groupList, ",")); this.groups = Collections.unmodifiableSet(set); } }
Source:
<code>private void cleanupDnsRecords(Stack stack, Collection<InstanceMetaData> instanceMetaDatas) { <START> Set<String> fqdns = instanceMetaDatas.stream().map(InstanceMetaData::getDiscoveryFQDN).collect(Collectors.toSet()); <END> Set<String> ips = instanceMetaDatas.stream().map(InstanceMetaData::getPrivateIp).collect(Collectors.toSet()); try { LOGGER.info("Cleanup DNS records for FQDNS: and IPs {}", fqdns, ips); freeIpaCleanupService.cleanupDnsOnly(stack, fqdns, ips); } catch (Exception e) { LOGGER.error("Failed to delete dns records for FQDNS: and IPs {}", fqdns, ips, e); } }</code><technical_language>I wondering if for getDiscoveryFQDN return null some error cases. I this called for cleanup of a cluster a node successfully complete registration. A filter(Objects:nonNull) helpful here. I in case is Objects.requireNonNull(hostNames, "Hostnames set"); throw exception. I if this validation is called for cluster deletion if prevent a cleanup completing "force"</technical_language>

Target:
private void cleanupDnsRecords(Stack stack, Collection<InstanceMetaData> instanceMetaDatas) { Set<String> fqdns = instanceMetadataProcessor.extractFqdn(instanceMetaDatas); Set<String> ips = instanceMetadataProcessor.extractIps(instanceMetaDatas); try { LOGGER.info("Cleanup DNS records for FQDNS: and IPs {}", fqdns, ips); freeIpaCleanupService.cleanupDnsOnly(stack, fqdns, ips); } catch (Exception e) { LOGGER.error("Failed to delete dns records for FQDNS: and IPs {}", fqdns, ips, e); } }
Source:
<code>public void testReResolvingSingle() { byte size = 1; ArrayList<InetSocketAddress> list = new ArrayList<InetSocketAddress>(size); <START> list.clear(); <END> list.add(InetSocketAddress.createUnresolved("issues.apache.org", 1234)); final InetAddress issuesApacheOrg = mock(InetAddress.class); when(issuesApacheOrg.getHostAddress()).thenReturn("192.168.1.1"); when(issuesApacheOrg.toString()).thenReturn("issues.apache.org"); when(issuesApacheOrg.getHostName()).thenReturn("issues.apache.org"); StaticHostProvider.Resolver resolver = new StaticHostProvider.Resolver() { @Override public InetAddress[] getAllByName(String name) { return new InetAddress[] { issuesApacheOrg }; } }; StaticHostProvider hostProvider = new StaticHostProvider(list, resolver); InetSocketAddress next = hostProvider.next(0); next = hostProvider.next(0); assertTrue("No address was removed", hostProvider.getNextRemoved() == 1); assertTrue("No address was added", hostProvider.getNextAdded() == 1); }</code><technical_language>do need this</technical_language>

Target:
public void testReResolvingSingle() throws UnknownHostException { byte size = 1; ArrayList<InetSocketAddress> list = new ArrayList<InetSocketAddress>(size); list.add(InetSocketAddress.createUnresolved("issues.apache.org", 1234)); final InetAddress issuesApacheOrg = mock(InetAddress.class); when(issuesApacheOrg.getHostAddress()).thenReturn("192.168.1.1"); when(issuesApacheOrg.toString()).thenReturn("issues.apache.org"); when(issuesApacheOrg.getHostName()).thenReturn("issues.apache.org"); StaticHostProvider.Resolver resolver = new StaticHostProvider.Resolver() { @Override public InetAddress[] getAllByName(String name) { return new InetAddress[] { issuesApacheOrg }; } }; StaticHostProvider.Resolver spyResolver = spy(resolver); StaticHostProvider hostProvider = new StaticHostProvider(list, spyResolver); for (int i = 0; i < 10; i++) { InetSocketAddress next = hostProvider.next(0); assertEquals(issuesApacheOrg, next.getAddress()); } verify(spyResolver, times(10)).getAllByName("issues.apache.org"); }
Source:
<code>static void addToRun(Fingerprint fp, String imageId, Run run) throws IOException { synchronized (run) { DockerFingerprintAction action = run.getAction(DockerFingerprintAction.class); if (action == null) { action = new DockerFingerprintAction(run); run.addAction(action); } if (!action.getFingerprintKeys().contains(imageId)) { action.getFingerprintKeys().add(imageId); } else { return; } <START> run.save(); <END> } }</code><technical_language>If like, this shortened a bit: java if (action.getFingerprintKeys().add(imageId)) { run.save(); } // else need save updates</technical_language>

Target:
static void addToRun(Fingerprint fp, String imageId, Run run) throws IOException { synchronized (run) { DockerFingerprintAction action = run.getAction(DockerFingerprintAction.class); if (action == null) { action = new DockerFingerprintAction(); run.addAction(action); } if (action.imageIDs.add(imageId)) { run.save(); } } }
Source:
<code><START> public void updateHandler_queryString() { <END> final String oldValue = "foo"; final String newValue = "foo bar"; Response response = db.save(new Foo(null, oldValue)); Params params = new Params() .addParam("field", "title") .addParam("value", newValue); String output = db.invokeUpdateHandler("example/example_update", response.getId(), params); Foo foo = db.find(Foo.class, response.getId()); assertNotNull(output); assertEquals(foo.getTitle(), newValue); }</code><technical_language>check special characters, + = correctly encoded in newValue</technical_language>

Target:
public void updateHandler_queryString() { final String oldValue = "foo"; final String newValue = "foo bar+plus=equals&ampersand"; Response response = db.save(new Foo(null, oldValue)); Params params = new Params() .addParam("field", "title") .addParam("value", newValue); String output = db.invokeUpdateHandler("example/example_update", response.getId(), params); Foo foo = db.find(Foo.class, response.getId()); assertNotNull(output); assertEquals(foo.getTitle(), newValue); }
Source:
<code>public ByteBuffer encrypt(ByteBuffer buffer) throws GeneralSecurityException { Object key = kms.getRandomKey(); Object contextKey = kms.getKey(context); ByteBuffer encryptedKey = cryptoService.encryptKey(key, contextKey); ByteBuffer encryptedDataBuffer = cryptoService.encrypt(buffer, key); ByteBuffer output = ByteBuffer.allocate( EncryptedDataPayload.OVERHEAD_LENGTH + encryptedKey.array().length + encryptedDataBuffer.array().length); EncryptedDataPayload.serialize(output, new EncryptedDataPayload(encryptedKey, encryptedDataBuffer)); <START> return output; <END> }</code><technical_language>buffer need flipped</technical_language>

Target:
public ByteBuffer encrypt(ByteBuffer buffer) throws GeneralSecurityException { Object key = kms.getRandomKey(); Object contextKey = kms.getKey(context); ByteBuffer encryptedKey = cryptoService.encryptKey(key, contextKey); ByteBuffer encryptedDataBuffer = cryptoService.encrypt(buffer, key); ByteBuffer output = ByteBuffer.allocate( EncryptedDataPayload.OVERHEAD_LENGTH + encryptedKey.array().length + encryptedDataBuffer.array().length); EncryptedDataPayload.serialize(output, new EncryptedDataPayload(encryptedKey, encryptedDataBuffer)); output.flip(); return output; }
Source:
<code>public IBlockState getBlockState(BlockPos pos) { <START> IBlockState value = this.processed.get(pos); <END> if (value != null) { return value; } Transaction<BlockSnapshot> unknown = this.transactions.get(this.index); if (unknown != null) { final BlockPos actualPos = this.poses.get(this.index); if (pos.equals(actualPos)) { return (IBlockState) unknown.getFinal().getState(); } } return this.processingWorld.getBlockState(pos); }</code><technical_language>Fluff necessary. this class rendered unnecessary PhaseTracker system. required eliminated bugs introduced gone</technical_language>

Target:
public IBlockState getBlockState(BlockPos pos) { if (this.processed.containsKey(pos)) { return this.processed.get(pos); } Transaction<BlockSnapshot> unknown = this.transactions.get(this.index); if (unknown != null) { final BlockPos actualPos = this.poses.get(this.index); if (pos.equals(actualPos)) { return (IBlockState) unknown.getFinal().getState(); } } return this.processingWorld.getBlockState(pos); }
Source:
<code><START> public void removeRecipient(String channelName) { <END> ConcurrentLinkedQueue<Recipient> removeList = new ConcurrentLinkedQueue<Recipient>(); for (Recipient recipient : recipients) { AbstractMessageChannel channel = (AbstractMessageChannel) recipient.getChannel(); if (channel.getBeanName().equals(channelName)) { removeList.add(recipient); } } recipients.removeAll(removeList); }</code><technical_language>return int (count of recipients removed) - next method</technical_language>

Target:
public int removeRecipient(String channelName) { int counter = 0; MessageChannel channel = this.getBeanFactory().getBean(channelName, MessageChannel.class); for (Iterator<Recipient> it = this.recipients.iterator(); it.hasNext();) { if (it.next().getChannel() == channel) { it.remove(); counter++; } } return counter; }
Source:
<code>public com.alliander.osgp.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasResponse getActualMeterReadsGasResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final ActualMeterReadsGasAsyncRequest request) throws OsgpException { LOGGER.debug("Incoming ActualMeterReadsGasAsyncRequest for meter: {}", request.getDeviceIdentification()); try { final MeterResponseData meterResponseData = this.meterResponseDataRepository .findSingleResultByCorrelationUid(request.getCorrelationUid()); if (meterResponseData == null) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_CORRELATION_UID, ComponentType.WS_SMART_METERING); } if (meterResponseData.getMessageData() instanceof MeterReadsGas) { final com.alliander.osgp.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasResponse response = this.monitoringMapper .map(meterResponseData.getMessageData(), com.alliander.osgp.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasResponse.class); this.meterResponseDataRepository.delete(meterResponseData); return response; } else { LOGGER.warn("Incorrect type of response data: for correlation UID: {}", meterResponseData.getClass() .getName(), request.getCorrelationUid()); } } catch (final Exception e) { this.handleRetrieveException(e, request, organisationIdentification); } <START> return null; <END> }</code><technical_language>I returning null is do here. If good response given, a suitable exception thrown</technical_language>

Target:
public com.alliander.osgp.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasResponse getActualMeterReadsGasResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final ActualMeterReadsGasAsyncRequest request) throws OsgpException { LOGGER.debug("Incoming ActualMeterReadsGasAsyncRequest for meter: {}", request.getDeviceIdentification()); com.alliander.osgp.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasResponse response = new ActualMeterReadsGasResponse(); try { final MeterResponseData meterResponseData = this.meterResponseDataRepository .findSingleResultByCorrelationUid(request.getCorrelationUid()); if (meterResponseData == null) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_CORRELATION_UID, ComponentType.WS_SMART_METERING); } if (meterResponseData.getMessageData() instanceof MeterReadsGas) { response = this.monitoringMapper .map(meterResponseData.getMessageData(), com.alliander.osgp.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasResponse.class); this.meterResponseDataRepository.delete(meterResponseData); return response; } else { LOGGER.warn("Incorrect type of response data: for correlation UID: {}", meterResponseData.getClass() .getName(), request.getCorrelationUid()); } } catch (final Exception e) { this.handleRetrieveException(e, request, organisationIdentification); } return response; }
Source:
<code>private void transactionalRemoveGroup(String groupName, EnumSet<Flag> explicitFlags, ClassLoader explicitClassLoader) { final boolean onGoingTransaction = getOngoingTransaction() != null; if (!onGoingTransaction) { tryBegin(); } try { InvocationContext context = getInvocationContextWithImplicitTransaction(false, explicitClassLoader, UNBOUNDED); Map<K, V> keys = internalGetGroup(groupName, explicitFlags, explicitClassLoader, context); EnumSet<Flag> removeFlags = explicitFlags == null ? EnumSet.noneOf(Flag.class) : explicitFlags; <START> removeFlags.add(IGNORE_RETURN_VALUES); <END> for (K key : keys.keySet()) { removeInternal(key, removeFlags, context); } if (!onGoingTransaction) { tryCommit(); } } catch (RuntimeException e) { if (!onGoingTransaction) { tryRollback(); } throw e; } }</code><technical_language>This add IGNORE_RETURN_VALUES provided explicitFlags set if empty, do. instead create EnumSet starts IGNORE_RETURN_VALUES add explicitFlags resulting EnumSet</technical_language>

Target:
private void transactionalRemoveGroup(String groupName, EnumSet<Flag> explicitFlags, ClassLoader explicitClassLoader) { final boolean onGoingTransaction = getOngoingTransaction() != null; if (!onGoingTransaction) { tryBegin(); } try { InvocationContext context = getInvocationContextWithImplicitTransaction(false, explicitClassLoader, UNBOUNDED); Map<K, V> keys = internalGetGroup(groupName, explicitFlags, explicitClassLoader, context); EnumSet<Flag> removeFlags = explicitFlags == null ? EnumSet.noneOf(Flag.class) : EnumSet.copyOf(explicitFlags); removeFlags.add(IGNORE_RETURN_VALUES); for (K key : keys.keySet()) { removeInternal(key, removeFlags, context); } if (!onGoingTransaction) { tryCommit(); } } catch (RuntimeException e) { if (!onGoingTransaction) { tryRollback(); } throw e; } }
Source:
<code>public SimpleReadSupport() { <START> super(); <END> this.showEmpty = false; }</code><technical_language>(nit) super() unnecessary other constructor, automatically anyway</technical_language>

Target:
public SimpleReadSupport() { this.showEmptyFields = false; }
Source:
<code>public static OseeEnumTypeCacheUpdateResponse fromCache(Collection<OseeEnumType> types) throws OseeCoreException { List<String[]> enumTypeRows = new ArrayList<String[]>(); List<String[]> enumEntryRows = new ArrayList<String[]>(); for (OseeEnumType type : types) { enumTypeRows.add(new String[] { String.valueOf(type.getId()), type.getStorageState().toString(), String.valueOf(type.getGuid()), type.getName()}); for (OseeEnumEntry entry : type.values()) { enumEntryRows.add(new String[] { String.valueOf(type.getGuid()), entry.getGuid(), entry.getName(), entry.getDescription(), <START> String.valueOf(entry.ordinal())}); <END> } } return new OseeEnumTypeCacheUpdateResponse(enumTypeRows, enumEntryRows); }</code><technical_language>Please move getDescription ordinal in fields in legacy message - compatibility considerations</technical_language>

Target:
public static OseeEnumTypeCacheUpdateResponse fromCache(Collection<OseeEnumType> types) throws OseeCoreException { List<String[]> enumTypeRows = new ArrayList<String[]>(); List<String[]> enumEntryRows = new ArrayList<String[]>(); for (OseeEnumType type : types) { enumTypeRows.add(new String[] { String.valueOf(type.getId()), type.getStorageState().toString(), String.valueOf(type.getGuid()), type.getName()}); for (OseeEnumEntry entry : type.values()) { enumEntryRows.add(new String[] { String.valueOf(type.getGuid()), entry.getGuid(), entry.getName(), String.valueOf(entry.ordinal()), entry.getDescription()}); } } return new OseeEnumTypeCacheUpdateResponse(enumTypeRows, enumEntryRows); }
Source:
<code><START> public static int instanceSize(Class<?>... classes) <END> { return Stream.of(classes) .mapToInt(clazz -> parseClass(clazz).instanceSize()) .reduce(0, Math::addExact); }</code><technical_language>is cases for multiple classes</technical_language>

Target:
public static int instanceSize(Class<?>... classes) { return Stream.of(classes) .mapToInt(clazz -> toIntExact(parseClass(clazz).instanceSize())) .reduce(0, Math::addExact); }
Source:
<code>private Map<String, Object> makeCall(String url, String body, HttpCallMethod callMethod) { Request request = (body == null) ? getRequest(url, callMethod) : getRequest(url, body, callMethod); try (Response response = client.newCall(request).execute()) { if (response.isSuccessful()) { <START> if(StringUtils.isBlank(response.body().string())) <END> return new HashMap<>(); else return objectMapper.readValue(response.body().string(), HashMap.class); } else { throw requestFailure(request, createStatus(response)); } } catch(Exception e) { throw KubernetesClientException.launderThrowable(e); } }</code><technical_language>Umm, response.body().string() close response body</technical_language>

Target:
private Map<String, Object> makeCall(String url, String body, HttpCallMethod callMethod) { Request request = (body == null) ? getRequest(url, callMethod) : getRequest(url, body, callMethod); try (Response response = client.newCall(request).execute()) { if (response.isSuccessful()) { String respBody = response.body().string(); if(Utils.isNullOrEmpty(respBody)) return new HashMap<>(); else return objectMapper.readValue(respBody, HashMap.class); } else { throw requestFailure(request, createStatus(response)); } } catch(Exception e) { throw KubernetesClientException.launderThrowable(e); } }
Source:
<code>public static Schema combineSchema(List<Schema> schemas, IOReporter reporter) { if (schemas == null || schemas.isEmpty()) { return new DefaultSchema(null, null); } else if (schemas.size() == 1) { return schemas.get(0); } else { DefaultSchema result = new DefaultSchema(null, null); schemas.forEach(schema -> { schema.getTypes().forEach(type -> { if (reporter != null) { QName name = type.getName(); if (result.getType(name) != null) { reporter.warn( MessageFormat.format("Multiple definitions of type {0}", name)); } } <START> result.addType(type); <END> }); }); return result; } }</code><technical_language>appears schema in list define a type wins here. Is order of schemas predictable? If not, this lead undeterministic results</technical_language>

Target:
public static Schema combineSchema(List<Schema> schemas, IOReporter reporter) { if (schemas == null || schemas.isEmpty()) { return new DefaultSchema(null, null); } else if (schemas.size() == 1) { return schemas.get(0); } else { DefaultSchema result = new DefaultSchema(null, null); schemas.forEach(schema -> { schema.getTypes().forEach(type -> { if (reporter != null) { QName name = type.getName(); if (result.getType(name) != null) { reporter.error( MessageFormat.format("Multiple definitions of type {0}", name)); } } result.addType(type); }); }); return result; } }
Source:
<code>protected static ImmutableList<Ds3Element> convertAllElements( final ImmutableList<Ds3Element> elements, final NameMapper nameMapper) { if (elements == null || elements.isEmpty()) { return elements; } <START> ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder(); <END> for (final Ds3Element element : elements) { final Ds3Element convertedElement = new Ds3Element( element.getName(), convertName(element.getType(), nameMapper), convertName(element.getComponentType(), nameMapper), convertAllAnnotations(element.getDs3Annotations(), nameMapper)); builder.add(convertedElement); } return builder.build(); }</code><technical_language>Missing final</technical_language>

Target:
protected static ImmutableList<Ds3Element> convertAllElements( final ImmutableList<Ds3Element> elements, final NameMapper nameMapper) { if (elements == null || elements.isEmpty()) { return elements; } final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder(); for (final Ds3Element element : elements) { final Ds3Element convertedElement = new Ds3Element( element.getName(), convertName(element.getType(), nameMapper), convertName(element.getComponentType(), nameMapper), convertAllAnnotations(element.getDs3Annotations(), nameMapper)); builder.add(convertedElement); } return builder.build(); }
Source:
<code>public void start() { <START> Optional.ofNullable(heartbeatScheduler.get()).ifPresent(Scheduler::start); <END> }</code><technical_language>big is chance heartbeatScheduler AtomicReference returns null? cover for logging throwing exception</technical_language>

Target:
public void start() { heartbeatMonitor().start(); }
Source:
<code>public int get(int key) { <START> if(map.get(key) != null) { <END> DoubleLinkedList node = map.get(key); int result = node.value; deleteNode(node); addToHead(node); return result; } return -1; }</code><technical_language>is a map.containsKey method check existence. if a is null for a specific key</technical_language>

Target:
public int get(int key) { if(map.containsKey(key)) { DoubleLinkedList node = map.get(key); int result = node.value; deleteNode(node); addToHead(node); return result; } return -1; }
Source:
<code>public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException { Data data = getData(element); if (data == null) return; moveFieldReferenceExpressions(data); if (!data.needReplaceDeclarationWithShortVar()) return; data.getStructDeclaration() <START> .replace(GoElementFactory.createShortVarDeclarationStatement(project, data.getStructVarName(), data.getCompositeLit().getText())); <END> }</code><technical_language>extract variable for more readability, please</technical_language>

Target:
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException { Data data = getData(element); if (data == null) return; boolean needReplaceDeclarationWithShortVar = data.getCompositeLit() == null; GoCompositeLit compositeLit = needReplaceDeclarationWithShortVar ? createStructLiteral(data.getStructDefinition(), project) : data.getCompositeLit(); if (compositeLit == null || needReplaceDeclarationWithShortVar && data.getStructDeclaration() == null) return; moveFieldReferenceExpressions(data.getReferenceExpressions(), compositeLit.getLiteralValue(), data.getAssignment()); if (!needReplaceDeclarationWithShortVar) return; GoStatement shortVarStatement = GoElementFactory.createShortVarDeclarationStatement(project, data.getStructDefinition().getText(), compositeLit.getText()); data.getStructDeclaration().replace(shortVarStatement); }
Source:
<code>void stop() { if (trace) log.tracef("Stop called on ReplicaSpliterator. Current segment %s", nextSegment); <START> if (isConflictResolutionInProgress()) <END> segmentRequestFuture.cancel(true); }</code><technical_language>I stop() called tryAdvance(), replace condition a null check segmentRequestFuture</technical_language>

Target:
void stop() { if (trace) log.tracef("Stop called on ReplicaSpliterator. Current segment %s", nextSegment); if (segmentRequestFuture != null) segmentRequestFuture.cancel(true); }
Source:
<code>public boolean isSameType(ItemStack inputStack) { <START> if (getLocked()) { <END> System.out.printf("+++ SUB#isSameType: locked: [%s]\n", lockedItem); return inputStack.getItem() == lockedItem; } if (inputStack != ItemStack.EMPTY) { return ItemUtils.isItemEqual(getStoredStack(), inputStack, true, true); } return false; }</code><technical_language>Sorry, I left this stuff in meant a formal PR</technical_language>

Target:
public boolean isSameType(ItemStack inputStack) { if (isLocked()) { return ItemUtils.isItemEqual(lockedItemStack, inputStack, true, true); } if (inputStack != ItemStack.EMPTY) { return ItemUtils.isItemEqual(getStoredStack(), inputStack, true, true); } return false; }
Source:
<code>private void scaffold(Iterator<RayMessage> msgIterator) { VKmer id = getVertexId(); RayValue vertex = getVertexValue(); requestScoreMsgs.clear(); aggregateScoreMsgs.clear(); while (msgIterator.hasNext()) { RayMessage msg = msgIterator.next(); switch (msg.getMessageType()) { case CONTINUE_WALK: startBranchComparison(msg); break; case REQUEST_KMER: sendKmerToWalkNodes(msg); break; case REQUEST_SCORE: RayMessage reqMsg = new RayMessage(); <START> reqMsg.setAsCopy(msg); <END> requestScoreMsgs.add(reqMsg); break; case AGGREGATE_SCORE: RayMessage aggMsg = new RayMessage(); aggMsg.setAsCopy(msg); aggregateScoreMsgs.add(aggMsg); break; case PRUNE_EDGE: vertex.getEdges(msg.getEdgeTypeBackToFrontier()).remove(msg.getSourceVertexId()); vertex.visited = false; break; case STOP: vertex.stopSearch = true; break; } } if (requestScoreMsgs.size() > 0) { sendScoresToFrontier(requestScoreMsgs); } if (aggregateScoreMsgs.size() > 0) { compareScoresAndPrune(aggregateScoreMsgs); } }</code><technical_language>This simplified requestScoreMsgs.add(new RayMessage(msg));</technical_language>

Target:
private void scaffold(Iterator<RayMessage> msgIterator) { VKmer id = getVertexId(); RayValue vertex = getVertexValue(); requestScoreMsgs.clear(); aggregateScoreMsgs.clear(); while (msgIterator.hasNext()) { RayMessage msg = msgIterator.next(); switch (msg.getMessageType()) { case CONTINUE_WALK: startBranchComparison(msg); break; case REQUEST_KMER: sendKmerToWalkNodes(msg); break; case REQUEST_SCORE: requestScoreMsgs.add(new RayMessage(msg)); break; case AGGREGATE_SCORE: aggregateScoreMsgs.add(new RayMessage(msg)); break; case PRUNE_EDGE: vertex.getEdges(msg.getEdgeTypeBackToFrontier()).remove(msg.getSourceVertexId()); vertex.visited = false; break; case STOP: vertex.stopSearch = true; break; } } if (requestScoreMsgs.size() > 0) { sendScoresToFrontier(requestScoreMsgs); } if (aggregateScoreMsgs.size() > 0) { compareScoresAndPrune(aggregateScoreMsgs); } }
Source:
<code>public void test_descriptor() { DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor(); sensor.describe(sensorDescriptor); assertThat(sensorDescriptor.name()).isEqualTo("Import of PMD issues"); MapSettings settings = new MapSettings(); <START> assertThat(sensorDescriptor.configurationPredicate().test(new ConfigurationBridge(settings))).isFalse(); <END> settings.setProperty(PmdSensor.REPORT_PROPERTY_KEY, "report.xml"); assertThat(sensorDescriptor.configurationPredicate().test(new ConfigurationBridge(settings))).isTrue(); }</code><technical_language>is method MapSettings#asConfig convert config</technical_language>

Target:
public void test_descriptor() { DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor(); sensor.describe(sensorDescriptor); assertThat(sensorDescriptor.name()).isEqualTo("Import of PMD issues"); MapSettings settings = new MapSettings(); assertThat(sensorDescriptor.configurationPredicate().test(settings.asConfig())).isFalse(); settings.setProperty(PmdSensor.REPORT_PROPERTY_KEY, "report.xml"); assertThat(sensorDescriptor.configurationPredicate().test(settings.asConfig())).isTrue(); }
Source:
<code>public ResourcePools build() { if (resourcePools.isEmpty()) { throw new IllegalStateException("No resource pools defined"); <START> } <END> return new ResourcePoolsImpl(resourcePools); }</code><technical_language>this validation occur constructor</technical_language>

Target:
public ResourcePools build() { return new ResourcePoolsImpl(resourcePools); }
Source:
<code>public RFuture<Void> setRateAsync(RateType type, long rate, long rateInterval, RateIntervalUnit unit) { return commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN, "redis.call('hset', KEYS[1], 'rate', ARGV[1]);" + "redis.call('hset', KEYS[1], 'interval', ARGV[2]);" + "redis.call('hset', KEYS[1], 'type', ARGV[3]);" <START> + "return redis.call('del', KEYS[2], KEYS[3]);", <END> Arrays.asList(getName(), getValueName(), getPermitsName()), rate, unit.toMillis(rateInterval), type.ordinal()); }</code><technical_language>need return in case of void result</technical_language>

Target:
public RFuture<Void> setRateAsync(RateType type, long rate, long rateInterval, RateIntervalUnit unit) { return commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN, "redis.call('hset', KEYS[1], 'rate', ARGV[1]);" + "redis.call('hset', KEYS[1], 'interval', ARGV[2]);" + "redis.call('hset', KEYS[1], 'type', ARGV[3]);" + "redis.call('del', KEYS[2], KEYS[3]);", Arrays.asList(getName(), getValueName(), getPermitsName()), rate, unit.toMillis(rateInterval), type.ordinal()); }
Source:
<code>public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes fs = logic.getFeedbackSession(feedbackSessionName, courseId); if (fs == null) { throw new EntityNotFoundException(new EntityDoesNotExistException("Feedback session is not found")); } Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { case INSTRUCTOR_RESULT: if (userInfo == null) { throw new UnauthorizedAccessException("Instructor account is required to access this resource"); <START> } else { <END> InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); gateKeeper.verifyAccessible(instructor, fs); } break; case STUDENT_RESULT: if (userInfo == null && StringHelper.isEmpty(getRequestParamValue(Const.ParamsNames.REGKEY))) { throw new UnauthorizedAccessException("Student account is required to access this resource."); } StudentAttributes student = getStudent(courseId); gateKeeper.verifyAccessible(student, fs); if (!fs.isPublished()) { throw new UnauthorizedAccessException("This feedback session is not yet published."); } break; case INSTRUCTOR_SUBMISSION: case STUDENT_SUBMISSION: throw new InvalidHttpParameterException("Invalid intent for this action"); default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }</code><technical_language>I more consistent style if guarding clause</technical_language>

Target:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes fs = logic.getFeedbackSession(feedbackSessionName, courseId); if (fs == null) { throw new EntityNotFoundException(new EntityDoesNotExistException("Feedback session is not found")); } Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { case INSTRUCTOR_RESULT: gateKeeper.verifyLoggedInUserPrivileges(); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); gateKeeper.verifyAccessible(instructor, fs); break; case STUDENT_RESULT: StudentAttributes student = getStudent(courseId); gateKeeper.verifyAccessible(student, fs); if (!fs.isPublished()) { throw new UnauthorizedAccessException("This feedback session is not yet published."); } break; case INSTRUCTOR_SUBMISSION: case STUDENT_SUBMISSION: throw new InvalidHttpParameterException("Invalid intent for this action"); default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }
Source:
<code>public final void apply(Project project) { TaskProvider<? extends Task> task = createTask(project); TaskProvider<DefaultTask> precommit = GradleUtils.maybeRegister(project.getTasks(), "precommit", DefaultTask.class, t -> { t.setGroup(JavaBasePlugin.VERIFICATION_GROUP); t.setDescription("Runs all non-test checks"); }); precommit.configure(t -> t.dependsOn(task)); <START> project.getPluginManager().withPlugin("java", p -> { <END> for (SourceSet sourceSet : GradleUtils.getJavaSourceSets(project)) { task.configure(t -> t.shouldRunAfter(sourceSet.getClassesTaskName())); } project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME).configure(t -> t.dependsOn(precommit)); project.getTasks().named(JavaPlugin.TEST_TASK_NAME).configure(t -> t.mustRunAfter(precommit)); }); }</code><technical_language>In opinion extract a JavaPreCommit plugin. this ensure this code is executed more project</technical_language>

Target:
public final void apply(Project project) { project.getPluginManager().apply(PrecommitTaskPlugin.class); TaskProvider<? extends Task> task = createTask(project); TaskProvider<Task> precommit = project.getTasks().named(PRECOMMIT_TASK_NAME); precommit.configure(t -> t.dependsOn(task)); project.getPluginManager() .withPlugin( "java", p -> { for (SourceSet sourceSet : GradleUtils.getJavaSourceSets(project)) { task.configure(t -> t.shouldRunAfter(sourceSet.getClassesTaskName())); } } ); }
Source:
<code>private SharedRealm(OsRealmConfig osRealmConfig) { Capabilities capabilities = new AndroidCapabilities(); RealmNotifier realmNotifier = new AndroidRealmNotifier(this, capabilities); this.nativePtr = nativeGetSharedRealm(osRealmConfig.getNativePtr(), realmNotifier); this.osRealmConfig = osRealmConfig; this.schemaInfo = new OsSchemaInfo(nativeGetSchemaInfo(nativePtr), this); this.context = osRealmConfig.getContext(); this.context.addReference(this); <START> this.isPhantomRef = true; <END> this.capabilities = capabilities; this.realmNotifier = realmNotifier; nativeSetAutoRefresh(nativePtr, capabilities.canDeliverNotification()); }</code><technical_language>isManagedByPhantomRef more clear? Right feels a bit unclear</technical_language>

Target:
private SharedRealm(OsRealmConfig osRealmConfig) { Capabilities capabilities = new AndroidCapabilities(); RealmNotifier realmNotifier = new AndroidRealmNotifier(this, capabilities); this.nativePtr = nativeGetSharedRealm(osRealmConfig.getNativePtr(), realmNotifier); this.osRealmConfig = osRealmConfig; this.schemaInfo = new OsSchemaInfo(nativeGetSchemaInfo(nativePtr), this); this.context = osRealmConfig.getContext(); this.context.addReference(this); this.capabilities = capabilities; this.realmNotifier = realmNotifier; nativeSetAutoRefresh(nativePtr, capabilities.canDeliverNotification()); }
Source:
<code>public void tearDown() throws InterruptedException, ExecutionException, IOException { <START> System.setOut(null); <END> }</code><technical_language>change - set this saved stdOut - ideally saved L85 (now L97) System.out</technical_language>

Target:
public void tearDown() throws InterruptedException, ExecutionException, IOException { DeleteDataset.deleteDataset(PROJECT_ID, datasetId); System.setOut(null); }
Source:
<code>public JcrRepositoryHandle(JcrResourceAdapter ra, JcrManagedConnectionFactory mcf, ConnectionManager cm) throws ResourceException { <START> System.out.println("Resource adaptor: " + ra); <END> this.mcf = mcf; this.cm = cm; try { this.repository = ra.getRepository(); } catch (Exception e) { throw new ResourceException(e); } }</code><technical_language>Oops. Please remove this System.out.println call</technical_language>

Target:
public JcrRepositoryHandle(JcrResourceAdapter ra, JcrManagedConnectionFactory mcf, ConnectionManager cm) throws ResourceException { this.mcf = mcf; this.cm = cm; try { this.repository = ra.getRepository(); } catch (Exception e) { throw new ResourceException(e); } }