auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String decodeAlarm(int value) { switch (value) { case 0: return Position.ALARM_OIL_CUT; case 1: return Position.ALARM_ACCIDENT; case 2: return Position.ALARM_SOS; case 3: return Position.ALARM_VIBRATION; case 4: return Position.ALARM_LOW_SPEED; case 5: return Position.ALARM_OVERSPEED; case 6: return Position.ALARM_GEOFENCE_EXIT; default: return null; } }

Target:
private String decodeAlarm(int value) { switch (value) { case 1: return Position.ALARM_ACCIDENT; case 2: return Position.ALARM_SOS; case 3: return Position.ALARM_VIBRATION; case 4: return Position.ALARM_LOW_SPEED; case 5: return Position.ALARM_OVERSPEED; case 6: return Position.ALARM_GEOFENCE_EXIT; default: return null; } }
Source:
void pushSubmissionAndAttachments(Path submissionFile, List<Path> attachments, RunnerStatus runnerStatus, PushToAggregateTracker tracker, int submissionNumber, int totalSubmissions, int part, int parts) { if (runnerStatus.isCancelled()) { tracker.trackCancellation("Sending submissions " + submissionNumber + " of " + totalSubmissions); return; } tracker.trackStartSendingSubmissionAndAttachments(submissionNumber, totalSubmissions, part, parts); Response<XmlElement> response = http.execute(server.getPushSubmissionRequest( submissionFile, attachments )); for (InputStream stream : server.getFileStreams()) { closeInputStream(stream); } server.getFileStreams().clear(); if (response.isSuccess()) tracker.trackEndSendingSubmissionAndAttachments(submissionNumber, totalSubmissions, part, parts); else tracker.trackErrorSendingSubmissionAndAttachments(submissionNumber, totalSubmissions, part, parts, response); }

Target:
void pushSubmissionAndAttachments(Path submissionFile, List<Path> attachments, RunnerStatus runnerStatus, PushToAggregateTracker tracker, int submissionNumber, int totalSubmissions, int part, int parts) { if (runnerStatus.isCancelled()) { tracker.trackCancellation("Sending submissions " + submissionNumber + " of " + totalSubmissions); return; } tracker.trackStartSendingSubmissionAndAttachments(submissionNumber, totalSubmissions, part, parts); Response<XmlElement> response = http.execute(server.getPushSubmissionRequest( submissionFile, attachments )); if (response.isSuccess()) tracker.trackEndSendingSubmissionAndAttachments(submissionNumber, totalSubmissions, part, parts); else tracker.trackErrorSendingSubmissionAndAttachments(submissionNumber, totalSubmissions, part, parts, response); }
Source:
private void releaseClassLoader() { Set<Map.Entry<String, Runnable>> hooks = releaseHooks.entrySet(); if (!hooks.isEmpty()) { LOG.debug("Running class loader shutdown hook(s): {}.", hooks.size(), releaseHooks.keySet()); for (Map.Entry<String, Runnable> hookEntry : hooks) { try { hookEntry.getValue().run(); } catch (Throwable t) { LOG.debug("Failed to run release hook '{}' for user code class loader.", hookEntry.getValue(), t); } } releaseHooks.clear(); } try { classLoader.close(); } catch (IOException e) { LOG.warn("Failed to release user code class loader for " + Arrays.toString(libraries.toArray())); } }

Target:
private void releaseClassLoader() { runReleaseHooks(); try { classLoader.close(); } catch (IOException e) { LOG.warn("Failed to release user code class loader for " + Arrays.toString(libraries.toArray())); } }
Source:
private void remove(final IResource path) throws CoreException { final IProject proj = path.getProject(); if (proj == null) { return; } final GitProjectData pd = GitProjectData.get(proj); if (pd == null) { return; } final RepositoryMapping rm = pd.getRepositoryMapping(path); if (rm == null) { return; } final Repository db = rm.getRepository(); DirCacheEditor e = edits.get(db); if (e == null) { try { e = db.lockDirCache().editor(); } catch (IOException err) { throw new CoreException(Activator.error(CoreText.UntrackOperation_failed, err)); } edits.put(db, e); } if (path instanceof IContainer) { e.add(new DirCacheEditor.DeleteTree(rm.getRepoRelativePath(path))); } else { e.add(new DirCacheEditor.DeletePath(rm.getRepoRelativePath(path))); } }

Target:
private void remove(final IResource path) throws CoreException { final IProject proj = path.getProject(); if (proj == null) { return; } final GitProjectData pd = GitProjectData.get(proj); if (pd == null) return; final RepositoryMapping rm = pd.getRepositoryMapping(path); if (rm == null) return; final Repository db = rm.getRepository(); DirCacheEditor e = edits.get(db); if (e == null) { try { e = db.lockDirCache().editor(); } catch (IOException err) { throw new CoreException(Activator.error(CoreText.UntrackOperation_failed, err)); } edits.put(db, e); mappings.put(rm, rm); } if (path instanceof IContainer) e.add(new DirCacheEditor.DeleteTree(rm.getRepoRelativePath(path))); else e.add(new DirCacheEditor.DeletePath(rm.getRepoRelativePath(path))); }
Source:
private char getChar() { int rndNum = baseProducer.randomBetween(0, 35); if (rndNum < 10) return (char)(49 + rndNum); else return (char)(65 + rndNum - 10); }

Target:
private char getChar() { int rndNum = baseProducer.randomBetween(0, 35); if (rndNum < 10) { return (char) (49 + rndNum); } else { return (char) (65 + rndNum - 10); } }
Source:
public void channelRegistered(ChannelHandlerContext ctx) throws Exception { super.channelRegistered(ctx); LOG.info("channelRegistered {}", ctx); }

Target:
public void channelRegistered(ChannelHandlerContext ctx) throws Exception { super.channelRegistered(ctx); LOG.debug("channelRegistered {}", ctx); }
Source:
public void testSingleServer() { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.clientIntelligence(ClientIntelligence.BASIC); RemoteCache<String, String> cache = SERVER_TEST.hotrod().withClientConfiguration(builder).withCacheMode(CacheMode.DIST_SYNC).create(); cache.put("k1", "v1"); assertEquals(1, cache.size()); assertEquals("v1", cache.get("k1")); }

Target:
public void testSingleServer() { RemoteCache<String, String> cache = SERVER_TEST .hotrod() .withCacheMode(CacheMode.DIST_SYNC).create(); cache.put("k1", "v1"); assertEquals(1, cache.size()); assertEquals("v1", cache.get("k1")); }
Source:
public void handleMediaPacket(@NotNull OctoPacketInfo packetInfo) { if (!running.get()) { ByteBufferPool.returnBuffer(packetInfo.getPacket().getBuffer()); return; } stats.packetReceived(packetInfo.getPacket().length, clock.instant()); IncomingOctoEpPacketHandler handler = incomingPacketHandlers.get(packetInfo.getEndpointId()); if (handler != null) { handler.handleIncomingPacket(packetInfo); } else { stats.incomingPacketDropped(); } }

Target:
public void handleMediaPacket(@NotNull OctoPacketInfo packetInfo) { if (!running.get()) { ByteBufferPool.returnBuffer(packetInfo.getPacket().getBuffer()); return; } stats.packetReceived(packetInfo.getPacket().length, clock.instant()); IncomingOctoEpPacketHandler handler = incomingPacketHandlers.get(packetInfo.getEndpointId()); if (handler != null) { handler.handleIncomingPacket(packetInfo); } else { stats.incomingPacketDropped(); ByteBufferPool.returnBuffer(packetInfo.getPacket().getBuffer()); } }
Source:
public void addressCloneTest() throws Exception { Address address = new Address("172.16.16.1", 4223); AddressConstructor constructor = new AddressConstructor(Address.class); Address clonedAddress = (Address) constructor.createNew(address); assertEquals(clonedAddress.getHost(), address.getHost()); assertEquals(clonedAddress.getPort(), address.getPort()); assertEquals(clonedAddress.getInetAddress(), address.getInetAddress()); assertEquals(clonedAddress.getInetSocketAddress(), address.getInetSocketAddress()); }

Target:
public void addressCloneTest() throws Exception { Address address = new Address("172.16.16.1", 4223); AddressConstructor constructor = new AddressConstructor(Address.class); Address clonedAddress = (Address) constructor.createNew(address); assertEquals(address.getHost(), clonedAddress.getHost()); assertEquals(address.getPort(), clonedAddress.getPort()); assertEquals(address.getInetAddress(), clonedAddress.getInetAddress()); assertEquals(address.getInetSocketAddress(), clonedAddress.getInetSocketAddress()); }
Source:
private static void getPackageFragmentRootContainers(IRuntimeClasspathEntry entry, List<ISourceContainer> containers) { IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); IPath entryPath = entry.getPath(); boolean found = false; try { IJavaProject[] jps = model.getJavaProjects(); for (int i = 0; i < jps.length; i++) { IJavaProject jp = jps[i]; IProject p = jp.getProject(); if (p.isOpen()) { IPackageFragmentRoot[] allRoots = jp.getPackageFragmentRoots(); for (int j = 0; j < allRoots.length; j++) { IPackageFragmentRoot root = allRoots[j]; if (root.getPath().equals(entryPath) && isSourceAttachmentEqual(root, entry)) { PackageFragmentRootSourceContainer container = new PackageFragmentRootSourceContainer(root); if (!containers.contains(container)) { containers.add(container); found = true; break; } } } } } } catch (JavaModelException e) { LaunchingPlugin.log(e); } if (!found) { tryToAddSourceAttachment(entry, containers); } }

Target:
private static void getPackageFragmentRootContainers(IRuntimeClasspathEntry entry, List<ISourceContainer> containers) { IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); IPath entryPath = entry.getPath(); boolean found = false; try { IJavaProject[] jps = model.getJavaProjects(); for (int i = 0; i < jps.length; i++) { IJavaProject jp = jps[i]; IProject p = jp.getProject(); if (p.isOpen()) { IPackageFragmentRoot[] allRoots = jp.getPackageFragmentRoots(); for (int j = 0; j < allRoots.length; j++) { IPackageFragmentRoot root = allRoots[j]; if (root.getPath().equals(entryPath) && isSourceAttachmentEqual(root, entry)) { PackageFragmentRootSourceContainer container = new PackageFragmentRootSourceContainer(root); if (!containers.contains(container)) { containers.add(container); found = true; } } } } } } catch (JavaModelException e) { LaunchingPlugin.log(e); } if (!found) { tryToAddSourceAttachment(entry, containers); } }
Source:
private SymbolStatsEstimate normalizeSymbolStats(Symbol symbol, SymbolStatsEstimate symbolStats, PlanNodeStatsEstimate stats, TypeProvider types) { if (symbolStats.isUnknown()) { return SymbolStatsEstimate.unknown(); } double outputRowCount = stats.getOutputRowCount(); double distinctValuesCount = symbolStats.getDistinctValuesCount(); double nullsFraction = symbolStats.getNullsFraction(); double averageRowSize = symbolStats.getAverageRowSize(); double lowValue = symbolStats.getLowValue(); double highValue = symbolStats.getHighValue(); if (!isNaN(distinctValuesCount)) { Type type = requireNonNull(types.get(symbol), () -> "No stats for symbol " + symbol); double maxDistinctValuesByLowHigh = maxDistinctValuesByLowHigh(symbolStats, type); if (distinctValuesCount > maxDistinctValuesByLowHigh) { distinctValuesCount = maxDistinctValuesByLowHigh; } if (distinctValuesCount > outputRowCount) { distinctValuesCount = outputRowCount; } double nonNullValues = outputRowCount * (1 - nullsFraction); if (distinctValuesCount > nonNullValues) { double difference = distinctValuesCount - nonNullValues; distinctValuesCount -= difference / 2; nonNullValues += difference / 2; nullsFraction = 1 - nonNullValues / outputRowCount; } } if (distinctValuesCount == 0.0) { nullsFraction = 1.0; averageRowSize = 0.0; lowValue = NaN; highValue = NaN; } return SymbolStatsEstimate.builder() .setDistinctValuesCount(distinctValuesCount) .setNullsFraction(nullsFraction) .setAverageRowSize(averageRowSize) .setLowValue(lowValue) .setHighValue(highValue) .build(); }

Target:
private SymbolStatsEstimate normalizeSymbolStats(Symbol symbol, SymbolStatsEstimate symbolStats, PlanNodeStatsEstimate stats, TypeProvider types) { if (symbolStats.isUnknown()) { return SymbolStatsEstimate.unknown(); } double outputRowCount = stats.getOutputRowCount(); double distinctValuesCount = symbolStats.getDistinctValuesCount(); double nullsFraction = symbolStats.getNullsFraction(); if (!isNaN(distinctValuesCount)) { Type type = requireNonNull(types.get(symbol), () -> "No stats for symbol " + symbol); double maxDistinctValuesByLowHigh = maxDistinctValuesByLowHigh(symbolStats, type); if (distinctValuesCount > maxDistinctValuesByLowHigh) { distinctValuesCount = maxDistinctValuesByLowHigh; } if (distinctValuesCount > outputRowCount) { distinctValuesCount = outputRowCount; } double nonNullValues = outputRowCount * (1 - nullsFraction); if (distinctValuesCount > nonNullValues) { double difference = distinctValuesCount - nonNullValues; distinctValuesCount -= difference / 2; nonNullValues += difference / 2; nullsFraction = 1 - nonNullValues / outputRowCount; } } if (distinctValuesCount == 0.0) { return SymbolStatsEstimate.zero(); } return SymbolStatsEstimate.buildFrom(symbolStats) .setDistinctValuesCount(distinctValuesCount) .setNullsFraction(nullsFraction) .build(); }
Source:
private void waitForOperation(BigtableClusterAdminClient client, String operationName, int maxSeconds) { GetOperationRequest request = GetOperationRequest.newBuilder().setName(operationName).build(); for (int i = 0; i < maxSeconds; i++) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } Operation response = client.getOperation(request); System.out.println(response); if (response.getDone()) { if (response.hasField(ERROR_DESCRIPTOR)) { throw new RuntimeException("Operation not complete: " + response.getError()); } return; } } throw new IllegalStateException(String.format( "Waited %d seconds and operation was not complete", maxSeconds)); }

Target:
private void waitForOperation(BigtableClusterAdminClient client, String operationName, int maxSeconds) throws InterruptedException { GetOperationRequest request = GetOperationRequest.newBuilder().setName(operationName).build(); for (int i = 0; i < maxSeconds; i++) { Thread.sleep(1000); Operation response = client.getOperation(request); if (response.getDone()) { switch (response.getResultCase()) { case ERROR: throw new RuntimeException("Cluster could not be created: " + response.getError()); case RESPONSE: return; case RESULT_NOT_SET: throw new IllegalStateException( "System returned invalid response for Operation check: " + response); } } } throw new IllegalStateException(String.format( "Waited %d seconds and operation was not complete", maxSeconds)); }
Source:
public static boolean remove(String prfx, String prvdr) { if(prvdr == null || prvdr.isEmpty()) { prvdr = UNKNOWN_PROVIDER; } return remove(new IsolationMethod(prfx, prvdr)); }

Target:
public static boolean remove(String prfx, String prvdr) { prvdr = StringUtils.isNotBlank(prvdr)? prvdr : UNKNOWN_PROVIDER; try { return remove(getIsolationMethod(prfx, prvdr)); } catch (IsolationMethodNotRegistered isolationMethodNotRegistered) { return false; } }
Source:
private void doGcEntryLogs() throws EntryLogMetadataMapException { AtomicLong totalEntryLogSizeAcc = new AtomicLong(0L); entryLogMetaMap.forEach((entryLogId, meta) -> { try { removeIfLedgerNotExists(entryLogId, meta, true); } catch (EntryLogMetadataMapException e) { LOG.warn("Failed to remove ledger from entry-log metadata {}", entryLogId, e); } if (meta.isEmpty()) { LOG.info("Deleting entryLogId " + entryLogId + " as it has no active ledgers!"); removeEntryLog(entryLogId); gcStats.getReclaimedSpaceViaDeletes().add(meta.getTotalSize()); } totalEntryLogSizeAcc.getAndAdd(meta.getRemainingSize()); }); this.totalEntryLogSize = totalEntryLogSizeAcc.get(); this.numActiveEntryLogs = entryLogMetaMap.size(); }

Target:
private void doGcEntryLogs() throws EntryLogMetadataMapException { AtomicLong totalEntryLogSizeAcc = new AtomicLong(0L); entryLogMetaMap.forEach((entryLogId, meta) -> { try { removeIfLedgerNotExists(meta); entryLogMetaMap.put(meta.getEntryLogId(), meta); if (meta.isEmpty()) { LOG.info("Deleting entryLogId as it has no active ledgers!", entryLogId); removeEntryLog(entryLogId); gcStats.getReclaimedSpaceViaDeletes().add(meta.getTotalSize()); } } catch (EntryLogMetadataMapException e) { LOG.warn("Failed to remove ledger from entry-log metadata {}", entryLogId, e); } totalEntryLogSizeAcc.getAndAdd(meta.getRemainingSize()); }); this.totalEntryLogSize = totalEntryLogSizeAcc.get(); this.numActiveEntryLogs = entryLogMetaMap.size(); }
Source:
public static FileSnapshot save(File path) { final long read = System.currentTimeMillis(); final long modified = path.lastModified(); return new FileSnapshot(read, modified); }

Target:
public static FileSnapshot save(File path) { final long read = SystemReader.getInstance().getCurrentTime(); final long modified = path.lastModified(); return new FileSnapshot(read, modified); }
Source:
private void generateStructReaderSource(StructType type) { JavaClassName readerName = javaTypes.getXmlReaderName(type); javaBuffer.addLine("public class %1$s {", readerName.getSimpleName()); javaBuffer.addLine(); generateStructReadOne(type); generateStructReadMany(type); generateParseLink(type); javaBuffer.addLine("}"); javaBuffer.addLine(); }

Target:
private void generateStructReaderSource(StructType type) { JavaClassName readerName = javaTypes.getXmlReaderName(type); javaBuffer.addLine("public class %1$s {", readerName.getSimpleName()); javaBuffer.addLine(); generateStructReadOne(type); generateStructReadMany(type); generateReadLink(type); javaBuffer.addLine("}"); javaBuffer.addLine(); }
Source:
public BindingDetails(Set<String> freeVariables, Set<String> scalarVariables, Set<String> arrayVariables) { this.freeVariables = freeVariables; this.scalarVariables = scalarVariables; this.arrayVariables = arrayVariables; }

Target:
public BindingDetails(Set<String> freeVariables, Set<String> scalarVariables, Set<String> arrayVariables) { this.freeVariables = ImmutableSet.copyOf(freeVariables); this.scalarVariables = ImmutableSet.copyOf(scalarVariables); this.arrayVariables = ImmutableSet.copyOf(arrayVariables); }
Source:
public RepositoryFile internalGetFile( File f ) { RepositoryFile file = null; if ( f.exists() ) { String jcrPath = f.getAbsolutePath().substring( rootDir.getAbsolutePath().length() ); if ( jcrPath.length() == 0 ) { jcrPath = "/"; } else if ( IS_WINDOWS ) { jcrPath = jcrPath.replaceAll( "\\\\", "/" ); } file = new RepositoryFile.Builder( f.getAbsolutePath(), f.getName() ).createdDate( new Date( f.lastModified() ) ) .lastModificationDate( new Date( f.lastModified() ) ).folder( f.isDirectory() ).versioned( false ).path( jcrPath ).versionId( f.getName() ).locked( false ).lockDate( null ).lockMessage( null ).lockOwner( null ).title( f.getName() ).description( f.getName() ).locale( null ).fileSize( f.length() ).build(); } return file; }

Target:
public RepositoryFile internalGetFile( File f ) { RepositoryFile file = null; if ( f.exists() ) { String jcrPath = f.getAbsolutePath().substring( rootDir.getAbsolutePath().length() ); if ( jcrPath.length() == 0 ) { jcrPath = "/"; } else if ( IS_WINDOWS ) { jcrPath = FilenameUtils.separatorsToUnix( jcrPath ); } file = new RepositoryFile.Builder( f.getAbsolutePath(), f.getName() ).createdDate( new Date( f.lastModified() ) ) .lastModificationDate( new Date( f.lastModified() ) ).folder( f.isDirectory() ).versioned( false ).path( jcrPath ).versionId( f.getName() ).locked( false ).lockDate( null ).lockMessage( null ).lockOwner( null ).title( f.getName() ).description( f.getName() ).locale( null ).fileSize( f.length() ).build(); } return file; }
Source:
public void testCFData() { String deadBug = "The only good bug is a dead bug."; Memory bugBytes = new Memory(deadBug.length() + 1); bugBytes.clear(); bugBytes.setString(0, deadBug); CFDataRef cfBug = CF.CFDataCreate(null, bugBytes, bugBytes.size()); assertEquals(bugBytes.size(), CF.CFDataGetLength(cfBug)); Pointer bytes = CF.CFDataGetBytePtr(cfBug); assertEquals(deadBug, bytes.getString(0)); cfBug.release(); }

Target:
public void testCFData() { int size = 128; byte[] randomBytes = new byte[size]; new Random().nextBytes(randomBytes); Memory nativeBytes = new Memory(size); nativeBytes.write(0, randomBytes, 0, randomBytes.length); CFDataRef cfData = CF.CFDataCreate(null, nativeBytes, new CFIndex(size)); assertEquals(CoreFoundation.DATA_TYPE_ID, cfData.getTypeID()); int dataSize = cfData.getLength(); assertEquals(size, dataSize); Pointer bytes = cfData.getBytePtr(); byte[] dataBytes = bytes.getByteArray(0, dataSize); assertArrayEquals(randomBytes, dataBytes); cfData.release(); }
Source:
protected void provideNewSessionAttributes( AttributeSharingSessionDataStore callingDataStore, String id, Map<String, Object> sessionAttributes) { if (!sessionAttributes.equals(getLatestSessionAttributes(id))) { LOGGER.debug("Pushing new session attributes to all web contexts for session {}", id); latestSessionAttributes.put(id, sessionAttributes); dataStores.forEach( ds -> { if (ds != callingDataStore) { ds.updateSessionAttributes(id, sessionAttributes); } }); } }

Target:
protected void provideNewSessionAttributes( AttributeSharingSessionDataStore callingDataStore, String id, Map<String, Object> sessionAttributes) { if (sessionAttributes != null && !sessionAttributes.equals(getLatestSessionAttributes(id))) { LOGGER.trace("Pushing new session attributes to all web contexts for session {}", id); latestSessionAttributes.put(id, sessionAttributes); dataStores .stream() .filter(ds -> ds != callingDataStore) .forEach(ds -> ds.updateSessionAttributes(id, sessionAttributes)); } }
Source:
CommitMessageWithCaretPosition calculateCommitMessageAndCaretPosition() { StringBuilder finalMessage = new StringBuilder(); int caretPosition = CommitMessageWithCaretPosition.DEFAULT_POSITION; for (ICommitMessageProvider provider : providers) { String messagePart = ""; try { if (provider instanceof ICommitMessageProvider2) { messagePart = getCommitMessage( (ICommitMessageProvider2) provider, finalMessage.length() == 0); } else { messagePart = getCommitMessage(provider, finalMessage.length() == 0); } caretPosition = getUpdatedCaretPosition(finalMessage, caretPosition, provider); } catch (RuntimeException e) { Activator.logError(e.getMessage(), e); } finalMessage.append(messagePart); } if (isCaretPositionSet) { return new CommitMessageWithCaretPosition(finalMessage.toString(), caretPosition); } else { return new CommitMessageWithCaretPosition(finalMessage.toString(), CommitMessageWithCaretPosition.DEFAULT_POSITION); } }

Target:
CommitMessageWithCaretPosition calculateCommitMessageAndCaretPosition() { StringBuilder finalMessage = new StringBuilder(); int caretPosition = CommitMessageWithCaretPosition.DEFAULT_POSITION; for (ICommitMessageProvider provider : providers) { String messagePart = ""; try { if (provider instanceof ICommitMessageProvider2) { CommitMessageWithCaretPosition commitMessageWithPosition = ((ICommitMessageProvider2) provider) .getCommitMessageWithPosition(resourcesArray); messagePart = getCommitMessage( commitMessageWithPosition, finalMessage.length() == 0); if (commitMessageWithPosition != null) { caretPosition = getUpdatedCaretPosition(finalMessage, caretPosition, commitMessageWithPosition, (ICommitMessageProvider2) provider); } } else { messagePart = getCommitMessage(provider, finalMessage.length() == 0); } } catch (RuntimeException e) { Activator.logError(e.getMessage(), e); } finalMessage.append(messagePart); } if (isCaretPositionSet) { return new CommitMessageWithCaretPosition(finalMessage.toString(), caretPosition); } else { return new CommitMessageWithCaretPosition(finalMessage.toString(), CommitMessageWithCaretPosition.DEFAULT_POSITION); } }
Source:
public boolean hasPermission(String username, String permissionID) throws PermissionException { if (log.isDebugEnabled()) { log.debug("Check permission " + permissionID); } List<Role> roles = getRoles(username); return this.getPermissionsDAO().hasPermission(roles, permissionID); }

Target:
public boolean hasPermission(String username, String permissionID) throws PermissionException { if (log.isDebugEnabled()) { log.debug("Checking permission with ID " + permissionID + " for the username " + username); } List<Role> roles = getRoles(username); return this.getPermissionsDAO().hasPermission(roles, permissionID); }
Source:
public void setValue(PersonAttribute personAttribute, String value) { PersonAttributeType attributeType = personAttribute.getAttributeType(); if(attributeType == null) { personAttribute.setValue(value); } else { try { Class<?> clazz = Context.loadClass(personAttribute.getAttributeType().getFormat()); if (Attributable.class.isAssignableFrom(clazz)) { Attributable instance = (Attributable) ConversionUtil.convert(value, clazz); if (instance != null) { personAttribute.setValue(instance.serialize()); } else { personAttribute.setValue(value); } } else { personAttribute.setValue(value); } } catch (ClassNotFoundException cnfe) { personAttribute.setValue(value); } catch (ConversionException ce) { personAttribute.setValue(value); } } }

Target:
public void setValue(PersonAttribute personAttribute, String value) { PersonAttributeType attributeType = personAttribute.getAttributeType(); if(attributeType == null) { personAttribute.setValue(value); } else { try { String format = personAttribute.getAttributeType().getFormat(); if(format == null) { personAttribute.setValue(value); } else { Class<?> clazz = Context.loadClass(personAttribute.getAttributeType().getFormat()); if (Attributable.class.isAssignableFrom(clazz)) { Attributable instance = (Attributable) ConversionUtil.convert(value, clazz); if (instance != null) { personAttribute.setValue(instance.serialize()); } else { personAttribute.setValue(value); } } else { personAttribute.setValue(value); } } } catch (ClassNotFoundException cnfe) { personAttribute.setValue(value); } catch (ConversionException ce) { personAttribute.setValue(value); } } }
Source:
private String resolveValue(String value) { StringBuffer valueBuffer = new StringBuffer(); Matcher jobParameterMatcher = OPERATOR_PATTERN.matcher(value); while (jobParameterMatcher.find()) { Matcher jobParameterKeyMatcher = PROPERTY_KEY_SEPERATOR.matcher(jobParameterMatcher.group(1)); if (jobParameterKeyMatcher.find()) { String propertyType = jobParameterMatcher.group(2); String extractedProperty = jobParameterKeyMatcher.group(1); Properties properties = propertyMap.get(propertyType); if(properties == null) { throw new IllegalArgumentException("Unknown property type: " + propertyType); } String resolvedProperty = properties.getProperty(extractedProperty, NULL); if (LOG.isInfoEnabled()) { if(NULL.equals(resolvedProperty)) { LOG.info(propertyType + " with key of: " + extractedProperty + " could not be resolved. Possible configuration error?"); } } jobParameterMatcher.appendReplacement(valueBuffer, resolvedProperty); } } jobParameterMatcher.appendTail(valueBuffer); String resolvedValue = valueBuffer.toString(); if (NULL.equals(resolvedValue)) { return ""; } return expressionParser.parseExpression(resolvedValue); }

Target:
private String resolveValue(String value) { StringBuffer valueBuffer = new StringBuffer(); Matcher jobParameterMatcher = OPERATOR_PATTERN.matcher(value); while (jobParameterMatcher.find()) { Matcher jobParameterKeyMatcher = PROPERTY_KEY_SEPERATOR.matcher(jobParameterMatcher.group(1)); if (jobParameterKeyMatcher.find()) { String propertyType = jobParameterMatcher.group(2); String extractedProperty = jobParameterKeyMatcher.group(1); Properties properties = propertyMap.get(propertyType); if(properties == null) { throw new IllegalArgumentException("Unknown property type: " + propertyType); } String resolvedProperty = properties.getProperty(extractedProperty, NULL); if (NULL.equals(resolvedProperty)) { LOG.info(propertyType + " with key of: " + extractedProperty + " could not be resolved. Possible configuration error?"); } jobParameterMatcher.appendReplacement(valueBuffer, resolvedProperty); } } jobParameterMatcher.appendTail(valueBuffer); String resolvedValue = valueBuffer.toString(); if (NULL.equals(resolvedValue)) { return ""; } return expressionParser.parseExpression(resolvedValue); }
Source:
public String letterify(String letterString, boolean isUpper) { StringBuffer sb = new StringBuffer(); int baseChar = (isUpper) ? 65 : 97; for (int i = 0; i < letterString.length(); i++) { if (letterString.charAt(i) == '?') { sb.append((char) (baseChar + nextInt(26))); } else { sb.append(letterString.charAt(i)); } } return sb.toString(); }

Target:
public String letterify(String letterString, boolean isUpper) { return letterHelper((isUpper) ? 65 : 97, letterString); }
Source:
public @NonNull String getName() { return ""; }

Target:
public @NonNull String getName() { return "aspect name"; }
Source:
private void updateGameMode(CommandSender sender, Player who, GameMode gameMode) { String gameModeName = GameModeUtils.prettyPrint(gameMode); who.setGameMode(gameMode); who.setFallDistance(0); if (!sender.equals(who)) { sender.sendMessage(who.getDisplayName() + "'s game mode has been updated to " + ChatColor.GRAY + "" + ChatColor.ITALIC + gameModeName + " Mode" + ChatColor.RESET); } who.sendMessage("Your game mode has been updated to " + ChatColor.GRAY + "" + ChatColor.ITALIC + gameModeName + " Mode" + ChatColor.RESET); }

Target:
private void updateGameMode(CommandSender sender, Player who, GameMode gameMode) { String gameModeName = GameModeUtils.prettyPrint(gameMode); who.setGameMode(gameMode); if (!sender.equals(who)) { sender.sendMessage( who.getDisplayName() + "'s game mode has been updated to " + ChatColor.GRAY + "" + ChatColor.ITALIC + gameModeName + " Mode" + ChatColor.RESET); } who.sendMessage( "Your game mode has been updated to " + ChatColor.GRAY + "" + ChatColor.ITALIC + gameModeName + " Mode" + ChatColor.RESET); }
Source:
private Map<Nucleotide, ArrayList<BaseQuality>> getPileupBaseQualities(final SamLocusIterator.LocusInfo locus) { Map<Nucleotide, ArrayList<BaseQuality>> baseQualities = new HashMap<>(); for (Nucleotide base : BASES) { baseQualities.put(base, new ArrayList<>()); } for (final SamLocusIterator.RecordAndOffset rec : locus.getRecordAndPositions()) { Nucleotide currentBase = Nucleotide.valueOf(rec.getReadBase()); ArrayList<BaseQuality> currentBaseQualityList = baseQualities.get(currentBase); if (currentBaseQualityList == null) { currentBaseQualityList = new ArrayList<>(); baseQualities.put(currentBase, currentBaseQualityList); } currentBaseQualityList.add(new BaseQuality( errorProbabilityAdjustmentFactor * QualityUtils.qualToErrorProb(rec.getBaseQuality()), errorProbabilityAdjustmentFactor * QualityUtils.qualToErrorProb(rec.getRecord().getMappingQuality())) ); } return baseQualities; }

Target:
private Map<Nucleotide, List<BaseQuality>> getPileupBaseQualities(final SamLocusIterator.LocusInfo locus) { final Map<Nucleotide, List<BaseQuality>> baseQualities = locus.getRecordAndPositions().stream() .map(rp -> new ImmutablePair<>( Nucleotide.valueOf(rp.getReadBase()), new BaseQuality( errorProbabilityAdjustmentFactor * QualityUtils.qualToErrorProb(rp.getBaseQuality()), errorProbabilityAdjustmentFactor * QualityUtils.qualToErrorProb(rp.getRecord().getMappingQuality()) ) )).collect(Collectors.groupingBy( ImmutablePair::getLeft, Collectors.mapping(ImmutablePair::getRight, Collectors.toList())) ); for (final Nucleotide base : BASES) { if (!baseQualities.containsKey(base)) { baseQualities.put(base, new ArrayList<>()); } } return baseQualities; }
Source:
private String collateCsvResults(HttpServletRequest request, Model model, Site site, MultiValueMap<String, String> params, Integer totalRows) throws IOException { StringBuilder resultsBuilder = new StringBuilder(); Integer start = 0; for (int i = 0; i < totalRows; i += MAXIMUM_SOLR_RESULT_COUNT) { final String rows = ((Integer) Math.min(MAXIMUM_SOLR_RESULT_COUNT, totalRows - i)).toString(); params.set("resultsPerPage", rows); params.set("start", start.toString()); if (!performValidSearch(request, model, site, params, true)) { throw new IOException("Invalid solr query. Please alter and try again."); } final Map<String, ?> searchResults = (Map<String, ?>) model.asMap().get("searchResults"); resultsBuilder.append(searchResults.get("stringResponse")); } return resultsBuilder.toString(); }

Target:
private String collateCsvResults(HttpServletRequest request, Model model, Site site, MultiValueMap<String, String> params, Integer totalRows) throws IOException { StringBuilder resultsBuilder = new StringBuilder(); for (Integer start = 0; start < totalRows; start += MAXIMUM_SOLR_RESULT_COUNT) { final String rows = ((Integer) Math.min(MAXIMUM_SOLR_RESULT_COUNT, totalRows - start)).toString(); params.set("rows", rows); params.set("start", start.toString()); if (!performValidSearch(request, model, site, params, true)) { throw new IOException("Invalid solr query. Please alter and try again."); } final Map<String, ?> searchResults = (Map<String, ?>) model.asMap().get("searchResults"); resultsBuilder.append(searchResults.get("stringResponse")); } return resultsBuilder.toString(); }
Source:
public FreeMarkerConfigurer freemarkerConfig(ServletContext servletContext) { FreeMarkerConfigurer configurer = new NGrinderFreeMarkerConfigure(); configurer.setTemplateLoaderPath("classpath:/templates/ftl/"); configurer.setPreferFileSystemAccess(false); configurer.setDefaultEncoding("UTF-8"); return configurer; }

Target:
public FreeMarkerConfigurer freemarkerConfig(ServletContext servletContext) { FreeMarkerConfigurer configurer = new NGrinderFreeMarkerConfigure(); configurer.setTemplateLoaderPath("classpath:/templates/ftl/"); configurer.setPreferFileSystemAccess(false); configurer.setDefaultEncoding(defaultEncoding); return configurer; }
Source:
void park(EnhancedQueueExecutor enhancedQueueExecutor, long nanos) { long start = System.nanoTime(); int spins = SPINS; ThreadLocalRandom tl = ThreadLocalRandom.current(); while (spins > 0) { if (tl.nextInt(spins) == 0) { Thread.yield(); } if (unsafe.compareAndSwapInt(this, parkedOffset, 2, 0)) { return; } if (System.nanoTime() - start > nanos) { return; } spins--; } long remaining = nanos - (System.nanoTime() - start); if (remaining < 0) { return; } try { if (unsafe.compareAndSwapInt(this, parkedOffset, 0, 1)) { LockSupport.parkNanos(enhancedQueueExecutor, remaining); } } finally { unsafe.compareAndSwapInt(this, parkedOffset, 1, 0); } }

Target:
void park(EnhancedQueueExecutor enhancedQueueExecutor, long nanos) { long start = System.nanoTime(); int spins = SPINS; ThreadLocalRandom tl = ThreadLocalRandom.current(); while (spins > 0) { if (tl.nextInt(SPINS) == 0) { Thread.yield(); } if (unsafe.compareAndSwapInt(this, parkedOffset, STATE_UNPARKED, STATE_NORMAL)) { return; } spins--; } long remaining = nanos - (System.nanoTime() - start); if (remaining < 0) { return; } try { if (unsafe.compareAndSwapInt(this, parkedOffset, STATE_NORMAL, STATE_PARKED)) { LockSupport.parkNanos(enhancedQueueExecutor, remaining); } } finally { unsafe.compareAndSwapInt(this, parkedOffset, STATE_PARKED, STATE_NORMAL); } }
Source:
protected String getUrl(String serviceName) { String result = ""; try { result = getWebServiceProxyHelper().getUrlLocalHomeCommunity(serviceName); } catch (Exception ex) { LOG.warn("Unable to retreive url for service: " + serviceName); LOG.warn("Error: " + ex.getMessage(), ex); } return result; }

Target:
protected String getUrl(String serviceName) { String result = ""; try { result = getWebServiceProxyHelper().getUrlLocalHomeCommunity(serviceName); } catch (Exception ex) { LOG.warn("Unable to retreive url for service: Error: ", serviceName, ex.getMessage(), ex); } return result; }
Source:
List<Boolean> resolveBooleanExpressions(List<String> expressions, Entity entity) { if (expressions.isEmpty()) { return Collections.emptyList(); } Bindings bindings = jsMagmaScriptEvaluator.createBindings(entity); List<Boolean> validationResults = new ArrayList<>(expressions.size()); for (String expression : expressions) { Object value = jsMagmaScriptEvaluator.eval(bindings, expression); validationResults.add(value != null ? Boolean.valueOf(value.toString()) : null); } return validationResults; }

Target:
List<Boolean> resolveBooleanExpressions(List<String> expressions, Entity entity) { if (expressions.isEmpty()) { return Collections.emptyList(); } return jsMagmaScriptEvaluator.eval(expressions, entity) .stream() .map(this::convertToBoolean) .collect(toList()); }
Source:
public PathBuilder path(final String pathFragment) { if (pathFragment == null) { return this; } if (!pathFragment.startsWith("/") && !currentPathEndsWith('/')) { this.path.append("/").append(pathFragment); } else if(!pathFragment.startsWith("/") && currentPathEndsWith('/')) { this.path.append(pathFragment); } else if(pathFragment.startsWith("/") && !currentPathEndsWith('/')) { this.path.append(pathFragment); } else if(pathFragment.startsWith("/") && currentPathEndsWith('/') && pathFragment.length() > 1) { this.path.append(pathFragment.substring(1)); } else if(pathFragment.startsWith("/") && this.path.toString().length() == 0) { this.path.append(pathFragment); } else { } return this; }

Target:
public PathBuilder path(final String pathFragment) { if (pathFragment == null) { return this; } if (!pathFragment.startsWith("/")) { if (!currentPathEndsWith('/')) { this.path.append("/").append(pathFragment); } else if (currentPathEndsWith('/')) { this.path.append(pathFragment); } } else { if (!currentPathEndsWith('/')) { this.path.append(pathFragment); } else if (currentPathEndsWith('/') && pathFragment.length() > 1) { this.path.append(pathFragment.substring(1)); } else if (this.path.toString().length() == 0) { this.path.append(pathFragment); } } return this; }
Source:
public void testDeleteRecursive() throws Exception { final File tmpDir = tmp.getRoot(); final File dir = new File(tmpDir, "dir"); final File d1 = new File(dir, "d1"); final File d2 = new File(dir, "d2"); final File f1 = new File(dir, "f1"); final File d1f1 = new File(d1, "d1f1"); final File d2f2 = new File(d2, "d1f2"); try { mkdirs(dir, d1, d2); mkfiles(f1, d1f1, d2f2); Util.deleteRecursive(dir); assertFalse("dir exists", dir.exists()); mkdirs(dir, d1, d2); mkfiles(f1, d1f1, d2f2); lockFileForDeletion(d1f1); try { Util.deleteRecursive(dir); fail("Expected IOException"); } catch (IOException x) { assertTrue("dir exists", dir.exists()); assertTrue("d1 exists", d1.exists()); assertTrue("d1f1 exists", d1f1.exists()); assertThat(x.getMessage(), containsString(dir.getPath())); } unlockFilesForDeletion(); } finally { unlockFilesForDeletion(); Util.deleteRecursive(tmpDir); } }

Target:
public void testDeleteRecursive() throws Exception { final File dir = tmp.newFolder(); final File d1 = new File(dir, "d1"); final File d2 = new File(dir, "d2"); final File f1 = new File(dir, "f1"); final File d1f1 = new File(d1, "d1f1"); final File d2f2 = new File(d2, "d1f2"); mkdirs(dir, d1, d2); mkfiles(f1, d1f1, d2f2); Util.deleteRecursive(dir); assertFalse("dir exists", dir.exists()); }
Source:
private boolean isSequenceElementChange(Notification notification) { boolean isSequenceElement = isSequenceElement(notification.getNotifier()); Object value = null; Object newValue = notification.getNewValue(); if (newValue instanceof EObject) { value = newValue; } else { Object oldValue = notification.getOldValue(); if (oldValue instanceof EObject) { value = oldValue; } } if (value != null) { boolean valueIsSequenceElt = false; if (value instanceof EObject) { valueIsSequenceElt = isSequenceElement(value); } else if (value instanceof Collection<?>) { Collection<?> values = (Collection<?>) value; for (Object val : values) { if (isSequenceElement(val)) { valueIsSequenceElt = true; break; } } } isSequenceElement = isSequenceElement && valueIsSequenceElt; } return isSequenceElement; }

Target:
private boolean isSequenceElementChange(Notification notification) { boolean isSequenceElement = isSequenceElement(notification.getNotifier()); Object value = getValue(notification); if (value != null) { boolean valueIsSequenceElt = false; if (value instanceof EObject) { valueIsSequenceElt = isSequenceElement(value); } else if (value instanceof Collection<?>) { Collection<?> values = (Collection<?>) value; for (Object val : values) { if (isSequenceElement(val)) { valueIsSequenceElt = true; break; } } } isSequenceElement = isSequenceElement && valueIsSequenceElt; } return isSequenceElement; }
Source:
public boolean isValid(AddSeriesDto dto, ConstraintValidatorContext context) { if (dto == null) { return true; } LocalDate today = LocalDate.now(); if (yearInFuture(today, dto)) { rejectField(context, "year"); return false; } if (yearAndMonthInFuture(today, dto)) { rejectField(context, "month"); return false; } if (dateInFuture(today, dto)) { rejectField(context, "day"); return false; } return true; }

Target:
public boolean isValid(AddSeriesDto dto, ConstraintValidatorContext context) { if (dto == null) { return true; } if (yearInFuture(dto)) { rejectField(context, "year"); return false; } if (yearAndMonthInFuture(dto)) { rejectField(context, "month"); return false; } if (dateInFuture(dto)) { rejectField(context, "day"); return false; } return true; }
Source:
protected boolean validate() { if (!super.validate()) { return false; } DiskImage image = imagesHandler.getVolumeInfoFromVdsm(getStoragePoolId(), getStorageDomainId(), getImageGroupId(), getParameters().getDestinationImageId()); return validate(isLeaf(image)); }

Target:
protected boolean validate() { if (!super.validate()) { return false; } if (!imagesHandler.hasCorrectVolType(getStoragePoolId(), getStorageDomainId(), getImageGroupId(), getParameters().getDestinationImageId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_IMAGE_IS_NOT_A_LEAF); } return true; }
Source:
private void addWatchdogActions(VersionCaps version, WatchdogAction[] values) { if (VersionUtils.greaterOrEqual(version, VERSION_3_2)) { version.setWatchdogActions(new WatchdogActions()); for (WatchdogAction watchdogAction : values) { version.getWatchdogActions().getWatchdogActions().add(watchdogAction.value()); } } }

Target:
private void addWatchdogActions(VersionCaps version, WatchdogAction[] values) { if (VersionUtils.greaterOrEqual(version, VERSION_3_3)) { version.setWatchdogActions(new WatchdogActions()); for (WatchdogAction watchdogAction : values) { version.getWatchdogActions().getWatchdogActions().add(watchdogAction.value()); } } }
Source:
public void unloadFromTransportShip(Unit u) { if (removeTransportedUnit(u)) { double unitWeight; if (u.getEntity().getUnitType() == UnitType.INFANTRY) { unitWeight = calcInfantryBayWeight(u.getEntity()); } else { unitWeight = u.getEntity().getWeight(); } if (u.hasTransportShipAssignment()) { updateBayCapacity(u.getEntity().getUnitType(), unitWeight, true, u.getTransportShipAssignment().getBayNumber()); } u.setTransportShipAssignment(null); } }

Target:
public void unloadFromTransportShip(Unit u) { Objects.requireNonNull(u); removeTransportedUnit(u); if (u.hasTransportShipAssignment() && u.getTransportShipAssignment().getTransportShip().equals(this)) { double unitWeight; if (u.getEntity().getUnitType() == UnitType.INFANTRY) { unitWeight = calcInfantryBayWeight(u.getEntity()); } else { unitWeight = u.getEntity().getWeight(); } updateBayCapacity(u.getEntity().getUnitType(), unitWeight, true, u.getTransportShipAssignment().getBayNumber()); u.setTransportShipAssignment(null); } }
Source:
private Invocable lazyGetTemplateInvocable() { if (templateInvocable == null) { synchronized(this) { templateInvocable = newTemplateInvocable(params); } } return templateInvocable; }

Target:
private Invocable lazyGetTemplateInvocable() { if (templateInvocable == null) { templateInvocable = newTemplateInvocable(params); } return templateInvocable; }
Source:
public static final List<BriefcaseFormDefinition> getBriefcaseFormList() { List<BriefcaseFormDefinition> formsList = new ArrayList<BriefcaseFormDefinition>(); File forms = FileSystemUtils.getFormsFolder(); if (forms.exists()) { File[] formDirs = forms.listFiles(); for (File f : formDirs) { if (f.isDirectory()) { try { File formFile = new File(f, f.getName() + ".xml"); String formFileHash = getMd5Hash(formFile); String existingFormFileHash = String.valueOf(pathToHashMap.get(formFile.getAbsolutePath())); BriefcaseFormDefinition existingDefinition = (BriefcaseFormDefinition) pathToDefinitionMap.get(formFile.getAbsolutePath()); if (existingFormFileHash == null || existingDefinition == null || !existingFormFileHash.equalsIgnoreCase(formFileHash)) { pathToHashMap.put(formFile.getAbsolutePath(), formFileHash); existingDefinition = new BriefcaseFormDefinition(f, formFile); pathToDefinitionMap.put(formFile.getAbsolutePath(), existingDefinition); } formsList.add(existingDefinition); } catch (BadFormDefinition e) { e.printStackTrace(); } } else { f.delete(); } } } return formsList; }

Target:
public static final List<BriefcaseFormDefinition> getBriefcaseFormList() { List<BriefcaseFormDefinition> formsList = new ArrayList<BriefcaseFormDefinition>(); File forms = FileSystemUtils.getFormsFolder(); if (forms.exists()) { File[] formDirs = forms.listFiles(); for (File f : formDirs) { if (f.isDirectory()) { try { File formFile = new File(f, f.getName() + ".xml"); String formFileHash = getMd5Hash(formFile); String existingFormFileHash = String.valueOf(CacheUtils.getFormFileMd5Hash(formFile.getAbsolutePath())); BriefcaseFormDefinition existingDefinition = CacheUtils.getFormFileFormDefinition(formFile.getAbsolutePath()); if (existingFormFileHash == null || existingDefinition == null || !existingFormFileHash.equalsIgnoreCase(formFileHash)) { CacheUtils.putFormFileMd5Hash(formFile.getAbsolutePath(), formFileHash); existingDefinition = new BriefcaseFormDefinition(f, formFile); CacheUtils.putFormFileFormDefinition(formFile.getAbsolutePath(), existingDefinition); } formsList.add(existingDefinition); } catch (BadFormDefinition e) { log.debug("bad form definition", e); } } else { f.delete(); } } } return formsList; }
Source:
public OutputView(OutputController controller) { super(controller); this.controller.getModel().addJobOutputListener(this); this.noOutputMessage = "No output available<br><br><br>" + "Click <strong>Finished Tasks Output</strong> to retrieve logs for already finished tasks. For all the finished Tasks within the Job, or for the selected Task. The command does work when Job is still in Running state, as well as when Job is Finished. In case of large number of Tasks (over 20), because the Tasks are paginated, when Selected Job is activated, it will add to the display the logs of the current page of Tasks.<br><br>"+ "Use <strong>Streaming Output</strong> to auto-fetch logs for running tasks of the entire Job. You cannot select a specific Task in the streaming mode. If you activate streaming while some Tasks are already finished, you will get the logs of those Tasks as well."; this.refreshButtonLabel = "Finished Tasks Output"; this.refreshButtonTooltip = "Request fetching the logs for finished tasks of the entire Job, or for a selected Task"; }

Target:
public OutputView(OutputController controller) { super(controller); this.controller.getModel().addJobOutputListener(this); this.noOutputMessage = "No output available<br><br><br>" + "Click <strong>Finished Tasks Output</strong> to retrieve logs for already finished tasks within the Job, or for the selected Task. The command does work when Job is still in Running state, as well as when Job is Finished. In case of large number of Tasks (over 20), the command displays only the logs of the current page of Tasks.<br><br>" + "Use <strong>Streaming Output</strong> to auto-fetch logs for running tasks of the entire Job. You cannot select a specific Task in the streaming mode. If you activate streaming while some Tasks are already finished, you will get the logs of those Tasks as well."; this.refreshButtonLabel = "Finished Tasks Output"; this.refreshButtonTooltip = "Request fetching the logs for finished tasks of the entire Job, or for a selected Task"; }