auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void beforeClass() { ps = PowerMockito.mock(PatientService.class); pss = PowerMockito.mock(PatientSetService.class); cs = PowerMockito.mock(ConceptService.class); es = PowerMockito.mock(EncounterService.class); PowerMockito.stub(PowerMockito.method(Context.class, "getPatientSetService")).toReturn(pss); PowerMockito.stub(PowerMockito.method(Context.class, "getPatientService")).toReturn(ps); PowerMockito.stub(PowerMockito.method(Context.class, "getConceptService")).toReturn(cs); PowerMockito.stub(PowerMockito.method(Context.class, "getEncounterService")).toReturn(es); PowerMockito.spy(Context.class); PowerMockito.doNothing().when(Context.class); Context.clearSession(); }

Target:
public void beforeClass() { ps = mock(PatientService.class); pss = mock(PatientSetService.class); cs = mock(ConceptService.class); es = mock(EncounterService.class); stub(method(Context.class, "getPatientSetService")).toReturn(pss); stub(method(Context.class, "getPatientService")).toReturn(ps); stub(method(Context.class, "getConceptService")).toReturn(cs); stub(method(Context.class, "getEncounterService")).toReturn(es); spy(Context.class); doNothing().when(Context.class); Context.clearSession(); }
Source:
private void deflateJdk11(ByteBuf out) { if (out.isDirect()) { try { int numBytes; do { numBytes = (Integer) DEFLATER_DEFLATE_BYTEBUFFER.invoke(deflater, out.nioBuffer(), Deflater.SYNC_FLUSH); } while (numBytes > 0); } catch (IllegalAccessException e) { throw new Error(e); } catch (InvocationTargetException e) { throw new Error(e); } } else { deflateJdk7(out); } }

Target:
private void deflateJdk11(ByteBuf out) { if (out.isDirect()) { try { ByteBuffer nioBuffer = out.nioBuffer(); int numBytes; do { numBytes = (Integer) DEFLATER_DEFLATE_BYTEBUFFER.invoke(deflater, nioBuffer, Deflater.SYNC_FLUSH); } while (numBytes > 0); } catch (IllegalAccessException e) { throw new Error(e); } catch (InvocationTargetException e) { throw new Error(e); } } else { deflateJdk7(out); } }
Source:
protected void doRun() throws Exception { ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); long[] deadLocks; try { deadLocks = mbean.findDeadlockedThreads(); } catch (UnsupportedOperationException x) { deadLocks = null; } if (deadLocks != null && deadLocks.length != 0) { File file = logs.file("DeadlockDetected-" + format.format(new Date()) + ".txt"); logs.add(file); PrintWriter builder = new PrintWriter(file,"UTF-8"); try { builder.println("=============="); builder.println("Deadlock Found"); builder.println("=============="); ThreadInfo[] deadLockThreads = mbean.getThreadInfo(deadLocks, Integer.MAX_VALUE); for (ThreadInfo threadInfo : deadLockThreads) { try { ThreadDumps.printThreadInfo(builder, threadInfo, mbean, SupportPlugin.getContentFilter().orElse(null)); } catch (LinkageError e) { builder.println(threadInfo); } } } finally { builder.close(); } } }

Target:
protected void doRun() throws Exception { ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); long[] deadLocks; try { deadLocks = mbean.findDeadlockedThreads(); } catch (UnsupportedOperationException x) { deadLocks = null; } if (deadLocks != null && deadLocks.length != 0) { File file = logs.file("DeadlockDetected-" + format.format(new Date()) + ".txt"); logs.add(file); PrintWriter builder = new PrintWriter(file,"UTF-8"); try { builder.println("=============="); builder.println("Deadlock Found"); builder.println("=============="); ThreadInfo[] deadLockThreads = mbean.getThreadInfo(deadLocks, Integer.MAX_VALUE); ContentFilter contentFilter = SupportPlugin.getContentFilter().orElse(null); for (ThreadInfo threadInfo : deadLockThreads) { try { ThreadDumps.printThreadInfo(builder, threadInfo, mbean, contentFilter); } catch (LinkageError e) { builder.println(threadInfo); } } } finally { builder.close(); } } }
Source:
public static MutableAggregate permute(MutableAggregate aggregate, MutableRel input, Mapping mapping) { ImmutableBitSet groupSet = Mappings.apply(mapping, aggregate.groupSet); ImmutableList<ImmutableBitSet> unSortedGroupSets = Mappings.apply2(mapping, aggregate.groupSets); ImmutableList<ImmutableBitSet> groupSets = ImmutableList.copyOf( ImmutableBitSet.ORDERING.sortedCopy(unSortedGroupSets)); List<AggregateCall> aggregateCalls = Util.transform(aggregate.aggCalls, call -> call.transform(mapping)); return MutableAggregate.of(input, groupSet, groupSets, aggregateCalls); }

Target:
public static MutableAggregate permute(MutableAggregate aggregate, MutableRel input, Mapping mapping) { ImmutableBitSet groupSet = Mappings.apply(mapping, aggregate.groupSet); ImmutableList<ImmutableBitSet> groupSets = Mappings.apply2(mapping, aggregate.groupSets); List<AggregateCall> aggregateCalls = Util.transform(aggregate.aggCalls, call -> call.transform(mapping)); return MutableAggregate.of(input, groupSet, groupSets, aggregateCalls); }
Source:
private void deleteContent( final ArtifactStore store ) throws IndyWorkflowException { List<Transfer> contents = downloadManager.listRecursively( store.getKey(), DownloadManager.ROOT_PATH ); Set<String> pending = contents.stream().map( Transfer::getPath ).collect( Collectors.toSet() ); for ( String path : pending ) { contentManager.delete( store, path, new EventMetadata().set( IGNORE_READONLY, Boolean.TRUE ) ); } }

Target:
private void deleteContent( final ArtifactStore store ) throws IndyWorkflowException { downloadManager.delete( store, ROOT_PATH, new EventMetadata().set( IGNORE_READONLY, Boolean.TRUE ) ); }
Source:
public void handleSynchronizeTimeResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.debug("handleSynchronizeTimeResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleSynchronizeTimeResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.debug("handleSynchronizeTimeResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
public void requestTaskReconfiguration() { synchronized (this) { if (closed) { throw new ConnectException(String.format( "The request for task reconfiguration has been rejected because this instance of " + "the connector '%s' has already been shut down.", connectorName )); } } herder.requestTaskReconfiguration(connectorName); }

Target:
public void requestTaskReconfiguration() { if (closed) { throw new ConnectException("The request for task reconfiguration has been rejected " + "because this instance of the connector '" + connectorName + "' has already " + "been shut down."); } herder.requestTaskReconfiguration(connectorName); }
Source:
public void visitFunctionExpression(FunctionExpressionTree tree) { LexicalVariablesTree lexicalVars = tree.lexicalVars(); if (tree == currentFunction) { if (lexicalVars != null) { lexicalVars.variables().stream() .map(VariableTree::variableExpression) .filter(variable -> variable.is(Kind.VARIABLE_IDENTIFIER)) .map(variable -> ((VariableIdentifierTree) variable).text().toLowerCase(Locale.ROOT)) .forEach(initializedVariables::add); } super.visitFunctionExpression(tree); } else { if (lexicalVars != null) { scan(lexicalVars.variables()); } } }

Target:
public void visitFunctionExpression(FunctionExpressionTree tree) { LexicalVariablesTree lexicalVars = tree.lexicalVars(); if (tree == currentFunction) { if (lexicalVars != null) { lexicalVars.variables().stream() .map(VariableTree::variableExpression) .filter(variable -> variable.is(Kind.VARIABLE_IDENTIFIER)) .map(variable -> ((VariableIdentifierTree) variable).text()) .forEach(initializedVariables::add); } super.visitFunctionExpression(tree); } else { if (lexicalVars != null) { scan(lexicalVars.variables()); } } }
Source:
public void check(String title) throws RemoteException { Selector nodeSelector = new Selector("span[title=\"" + title + "\"]"); browser.run(nodeSelector.getStatement() + ".click();"); }

Target:
public void check(String title) throws RemoteException { if (isChecked(title) == false) { Selector nodeSelector = new Selector("span[title=\"" + title + "\"]"); browser.run(String.format("%s[0].click();", nodeSelector.getStatement())); } }
Source:
public <T extends Action> T getAction(Class<T> type) { for (Action a : getActions()) { if (type.isInstance(a)) { return type.cast(a); } } for (TransientActionFactory<?> taf : TransientActionFactory.factoriesFor(getClass())) { for (Action a : createFor(taf)) { if (type.isInstance(a)) { return type.cast(a); } } } return null; }

Target:
public <T extends Action> T getAction(Class<T> type) { for (Action a : getActions()) { if (type.isInstance(a)) { return type.cast(a); } } for (TransientActionFactory<?> taf : TransientActionFactory.factoriesFor(getClass(), type)) { for (Action a : createFor(taf)) { if (type.isInstance(a)) { return type.cast(a); } } } return null; }
Source:
public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); String fedoraUri = (String) in.getHeader(FCREPO_URI); String binaryPath = (String) in.getHeader(CdrBinaryPath); String binaryId = PIDs.get(fedoraUri).getId(); String binarySubPath = idToPath(binaryId, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); String text; try { text = extractText(binaryPath); } catch (TikaException e) { log.error("Failed to extract text for due to parsing error", fedoraUri, e); return; } Path derivativePath = Paths.get(derivativeBasePath, binarySubPath, binaryId + ".txt"); File derivative = derivativePath.toFile(); File parentDir = derivative.getParentFile(); if (parentDir != null) { try { Files.createDirectories(parentDir.toPath()); } catch (Exception e) { log.error(e.getMessage()); throw new IOException("Failed to create parent directories for " + derivativePath); } FileUtils.write(derivative, text, UTF_8); } }

Target:
public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); String fedoraUri = (String) in.getHeader(FCREPO_URI); String binaryPath = (String) in.getHeader(CdrBinaryPath); String binaryId = PIDs.get(fedoraUri).getId(); String binarySubPath = idToPath(binaryId, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); String text; try { text = extractText(binaryPath); } catch (TikaException e) { log.error("Failed to extract text for due to parsing error", fedoraUri, e); return; } Path derivativePath = Paths.get(derivativeBasePath, binarySubPath, binaryId + ".txt"); File derivative = derivativePath.toFile(); File parentDir = derivative.getParentFile(); if (parentDir != null) { try { Files.createDirectories(parentDir.toPath()); } catch (IOException e) { throw new IOException("Failed to create parent directories for " + derivativePath + ".", e); } FileUtils.write(derivative, text, UTF_8); } }
Source:
private void processServerError(ServerErrorCode error) { setChunkException(new RouterException("Operation timed out", RouterErrorCode.AmbryUnavailable)); }

Target:
private void processServerError(ServerErrorCode error) { setChunkException(new RouterException("Could not complete operation, server returned: " + error, RouterErrorCode.AmbryUnavailable)); }
Source:
public String toString() { List<String> keys = new ArrayList<>( params.keySet() ); Collections.sort( keys ); LinkedHashMap<String,String> output = new LinkedHashMap<>(); for ( String key : keys ) { output.put( key, params.get( key ) ); } return output.toString(); }

Target:
public String toString() { return params.entrySet().stream() .sorted( Comparator.comparing( Map.Entry::getKey ) ) .map( entry -> entry.getKey() + "=" + entry.getValue() ) .collect( Collectors.joining( ", ") ); }
Source:
default public void prompt( String prompt ) { print(prompt); }

Target:
default void prompt( String prompt ) { print(prompt); }
Source:
private CompletionStage<List<KeyIterable<ShardId, Row>>> tryFetchMore(ShardId shardId) { if (allExhausted()) { return CompletableFuture.failedFuture(new IllegalStateException("Cannot fetch more if source is exhausted")); } if (shardId == null) { return CompletableFutures.asKillable( ThreadPools.runWithAvailableThreads( executor, availableThreads, Lists2.map(orderedDocCollectors, Function.identity())), this::kill); } else { return loadFrom(collectorsByShardId.get(shardId)); } }

Target:
private KillableCompletionStage<List<KeyIterable<ShardId, Row>>> tryFetchMore(ShardId shardId) { if (allExhausted()) { return KillableCompletionStage.whenKilled( CompletableFuture.failedFuture(new IllegalStateException("Cannot fetch more if source is exhausted")), t -> { }); } CompletionStage<List<KeyIterable<ShardId, Row>>> stage; if (shardId == null) { stage = ThreadPools.runWithAvailableThreads( executor, availableThreads, Lists2.map(orderedDocCollectors, Function.identity())); } else { stage = loadFrom(collectorsByShardId.get(shardId)); } return KillableCompletionStage.whenKilled(stage, this::kill); }
Source:
public List<Attachment> getAttachments(Collection<AttachmentId> attachmentIds) { Preconditions.checkArgument(attachmentIds != null); return ImmutableList.<Attachment>builder().addAll( attachmentIds.stream().distinct() .map(attachmentId -> getEntityManager().find(JPAAttachment.class, attachmentId.getId())) .filter(Objects::nonNull) .map(jpaAttachment -> jpaAttachment.toAttachment()) .collect(Collectors.toList()) ).build(); }

Target:
public List<Attachment> getAttachments(Collection<AttachmentId> attachmentIds) { Preconditions.checkArgument(attachmentIds != null, "AttachmentId collection can't be null when trying to get attachments!"); return attachmentIds.stream().distinct() .map(attachmentId -> getEntityManager().find(JPAAttachment.class, attachmentId.getId())) .filter(Objects::nonNull) .map(jpaAttachment -> jpaAttachment.toAttachment()) .collect(Guavate.toImmutableList()); }
Source:
public void wrongLastViewedTest() throws InterruptedException { String title = TestController.getUI().getTitle(); assertEquals("test2/test2 (none)", title); }

Target:
public void wrongLastViewedTest() { String title = TestController.getUI().getTitle(); assertEquals("test2/test2 (none)", title); }
Source:
public FormValidation doCheckExtraHostsString(@QueryParameter String extraHostsString) { final List<String> extraHosts = splitAndFilterEmptyList(extraHostsString, "\n"); for (String extraHost : extraHosts) { if (extraHost.split(":").length != 2) { return FormValidation.error("Wrong extraHost {}", extraHost); } } return FormValidation.ok(); }

Target:
public FormValidation doCheckExtraHostsString(@QueryParameter String extraHostsString) { final List<String> extraHosts = splitAndFilterEmptyList(extraHostsString, "\n"); for (String extraHost : extraHosts) { if (extraHost.trim().split(":").length < 2) { return FormValidation.error("Wrong extraHost {}", extraHost); } } return FormValidation.ok(); }
Source:
private EchoRequest buildRequest(Integer messageSize) { final EchoRequest request = new EchoRequest(); request.setId(System.currentTimeMillis()); String message = Strings.repeat("*", messageSize); if(messageSize > MAX_BUFFER_SIZE) { request.setBody(message); } else { request.setMessage(message); } request.setLocation(location); request.setSystemId(systemId); request.setTimeToLiveMs(ttlInMs); request.setDelay(delay); request.shouldThrow(shouldThrow); return request; }

Target:
private EchoRequest buildRequest(Integer messageSize) { final EchoRequest request = new EchoRequest(); request.setId(System.currentTimeMillis()); String message = Strings.repeat("*", messageSize); request.setBody(message); request.setLocation(location); request.setSystemId(systemId); request.setTimeToLiveMs(ttlInMs); request.setDelay(delay); request.shouldThrow(shouldThrow); return request; }
Source:
public boolean anyLife() { ArrayList<Player> players = Model.getPlayers(); boolean alive = false; for (Player player : players) { if (player.isAlive()) { alive = true; } } return alive; }

Target:
public boolean anyLife() { for (Player player : Model.getPlayers()) { if (player.isAlive()) { return true; } } return false; }
Source:
public String toString() { return "IotasProcessor{" + "declaredOutputStreams=" + outputStreams + '}'+super.toString(); }

Target:
public String toString() { return "IotasProcessor{" + "outputStreams=" + outputStreams + '}'+super.toString(); }
Source:
public void recordingTestThatShouldHaveCorrectDuration() throws IOException { final String flvFileTitle = "ChromeThatRecordsAllTests-recordingTestThatShouldBeRecordedAndRetained"; final String flvFileNameRegEx = "PASSED-" + flvFileTitle + ".*\\.flv"; try ( BrowserWebDriverContainer chrome = new BrowserWebDriverContainer() .withCapabilities(new ChromeOptions()) .withRecordingMode(RECORD_ALL, vncRecordingDirectory.getRoot()) .withRecordingFileFactory(new DefaultRecordingFileFactory()) ) { chrome.start(); doSimpleExplore(chrome); chrome.afterTest(new TestDescription() { @Override public String getTestId() { return getFilesystemFriendlyName(); } @Override public String getFilesystemFriendlyName() { return flvFileTitle; } }, Optional.empty()); String recordedFile = vncRecordingDirectory.getRoot().listFiles(new PatternFilenameFilter(flvFileNameRegEx))[0].getCanonicalPath(); ToStringConsumer dockerLogConsumer = new ToStringConsumer(); try( GenericContainer container = new GenericContainer<>("jrottenberg/ffmpeg:3.2-alpine38") ) { container.withStartupCheckStrategy(new OneShotStartupCheckStrategy()) .withFileSystemBind(recordedFile, "/tmp/chromeTestRecord.flv", BindMode.READ_WRITE ) .withCommand("-i" ,"/tmp/chromeTestRecord.flv") .withLogConsumer(dockerLogConsumer) .start(); } catch (RuntimeException ex) { } String dockerOutput = dockerLogConsumer.toUtf8String(); assertTrue("Duration is incorrect: ", dockerOutput.matches("[\\S\\s]*Duration: (?!00:00:00.00)[\\S\\s]*")); } }

Target:
public void recordingTestThatShouldHaveCorrectDuration() throws IOException, InterruptedException { MountableFile mountableFile; try ( BrowserWebDriverContainer<?> chrome = new BrowserWebDriverContainer<>() .withCapabilities(new ChromeOptions()) .withRecordingMode(RECORD_ALL, vncRecordingDirectory.getRoot()) .withRecordingFileFactory(new DefaultRecordingFileFactory()) .withNetwork(NETWORK) ) { File[] recordedFiles = runSimpleExploreInContainer(chrome, "PASSED-.*\\.flv"); mountableFile = MountableFile.forHostPath(recordedFiles[0].getCanonicalPath()); } try( GenericContainer<?> container = new GenericContainer<>(DockerImageName.parse("testcontainers/vnc-recorder:1.2.0")) ) { String recordFileContainerPath = "/tmp/chromeTestRecord.flv"; container.withCopyFileToContainer(mountableFile, recordFileContainerPath) .withCreateContainerCmdModifier( createContainerCmd -> createContainerCmd.withEntrypoint("ffmpeg") ) .withCommand("-i" , recordFileContainerPath, "-f" ,"null" ,"-" ) .waitingFor( new LogMessageWaitStrategy() .withRegEx(".*Duration.*") .withStartupTimeout(Duration.of(60, SECONDS)) ) .start(); String ffmpegOutput = container.getLogs(); assertTrue("Duration is incorrect in:\n " + ffmpegOutput, ffmpegOutput.contains("Duration: 00:") && !(ffmpegOutput.contains("Duration: 00:00:00.00"))); } }
Source:
private Map<InputFile, CoverageMeasuresBuilder> parse(List<String> lines) { final Map<InputFile, FileData> files = Maps.newHashMap(); FileData fileData = null; for (String line : lines) { if (line.startsWith(SF)) { fileData = loadCurrentFileData(files, line); } else if (fileData != null) { if (line.startsWith(DA)) { String execution = line.substring(DA.length()); String executionCount = execution.substring(execution.indexOf(',') + 1); String lineNumber = execution.substring(0, execution.indexOf(',')); try { fileData.addLine(Integer.valueOf(lineNumber), Integer.valueOf(executionCount)); } catch (IllegalArgumentException e) { LOG.warn("Can't save DA data. Cause: " + e.getMessage(), e); } } else if (line.startsWith(BRDA)) { String[] tokens = line.substring(BRDA.length()).trim().split(","); String lineNumber = tokens[0]; String branchNumber = tokens[1] + tokens[2]; String taken = tokens[3]; try { fileData.addBranch(Integer.valueOf(lineNumber), branchNumber, "-".equals(taken) ? 0 : Integer.valueOf(taken)); } catch (IllegalArgumentException e) { LOG.warn("Can't save BRDA data. Cause: " + e.getMessage(), e); } } } } Map<InputFile, CoverageMeasuresBuilder> coveredFiles = Maps.newHashMap(); for (Map.Entry<InputFile, FileData> e : files.entrySet()) { coveredFiles.put(e.getKey(), e.getValue().convert()); } return coveredFiles; }

Target:
private Map<InputFile, CoverageMeasuresBuilder> parse(List<String> lines) { final String errorMessage = "Problem during processing LCOV report: can't save %s data for line %s."; final Map<InputFile, FileData> files = Maps.newHashMap(); FileData fileData = null; for (String line : lines) { if (line.startsWith(SF)) { fileData = loadCurrentFileData(files, line); } else if (fileData != null) { if (line.startsWith(DA)) { String execution = line.substring(DA.length()); String executionCount = execution.substring(execution.indexOf(',') + 1); String lineNumber = execution.substring(0, execution.indexOf(',')); try { fileData.addLine(Integer.valueOf(lineNumber), Integer.valueOf(executionCount)); } catch (IllegalArgumentException e) { LOG.warn(String.format(errorMessage, "DA", lineNumber), e); } } else if (line.startsWith(BRDA)) { String[] tokens = line.substring(BRDA.length()).trim().split(","); String lineNumber = tokens[0]; String branchNumber = tokens[1] + tokens[2]; String taken = tokens[3]; try { fileData.addBranch(Integer.valueOf(lineNumber), branchNumber, "-".equals(taken) ? 0 : Integer.valueOf(taken)); } catch (IllegalArgumentException e) { LOG.warn(String.format(errorMessage, "BRDA", lineNumber), e); } } } } Map<InputFile, CoverageMeasuresBuilder> coveredFiles = Maps.newHashMap(); for (Map.Entry<InputFile, FileData> e : files.entrySet()) { coveredFiles.put(e.getKey(), e.getValue().convert()); } return coveredFiles; }
Source:
public boolean equals(Object obj) { if (!(obj instanceof GlusterServerInfo)) { return false; } GlusterServerInfo host = (GlusterServerInfo) obj; return (getUuid().equals(host.getUuid()) && (GlusterCoreUtil.objectsEqual(hostName, host.getHostName())) && (GlusterCoreUtil.objectsEqual(status, host.getStatus()))); }

Target:
public boolean equals(Object obj) { if (!(obj instanceof GlusterServerInfo)) { return false; } GlusterServerInfo host = (GlusterServerInfo) obj; return (GlusterCoreUtil.objectsEqual(getUuid(), host.getUuid()) && (GlusterCoreUtil.objectsEqual(getHostName(), host.getHostName())) && (GlusterCoreUtil.objectsEqual(getStatus(), host.getStatus()))); }
Source:
public void stop() { if (started.compareAndSet(true, false)) { if (scheduler != null) { Utils.shutDownExecutorService(scheduler, config.nettyMetricsStopWaitTimeoutSeconds, TimeUnit.SECONDS); logger.trace("De-scheduled for collecting netty metrics"); } } }

Target:
public void stop() { if (started.compareAndSet(true, false)) { if (scheduler != null) { Utils.shutDownExecutorService(scheduler, config.nettyMetricsStopWaitTimeoutSeconds, TimeUnit.SECONDS); logger.info("De-scheduled for collecting netty metrics"); } } }
Source:
public void render(Context context, GlusterVolumeEntity volume, SafeHtmlBuilder sb) { int brickCount = volume.getBricks().size(); if (volume == null) { return; } int count = 0; GlusterStatus status = volume.getStatus(); ImageResource statusImage = null; String tooltip; switch (status) { case DOWN: statusImage = resources.downImage(); tooltip = constants.down(); break; case UP: count = countDownBricks(volume); if((count < brickCount) && (count != 0)) { statusImage = resources.volumeUpWarning(); tooltip = constants.volumeBricksDown(); } else if(count == 0){ statusImage = resources.upImage(); tooltip = constants.up(); } else { statusImage = resources.volumeUpWarning(); tooltip = constants.allBricksDown(); } break; default: statusImage = resources.downImage(); tooltip = constants.down(); } ImageResource alertImage = resources.alertImage(); SafeHtml statusImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML()); SafeHtml alertImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(alertImage).getHTML()); sb.appendHtmlConstant("<div>"); if(count == brickCount) { sb.append(applicationTemplates.statusWithAlertTemplate(statusImageHtml, alertImageHtml, tooltip)); } else { sb.append(applicationTemplates.statusTemplate(statusImageHtml, tooltip)); } sb.appendHtmlConstant("</div>"); }

Target:
public void render(Context context, GlusterVolumeEntity volume, SafeHtmlBuilder sb) { int brickCount = volume.getBricks().size(); if (volume == null) { return; } int count = 0; GlusterStatus status = volume.getStatus(); ImageResource statusImage = null; String tooltip; switch (status) { case DOWN: statusImage = resources.downImage(); tooltip = constants.down(); break; case UP: count = countDownBricks(volume); if(count == 0){ statusImage = resources.upImage(); tooltip = constants.up(); }else { statusImage = resources.volumeUpWarning(); if(count < brickCount) { tooltip = constants.volumeBricksDown(); } else { tooltip = constants.allBricksDown(); } } break; default: statusImage = resources.downImage(); tooltip = constants.down(); } ImageResource alertImage = resources.alertImage(); SafeHtml statusImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML()); SafeHtml alertImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(alertImage).getHTML()); if(count == brickCount) { sb.append(applicationTemplates.statusWithAlertTemplate(statusImageHtml, alertImageHtml, tooltip)); } else { sb.append(applicationTemplates.statusTemplate(statusImageHtml, tooltip)); } }
Source:
public void reportErrors(Collection<ConstraintCheckIssue> errors) { errors.forEach( this::reportError ); }

Target:
public void reportErrors(Collection<ConstraintCheckIssue> errors) { for ( ConstraintCheckIssue error : errors ) { reportError( error ); } }
Source:
public void registerListenerAndConnect(final Consumer<ServerMessageEnvelope> messageListener) { this.messageListener = messageListener; client .connect(this, errorHandler) .exceptionally( throwable -> { log.log( Level.SEVERE, "Unexpected exception completing websocket connection", throwable); return null; }); }

Target:
public void registerListenerAndConnect(final Consumer<ServerMessageEnvelope> messageListener) { this.messageListener = messageListener; client.connect(this, errorHandler); }
Source:
public boolean isRunning() { synchronized (this.directReplyToContainers) { if (this.directReplyToContainers.size() > 0) { for (DirectReplyToMessageListenerContainer container : this.directReplyToContainers.values()) { if (container.isRunning()) { return true; } } } } return false; }

Target:
public boolean isRunning() { synchronized (this.directReplyToContainers) { synchronized (this.directReplyToContainers) { return this.directReplyToContainers.values() .stream() .anyMatch(AbstractMessageListenerContainer::isRunning); } } }
Source:
Mono<Response<String>> renewLeaseWithResponse(Context context) { context = context == null ? Context.NONE : context; if (this.isShareFile) { throw logger.logExceptionAsError(new IllegalArgumentException("Cannot renew a lease on a share file.")); } else { return this.client.shares().renewLeaseWithRestResponseAsync(null, this.leaseId, null, null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getLeaseId())); } }

Target:
Mono<Response<String>> renewLeaseWithResponse(Context context) { context = context == null ? Context.NONE : context; if (this.isShareFile) { throw logger.logExceptionAsError(new UnsupportedOperationException( "Cannot renew a lease on a share file.")); } else { return this.client.shares().renewLeaseWithRestResponseAsync(null, this.leaseId, null, null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getLeaseId())); } }
Source:
private String getStoragePath( ConcreteResource resource ) { String storagePath = resource.getPath(); if ( pathGenerators != null ) { for ( final PathGenerator generator : pathGenerators ) { final ConcreteResource storeRes = new ConcreteResource( resource.getLocation(), storagePath ); storagePath = generator.getPath( storeRes ); } } return storagePath; }

Target:
private String getStoragePath( ConcreteResource resource ) { String storagePath = resource.getPath(); if ( pathGenerator != null ) { final ConcreteResource storeRes = new ConcreteResource( resource.getLocation(), storagePath ); storagePath = pathGenerator.getPath( storeRes ); } return storagePath; }
Source:
private String getTileEntityName(TileEntity tileEntity) { String className = tileEntity.getClass().getSimpleName(); ResourceLocation registryId = TileEntity.getKey(tileEntity.getClass()); if (registryId == null) return className; else { return registryId.toString(); } }

Target:
private String getTileEntityName(TileEntity tileEntity) { ResourceLocation registryId = TileEntity.getKey(tileEntity.getClass()); if (registryId == null) return tileEntity.getClass().getSimpleName(); else { return registryId.toString(); } }
Source:
public boolean isUniqueItemName(DispoProgram program, String setId, String name) { IOseeBranch branch = TokenFactory.createBranch(program.getGuid(), program.getUuid(), program.getName()); ArtifactReadable setArt = findDispoArtifact(branch, setId, DispoConstants.DispoSet); ResultSet<ArtifactReadable> results = getQuery() .fromBranch(branch) .andRelatedTo(CoreRelationTypes.Default_Hierarchical__Parent, setArt) .andTypeEquals(DispoConstants.DispoItem) .andNameEquals(name) .getResults(); return results.isEmpty(); }

Target:
public boolean isUniqueItemName(DispoProgram program, String setId, String name) { IOseeBranch branch = getProgramBranch(program); ArtifactReadable setArt = findDispoArtifact(branch, setId, DispoConstants.DispoSet); ResultSet<ArtifactReadable> results = getQuery() .fromBranch(branch) .andRelatedTo(CoreRelationTypes.Default_Hierarchical__Parent, setArt) .andTypeEquals(DispoConstants.DispoItem) .andNameEquals(name) .getResults(); return results.isEmpty(); }
Source:
public SqlStatements() { attributes = Collections.synchronizedMap(new HashMap<>()); templateEngine = new DefinedAttributeTemplateEngine(); sqlParser = new ColonPrefixSqlParser(); sqlLogger = SqlLogger.NOP_SQL_LOGGER; queryTimeout = null; allowUnusedBindings = false; customizers = new CopyOnWriteArrayList<>(); }

Target:
public SqlStatements() { attributes = Collections.synchronizedMap(new HashMap<>()); templateEngine = new DefinedAttributeTemplateEngine(); sqlParser = new ColonPrefixSqlParser(); sqlLogger = SqlLogger.NOP_SQL_LOGGER; queryTimeout = null; }
Source:
private int makeRequest(String urlString, JsonStream.Streamable streamable, Map<String, String> headers) throws NetworkException { checkHasNetworkConnection(urlString); HttpURLConnection conn = null; try { URL url = new URL(urlString); conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setChunkedStreamingMode(0); conn.addRequestProperty("Content-Type", "application/json"); for (Map.Entry<String, String> entry : headers.entrySet()) { conn.addRequestProperty(entry.getKey(), entry.getValue()); } OutputStream out = null; try { out = conn.getOutputStream(); Charset charset = Charset.forName("UTF-8"); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, charset)); JsonStream stream = new JsonStream(writer); streamable.toStream(stream); stream.close(); } finally { IOUtils.closeQuietly(out); } return conn.getResponseCode(); } catch (IOException exception) { throw new NetworkException(urlString, exception); } finally { IOUtils.close(conn); } }

Target:
private int makeRequest(String urlString, JsonStream.Streamable streamable, Map<String, String> headers) throws NetworkException { checkHasNetworkConnection(urlString); HttpURLConnection conn = null; try { URL url = new URL(urlString); conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setChunkedStreamingMode(0); conn.addRequestProperty("Content-Type", "application/json"); for (Map.Entry<String, String> entry : headers.entrySet()) { conn.addRequestProperty(entry.getKey(), entry.getValue()); } JsonStream stream = null; try { OutputStream out = conn.getOutputStream(); Charset charset = Charset.forName("UTF-8"); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, charset)); stream = new JsonStream(writer); streamable.toStream(stream); } finally { IOUtils.closeQuietly(stream); } return conn.getResponseCode(); } catch (IOException exception) { throw new NetworkException(urlString, exception); } finally { IOUtils.close(conn); } }
Source:
private void scheduleCompaction(long lastApplied) { long compactTime = System.currentTimeMillis(); long lastCompactTime = this.compactTime; this.compactTime = compactTime; if (lastCompactTime > 0) { Duration duration = Duration.ofMillis((compactTime - lastCompactTime) / 2); logger.trace("Scheduling compaction for {}", duration); threadContext.schedule(duration, () -> compactLogs(lastApplied)); } else { scheduleSnapshots(); } }

Target:
private void scheduleCompaction(long lastApplied) { logger.trace("Scheduling compaction in {}", COMPACT_INTERVAL); threadContext.schedule(COMPACT_INTERVAL, () -> compactLogs(lastApplied)); }
Source:
public <T> T createInstance(StoreConfiguration cfg) { if (cfg instanceof DeployedStoreConfiguration) { DeployedStoreConfiguration deployedConfiguration = (DeployedStoreConfiguration) cfg; DeployedCacheStoreMetadata deployedCacheStoreMetadata = null; try { deployedCacheStoreMetadata = getPromise(deployedConfiguration.getCustomStoreClassName()).get(TIMEOUT_SECONDS, TimeUnit.SECONDS); return (T) deployedCacheStoreMetadata.getLoaderWriterRawInstance(); } catch (InterruptedException e) { InfinispanLogger.ROOT_LOGGER.error("Could not get Custom Cache Store metadata (" + deployedConfiguration.getCustomStoreClassName() + ") because of an InterruptionException.", e); } catch (ExecutionException e) { InfinispanLogger.ROOT_LOGGER.error("Could not get Custom Cache Store metadata (" + deployedConfiguration.getCustomStoreClassName() + ") because of an ExecutionException.", e); } catch (TimeoutException e) { InfinispanLogger.ROOT_LOGGER.error("Could not get Custom Cache Store metadata (" + deployedConfiguration.getCustomStoreClassName() + ") within given time.", e); } } return null; }

Target:
public <T> T createInstance(StoreConfiguration cfg) { if (cfg instanceof DeployedStoreConfiguration) { DeployedStoreConfiguration deployedConfiguration = (DeployedStoreConfiguration) cfg; DeployedCacheStoreMetadata deployedCacheStoreMetadata = null; try { deployedCacheStoreMetadata = getPromise(deployedConfiguration.getCustomStoreClassName()).get(TIMEOUT_SECONDS, TimeUnit.SECONDS); return (T) deployedCacheStoreMetadata.getLoaderWriterRawInstance(); } catch (InterruptedException | ExecutionException e) { throw new IllegalStateException("An error occurred while processing the deployment", e); } catch (TimeoutException e) { InfinispanLogger.ROOT_LOGGER.error("Could not get Custom Cache Store metadata (" + deployedConfiguration.getCustomStoreClassName() + ") within given time.", e); } } return null; }
Source:
public ServerConfigurationNotFoundException(String serverId) { super(serverId == null || serverId.isEmpty() ? "Server Id not supplied and no default server could be found" : "Server configuration, " + serverId + ", not found."); }

Target:
public ServerConfigurationNotFoundException(String serverId) { super( serverId == null || serverId.isEmpty() ? "Server Id not supplied and no default server could be found" : "Server configuration, '" + serverId + "', not found. The serverId parameter needs to match the Server ID of a configured OctopusDeploy server at Manage Jenkins -> Configure System -> OctopusDeploy Plugin"); }
Source:
public void filterByThreadName(String name) { ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace == null) { return; } List<Integer> TIDS = findMatchName(name, trace); if (TIDS.size() == 0) { return; } String regexList = ""; Integer index = 0; for (Integer TID : TIDS) { regexList += " TID == " + TID; index++; if (index != TIDS.size()) { regexList += " ||"; } } applyGlobalFilter(regexList); }

Target:
public void filterByThreadName(String name) { ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace == null) { return; } List<Integer> tids = findMatchName(name, trace); if (tids.size() == 0) { return; } String regexList = ""; Integer index = 0; for (Integer tid : tids) { regexList += OsStrings.tid() + IFilterStrings.EQUAL + tid; index++; if (index != tids.size()) { regexList += ' ' + IFilterStrings.OR + ' '; } } applyGlobalFilter(regexList); }
Source:
private void assemble() { for (ItemStack in : currentRecipe.input) { if (in == null) { continue; } int found = 0; for (int i = 0; i < items.length; ++i) { if (items[i] == null) { continue; } if (items[i].isItemEqual(in)) { int supply = items[i].stackSize; int toBeFound = in.stackSize - found; if (supply >= toBeFound) { found += decrStackSize(i, toBeFound).stackSize; } else { found += decrStackSize(i, supply).stackSize; } if (found >= in.stackSize) { break; } } } } }

Target:
private void assemble() { Object[] stacks; if (currentRecipe instanceof AssemblyOreRecipe) stacks = ((AssemblyOreRecipe) currentRecipe).recipe.toArray(); else stacks = currentRecipe.input; for (Object in : stacks) { if (in == null) { continue; } StackWrapper stack = new StackWrapper(in); int found = 0; for (int i = 0; i < items.length; ++i) { if (items[i] == null) { continue; } if (stack.isItemEqual(items[i])) { int supply = items[i].stackSize; int toBeFound = stack.stackSize - found; if (supply >= toBeFound) { found += decrStackSize(i, toBeFound).stackSize; } else { found += decrStackSize(i, supply).stackSize; } if (found >= stack.stackSize) { break; } } } } }
Source:
private static String getTsvFromTumorTypes(Map<String, TumorType> tumorTypes) { List<String> rows = new ArrayList<>(); rows.add(TSV_HEADER); for (String code : tumorTypes.keySet()) { TumorType tumorType = tumorTypes.get(code); Map<String, TumorType> children = tumorType.getChildren(); for (String childCode : children.keySet()) { addTumorTypeToRows(children.get(childCode), rows, new ArrayList<String>()); } } return StringUtils.join(rows, "\n"); }

Target:
private static String getTsvFromTumorTypes(Map<String, TumorType> tumorTypes) { List<String> rows = new ArrayList<>(); rows.add(TSV_HEADER); for (String code : tumorTypes.keySet()) { TumorType tumorType = tumorTypes.get(code); Map<String, TumorType> children = tumorType.getChildren(); for (String childCode : children.keySet()) { addTumorTypeToRows(children.get(childCode), rows, new ArrayList<String>()); } } return StringUtils.join(rows, "\n") + "\n"; }
Source:
public Result apply(AggregationNode node, Captures captures, Context context) { boolean anyRewritten = false; ImmutableMap.Builder<Symbol, Aggregation> aggregations = ImmutableMap.builder(); for (Map.Entry<Symbol, Aggregation> entry : node.getAggregations().entrySet()) { Aggregation aggregation = entry.getValue(); if (functionRegistry.getAggregateFunctionImplementation(aggregation.getSignature()).isOrderSensitive()) { aggregations.put(entry); } else if (aggregation.getOrderBy().isEmpty()) { aggregations.put(entry); } else { anyRewritten = true; aggregations.put(entry.getKey(), new Aggregation(aggregation.getCall(), aggregation.getSignature(), aggregation.getMask(), ImmutableList.of(), ImmutableList.of())); } } if (!anyRewritten) { return Result.empty(); } return Result.ofPlanNode(new AggregationNode(node.getId(), node.getSource(), aggregations.build(), node.getGroupingSets(), node.getStep(), node.getHashSymbol(), node.getGroupIdSymbol())); }

Target:
public Result apply(AggregationNode node, Captures captures, Context context) { if (node.getAggregations().values().stream().allMatch(aggregation -> aggregation.getOrderBy().isEmpty())) { return Result.empty(); } boolean anyRewritten = false; ImmutableMap.Builder<Symbol, Aggregation> aggregations = ImmutableMap.builder(); for (Map.Entry<Symbol, Aggregation> entry : node.getAggregations().entrySet()) { Aggregation aggregation = entry.getValue(); if (aggregation.getOrderBy().isEmpty()) { aggregations.put(entry); } else if (functionRegistry.getAggregateFunctionImplementation(aggregation.getSignature()).isOrderSensitive()) { aggregations.put(entry); } else { anyRewritten = true; aggregations.put(entry.getKey(), new Aggregation(aggregation.getCall(), aggregation.getSignature(), aggregation.getMask(), ImmutableList.of(), ImmutableList.of())); } } if (!anyRewritten) { return Result.empty(); } return Result.ofPlanNode(new AggregationNode(node.getId(), node.getSource(), aggregations.build(), node.getGroupingSets(), node.getStep(), node.getHashSymbol(), node.getGroupIdSymbol())); }
Source:
public Flux<Long> scheduleMessages(Iterable<ServiceBusMessage> messages, OffsetDateTime scheduledEnqueueTime, ServiceBusTransactionContext transactionContext) { if (Objects.isNull(messages)) { return fluxError(logger, new NullPointerException("'messages' cannot be null.")); } if (Objects.isNull(scheduledEnqueueTime)) { return fluxError(logger, new NullPointerException("'scheduledEnqueueTime' cannot be null.")); } return getSendLink().flatMapMany(link -> link.getLinkSize() .flatMapMany(size -> { int maxSize = size > 0 ? size : MAX_MESSAGE_LENGTH_BYTES; final CreateBatchOptions batchOptions = new CreateBatchOptions(); batchOptions.setMaximumSizeInBytes(maxSize); return createBatch(batchOptions).flatMapMany(messageBatch -> { AtomicInteger index = new AtomicInteger(); messages.forEach(message -> { index.incrementAndGet(); boolean added = messageBatch.tryAdd(message); if (!added) { final String error = String.format(Locale.US, "Messages exceed max allowed size '%s' bytes for all the messages together." + " Failed to add message at index '%s'.", maxSize, index.get()); throw logger.logExceptionAsError(new AmqpException(false, AmqpErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, error, link.getErrorContext())); } }); return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityName, entityType)) .flatMapMany(managementNode -> managementNode.schedule(messageBatch.getMessages(), scheduledEnqueueTime, messageBatch.getMaxSizeInBytes(), link.getLinkName(), transactionContext)); }); })); }

Target:
public Flux<Long> scheduleMessages(Iterable<ServiceBusMessage> messages, OffsetDateTime scheduledEnqueueTime, ServiceBusTransactionContext transactionContext) { if (Objects.isNull(messages)) { return fluxError(logger, new NullPointerException("'messages' cannot be null.")); } if (Objects.isNull(scheduledEnqueueTime)) { return fluxError(logger, new NullPointerException("'scheduledEnqueueTime' cannot be null.")); } return getSendLink().flatMapMany(link -> createMessageBatch() .flatMapMany(messageBatch -> { int index = 0; for (ServiceBusMessage message : messages) { if (!messageBatch.tryAddMessage(message)) { final String error = String.format(Locale.US, "Messages exceed max allowed size for all the messages together. " + "Failed to add message at index '%s'.", index); throw logger.logExceptionAsError(new AmqpException(false, AmqpErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, error, link.getErrorContext())); } ++index; } return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityName, entityType)) .flatMapMany(managementNode -> managementNode.schedule(messageBatch.getMessages(), scheduledEnqueueTime, messageBatch.getMaxSizeInBytes(), link.getLinkName(), transactionContext)); })); }
Source:
void initTable(ApplicationConstants constants) { getTable().enableColumnResizing(); TextColumnWithTooltip<VmTemplate> nameColumn = new TextColumnWithTooltip<VmTemplate>() { @Override public String getValue(VmTemplate object) { return object.getName(); } }; getTable().addColumn(nameColumn, constants.nameTemplate(), "220px"); TextColumnWithTooltip<VmTemplate> disksColumn = new TextColumnWithTooltip<VmTemplate>() { @Override public String getValue(VmTemplate object) { return String.valueOf(object.getDiskMap().size()); } }; getTable().addColumn(disksColumn, constants.disksTemplate(), "220px"); DiskSizeColumn<VmTemplate> sizeColumn = new DiskSizeColumn<VmTemplate>() { @Override protected Long getRawValue(VmTemplate object) { return Double.valueOf(object.getActualDiskSize()).longValue(); } }; getTable().addColumn(sizeColumn, constants.actualSizeTemplate(), "220px"); FullDateTimeColumn<VmTemplate> dateColumn = new FullDateTimeColumn<VmTemplate>() { @Override protected Date getRawValue(VmTemplate object) { return object.getCreationDate(); } }; getTable().addColumn(dateColumn, constants.creationDateTemplate(), "220px"); }

Target:
void initTable(ApplicationConstants constants) { getTable().enableColumnResizing(); TextColumnWithTooltip<VmTemplate> nameColumn = new TextColumnWithTooltip<VmTemplate>() { @Override public String getValue(VmTemplate object) { return object.getName(); } }; getTable().addColumn(nameColumn, constants.nameTemplate(), "200px"); TextColumnWithTooltip<VmTemplate> disksColumn = new TextColumnWithTooltip<VmTemplate>() { @Override public String getValue(VmTemplate object) { return String.valueOf(object.getDiskMap().size()); } }; getTable().addColumn(disksColumn, constants.disksTemplate(), "200px"); DiskSizeColumn<VmTemplate> sizeColumn = new DiskSizeColumn<VmTemplate>() { @Override protected Long getRawValue(VmTemplate object) { return Double.valueOf(object.getActualDiskSize()).longValue(); } }; getTable().addColumn(sizeColumn, constants.actualSizeTemplate(), "200px"); FullDateTimeColumn<VmTemplate> dateColumn = new FullDateTimeColumn<VmTemplate>() { @Override protected Date getRawValue(VmTemplate object) { return object.getCreationDate(); } }; getTable().addColumn(dateColumn, constants.creationDateTemplate(), "200px"); }