auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void checkout() throws NoWorkTreeException, IOException { for (int i = toBeDeleted.size() - 1; i >= 0; i--) { String fileName = toBeDeleted.get(i); File f = new File(nonNullRepo().getWorkTree(), fileName); if (!f.delete()) if (!f.isDirectory()) failingPaths.put(fileName, MergeFailureReason.COULD_NOT_DELETE); modifiedFiles.add(fileName); } for (Map.Entry<String, DirCacheEntry> entry : toBeCheckedOut .entrySet()) { DirCacheEntry cacheEntry = entry.getValue(); if (cacheEntry.getFileMode() == FileMode.GITLINK) { new <START> File(db.getWorkTree(), <END> entry.getKey()).mkdirs(); } else { DirCacheCheckout.checkoutEntry(db, cacheEntry, reader); modifiedFiles.add(entry.getKey()); } } }</code><technical_language>potential NPE: db is @Nullable</technical_language>

Target:
private void checkout() throws NoWorkTreeException, IOException { for (int i = toBeDeleted.size() - 1; i >= 0; i--) { String fileName = toBeDeleted.get(i); File f = new File(nonNullRepo().getWorkTree(), fileName); if (!f.delete()) if (!f.isDirectory()) failingPaths.put(fileName, MergeFailureReason.COULD_NOT_DELETE); modifiedFiles.add(fileName); } for (Map.Entry<String, DirCacheEntry> entry : toBeCheckedOut .entrySet()) { DirCacheEntry cacheEntry = entry.getValue(); if (cacheEntry.getFileMode() == FileMode.GITLINK) { new File(nonNullRepo().getWorkTree(), entry.getKey()).mkdirs(); } else { DirCacheCheckout.checkoutEntry(db, cacheEntry, reader); modifiedFiles.add(entry.getKey()); } } }
Source:
<code>public Blob run() { JSONArray result = new JSONArray(); JSONObject resultJSON = new JSONObject(); if (updateInProgress) { <START> resultJSON.put("status", "inProgress"); <END> result.add(resultJSON); return Blobs.createJSONBlob(result.toString()); } if (!((NuxeoPrincipal) session.getPrincipal()).isAdministrator()) { resultJSON.put("status", "error"); resultJSON.put("message", "Must be Administrator to use this function"); result.add(resultJSON); return Blobs.createJSONBlob(result.toString()); } if (!Framework.isDevModeSet()) { resultJSON.put("status", "error"); resultJSON.put("message", "You must enable Dev mode to Hot reload your Studio Snapshot package."); result.add(resultJSON); return Blobs.createJSONBlob(result.toString()); } List<DownloadablePackage> pkgs = pm.listRemoteAssociatedStudioPackages(); DownloadablePackage snapshotPkg = StudioSnapshotHelper.getSnapshot(pkgs); if (snapshotPkg == null) { resultJSON.put("status", "error"); resultJSON.put("message", "No Snapshot Package was found."); result.add(resultJSON); return Blobs.createJSONBlob(result.toString()); } try { updateInProgress = true; hotReloadPackage(snapshotPkg, resultJSON); result.add(resultJSON); return Blobs.createJSONBlob(result.toString()); } finally { updateInProgress = false; } }</code><technical_language>declare statuses constant in this class for example. a quick statuses have</technical_language>

Target:
public Blob run() { JSONArray result = new JSONArray(); JSONObject resultJSON = new JSONObject(); if (updateInProgress) { return jsonHelper(inProgress, "Update in progress.", null); } if (!((NuxeoPrincipal) session.getPrincipal()).isAdministrator()) { return jsonHelper(error, "Must be Administrator to use this function.", null); } if (!Framework.isDevModeSet()) { return jsonHelper(error, "You must enable Dev mode to Hot reload your Studio Snapshot package.", null); } List<DownloadablePackage> pkgs = pm.listRemoteAssociatedStudioPackages(); DownloadablePackage snapshotPkg = StudioSnapshotHelper.getSnapshot(pkgs); if (snapshotPkg == null) { return jsonHelper(error, "No Snapshot Package was found.", null); } try { updateInProgress = true; return hotReloadPackage(snapshotPkg); } finally { updateInProgress = false; } }
Source:
<code>public EmbeddedCacheManager startCaches(final String... cacheNames) { authzHelper.checkPermission(AuthorizationPermission.LIFECYCLE); List<Thread> threads = new ArrayList<Thread>(cacheNames.length); final AtomicReference<RuntimeException> exception = new AtomicReference<RuntimeException>(null); <START> for (final String cacheName : new HashSet<String>(Arrays.asList(cacheNames))) { <END> String threadName = "CacheStartThread," + configurationManager.getGlobalConfiguration().transport().nodeName() + "," + cacheName; Thread thread = new Thread(threadName) { @Override public void run() { try { createCache(cacheName, cacheName); } catch (RuntimeException e) { exception.set(e); } catch (Throwable t) { exception.set(new RuntimeException(t)); } } }; thread.start(); threads.add(thread); } try { for (Thread thread : threads) { thread.join(); } } catch (InterruptedException e) { throw new CacheException("Interrupted while waiting for the caches to start"); } RuntimeException runtimeException = exception.get(); if (runtimeException != null) { throw runtimeException; } return this; }</code><technical_language>this</technical_language>

Target:
public EmbeddedCacheManager startCaches(final String... cacheNames) { authzHelper.checkPermission(AuthorizationPermission.LIFECYCLE); Map<String, Thread> threads = new HashMap<>(cacheNames.length); final AtomicReference<RuntimeException> exception = new AtomicReference<RuntimeException>(null); for (final String cacheName : cacheNames) { if (!threads.containsKey(cacheName)) { String threadName = "CacheStartThread," + configurationManager.getGlobalConfiguration().transport().nodeName() + "," + cacheName; Thread thread = new Thread(threadName) { @Override public void run() { try { createCache(cacheName, cacheName); } catch (RuntimeException e) { exception.set(e); } catch (Throwable t) { exception.set(new RuntimeException(t)); } } }; thread.start(); threads.put(cacheName, thread); } } try { for (Thread thread : threads.values()) { thread.join(); } } catch (InterruptedException e) { throw new CacheException("Interrupted while waiting for the caches to start"); } RuntimeException runtimeException = exception.get(); if (runtimeException != null) { throw runtimeException; } return this; }
Source:
<code>public void checkRttButtonStatus() { Contact contact = conversation == null ? null : conversation.getContact(); if (contact != null && contact.getPresences().supports(Namespace.RTT) <START> && activity.xmppConnectionService.useRealTimeText() <END> && conversation.getBooleanAttribute(Conversation.ATTRIBUTE_REAL_TIME_TEXT, false)) { conversation.setAttribute(Conversation.ATTRIBUTE_REAL_TIME_TEXT, "true"); setRttButtonAlpha(true); } else { conversation.setAttribute(Conversation.ATTRIBUTE_REAL_TIME_TEXT, "false"); setRttButtonAlpha(false); } }</code><technical_language>This condition is unnecessary button hidden this is false</technical_language>

Target:
public void checkRttButtonStatus() { if (conversation != null) { Contact contact = conversation.getContact(); if (contact != null && contact.getPresences().supports(Namespace.RTT) && conversation.getBooleanAttribute(Conversation.ATTRIBUTE_REAL_TIME_TEXT, false)) { setRttButtonAlpha(true); } else { setRttButtonAlpha(false); } } }
Source:
<code>public GroupRebalanceConfig(AbstractConfig config, ProtocolType protocolType) { this.sessionTimeoutMs = config.getInt(CommonClientConfigs.SESSION_TIMEOUT_MS_CONFIG); if (protocolType == ProtocolType.Consumer) { this.rebalanceTimeoutMs = config.getInt(CommonClientConfigs.MAX_POLL_INTERVAL_MS_CONFIG); } else { this.rebalanceTimeoutMs = config.getInt(CommonClientConfigs.REBALANCE_TIMEOUT_MS_CONFIG); } this.heartbeatIntervalMs = config.getInt(CommonClientConfigs.HEARTBEAT_INTERVAL_MS_CONFIG); this.groupId = config.getString(CommonClientConfigs.GROUP_ID_CONFIG); if (protocolType == ProtocolType.Consumer) { String groupInstanceId = config.getString(CommonClientConfigs.GROUP_INSTANCE_ID_CONFIG); if (groupInstanceId != null) { JoinGroupRequest.validateGroupInstanceId(groupInstanceId); this.groupInstanceId = Optional.of(groupInstanceId); } else { this.groupInstanceId = Optional.empty(); } } else { this.groupInstanceId = Optional.empty(); } this.retryBackoffMs = config.getLong(CommonClientConfigs.RETRY_BACKOFF_MS_CONFIG); if (protocolType == ProtocolType.Consumer) { <START> this.leaveGroupOnClose = config.getBoolean("internal.leave.group.on.close"); <END> } else { this.leaveGroupOnClose = true; } }</code><technical_language>is a variable ConsumerConfig#LEAVE_GROUP_ON_CLOSE_CONFIG for this property</technical_language>

Target:
public GroupRebalanceConfig(AbstractConfig config, ProtocolType protocolType) { this.sessionTimeoutMs = config.getInt(CommonClientConfigs.SESSION_TIMEOUT_MS_CONFIG); if (protocolType == ProtocolType.CONSUMER) { this.rebalanceTimeoutMs = config.getInt(CommonClientConfigs.MAX_POLL_INTERVAL_MS_CONFIG); } else { this.rebalanceTimeoutMs = config.getInt(CommonClientConfigs.REBALANCE_TIMEOUT_MS_CONFIG); } this.heartbeatIntervalMs = config.getInt(CommonClientConfigs.HEARTBEAT_INTERVAL_MS_CONFIG); this.groupId = config.getString(CommonClientConfigs.GROUP_ID_CONFIG); if (protocolType == ProtocolType.CONSUMER) { String groupInstanceId = config.getString(CommonClientConfigs.GROUP_INSTANCE_ID_CONFIG); if (groupInstanceId != null) { JoinGroupRequest.validateGroupInstanceId(groupInstanceId); this.groupInstanceId = Optional.of(groupInstanceId); } else { this.groupInstanceId = Optional.empty(); } } else { this.groupInstanceId = Optional.empty(); } this.retryBackoffMs = config.getLong(CommonClientConfigs.RETRY_BACKOFF_MS_CONFIG); if (protocolType == ProtocolType.CONSUMER) { this.leaveGroupOnClose = config.getBoolean("internal.leave.group.on.close"); } else { this.leaveGroupOnClose = true; } }
Source:
<code>public static boolean isInstanceSetup(RealmAwareZkClient zkclient, String clusterName, String instanceName, InstanceType type) { if (type == InstanceType.PARTICIPANT || type == InstanceType.CONTROLLER_PARTICIPANT) { List<String> requiredPaths = new ArrayList<>(); requiredPaths.add(PropertyPathBuilder.instanceConfig(clusterName, instanceName)); requiredPaths.add(PropertyPathBuilder.instanceMessage(clusterName, instanceName)); requiredPaths.add(PropertyPathBuilder.instanceCurrentState(clusterName, instanceName)); <START> requiredPaths.add(PropertyPathBuilder.instanceTaskCurrentState(clusterName, instanceName)); <END> requiredPaths.add(PropertyPathBuilder.instanceStatusUpdate(clusterName, instanceName)); requiredPaths.add(PropertyPathBuilder.instanceError(clusterName, instanceName)); boolean isValid = true; for (String path : requiredPaths) { if (!zkclient.exists(path)) { isValid = false; logger.info("Invalid instance setup, missing znode path: {}", path); } } if (isValid) { String historyPath = PropertyPathBuilder.instanceHistory(clusterName, instanceName); if (!zkclient.exists(historyPath)) { zkclient.createPersistent(historyPath, true); } } return isValid; } return true; }</code><technical_language>A new controller supports older participants. this a required path, no</technical_language>

Target:
public static boolean isInstanceSetup(RealmAwareZkClient zkclient, String clusterName, String instanceName, InstanceType type) { if (type == InstanceType.PARTICIPANT || type == InstanceType.CONTROLLER_PARTICIPANT) { List<String> requiredPaths = new ArrayList<>(); requiredPaths.add(PropertyPathBuilder.instanceConfig(clusterName, instanceName)); requiredPaths.add(PropertyPathBuilder.instanceMessage(clusterName, instanceName)); requiredPaths.add(PropertyPathBuilder.instanceCurrentState(clusterName, instanceName)); requiredPaths.add(PropertyPathBuilder.instanceStatusUpdate(clusterName, instanceName)); requiredPaths.add(PropertyPathBuilder.instanceError(clusterName, instanceName)); boolean isValid = true; for (String path : requiredPaths) { if (!zkclient.exists(path)) { isValid = false; logger.info("Invalid instance setup, missing znode path: {}", path); } } if (isValid) { String historyPath = PropertyPathBuilder.instanceHistory(clusterName, instanceName); if (!zkclient.exists(historyPath)) { zkclient.createPersistent(historyPath, true); } } return isValid; } return true; }
Source:
<code>public void close() { clientPool.shutdown(); try { log.info("Trying to close a CQL client"); cqlClient.close(); } catch (Exception e) { <START> log.info("Closing of CQL client failed"); <END> } super.close(); }</code><technical_language>I want log exception too, this'll hard debug</technical_language>

Target:
public void close() { clientPool.shutdown(); try { log.info("Trying to close a CQL client"); cqlClient.close(); } catch (Exception e) { log.info("Closing of CQL client failed", e); } super.close(); }
Source:
<code>public void visitToken(DetailAST token) { switch (token.getType()) { case TokenTypes.IMPORT: final String importClassPath = FullIdent.createFullIdentBelow(token).getText(); final String className = importClassPath.substring(importClassPath.lastIndexOf(".") + 1); simpleClassNameToQualifiedNameMap.put(className, importClassPath); break; case TokenTypes.CLASS_DEF: <START> final DetailAST modifiersToken = token.findFirstToken(TokenTypes.MODIFIERS); <END> isPublicClass = modifiersToken.branchContains(TokenTypes.LITERAL_PUBLIC); break; case TokenTypes.METHOD_DEF: if (!isPublicClass) { return; } checkNoExternalDependencyExposed(token); break; default: break; } }</code><technical_language>a CheckUtil method in file modifier. final AccessModifier accessModifier = CheckUtil.getAccessModifierFromModifiersToken(modifiersToken);</technical_language>

Target:
public void visitToken(DetailAST token) { switch (token.getType()) { case TokenTypes.IMPORT: final String importClassPath = FullIdent.createFullIdentBelow(token).getText(); final String className = importClassPath.substring(importClassPath.lastIndexOf(".") + 1); simpleClassNameToQualifiedNameMap.put(className, importClassPath); break; case TokenTypes.CLASS_DEF: final AccessModifier accessModifier = CheckUtil.getAccessModifierFromModifiersToken( token.findFirstToken(TokenTypes.MODIFIERS)); isPublicClass = accessModifier.equals(AccessModifier.PUBLIC); break; case TokenTypes.METHOD_DEF: if (!isPublicClass) { return; } checkNoExternalDependencyExposed(token); break; default: break; } }
Source:
<code>public String allocate(Network network, VmNetworkInterface nic) { deallocate(nic); try { org.openstack.quantum.model.Network quantumNetwork = getQuantumClient().execute(new ShowNetwork(network.getProvidedBy().getExternalId())); PortForCreate port = new PortForCreate(); port.setAdminStateUp(true); port.setName(nic.getName()); port.setTenantId(quantumNetwork.getTenantId()); port.setMacAddress(nic.getMacAddress()); port.setNetworkId(quantumNetwork.getId()); port.setDeviceOwner(DEVICE_OWNER); port.setDeviceId(nic.getId().toString()); Port createdPort = getQuantumClient().execute(new CreatePort(port)); return createdPort.getId(); } catch (RuntimeException e) { <START> throw new VdcBLLException(VdcBllErrors.PROVIDER_FAILURE, new RuntimeException(e)); <END> } }</code><technical_language>pass 'e' instead of wrapping a new exception</technical_language>

Target:
public String allocate(Network network, VmNetworkInterface nic) { deallocate(nic); try { org.openstack.quantum.model.Network quantumNetwork = getQuantumClient().networks().show(network.getProvidedBy().getExternalId()).execute(); PortForCreate port = new PortForCreate(); port.setAdminStateUp(true); port.setName(nic.getName()); port.setTenantId(quantumNetwork.getTenantId()); port.setMacAddress(nic.getMacAddress()); port.setNetworkId(quantumNetwork.getId()); port.setDeviceOwner(DEVICE_OWNER); port.setDeviceId(nic.getId().toString()); Port createdPort = getQuantumClient().ports().create(port).execute(); return createdPort.getId(); } catch (RuntimeException e) { throw new VdcBLLException(VdcBllErrors.PROVIDER_FAILURE, new RuntimeException(e)); } }
Source:
<code>public void testListAllLibrarySelectionTypes() throws Exception { List<LibrarySelectionType> librarySelectionTypes = dao.listAllLibrarySelectionTypes(); <START> assertTrue(librarySelectionTypes.size() > 0); <END> }</code><technical_language>missed</technical_language>

Target:
public void testListAllLibrarySelectionTypes() throws Exception { List<LibrarySelectionType> librarySelectionTypes = dao.listAllLibrarySelectionTypes(); assertEquals(2, librarySelectionTypes.size()); }
Source:
<code>public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final JurisDetail jurisDetail = (JurisDetail) o; if (description != null ? !description.equals(jurisDetail.description) : jurisDetail.description != null) { return false; } if (jurisdiction != null ? !jurisdiction.equals(jurisDetail.jurisdiction) : jurisDetail.jurisdiction != null) { return false; } if (jurisdictionName != null ? !jurisdictionName.equals(jurisDetail.jurisdictionName) : jurisDetail.jurisdictionName != null) { return false; } if (taxInCents != null ? !taxInCents.equals(jurisDetail.taxInCents) : jurisDetail.taxInCents != null) { return false; } <START> if (rate != null ? !rate.equals(jurisDetail.rate) : jurisDetail.rate != null) { <END> return false; } if (subType != null ? !subType.equals(jurisDetail.subType) : jurisDetail.subType != null) { return false; } return true; }</code><technical_language>Need compareTo for BigDecimal</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final JurisDetail jurisDetail = (JurisDetail) o; if (description != null ? !description.equals(jurisDetail.description) : jurisDetail.description != null) { return false; } if (jurisdiction != null ? !jurisdiction.equals(jurisDetail.jurisdiction) : jurisDetail.jurisdiction != null) { return false; } if (jurisdictionName != null ? !jurisdictionName.equals(jurisDetail.jurisdictionName) : jurisDetail.jurisdictionName != null) { return false; } if (taxInCents != null ? !taxInCents.equals(jurisDetail.taxInCents) : jurisDetail.taxInCents != null) { return false; } if (rate != null ? rate.compareTo(jurisDetail.rate) != 0 : jurisDetail.rate != null) { return false; } if (subType != null ? !subType.equals(jurisDetail.subType) : jurisDetail.subType != null) { return false; } return true; }
Source:
<code>public ReadOnlyGraph<URI> getResourcesGraph() { return (ReadOnlyGraph<URI>)EMFCompareRCPPlugin.getDefault().getGraphView( <START> "org.eclipse.emf.compare"); <END> }</code><technical_language>This constant declared shared somewhere. "org.eclipse.emf.compare.resources.graph"</technical_language>

Target:
public ReadOnlyGraph<URI> getResourcesGraph() { return (ReadOnlyGraph<URI>)EMFCompareRCPPlugin.getDefault().getGraphView( ResourceUIUtil.RESOURCES_GRAPH_ID); }
Source:
<code>private Collection<String> getRootAndContextScopes(Map<String, ?> map) { List<String> extractedScopes = new ArrayList<>(Collections.emptyList()); try { if (map.containsKey(CONTEXT)) { val context = (Map<String, Object>) map.get("context"); <START> extractedScopes.addAll((Collection<String>) context.get("scope")); <END> } if (map.containsKey(SCOPE)) { extractedScopes.addAll((Collection<String>) map.get(SCOPE)); } } catch (Exception e) { log.error("Failed to extract scopes from JWT"); } return extractedScopes; }</code><technical_language>replace "scope" constant variable SCOPE</technical_language>

Target:
private Collection<String> getRootAndContextScopes(Map<String, ?> map) { List<String> extractedScopes = new ArrayList<>(Collections.emptyList()); try { if (map.containsKey(CONTEXT)) { val context = (Map<String, Object>) map.get(CONTEXT); extractedScopes.addAll((Collection<String>) context.get(SCOPE)); } if (map.containsKey(SCOPE)) { extractedScopes.addAll((Collection<String>) map.get(SCOPE)); } } catch (Exception e) { log.error("Failed to extract scopes from JWT"); } return extractedScopes; }
Source:
<code>private void setArgument(PreparedStatement pstmt, String argument, int targetSqlType, int index) throws SQLException { switch (targetSqlType) { case Types.INTEGER: pstmt.setInt(index, Integer.parseInt(argument)); break; case Types.DOUBLE: case Types.DECIMAL: <START> pstmt.setDouble(index, Double.parseDouble(argument)); <END> break; case Types.VARCHAR: pstmt.setString(index, argument); break; case Types.BOOLEAN: pstmt.setBoolean(index, Boolean.parseBoolean(argument)); break; case Types.BIGINT: pstmt.setLong(index, Long.parseLong(argument)); break; case Types.DATE: pstmt.setDate(index, Date.valueOf(argument)); break; case Types.FLOAT: pstmt.setFloat(index, Float.parseFloat(argument)); break; case Types.TIMESTAMP: pstmt.setTimestamp(index, Timestamp.valueOf(argument)); break; case Types.TIME: pstmt.setTime(index, Time.valueOf(argument)); break; case Types.NULL: pstmt.setNull(index, targetSqlType); break; default: pstmt.setObject(index, argument, targetSqlType); } }</code><technical_language>This is valid. > <LINK_0> > recommended Java mapping for DECIMAL NUMERIC types is java.math.BigDecimal</technical_language>

Target:
private void setArgument(PreparedStatement pstmt, String argument, int targetSqlType, int index) throws SQLException { switch (targetSqlType) { case Types.INTEGER: pstmt.setInt(index, Integer.parseInt(argument)); break; case Types.DECIMAL: case Types.NUMERIC: pstmt.setBigDecimal(index, new BigDecimal(argument)); break; case Types.DOUBLE: case Types.FLOAT: pstmt.setDouble(index, Double.parseDouble(argument)); break; case Types.CHAR: case Types.LONGVARCHAR: case Types.VARCHAR: pstmt.setString(index, argument); break; case Types.BIT: case Types.BOOLEAN: pstmt.setBoolean(index, Boolean.parseBoolean(argument)); break; case Types.BIGINT: pstmt.setLong(index, Long.parseLong(argument)); break; case Types.DATE: pstmt.setDate(index, Date.valueOf(argument)); break; case Types.REAL: pstmt.setFloat(index, Float.parseFloat(argument)); break; case Types.TINYINT: pstmt.setByte(index, Byte.parseByte(argument)); break; case Types.SMALLINT: pstmt.setShort(index, Short.parseShort(argument)); break; case Types.TIMESTAMP: pstmt.setTimestamp(index, Timestamp.valueOf(argument)); break; case Types.TIME: pstmt.setTime(index, Time.valueOf(argument)); break; case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: pstmt.setBytes(index, argument.getBytes()); break; case Types.NULL: pstmt.setNull(index, targetSqlType); break; default: pstmt.setObject(index, argument, targetSqlType); } }
Source:
<code>public boolean isSystemUser(@NonNull final UserId userId) { return Services.get(IQueryBL.class) .createQueryBuilder(I_AD_User.class) .addOnlyActiveRecordsFilter() .addEqualsFilter(I_AD_User.COLUMNNAME_AD_User_ID, userId) <START> .create() .listDistinct(I_AD_User.COLUMNNAME_IsSystemUser, Boolean.class) .stream() .findFirst() .orElse(false); <END> }</code><technical_language>suggestion .addEqualsFilter(I_AD_User.COLUMNNAME_IsSystemUser, true) .create() .anyMatch()</technical_language>

Target:
public boolean isSystemUser(@NonNull final UserId userId) { return Services.get(IQueryBL.class) .createQueryBuilder(I_AD_User.class) .addOnlyActiveRecordsFilter() .addEqualsFilter(I_AD_User.COLUMNNAME_AD_User_ID, userId) .addEqualsFilter(I_AD_User.COLUMNNAME_IsSystemUser, true) .create() .anyMatch(); }
Source:
<code>protected boolean isSessionInvalid(HiveSQLException exc, SessionHandle sessionHandle) { if (exc.getMessage().contains("Invalid SessionHandle") && exc.getMessage().contains(sessionHandle.toString())) { return true; } <START> if (exc.getCause() != null && exc.getCause() instanceof HiveSQLException) { <END> isSessionInvalid((HiveSQLException) exc.getCause(), sessionHandle); } return false; }</code><technical_language>This is redundant. exc.getCause() instanceof HiveSQLException is enough check null HiveSQLException objects</technical_language>

Target:
protected boolean isSessionInvalid(HiveSQLException exc, SessionHandle sessionHandle) { if (exc.getMessage().contains("Invalid SessionHandle") && exc.getMessage().contains(sessionHandle.toString())) { return true; } if (exc.getCause() instanceof HiveSQLException) { isSessionInvalid((HiveSQLException) exc.getCause(), sessionHandle); } return false; }
Source:
<code><START> private byte[] signData(byte[] data) throws Exception { <END> Signature signer = Signature.getInstance(SIGNATURE_ALGORITHM_NAME); signer.initSign(privateKey); signer.update(data); return signer.sign(); }</code><technical_language>a bit sad throws Exception here. list out: throws NoSuchAlgorithmException, InvalidKeyException, SignatureException? expecting unchecked exceptions</technical_language>

Target:
private byte[] signData(byte[] data) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException { Signature signer = Signature.getInstance(SIGNATURE_ALGORITHM_NAME); signer.initSign(privateKey); signer.update(data); return signer.sign(); }
Source:
<code>private IgniteEx startGridWithCache(CacheConfiguration<Integer, Integer> ccfg, int range) throws Exception { defaultCacheCfg = ccfg; IgniteEx ig = startGrid(0); ig.cluster().baselineAutoAdjustEnabled(false); ig.cluster().active(true); for (int i = 0; i < range; i++) ig.cache(DEFAULT_CACHE_NAME).put(i, i); <START> CheckpointProgress cpFut = ig.context() <END> .cache() .context() .database() .forceCheckpoint("the next one"); cpFut.futureFor(CheckpointState.FINISHED).get(); return ig; }</code><technical_language>forceCheckpoint(ig)</technical_language>

Target:
private IgniteEx startGridWithCache(CacheConfiguration<Integer, Integer> ccfg, int range) throws Exception { dfltCacheCfg = ccfg; IgniteEx ig = startGrid(0); ig.cluster().baselineAutoAdjustEnabled(false); ig.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < range; i++) ig.cache(DEFAULT_CACHE_NAME).put(i, i); forceCheckpoint(ig); return ig; }
Source:
<code>public Set<Change.Id> getStarredChanges() { <START> return null; <END> }</code><technical_language>return Collections.emptySet();</technical_language>

Target:
public Set<Change.Id> getStarredChanges() { return Collections.emptySet(); }
Source:
<code>public boolean perform(final Build<?,?> build, final Launcher launcher, final BuildListener listener) throws InterruptedException, IOException { <START> final Timer timer = new Timer("Timer-" + build.getDisplayName().replace(" ", "_"), true); <END> final AtomicBoolean stopped = new AtomicBoolean(false); try { final long delay = getTimeout(build, listener); timer.schedule(new TimerTask() { @Override public void run() { if (operationList.isEmpty()) { new AbortOperation().perform(build, listener, delay); } for (BuildTimeOutOperation op : operationList) { op.perform(build, listener, delay); } stopped.set(true); timer.cancel(); } }, delay); return buildStep.perform((AbstractBuild) build, launcher, listener); } catch(InterruptedException e) { if (!stopped.get()) { throw e; } } return false; }</code><technical_language>Trigger.timer in BuildTimeoutWrapper. <LINK_0></technical_language>

Target:
public boolean perform(final Build<?,?> build, final Launcher launcher, final BuildListener listener) throws InterruptedException, IOException { final Timer timer = Trigger.timer; final long delay = getTimeout(build, listener); final TimerTask task = new SafeTimerTask() { @Override public void doRun() { if (operationList.isEmpty()) { new AbortOperation().perform(build, listener, delay); } for (BuildTimeOutOperation op : operationList) { op.perform(build, listener, delay); } } }; try { timer.schedule(task, delay); return buildStep.perform(build, launcher, listener); } finally { task.cancel(); } }
Source:
<code>public List<String> getSourceFolders(String projectPath) { <START> if (!findInitializedLanguageServer().isPresent()) { <END> throw new IllegalStateException("Language server isn't initialized"); } String projectUri = prefixURI(projectPath); Type type = new TypeToken<ArrayList<String>>() {}.getType(); return doGetList(GET_SOURCE_FOLDERS, projectUri, type); }</code><technical_language>is worth move this check separate method</technical_language>

Target:
public List<String> getSourceFolders(String projectPath) { checkLanguageServerInitialized(); String projectUri = prefixURI(projectPath); Type type = new TypeToken<ArrayList<String>>() {}.getType(); return doGetList(GET_SOURCE_FOLDERS, projectUri, type); }
Source:
<code>private static boolean isVisibleEventColumn(TableColumn column) { if (column.getData(Key.ASPECT) == TmfMarginColumn.MARGIN_ASPECT) { return false; } return <START> (!column.getResizable() && column.getWidth() == 0); <END> }</code><technical_language>needs negated, right</technical_language>

Target:
private static boolean isVisibleEventColumn(TableColumn column) { if (column.getData(Key.ASPECT) == TmfMarginColumn.MARGIN_ASPECT) { return false; } return !(!column.getResizable() && column.getWidth() == 0); }
Source:
<code>private void populateFieldInfosFromPojo(ColumnDefinitions rsMetaData) { fieldInfos = Lists.newArrayList(); Field[] fields = pojoClass.getDeclaredFields(); for (int i = 0; i < rsMetaData.size(); i++) { String columnName = rsMetaData.getName(i); String pojoField = getMatchingField(fields, columnName); if (pojoField != null && pojoField.length() != 0) { fieldInfos.add(new FieldInfo(columnName, pojoField, null)); } else { <START> LOG.error("Couldn't find corrosponding pojo field for column: " + columnName); <END> } } }</code><technical_language>This insert null for column is in POJO. This issues null constraints in cassandra tables</technical_language>

Target:
private void populateFieldInfosFromPojo(ColumnDefinitions rsMetaData) { fieldInfos = Lists.newArrayList(); Field[] fields = pojoClass.getDeclaredFields(); for (int i = 0; i < rsMetaData.size(); i++) { String columnName = rsMetaData.getName(i); String pojoField = getMatchingField(fields, columnName); if (pojoField != null && pojoField.length() != 0) { fieldInfos.add(new FieldInfo(columnName, pojoField, null)); } else { LOG.warn("Couldn't find corrosponding pojo field for column: " + columnName); } } }
Source:
<code>public void checkUser(User user) throws BadRequestException { if (user == null) { throw new BadRequestException("User required"); } if (isNullOrEmpty(user.getName())) { throw new BadRequestException("User name required"); } if (user.getName().length() > 39) { <START> throw new BadRequestException("Username should contain less then 39 characters"); <END> } if (!isValidName(user.getName())) { throw new BadRequestException("Username may only contain alphanumeric characters or single hyphens inside"); } if (isNullOrEmpty(user.getEmail())) { throw new BadRequestException("User email required"); } if (user.getPassword() != null) { checkPassword(user.getPassword()); } }</code><technical_language>typo -></technical_language>

Target:
public void checkUser(User user) throws BadRequestException { if (user == null) { throw new BadRequestException("User required"); } if (isNullOrEmpty(user.getName())) { throw new BadRequestException("User name required"); } if (user.getName().length() > 39) { throw new BadRequestException("Username should contain less than 39 characters"); } if (!isValidName(user.getName())) { throw new BadRequestException("Username may only contain alphanumeric characters or single hyphens inside"); } if (isNullOrEmpty(user.getEmail())) { throw new BadRequestException("User email required"); } if (user.getPassword() != null) { checkPassword(user.getPassword()); } }
Source:
<code>public void run(TimelockBenchmarkClientConfig configuration, Environment environment) throws Exception { <START> FeignOkHttpClients.globalClientSetttings = client -> client.hostnameVerifier((ig, nored) -> true); <END> environment.jersey().register(new BenchmarksResource(configuration.getAtlas())); environment.jersey().register( HttpRemotingJerseyFeature.with(HttpRemotingJerseyFeature.StacktracePropagation.PROPAGATE)); }</code><technical_language>basically this bypass hostname verification</technical_language>

Target:
public void run(TimelockBenchmarkClientConfig configuration, Environment environment) throws Exception { FeignOkHttpClients.globalClientSettings = client -> client.hostnameVerifier((ig, nored) -> true); environment.jersey().register(new BenchmarksResource(configuration.getAtlas())); environment.jersey().register(HttpRemotingJerseyFeature.INSTANCE); }
Source:
<code>public void accept(Object rv, Throwable throwable) { <START> if (trace) <END> log.tracef("Resuming invocation of command %s with %d handlers", command, queueSize()); Stages.pushInvocationIdNDC(command, trace); try { invokeQueuedHandlers(rv, throwable); } finally { Stages.popInvocationIdNDC(command, trace); } }</code><technical_language>IMO, trace message in invokeQueuedHandlers()</technical_language>

Target:
public void accept(Object rv, Throwable throwable) { invokeQueuedHandlers(rv, throwable); }
Source:
<code>PlanNodeStatsEstimate calculateJoinComplementStats( Optional<Expression> filter, List<JoinNode.EquiJoinClause> criteria, PlanNodeStatsEstimate leftStats, PlanNodeStatsEstimate rightStats) { if (criteria.isEmpty()) { if (rightStats.getOutputRowCount() > 0) { <START> return leftStats.mapOutputRowCount(rowCount -> 0.0); <END> } if (rightStats.getOutputRowCount() == 0) { return leftStats; } return UNKNOWN_STATS; } int numberOfFilterClauses = filter.map( exression -> ExpressionUtils.extractConjuncts(exression).size()) .orElse(0); return IntStream.range(0, criteria.size()) .mapToObj(drivingClauseId -> { EquiJoinClause drivingClause = criteria.get(drivingClauseId); return calculateJoinComplementStats(leftStats, rightStats, drivingClause, criteria.size() - 1 + numberOfFilterClauses); }) .max(comparingDouble(PlanNodeStatsEstimate::getOutputRowCount)) .get(); }</code><technical_language>This correct based assumption ! filter.isPresent(), is necessarily true anymore</technical_language>

Target:
PlanNodeStatsEstimate calculateJoinComplementStats( Optional<Expression> filter, List<JoinNode.EquiJoinClause> criteria, PlanNodeStatsEstimate leftStats, PlanNodeStatsEstimate rightStats) { if (rightStats.getOutputRowCount() == 0) { return leftStats; } if (criteria.isEmpty()) { if (filter.isPresent()) { return UNKNOWN_STATS; } return leftStats.mapOutputRowCount(rowCount -> 0.0); } int numberOfFilterClauses = filter.map( exression -> ExpressionUtils.extractConjuncts(exression).size()) .orElse(0); return IntStream.range(0, criteria.size()) .mapToObj(drivingClauseId -> { EquiJoinClause drivingClause = criteria.get(drivingClauseId); return calculateJoinComplementStats(leftStats, rightStats, drivingClause, criteria.size() - 1 + numberOfFilterClauses); }) .max(comparingDouble(PlanNodeStatsEstimate::getOutputRowCount)) .get(); }
Source:
<code>public NettyServer(BaseServerOptions options, HttpHandler handler) throws SSLException, CertificateException { Objects.requireNonNull(options, "Server options must be set."); Objects.requireNonNull(handler, "Handler to use must be set."); <START> Boolean secure = options.isSecure(); <END> if (secure) { sslCtx = SslContextBuilder.forServer(options.getCertificate(), options.getPrivateKey()) .build(); } else { sslCtx = null; } this.handler = handler.with(new WrapExceptions().andThen(new AddWebDriverSpecHeaders())); bossGroup = new NioEventLoopGroup(1); workerGroup = new NioEventLoopGroup(); port = options.getPort(); try { externalUrl = options.getExternalUri().toURL(); } catch (MalformedURLException e) { throw new UncheckedIOException("Server URI is not a valid URL: " + options.getExternalUri(), e); } }</code><technical_language>boolean: expect this null, unboxing next line throw NPE if happens</technical_language>

Target:
public NettyServer(BaseServerOptions options, HttpHandler handler) { Objects.requireNonNull(options, "Server options must be set."); Objects.requireNonNull(handler, "Handler to use must be set."); Boolean secure = options.isSecure(); if (secure) { try { sslCtx = SslContextBuilder.forServer(options.getCertificate(), options.getPrivateKey()) .build(); } catch (SSLException e) { throw new UncheckedIOException(new IOException("Certificate problem.", e)); } } else { sslCtx = null; } this.handler = handler.with(new WrapExceptions().andThen(new AddWebDriverSpecHeaders())); bossGroup = new NioEventLoopGroup(1); workerGroup = new NioEventLoopGroup(); port = options.getPort(); try { externalUrl = options.getExternalUri().toURL(); } catch (MalformedURLException e) { throw new UncheckedIOException("Server URI is not a valid URL: " + options.getExternalUri(), e); } }
Source:
<code>private void removeEmptySerialExecutor(Object stripe, SerialExecutor ser_ex) { assert lock.isHeldByCurrentThread(); assert ser_ex.isEmpty(); SerialExecutor removed = executors.remove(stripe); <START> assert ser_ex == removed || (executor.isShutdown() && removed == null); <END> if (ser_ex == removed); { terminating.signalAll(); if (state == State.SHUTDOWN && executors.isEmpty()) { executor.shutdown(); } } }</code><technical_language>assert ser_ex == removed do assert ser_ex == executors.get(stripe); failed remove executor. I assert prevent do unexpected operation</technical_language>

Target:
private void removeEmptySerialExecutor(Object stripe, SerialExecutor ser_ex) { assert ser_ex == executors.get(stripe); assert lock.isHeldByCurrentThread(); assert ser_ex.isEmpty(); executors.remove(stripe); if (state == State.SHUTDOWN && executors.isEmpty()) { executor.shutdown(); terminating.signalAll(); } }
Source:
<code>public void runCucumber(CucumberFeature cucumberFeature) { <START> runtime = new cucumber.runtime.Runtime(resourceLoader, classFinder, classLoader, runtimeOptions); <END> cucumberFeature.run( runtimeOptions.formatter(classLoader), runtimeOptions.reporter(classLoader), runtime); if (!runtime.getErrors().isEmpty()) { throw new CucumberException(runtime.getErrors().get(0)); } if (runtime.exitStatus() != 0) { throw new CucumberException("There are undefined steps"); } }</code><technical_language>please extract this line a method descriptive name</technical_language>

Target:
public void runCucumber(CucumberFeature cucumberFeature) { Runtime runtime = createRuntime(); cucumberFeature.run( runtimeOptions.formatter(classLoader), runtimeOptions.reporter(classLoader), runtime); if (!runtime.getErrors().isEmpty()) { throw new CucumberException(runtime.getErrors().get(0)); } if (runtime.exitStatus() != 0) { throw new CucumberException("There are undefined steps"); } }
Source:
<code>private static InputStream getStream(URL url) { if <START> (url != null) { <END> try { if (InternalPolicy.OSGI_AVAILABLE) { URL platformURL = FileLocator.find(url); if (platformURL != null) { url = platformURL; } } return new BufferedInputStream(url.openStream()); } catch (IOException e) { if (InternalPolicy.DEBUG_LOG_URL_IMAGE_DESCRIPTOR_MISSING_2x) { String path = url.getPath(); if (path.endsWith("@2x.png") || path.endsWith("@1.5x.png")) { String message = "High-resolution image missing: " + url; Policy.getLog().log(new Status(IStatus.WARNING, Policy.JFACE, message, e)); } } } } return null; }</code><technical_language>do a shortcut return null if url == null, avoid deep nesting</technical_language>

Target:
private static InputStream getStream(URL url) { if (url == null) { return null; } try { if (InternalPolicy.OSGI_AVAILABLE) { URL platformURL = FileLocator.find(url); if (platformURL != null) { url = platformURL; } } return new BufferedInputStream(url.openStream()); } catch (IOException e) { if (InternalPolicy.DEBUG_LOG_URL_IMAGE_DESCRIPTOR_MISSING_2x) { String path = url.getPath(); if (path.endsWith("@2x.png") || path.endsWith("@1.5x.png")) { String message = "High-resolution image missing: " + url; Policy.getLog().log(new Status(IStatus.WARNING, Policy.JFACE, message, e)); } } return null; } }
Source:
<code>public String placeLimitOrder(LimitOrder limitOrder) throws IOException { <START> return placeBithumbLimitOrder(limitOrder).getOrderId(); <END> }</code><technical_language>try / catch BithumbException needed</technical_language>

Target:
public String placeLimitOrder(LimitOrder limitOrder) throws IOException { try { return placeBithumbLimitOrder(limitOrder).getOrderId(); } catch (BithumbException e) { throw BithumbErrorAdapter.adapt(e); } }
Source:
<code>public boolean containsThread(@NonNull DiscussionThread discussionThread) { <START> if (isAllType() || isFollowingType()) { <END> return true; } else if (identifier != null && identifier.equals(discussionThread.getTopicId())) { return true; } for (DiscussionTopic child : children) { if (child.containsThread(discussionThread)) { return true; } } return false; }</code><technical_language>I a noticable impact now, for correctness sake, this (isFollowingType() && discussionThread.isFollowing())</technical_language>

Target:
public boolean containsThread(@NonNull DiscussionThread discussionThread) { if (isAllType() || (isFollowingType() && discussionThread.isFollowing())) { return true; } else if (identifier != null && identifier.equals(discussionThread.getTopicId())) { return true; } for (DiscussionTopic child : children) { if (child.containsThread(discussionThread)) { return true; } } return false; }
Source:
<code>protected void resetCurrentContentViewWorkingList() { if (currentContentViewName != null) { ContentView contentView = contentViewActions.getContentView(currentContentViewName); <START> if(contentView != null){ <END> String selectionListName = contentView.getSelectionListName(); documentsListsManager.resetWorkingList(selectionListName); } } }</code><technical_language>format a space if (</technical_language>

Target:
protected void resetCurrentContentViewWorkingList() { if (currentContentViewName != null) { ContentView contentView = contentViewActions.getContentView(currentContentViewName); if (contentView != null) { documentsListsManager.resetWorkingList(contentView.getSelectionListName()); } } }
Source:
<code><START> public AuthenticationConfiguration useBearerTokenCredential(BearerTokenCredential credential) { <END> return useCredentials(IdentityCredentials.NONE.withCredential(credential)); }</code><technical_language>FYI is happening in parallel is methods final prevent implementations overriding building</technical_language>

Target:
public final AuthenticationConfiguration useBearerTokenCredential(BearerTokenCredential credential) { return credential == null ? this : useCredentials(getCredentialSource().with(IdentityCredentials.NONE.withCredential(credential))); }
Source:
<code>public void onSyncQueueFinishedEvent(SyncQueueFinishedEvent event) { Log.d(TAG, "onSyncQueueFinishedEvent() started"); checkOperationID(event); getNotificationManager().cancel(TAG, NOTIFICATION_ID_SYNC_QUEUE_ONGOING); ActionResult result = event.getResult(); <START> if(result != null && !result.isSuccess() <END> || event.getQueueLength() == null || event.getQueueLength() > 0) { enableConnectivityChangeReceiver(true); } emptyOperationID(); }</code><technical_language>This condition is hard read. please add some additional braces</technical_language>

Target:
public void onSyncQueueFinishedEvent(SyncQueueFinishedEvent event) { Log.d(TAG, "onSyncQueueFinishedEvent() started"); checkOperationID(event); getNotificationManager().cancel(TAG, NOTIFICATION_ID_SYNC_QUEUE_ONGOING); ActionResult result = event.getResult(); if((result != null && !result.isSuccess()) || (event.getQueueLength() == null || event.getQueueLength() > 0)) { enableConnectivityChangeReceiver(true); } emptyOperationID(); }
Source:
<code>private void checkMultipleRPFs(ServletContext ctx, ConfigurationProperties props, StartupStatus ss) { String rpfStatus = props.getProperty(MULTIPLE_RPFS); <START> if (rpfStatus == "both") { <END> ss.warning(this, "Deprecation warning: Files matching the name 'runtime.properties' " + "were found in both vivo.home and vivo.home/config. Using " + "the file in vivo.home. Future releases may require " + "runtime.properties be placed in vivo.home/config."); } if (rpfStatus == "home") { ss.warning(this, "Deprecation warning: runtime.properties was found in the " + "vivo.home directory. The recommended directory for " + "runtime.properties is now vivo.home/config. Future releases " + "may require runtime.properties be placed in " + "vivo.home/config."); } }</code><technical_language>equals() more robust == This work interned string in ConfigurationPropertiesSetup</technical_language>

Target:
private void checkMultipleRPFs(ServletContext ctx, ConfigurationProperties props, StartupStatus ss) { String rpfStatus = props.getProperty(ConfigurationPropertiesSetup.RP_MULTIPLE); if (rpfStatus.equals("both")) { ss.warning(this, "Deprecation warning: Files matching the name 'runtime.properties' " + "were found in both vivo.home and vivo.home/config. Using " + "the file in vivo.home. Future releases may require " + "runtime.properties be placed in vivo.home/config."); } if (rpfStatus.equals("home")) { ss.warning(this, "Deprecation warning: runtime.properties was found in the " + "vivo.home directory. The recommended directory for " + "runtime.properties is now vivo.home/config. Future releases " + "may require runtime.properties be placed in " + "vivo.home/config."); } }
Source:
<code>void restore(IMemento memento) throws ClassNotFoundException { IMemento type = memento.getChild(KEY_TYPE); <START> synchronized (fType) { <END> fType = (Class<V>)Class.forName(type.getTextData()); } IMemento[] list = memento.getChildren(KEY_NAME); Map<String, V> values = Collections.synchronizedMap(new TreeMap<String, V>()); for (IMemento elem : list) { values.put(elem.getID(), getValue(elem)); } synchronized (fValues) { fValues = values; } }</code><technical_language>A null pointer exception is triggered here, fType initialized empty constructor is in place. fType is synchronized in multiple places java.lang.NullPointerException org.eclipse.cdt.dsf.debug.ui.viewmodel.SimpleMapPersistable.restore(SimpleMapPersistable.java:78)</technical_language>

Target:
void restore(IMemento memento) throws ClassNotFoundException { IMemento type = memento.getChild(KEY_TYPE); fType = (Class<V>)Class.forName(type.getTextData()); IMemento[] list = memento.getChildren(KEY_NAME); Map<String, V> values = Collections.synchronizedMap(new TreeMap<String, V>()); for (IMemento elem : list) { values.put(elem.getID(), getValue(elem)); } fValues = values; }
Source:
<code>public void rollback() throws XAException { final Transaction transaction = this.transaction; try { final int status = transaction.getStatus(); if (status == Status.STATUS_ROLLING_BACK || status == Status.STATUS_ROLLEDBACK) { return; } } catch (SystemException e) { } if (! (transaction instanceof ImportedTransaction)) { throw Log.log.notImportedXa(XAException.XAER_NOTA); } int oldVal; do { oldVal = completionBits.get(); <START> if ((oldVal & BIT_PREPARE_OR_ROLLBACK) == 0) { <END> throw Log.log.invalidTxStateXa(XAException.XAER_NOTA); } } while (! completionBits.compareAndSet(oldVal, oldVal | BIT_PREPARE_OR_ROLLBACK | BIT_BEFORE_COMP)); final ImportedTransaction importedTransaction = (ImportedTransaction) transaction; if (importedTransaction.activated()) try { importedTransaction.doRollback(); } catch (HeuristicCommitException e) { throw Log.log.heuristicCommitXa(XAException.XA_HEURCOM, e); } catch (HeuristicMixedException e) { throw Log.log.heuristicMixedXa(XAException.XA_HEURMIX, e); } catch (HeuristicRollbackException e) { throw Log.log.heuristicRollbackXa(XAException.XA_HEURRB, e); } catch (IllegalStateException e) { throw Log.log.illegalStateXa(XAException.XAER_NOTA, e); } catch (Throwable e) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMERR, e); } finally { ext.removeImportedTransaction(gtid); } }</code><technical_language>In this case '!=' want throw exception if rollback() called prepare() rollback()</technical_language>

Target:
public void rollback() throws XAException { final Transaction transaction = this.transaction; try { final int status = transaction.getStatus(); if (status == Status.STATUS_ROLLING_BACK || status == Status.STATUS_ROLLEDBACK) { return; } } catch (SystemException e) { } if (! (transaction instanceof ImportedTransaction)) { throw Log.log.notImportedXa(XAException.XAER_NOTA); } final ImportedTransaction importedTransaction = (ImportedTransaction) transaction; if (importedTransaction.activated()) try { importedTransaction.doRollback(); } catch (HeuristicCommitException e) { throw Log.log.heuristicCommitXa(XAException.XA_HEURCOM, e); } catch (HeuristicMixedException e) { throw Log.log.heuristicMixedXa(XAException.XA_HEURMIX, e); } catch (HeuristicRollbackException e) { throw Log.log.heuristicRollbackXa(XAException.XA_HEURRB, e); } catch (IllegalStateException e) { throw Log.log.illegalStateXa(XAException.XAER_NOTA, e); } catch (Throwable e) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMERR, e); } finally { ext.removeImportedTransaction(gtid); } }