auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<Filter> additionalFilters() { if (rootContextFilters.isEmpty()) { <START> new ArrayList<>(); <END> } List<Filter> filters = new ArrayList<>(); final String[] filterClasses = rootContextFilters.split(","); for (String filterClass : filterClasses) { try { final Class<?> filterCls = Class.forName(filterClass); if (Filter.class.isAssignableFrom(filterCls)) { Filter filter = (Filter) filterCls.newInstance(); filters.add(filter); } } catch (InstantiationException | IllegalAccessException e) { logger.warn("Filter class can not be instantiated " + filterClass); } catch (ClassNotFoundException e) { logger.warn("Filter class not found " + filterClass); } } return filters; }</code><technical_language>return Collections.emptyList()</technical_language>

Target:
public List<Filter> additionalFilters() { if (rootContextFilters.isEmpty()) { return Collections.emptyList(); } List<Filter> filters = new ArrayList<>(); final String[] filterClasses = rootContextFilters.split(","); for (String filterClass : filterClasses) { try { getClass().getClassLoader(); final Class<?> filterCls = Class.forName(filterClass, false, getClass().getClassLoader()); if (Filter.class.isAssignableFrom(filterCls)) { Filter filter = (Filter) filterCls.newInstance(); filters.add(filter); } } catch (InstantiationException | IllegalAccessException e) { logger.warn("Filter class can not be instantiated " + filterClass); } catch (ClassNotFoundException e) { logger.warn("Filter class not found " + filterClass); } } return filters; }
Source:
<code>private String prettyUploadedDate(Media media) { Date date = media.getDateUploaded(); if (date == null || date.toString() == null || date.toString().isEmpty()) { return "Uploaded date not available"; } <START> SimpleDateFormat formatter = new SimpleDateFormat("yyyy MMM dd", Locale.getDefault()); <END> return formatter.format(date); }</code><technical_language>find a solution works in languages</technical_language>

Target:
private String prettyUploadedDate(Media media) { Date date = media.getDateUploaded(); if (date == null || date.toString() == null || date.toString().isEmpty()) { return "Uploaded date not available"; } return DateUtils.dateInLocaleFormat(date); }
Source:
<code>public String toString() { return "CustomFieldValue{" + "id=" + id + <START> ", value=" + (value == null ? "null" : Arrays.asList(value).toString()) + <END> '}'; }</code><technical_language>simplier: showing empty array if is null is a big deal imo. Also, toString for logger.</technical_language>

Target:
public String toString() { return "CustomFieldValue{" + "id=" + id + ", value=" + Arrays.toString(value) + '}'; }
Source:
<code>public void shouldBeAbleToScoreAGameWithNoStrikesOrSpares() { int[] rolls = { 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6 }; <START> PlayGame(rolls); <END> assertEquals(90, game.score()); }</code><technical_language>A newline nice in lines in test cases</technical_language>

Target:
public void shouldBeAbleToScoreAGameWithNoStrikesOrSpares() { int[] rolls = {3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6}; playGame(rolls); assertEquals(90, game.score()); }
Source:
<code>public static void gather( long[] source, int[] positions, int[] rowNumberMap, int sourceOffset, byte[] target, int targetOffset, int numWords) { if (target.length < targetOffset + numWords * ARRAY_LONG_INDEX_SCALE || targetOffset < 0) { throw new IndexOutOfBoundsException(); } int end = sourceOffset + numWords; targetOffset += ARRAY_BYTE_BASE_OFFSET; if (rowNumberMap == null) { for (int i = sourceOffset; i < end; i++) { <START> setLong(target, targetOffset, source[positions[i]]); <END> targetOffset += ARRAY_LONG_INDEX_SCALE; } } else { for (int i = sourceOffset; i < end; i++) { setLong(target, targetOffset, source[rowNumberMap[positions[i]]]); targetOffset += ARRAY_LONG_INDEX_SCALE; } } }</code><technical_language>I static import calls code loses readability -- setLong sounds a setter in this class, not, etc</technical_language>

Target:
public static void gather( long[] source, int[] positions, int[] rowNumberMap, int sourceOffset, byte[] target, int targetOffset, int numWords) { if (target.length < targetOffset + numWords * ARRAY_LONG_INDEX_SCALE || targetOffset < 0) { throw new IndexOutOfBoundsException(); } int end = sourceOffset + numWords; targetOffset += ARRAY_BYTE_BASE_OFFSET; if (rowNumberMap == null) { for (int i = sourceOffset; i < end; i++) { ByteArrays.setLong(target, targetOffset, source[positions[i]]); targetOffset += ARRAY_LONG_INDEX_SCALE; } } else { for (int i = sourceOffset; i < end; i++) { ByteArrays.setLong(target, targetOffset, source[rowNumberMap[positions[i]]]); targetOffset += ARRAY_LONG_INDEX_SCALE; } } }
Source:
<code>public Collection<SlotState> getShardState(int shard) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_STATE_NAME); final Collection<SlotState> slotStates = new LinkedList<SlotState>(); Session session = DatastaxIO.getSession(); try { Select.Where statement = QueryBuilder .select() .column("key") .column("column1") .column("value") <START> .writeTime("value") <END> .from(CassandraModel.QUOTED_KEYSPACE, CassandraModel.CF_METRICS_STATE_NAME) .where(eq("key", (long) shard)); List<Row> results = session.execute(statement).all(); for (Row row : results) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Read shard: %d: - %s %s writetime(value): %s\n", row.getLong("key"), row.getString("column1"), row.getLong("value"), row.getLong("writetime(value)"))); } SlotState state = serDes.deserialize(row.getString("column1")); state.withTimestamp(row.getLong("value")) .withLastUpdatedTimestamp(row.getLong("writetime(value)") / 1000); slotStates.add(state); } return slotStates; } finally { ctx.stop(); } }</code><technical_language>wow, nice easy! @usnavi get merge conflict this file. :-)</technical_language>

Target:
public Collection<SlotState> getShardState(int shard) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_STATE_NAME); final Collection<SlotState> slotStates = new LinkedList<SlotState>(); Session session = DatastaxIO.getSession(); try { Select.Where statement = QueryBuilder .select() .column("key") .column("column1") .column("value") .writeTime("value") .from(CassandraModel.CF_METRICS_STATE_NAME) .where(eq("key", (long) shard)); List<Row> results = session.execute(statement).all(); for (Row row : results) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Read shard: %d: - %s %s writetime(value): %s\n", row.getLong("key"), row.getString("column1"), row.getLong("value"), row.getLong("writetime(value)"))); } SlotState state = serDes.deserialize(row.getString("column1")); state.withTimestamp(row.getLong("value")) .withLastUpdatedTimestamp(row.getLong("writetime(value)") / 1000); slotStates.add(state); } return slotStates; } finally { ctx.stop(); } }
Source:
<code>public static void saveEditors(Collection projects) { if (!BuildAction.isSaveAllSet()) { return; } IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { <START> IWorkbenchPage[] pages = window.getPages(); <END> for (IWorkbenchPage page : pages) { if (projects == null) { page.saveAllEditors(false); } else { IEditorPart[] editors = page.getDirtyEditors(); for (IEditorPart editor : editors) { IFile inputFile = ResourceUtil.getFile(editor.getEditorInput()); if (inputFile != null) { if (projects.contains(inputFile.getProject())) { page.saveEditor(editor, false); } } } } } } }</code><technical_language>inline</technical_language>

Target:
public static void saveEditors(Collection projects) { if (!BuildAction.isSaveAllSet()) { return; } IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { for (IWorkbenchPage page : window.getPages()) { if (projects == null) { page.saveAllEditors(false); } else { for (IEditorPart editor : page.getDirtyEditors()) { IFile inputFile = ResourceUtil.getFile(editor.getEditorInput()); if (inputFile != null) { if (projects.contains(inputFile.getProject())) { page.saveEditor(editor, false); } } } } } } }
Source:
<code>ReceiveConfig(final Config config) { checkReceivedObjects = config.getBoolean( "receive", "fsckobjects", config.getBoolean("transfer", "fsckobjects", false)); allowLeadingZeroFileMode = checkReceivedObjects && config.getBoolean("fsck", "allowLeadingZeroFileMode", false); safeForWindows = checkReceivedObjects && config.getBoolean("fsck", "safeForWindows", false); safeForMacOS = checkReceivedObjects && config.getBoolean("fsck", "safeForMacOS", false); allowCreates = true; allowDeletes = !config.getBoolean("receive", "denydeletes", false); allowNonFastForwards = !config.getBoolean("receive", "denynonfastforwards", false); allowOfsDelta = config.getBoolean("repack", "usedeltabaseoffset", true); certNonceSeed = config.getString("receive", <START> "", "certnonceseed"); <END> certNonceSlopLimit = config.getInt("receive", "certnonceslop", 0); }</code><technical_language>I thought a 2 arg form of getString() this necessary</technical_language>

Target:
ReceiveConfig(final Config config) { checkReceivedObjects = config.getBoolean( "receive", "fsckobjects", config.getBoolean("transfer", "fsckobjects", false)); allowLeadingZeroFileMode = checkReceivedObjects && config.getBoolean("fsck", "allowLeadingZeroFileMode", false); safeForWindows = checkReceivedObjects && config.getBoolean("fsck", "safeForWindows", false); safeForMacOS = checkReceivedObjects && config.getBoolean("fsck", "safeForMacOS", false); allowCreates = true; allowDeletes = !config.getBoolean("receive", "denydeletes", false); allowNonFastForwards = !config.getBoolean("receive", "denynonfastforwards", false); allowOfsDelta = config.getBoolean("repack", "usedeltabaseoffset", true); certNonceSeed = config.getString("receive", null, "certnonceseed"); certNonceSlopLimit = config.getInt("receive", "certnonceslop", 0); }
Source:
<code>public LocalDateTime getStartDate() { int firstDataLine = -1; String message = ""; if (null == startDate) { try { loadContents(); firstDataLine = getFirstDataLine(); startDate = getDate(firstDataLine); } catch (DataFileException e) { message = e.getMessage(); } catch (IndexOutOfBoundsException arrex) { <START> message = "Date column don't exist."; <END> } if (!"".equals(message)) { if (firstDataLine > -1) { addMessage(firstDataLine, message); } else { addMessage(message); } } } return startDate; }</code><technical_language>"Date column exist"</technical_language>

Target:
public LocalDateTime getStartDate() { int firstDataLine = -1; String message = ""; if (null == startDate) { try { loadContents(); firstDataLine = getFirstDataLine(); startDate = getDate(firstDataLine); } catch (DataFileException e) { message = e.getMessage(); } catch (IndexOutOfBoundsException arrex) { message = "Date column doesn't exist."; } if (!"".equals(message)) { if (firstDataLine > -1) { addMessage(firstDataLine, message); } else { addMessage(message); } } } return startDate; }
Source:
<code>public void shouldDisplayEndpointParametersInOrderAfterMethodParametersUpdateInWorkingCopy() throws CoreException { final IMethod modifiedMethod = remodifyJavaMethod(modifyJavaMethod(WORKING_COPY)); final JaxrsResourceMethod resourceMethod = getResourceMethod(); resourceMethod.update(modifiedMethod, JdtUtils.parse(modifiedMethod, null)); final JaxrsEndpoint endpoint = metamodel.findEndpoints(resourceMethod).iterator().next(); endpoint.update(new Flags(F_PATH_ANNOTATION + F_QUERY_PARAM_ANNOTATION + F_MATRIX_PARAM_ANNOTATION)); <START> WorkbenchTasks.waitForTasksToComplete(javaProject.getProject().getWorkspace()); <END> final String uriPathTemplate = endpoint.getUriPathTemplate(); assertThat( uriPathTemplate, equalTo("/hello/customers/{foo:\\d+}/{bar:[a-z]+};matrixParam1={short};matrixParam2={List<String>};matrixParam3={String}?queryParam1={long}")); }</code><technical_language>getWorkspace(javaProject) below</technical_language>

Target:
public void shouldDisplayEndpointParametersInOrderAfterMethodParametersUpdateInWorkingCopy() throws CoreException { final IMethod modifiedMethod = remodifyJavaMethod(modifyJavaMethod(WORKING_COPY)); final JaxrsResourceMethod resourceMethod = getResourceMethod(); resourceMethod.update(modifiedMethod, JdtUtils.parse(modifiedMethod, null)); final JaxrsEndpoint endpoint = metamodel.findEndpoints(resourceMethod).iterator().next(); endpoint.update(new Flags(F_PATH_ANNOTATION + F_QUERY_PARAM_ANNOTATION + F_MATRIX_PARAM_ANNOTATION)); WorkbenchTasks.waitForTasksToComplete(getWorkspace(javaProject)); final String uriPathTemplate = endpoint.getUriPathTemplate(); assertThat( uriPathTemplate, equalTo("/hello/customers/{foo:\\d+}/{bar:[a-z]+};matrixParam1={short};matrixParam2={List<String>};matrixParam3={String}?queryParam1={long}")); }
Source:
<code>public boolean isSatisfied(CommandContext ctx) { if(satisfied == null) { satisfied = checkAccess(ctx); if(satisfied) { CliLogger.ROOT_LOGGER.accessRequirementSatisfied(toString()); } else { CliLogger.ROOT_LOGGER.accessRequirementNotSatisfied(toString()); <START> } <END> } return satisfied; }</code><technical_language>This java if (CliLogger.ROOT_LOGGER.isTraceEnabled()) { if(satisfied) { CliLogger.ROOT_LOGGER.accessRequirementSatisfied(toString()); } else { CliLogger.ROOT_LOGGER.accessRequirementNotSatisfied(toString()); } } toString() expensive</technical_language>

Target:
public boolean isSatisfied(CommandContext ctx) { if(satisfied == null) { satisfied = checkAccess(ctx); if(satisfied) { CliLogger.ROOT_LOGGER.tracef("Requirement %s is satisfied", this); } else { CliLogger.ROOT_LOGGER.tracef("Requirement %s is not satisfied", this); } } return satisfied; }
Source:
<code>private Set<QualifiedTablePrefix> calculatePrefixesWithSchemaName( ConnectorSession connectorSession, TupleDomain<ColumnHandle> constraint, Predicate<Map<ColumnHandle, NullableValue>> predicate) { Optional<Set<String>> schemas = stringFilter(constraint, SCHEMA_COLUMN_HANDLE); if (schemas.isPresent()) { return schemas.get().stream() .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); } Session session = ((FullConnectorSession) connectorSession).getSession(); return metadata.listSchemaNames(session, catalogName).stream() .filter(schema -> predicate.test(ImmutableMap.of( CATALOG_COLUMN_HANDLE, new NullableValue(createUnboundedVarcharType(), utf8Slice(catalogName)), SCHEMA_COLUMN_HANDLE, new NullableValue(createUnboundedVarcharType(), utf8Slice(schema))))) .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); <START> } <END></code><technical_language>is this needed? apply predicate? slower</technical_language>

Target:
private Set<QualifiedTablePrefix> calculatePrefixesWithSchemaName( ConnectorSession connectorSession, TupleDomain<ColumnHandle> constraint, Predicate<Map<ColumnHandle, NullableValue>> predicate) { Optional<Set<String>> schemas = filterString(constraint, SCHEMA_COLUMN_HANDLE); if (schemas.isPresent()) { return schemas.get().stream() .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); } Session session = ((FullConnectorSession) connectorSession).getSession(); return metadata.listSchemaNames(session, catalogName).stream() .filter(schema -> predicate.test(schemaAsFixedValues(schema))) .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); }
Source:
<code>public FollowerBean(Follower follower, ZooKeeperServer zks) { super(zks, "FollowerServer_port" + zks.getClientPort()); <START> this.follower = follower; <END> }</code><technical_language>super(zks, "Follower");</technical_language>

Target:
public FollowerBean(Follower follower, ZooKeeperServer zks) { super(zks, "Follower"); this.follower = follower; }
Source:
<code>protected JsonPayloadGenerator getPayloadGenerator() { if (!validate()) { return null; } <START> String j = jsonTextArea.getText(); <END> int i = numberOfPayloadsSpinner.getValue(); return new JsonPayloadGenerator(j, i); }</code><technical_language>This inlined (e.g. new JsonPayloadGenerator(jsonTextArea.getText(), numberOfPayloadsSpinner.getValue()))</technical_language>

Target:
protected JsonPayloadGenerator getPayloadGenerator() { if (!validate()) { return null; } return new JsonPayloadGenerator(jsonTextArea.getText(), numberOfPayloadsSpinner.getValue()); }
Source:
<code>public CompositeFileListFilter(Collection<? extends FileListFilter<F>> fileFilters) { this.fileFilters = new LinkedHashSet<>(fileFilters); <START> fileFilters.stream().allMatch(f -> f.supportsSingleFileFiltering()); <END> }</code><technical_language>missing this.allSupportAccept &= here? is point of allMatch() if result</technical_language>

Target:
public CompositeFileListFilter(Collection<? extends FileListFilter<F>> fileFilters) { this.fileFilters = new LinkedHashSet<>(fileFilters); this.allSupportAccept = fileFilters.stream().allMatch(FileListFilter<F>::supportsSingleFileFiltering); }
Source:
<code>void processContainersNow() { <START> containerManager.getContainerIDs() <END> .parallelStream().forEach(this::processContainer); }</code><technical_language>Sure, fix this. If interrupt thread need consider scenario, if ReplicationMonitor thread is processing containers call processContainersNow , interrupt ignored. check if Thread interrupted sleep call, easily handled</technical_language>

Target:
synchronized void processContainersNow() { notify(); }
Source:
<code>private void assertDiskDescriptionMap(Disk disk) throws IOException { assertEquals("Should be map of disk alias and disk description", String.format("{\"DiskAlias\":\"%s\"," + <START> "\"DiskDescription\":\"%s\"}", <END> disk.getDiskAlias(), StringUtils.defaultString(disk.getDiskDescription())), MetadataDiskDescriptionHandler.getJsonDiskDescription(disk)); }</code><technical_language>try static fields MetadataDiskDescriptionHandler, this way, more related real scenario testing</technical_language>

Target:
private static void assertDiskDescriptionMap(Disk disk) throws IOException { assertEquals("Should be map of disk alias and disk description", String.format("{\"DiskAlias\":\"%s\"," + "\"DiskDescription\":\"%s\"}", disk.getDiskAlias(), StringUtils.defaultString(disk.getDiskDescription())), MetadataDiskDescriptionHandler.getJsonDiskDescription(disk)); }
Source:
<code>public void listenTag(ReplaceableTagEvent event) { if (!event.matches("LISTENER")) return; if (!event.getType().equalsIgnoreCase(id)) return; if (event.getValue().equalsIgnoreCase("region")) { event.setReplaced(region); } else if (event.getValue().equalsIgnoreCase("required")) { event.setReplaced(String.valueOf(required)); } else if (event.getValue().equalsIgnoreCase("currentkills")) { event.setReplaced(String.valueOf(kills_so_far)); } else if (event.getValue().equalsIgnoreCase("targets")) { String targetList = ""; for (String curTar : targets){ targetList = targetList + curTar + ", "; targetList = targetList.substring(0, targetList.length() - 1); } event.setReplaced(targetList); } else if (event.getValue().equalsIgnoreCase("mobnames")){ String namesList = ""; for (String curNam : names){ namesList = namesList + curNam + ", "; namesList = namesList.substring(0, namesList.length() - 1); <START> } <END> } }</code><technical_language>This call event.setReplaced(...)</technical_language>

Target:
public void listenTag(ReplaceableTagEvent event) { if (!event.matches("LISTENER")) return; if (!event.getType().equalsIgnoreCase(id)) return; if (event.getValue().equalsIgnoreCase("region")) { event.setReplaced(region); } else if (event.getValue().equalsIgnoreCase("required")) { event.setReplaced(String.valueOf(required)); } else if (event.getValue().equalsIgnoreCase("currentkills")) { event.setReplaced(String.valueOf(kills_so_far)); } else if (event.getValue().equalsIgnoreCase("targets")) { String targetList = ""; for (String curTar : targets){ targetList = targetList + curTar + ", "; targetList = targetList.substring(0, targetList.length() - 1); } event.setReplaced(targetList); } else if (event.getValue().equalsIgnoreCase("mobnames")){ String namesList = ""; for (String curNam : names){ namesList = namesList + curNam + ", "; namesList = namesList.substring(0, namesList.length() - 1); } event.setReplaced(namesList); } }
Source:
<code>DefaultMetricsMaster(CoreMasterContext masterContext, Clock clock, ExecutorServiceFactory executorServiceFactory) { super(masterContext, clock, executorServiceFactory); mMetricsStore = new MetricsStore(); registerAggregators(); mClusterMetricsUpdater = new HeartbeatThread(HeartbeatContext.MASTER_CLUSTER_METRICS_UPDATER, new ClusterMetricsUpdater(), ServerConfiguration.getMs(PropertyKey.MASTER_CLUSTER_METRICS_UPDATE_INTERVAL), ServerConfiguration.global(), mMasterContext.getUserState()); int numThreads = ServerConfiguration.getInt(PropertyKey.MASTER_METRICS_SERVICE_THREADS); mExecutorService = ExecutorServiceFactories.fixedThreadPool( <START> "alluxio-master-metrics-service", numThreads).create(); <END> }</code><technical_language>alluxio-master-metrics-updater ? I "service" is a bit general</technical_language>

Target:
DefaultMetricsMaster(CoreMasterContext masterContext, Clock clock, ExecutorServiceFactory executorServiceFactory) { super(masterContext, clock, executorServiceFactory); mMetricsStore = new MetricsStore(); registerAggregators(); mClusterMetricsUpdater = new HeartbeatThread(HeartbeatContext.MASTER_CLUSTER_METRICS_UPDATER, new ClusterMetricsUpdater(), ServerConfiguration.getMs(PropertyKey.MASTER_CLUSTER_METRICS_UPDATE_INTERVAL), ServerConfiguration.global(), mMasterContext.getUserState()); int numThreads = ServerConfiguration.getInt(PropertyKey.MASTER_METRICS_SERVICE_THREADS); mExecutorService = ExecutorServiceFactories.fixedThreadPool( "alluxio-master-metrics-updater", numThreads).create(); }
Source:
<code>public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, AuditEvent message) throws InternalErrorException, WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; <START> List<AttributeHandleIdenfier> list = getChecks(); <END> for (AttributeHandleIdenfier attributeHandleIdenfier : list) { if (attributeHandleIdenfier.check(message) != null) { try { User user = perunSession.getPerunBl().getUsersManagerBl().getUserById(perunSession, attributeHandleIdenfier.check(message)); Attribute attribute = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, user, getDestinationAttributeName()); if (attribute.valueAsList() == null || attribute.valueAsList().isEmpty()) { AttributeDefinition attributeDefinition = new AttributeDefinition(attribute); resolvingMessages.add(new AttributeRemovedForUser(attributeDefinition, user)); } else { resolvingMessages.add(new AttributeSetForUser(attribute, user)); } } catch (UserNotExistsException e) { log.warn("User from UserExtSource doesn't exist in Perun. This occurred while parsing message: {}.", attributeHandleIdenfier.check(message), message); } } } return resolvingMessages; }</code><technical_language>getChecks -> getHandleIdentifiers that</technical_language>

Target:
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, AuditEvent message) throws InternalErrorException, WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; List<AttributeHandleIdentifier> list = getHandleIdentifiers(); for (AttributeHandleIdentifier attributeHandleIdenfier : list) { Integer userId = attributeHandleIdenfier.shouldBeEventHandled(message); if (userId != null) { try { User user = perunSession.getPerunBl().getUsersManagerBl().getUserById(perunSession, userId); Attribute attribute = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, user, getDestinationAttributeName()); if (attribute.valueAsList() == null || attribute.valueAsList().isEmpty()) { AttributeDefinition attributeDefinition = new AttributeDefinition(attribute); resolvingMessages.add(new AttributeRemovedForUser(attributeDefinition, user)); } else { resolvingMessages.add(new AttributeSetForUser(attribute, user)); } } catch (UserNotExistsException e) { log.warn("User from UserExtSource doesn't exist in Perun. This occurred while parsing message: {}.", message); } } } return resolvingMessages; }
Source:
<code>private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, IAction.AS_RADIO_BUTTON) { @Override public void run() { if (fIsFlatViewClicked) { ITmfTrace parentTrace = getTrace(); <START> for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { <END> final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); List<ControlFlowEntry> currentRootList = (List<ControlFlowEntry>)(Object)getEntryList(ss); addEntriesToHierarchicalTree(currentRootList, parentTrace, ss); } fIsFlatViewClicked = false; refresh(); } } }; action.setChecked(true); action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(IControlflowImageConstants.IMG_UI_HIERARCHICAL_VIEW)); return action; }</code><technical_language>works for me, opened trace is experiment of traces? test this double-click experiment Experiments folder. 'Trace' column in Control Flow view tree show trace entry belongs</technical_language>

Target:
private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, IAction.AS_PUSH_BUTTON) { @Override public void run() { ITmfTrace parentTrace = getTrace(); for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); List<ControlFlowEntry> currentRootList = (List<ControlFlowEntry>)(Object)getEntryList(ss); addEntriesToHierarchicalTree(currentRootList, parentTrace, ss); refresh(); } } }; action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(IControlflowImageConstants.IMG_UI_HIERARCHICAL_VIEW)); return action; }
Source:
<code>public <U> UpdateHandlerRegistration<U> registerUpdateHandler( SubscriptionQueryMessage<?, ?, ?> query, int updateBufferSize) { Sinks.Many<SubscriptionQueryUpdateMessage<U>> sink = Sinks.many().replay().limit(updateBufferSize); Runnable removeHandler = () -> updateHandlers.remove(query); Flux<SubscriptionQueryUpdateMessage<U>> updateMessageFlux = sink.asFlux() <START> .doOnCancel(removeHandler) <END> .doOnTerminate(removeHandler); FluxSinkWrapper<SubscriptionQueryUpdateMessage<U>> fluxSinkWrapper = new FluxSinkWrapper<>(sink); updateHandlers.put(query, fluxSinkWrapper); Registration registration = () -> { fluxSinkWrapper.complete(); return true; }; return new UpdateHandlerRegistration<>(registration, updateMessageFlux); }</code><technical_language>Guessing setting axon_code_style.xml, changes reverted</technical_language>

Target:
public <U> UpdateHandlerRegistration<U> registerUpdateHandler( SubscriptionQueryMessage<?, ?, ?> query, int updateBufferSize) { Sinks.Many<SubscriptionQueryUpdateMessage<U>> sink = Sinks.many().replay().limit(updateBufferSize); Runnable removeHandler = () -> updateHandlers.remove(query); Flux<SubscriptionQueryUpdateMessage<U>> updateMessageFlux = sink.asFlux() .doOnCancel(removeHandler) .doOnTerminate(removeHandler); SinksManyWrapper<SubscriptionQueryUpdateMessage<U>> sinksManyWrapper = new SinksManyWrapper<>(sink); updateHandlers.put(query, sinksManyWrapper); Registration registration = () -> { sinksManyWrapper.complete(); return true; }; return new UpdateHandlerRegistration<>(registration, updateMessageFlux); }
Source:
<code>@Test public void hasValue_FailingWithAbsent() { try { ASSERT.that(Optional.absent()).hasValue("foo"); fail("Should have thrown"); } catch (AssertionError expected) { ASSERT.that(expected.getMessage()) <START> .isEqualTo("<Optional.absent()> cannot have the value <foo>"); <END> } }</code><technical_language>"cannot" is confusing me. this worded more consistently other truth messages? "Not true <Optional.absent()> present <foo>"? (Or that)</technical_language>

Target:
@Test public void hasValue_FailingWithAbsent() { try { ASSERT.that(Optional.absent()).hasValue("foo"); fail("Should have thrown"); } catch (AssertionError expected) { ASSERT.that(expected.getMessage()) .isEqualTo("Not true that <Optional.absent()> has value <foo>"); } }
Source:
<code>public boolean validate(IDocument document, int offset, DocumentEvent event) { if (!isOffsetValid(offset)) return fIsValidated= false; <START> CompletionProposal coreProposal= ((MemberProposalInfo) getProposalInfo()).fProposal; <END> if (coreProposal.isSuffixProposal()) fIsValidated= isValidPrefix(getPrefix(document, offset)); if (fIsValidated && event != null) { int delta= (event.fText == null ? 0 : event.fText.length()) - event.fLength; final int newLength= Math.max(getReplacementLength() + delta, 0); setReplacementLength(newLength); } return fIsValidated; }</code><technical_language>This result in ClassCastException in cases. For example, try complete package name segment 'java' pressing Ctrl+space Enter key. I NullPointerException complete keyword 'public'</technical_language>

Target:
public boolean validate(IDocument document, int offset, DocumentEvent event) { if (!isOffsetValid(offset)) return fIsValidated= false; if (isSupportingRequiredProposals()) { CompletionProposal coreProposal= ((MemberProposalInfo) getProposalInfo()).fProposal; if (coreProposal.isSuffixProposal()) fIsValidated= isValidPrefix(getPrefix(document, offset)); } else fIsValidated= isValidPrefix(getPrefix(document, offset)); if (fIsValidated && event != null) { int delta= (event.fText == null ? 0 : event.fText.length()) - event.fLength; final int newLength= Math.max(getReplacementLength() + delta, 0); setReplacementLength(newLength); } return fIsValidated; }
Source:
<code>static String spliceOrAppendString(final String destination, final String toInsert, final int insertIdx) { if (destination.equals(Allele.SPAN_DEL_STRING)) { return destination; } if (insertIdx <= destination.length()) { return destination.substring(0, insertIdx) + toInsert + destination.substring(insertIdx); <START> } else { <END> return destination + toInsert; } }</code><technical_language>else required (last statement)</technical_language>

Target:
static String spliceOrAppendString(final String destination, final String toInsert, final int insertIdx) { if (destination.equals(Allele.SPAN_DEL_STRING)) { return destination; } if (insertIdx <= destination.length()) { return destination.substring(0, insertIdx) + toInsert + destination.substring(insertIdx); } return destination + toInsert; }
Source:
<code>public void gitHubURLPageElementTest() { assertEquals("123", GithubURLPageElements.extractIssueNumber("fixes #123").get()); assertEquals("123", GithubURLPageElements.extractIssueNumber("Closed #123. This is dummy").get()); assertEquals("123", GithubURLPageElements.extractIssueNumber("refer to #144. Closed #123. This is du").get()); <START> assertNotEquals("131", GithubURLPageElements.extractIssueNumber("fixes #123").get()); <END> }</code><technical_language>purpose of this line</technical_language>

Target:
public void gitHubURLPageElementTest() { assertEquals(123, (int) GithubURLPageElements.extractIssueNumber("fixes #123").get()); assertEquals(123, (int) GithubURLPageElements.extractIssueNumber("Closed #123. This is dummy").get()); assertEquals(123, (int) GithubURLPageElements.extractIssueNumber("refer to #144. Closed #123. This i").get()); }
Source:
<code>private Mono<PollResponse<BlobCopyInfo>> onPoll(PollResponse<BlobCopyInfo> pollResponse) { if (pollResponse.getStatus() == OperationStatus.SUCCESSFULLY_COMPLETED || pollResponse.getStatus() == OperationStatus.FAILED) { return Mono.just(pollResponse); } final BlobCopyInfo lastInfo = pollResponse.getValue(); if (lastInfo == null) { logger.warning("BlobCopyInfo does not exist. Activation operation failed."); return Mono.just(new PollResponse<>( OperationStatus.fromString("COPY_START_FAILED", true), null)); } return getProperties().map(response -> { final CopyStatusType status = response.getCopyStatus(); final BlobCopyInfo result = new BlobCopyInfo(response.getCopySource(), response.getCopyId(), status, response.getETag(), response.getCopyCompletionTime(), response.getCopyStatusDescription()); OperationStatus operationStatus; switch (status) { case SUCCESS: operationStatus = OperationStatus.SUCCESSFULLY_COMPLETED; break; case FAILED: operationStatus = OperationStatus.NOT_STARTED; break; case ABORTED: operationStatus = OperationStatus.USER_CANCELLED; break; case PENDING: operationStatus = OperationStatus.IN_PROGRESS; break; default: throw Exceptions.propagate(logger.logExceptionAsError(new IllegalArgumentException( "CopyStatusType is not supported. Status: " + status))); } <START> return new PollResponse<>(operationStatus, result); <END> }).onErrorReturn( new PollResponse<>(OperationStatus.fromString("POLLING_FAILED", true), lastInfo)); }</code><technical_language>FAILED correspond NOT_STARTED</technical_language>

Target:
private Mono<PollResponse<BlobCopyInfo>> onPoll(PollResponse<BlobCopyInfo> pollResponse) { if (pollResponse.getStatus() == OperationStatus.SUCCESSFULLY_COMPLETED || pollResponse.getStatus() == OperationStatus.FAILED) { return Mono.just(pollResponse); } final BlobCopyInfo lastInfo = pollResponse.getValue(); if (lastInfo == null) { logger.warning("BlobCopyInfo does not exist. Activation operation failed."); return Mono.just(new PollResponse<>( OperationStatus.fromString("COPY_START_FAILED", true), null)); } return getProperties().map(response -> { final CopyStatusType status = response.getCopyStatus(); final BlobCopyInfo result = new BlobCopyInfo(response.getCopySource(), response.getCopyId(), status, response.getETag(), response.getCopyCompletionTime(), response.getCopyStatusDescription()); OperationStatus operationStatus; switch (status) { case SUCCESS: operationStatus = OperationStatus.SUCCESSFULLY_COMPLETED; break; case FAILED: operationStatus = OperationStatus.FAILED; break; case ABORTED: operationStatus = OperationStatus.USER_CANCELLED; break; case PENDING: operationStatus = OperationStatus.IN_PROGRESS; break; default: throw logger.logExceptionAsError(new IllegalArgumentException( "CopyStatusType is not supported. Status: " + status)); } return new PollResponse<>(operationStatus, result); }).onErrorReturn( new PollResponse<>(OperationStatus.fromString("POLLING_FAILED", true), lastInfo)); }
Source:
<code>public void populate(List<CategoryDTO> categories) { Platform.runLater(() -> { Set<String> themedCategories = Sets.newHashSet( <START> "custom", <END> "development", "games", "graphics", "internet", "multimedia", "office", "other", "science" ); final List<LeftButton> leftButtonList = new ArrayList<>(); for (CategoryDTO category : categories) { if(category.getType() == CategoryDTO.CategoryType.INSTALLERS) { final LeftButton categoryButton = new LeftButton(category.getName()); if (themedCategories.contains(category.getName().toLowerCase())) { final String themeName = new String(category.getName().toLowerCase() + "Button"); categoryButton.getStyleClass().add(themeName); } else { categoryButton.setStyle("-fx-background-image: url('file:/ } categoryButton.setOnMouseClicked(event -> selectCategory(category)); leftButtonList.add(categoryButton); } } categoryView.setNodes(leftButtonList); showAvailableApps(); }); }</code><technical_language>generalizing it</technical_language>

Target:
public void populate(List<CategoryDTO> categories) { Platform.runLater(() -> { final List<LeftButton> leftButtonList = new ArrayList<>(); for (CategoryDTO category : categories) { if(category.getType() == CategoryDTO.CategoryType.INSTALLERS) { final LeftButton categoryButton = new LeftButton(category.getName()); final String themeName = new String(category.getName().toLowerCase() + "Button"); categoryButton.setStyle("-fx-background-image: url('" + category.getIcon() + "');"); categoryButton.getStyleClass().add(themeName); categoryButton.setOnMouseClicked(event -> selectCategory(category)); leftButtonList.add(categoryButton); } } categoryView.setNodes(leftButtonList); showAvailableApps(); }); }
Source:
<code>public long[] getLargeUpdateCount() { long[] copyCount = uncompressLongUpdateCount(); <START> return Arrays.copyOf(copyCount, copyCount.length); <END> }</code><technical_language>Is copy required here</technical_language>

Target:
public long[] getLargeUpdateCount() { return uncompressLongUpdateCount(); }
Source:
<code>public void setRemoteCharset(Charset remoteCharset) { <START> this.remoteCharset = remoteCharset; <END> }</code><technical_language>Ensure set null</technical_language>

Target:
public void setRemoteCharset(Charset remoteCharset) { this.remoteCharset = remoteCharset != null ? remoteCharset : IOUtils.UTF8; }
Source:
<code>public String toString() { if ( isClosed() ) { return "NodeValueIndexCursor[closed state]"; } else { <START> return "NodeValueIndexCursor[node=" + node + ", open state with: keys=" + Arrays.toString( query ) + <END> ", values=" + Arrays.toString( values ) + ", underlying record=" + super.toString() + " ]"; } }</code><technical_language>Printing query keys like: ... keys=[IndexQuery.ExistsPredicate[propertyKeyId=0]]. I is worth extracting actual keys queries print those</technical_language>

Target:
public String toString() { if ( isClosed() ) { return "NodeValueIndexCursor[closed state]"; } else { return "NodeValueIndexCursor[node=" + node + ", open state with: keys=" + Arrays.toString( stream( query ).map( IndexQuery::propertyKeyId ).toArray( Integer[]::new ) ) + ", values=" + Arrays.toString( values ) + ", underlying record=" + super.toString() + " ]"; } }
Source:
<code>public Field setHidden(Boolean hidden) { <START> retrievable = this.hidden == null ? null : !this.hidden; <END> this.hidden = hidden; return this; }</code><technical_language>This easier understand if do: java if (this.hidden != null) { this.retrievable = !this.hidden; } retrievable logic done setting member variable? before</technical_language>

Target:
public Field setHidden(Boolean hidden) { this.hidden = hidden; retrievable = this.hidden == null ? null : !this.hidden; return this; }
Source:
<code>public String _getBindingItemsPolicy() { String value = config.getString("binding-items-policy", "keep").toLowerCase(Locale.ENGLISH); if (!value.equals("delete") && !value.equals("drop") && !value.equals("keep")) { <START> value = "delete"; <END> } return value; }</code><technical_language>=</technical_language>

Target:
public KeepInvPolicy _getBindingItemsPolicy() { String value = config.getString("binding-items-policy", "keep").toLowerCase(Locale.ENGLISH); try { return KeepInvPolicy.valueOf(value.toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException e) { return KeepInvPolicy.KEEP; } }
Source:
<code>public void onResult(String text) { result = text; AfterGettingText(result, false); <START> onDelete(); <END> }</code><technical_language>Is necessary do this here? semantics of onDelete supposed called component is removed screen in companion app</technical_language>

Target:
public void onResult(String text) { result = text; AfterGettingText(result, false); }
Source:
<code>public WorkunitInfo createWUFromECL(WorkunitInfo wu) throws Exception { WorkunitInfo createdWU = null; if (wsWorkunitsServiceSoapProxy == null) throw new Exception("wsWorkunitsServiceSoapProxy not available"); else { WUCreateAndUpdateWrapper wucreateparameters = new WUCreateAndUpdateWrapper(); wucreateparameters.setAction(1); wucreateparameters.setQueryText(wu.getECL()); wucreateparameters.setApplicationValues(wu.getRawApplicationValues()); wucreateparameters.setDebugValues(wu.getDebugValues()); wucreateparameters.setJobname(wu.getJobname()); wucreateparameters.setClusterOrig(wu.getCluster()); wucreateparameters.setResultLimit(wu.getResultLimit()); wucreateparameters.setWuid(wu.getWuid()); WUUpdateResponseWrapper wuUpdateResponse = null; <START> if (targetVersion.major==6) { <END> wuUpdateResponse=new WUUpdateResponseWrapper(this.version6WorkunitsServiceSoapProxy.WUCreateAndUpdate(wucreateparameters.getRawVersion6())); } else if (targetVersion.major==7) { wuUpdateResponse=new WUUpdateResponseWrapper(this.wsWorkunitsServiceSoapProxy.WUCreateAndUpdate(wucreateparameters.getRaw())); } else { throw new NotImplementedException("Can only handle cluster versions 6 and 7, not version " + String.valueOf(targetVersion.major)); } createdWU = wuUpdateResponse.getWorkunit(); if (wuUpdateResponse.getExceptions().size()==0) { createdWU.setMaxMonitorMillis(wu.getMaxMonitorMillis()); createdWU.setCluster(wu.getCluster()); createdWU.setJobname(wu.getJobname()); createdWU.setSleepMillis(wu.getSleepMillis()); createdWU.setOriginalEclWatchUrl(getEclWatchUrl()); } else { throwWsWUExceptions(createdWU.getRawArrayOfEspExceptions(), "Error compiling ECL query"); } } return createdWU; }</code><technical_language>hide this type of logic in soapproxywrapper</technical_language>

Target:
public WorkunitInfo createWUFromECL(WorkunitInfo wu) throws Exception { WorkunitInfo createdWU = null; getSoapProxy(); WUCreateAndUpdateWrapper wucreateparameters = new WUCreateAndUpdateWrapper(); wucreateparameters.setAction(WUActionCode.WUActionCompile.ordinal()); wucreateparameters.setQueryText(wu.getECL()); wucreateparameters.setApplicationValues(wu.getRawApplicationValues()); wucreateparameters.setDebugValues(wu.getDebugValues()); wucreateparameters.setJobname(wu.getJobname()); wucreateparameters.setClusterOrig(wu.getCluster()); wucreateparameters.setResultLimit(wu.getResultLimit()); wucreateparameters.setWuid(wu.getWuid()); WUUpdateResponseWrapper wuUpdateResponse = soapWrapper.WUCreateAndUpdate(wucreateparameters); createdWU = wuUpdateResponse.getWorkunit(); if (wuUpdateResponse.getExceptions().size()==0) { createdWU.setMaxMonitorMillis(wu.getMaxMonitorMillis()); createdWU.setCluster(wu.getCluster()); createdWU.setJobname(wu.getJobname()); createdWU.setSleepMillis(wu.getSleepMillis()); createdWU.setOriginalEclWatchUrl(getEclWatchUrl()); } else { throwWsWUExceptions(createdWU.getRawArrayOfEspExceptions(), "Error compiling ECL query"); } return createdWU; }
Source:
<code>public boolean performNextOperationColdMerge(int completedChildren) { if (completedChildren == getParameters().getImageIds().size()) { return false; <START> } <END> if (completedChildren == 0) { ImagesHandler.updateAllDiskImageSnapshotsStatus(getImageGroupId(), ImageStatus.LOCKED); } Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskParameters(nextImageId); CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDisk, parameters, cloneContextAndDetachFromParent()); return true; }</code><technical_language>please mutual behavior (locks/check if execution ended) in performNextOperation()</technical_language>

Target:
private boolean performNextOperationColdMerge(int completedChildren) { Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskParameters(nextImageId); CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDisk, parameters, cloneContextAndDetachFromParent()); return true; }
Source:
<code><START> public void testChangePassword() throws InterruptedException { <END> List<SharedStorageAccess> response = sharedStorageApi().changePassword(SharedStorageAccess.UpdateSharedStorageAccess.create("Test123!")); assertNotNull(response); }</code><technical_language>Remove InterruptedException signature</technical_language>

Target:
public void testChangePassword() { List<SharedStorageAccess> response = sharedStorageApi().changePassword(SharedStorageAccess.UpdateSharedStorageAccess.create("Test123!")); assertNotNull(response); }
Source:
<code>public FeedbackSessionResponseStatus() { noResponse = new ArrayList<String>(); <START> studentsWhoRespond = new ArrayList<String>(); <END> emailNameTable = new HashMap<String, String>(); emailSectionTable = new HashMap<String, String>(); emailTeamNameTable = new HashMap<String, String>(); }</code><technical_language>studentsWhoRespond -> studentsWhoResponded</technical_language>

Target:
public FeedbackSessionResponseStatus() { noResponse = new ArrayList<String>(); studentsWhoResponded = new ArrayList<String>(); emailNameTable = new HashMap<String, String>(); emailSectionTable = new HashMap<String, String>(); emailTeamNameTable = new HashMap<String, String>(); }
Source:
<code>public void updateDependentPhenotypesAsOutOfSync(final Integer variableId, final Set<Integer> observationUnitIds) { final List<Formula> formulaList = this.daoFactory.getFormulaDAO().getByInputId(variableId); <START> if (!formulaList.isEmpty() && !observationUnitIds.isEmpty()) { <END> final List<Integer> targetVariableIds = Lists.transform(formulaList, new Function<Formula, Integer>() { @Override public Integer apply(final Formula formula) { return formula.getTargetCVTerm().getCvTermId(); } }); this.daoFactory.getPhenotypeDAO() .updateOutOfSyncPhenotypes(observationUnitIds, Sets.newHashSet(targetVariableIds)); } }</code><technical_language>CollectionUtils.isEmpty for checking formulaList observationunitIds parameter</technical_language>

Target:
public void updateDependentPhenotypesAsOutOfSync(final Integer variableId, final Set<Integer> observationUnitIds) { final List<Formula> formulaList = this.daoFactory.getFormulaDAO().getByInputId(variableId); if (!org.springframework.util.CollectionUtils.isEmpty(formulaList) && !org.springframework.util.CollectionUtils .isEmpty(observationUnitIds)) { final List<Integer> targetVariableIds = Lists.transform(formulaList, new Function<Formula, Integer>() { @Override public Integer apply(final Formula formula) { return formula.getTargetCVTerm().getCvTermId(); } }); this.daoFactory.getPhenotypeDAO() .updateOutOfSyncPhenotypes(observationUnitIds, Sets.newHashSet(targetVariableIds)); } }
Source:
<code>private int calculateLifeTime(int power) { ThreadLocalRandom random = ThreadLocalRandom.current(); <START> return ((power + 1) * 10 + random.nextInt(0, 6) + random.nextInt(0, 7)); <END> }</code><technical_language>nextInt(0, n) nextInt(n)</technical_language>

Target:
private int calculateLifeTime(int power) { ThreadLocalRandom random = ThreadLocalRandom.current(); return ((power + 1) * 10 + random.nextInt(6) + random.nextInt(7)); }
Source:
<code>protected DistributedTxManagerProvider() { Properties properties = new Properties(); properties.setProperty(JMSTestConstants.ATOMIKOS_BASE_DIRECTORY_PROP, JMSTestConstants.TEST_LOG_DIR); try { UserTransactionServiceImp service = new UserTransactionServiceImp(properties); service.init(); UserTransactionManager utm = new UserTransactionManager(); <START> utm.setStartupTransactionService(false); <END> utm.init(); this.transactionManager = utm; } catch (SystemException e) { logger.error("Error when creating the XA provider ", e); } }</code><technical_language>instead of utm. give a proper name? readable names enigmatic names</technical_language>

Target:
protected DistributedTxManagerProvider() { Properties properties = new Properties(); properties.setProperty(JMSTestConstants.ATOMIKOS_BASE_DIRECTORY_PROP, JMSTestConstants.TEST_LOG_DIR); try { UserTransactionServiceImp service = new UserTransactionServiceImp(properties); service.init(); UserTransactionManager atomikosTransactionManager = new UserTransactionManager(); atomikosTransactionManager.setStartupTransactionService(false); atomikosTransactionManager.init(); this.transactionManager = atomikosTransactionManager; } catch (SystemException e) { logger.error("Error when creating the XA provider ", e); } }