auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void setup(RequestContext ctx, MeterRegistry registry, String metricName) { if (ctx.attr(PROMETHEUS_METRICS_SET) == null) { return; } ctx.setAttr(PROMETHEUS_METRICS_SET, true); ctx.log().whenComplete().thenAccept(log -> getTimeBuilder(log, metricName).register(registry) .record(log.totalDurationNanos(), TimeUnit.NANOSECONDS)); }

Target:
public static void setup(RequestContext ctx, MeterRegistry registry, String metricName) { if (ctx.setAttrIfAbsent(PROMETHEUS_METRICS_SET, true) != null) { return; } ctx.log().whenComplete().thenAccept(log -> getTimeBuilder(log, metricName).register(registry) .record(log.totalDurationNanos(), TimeUnit.NANOSECONDS)); }
Source:
private Set<TimeDimensionProjection> resolveTimeDimensions() { Set<TimeDimensionProjection> timeDims = new LinkedHashSet<>(); entityProjection.getAttributes().stream().forEach((attribute -> { TimeDimensionColumn timeDim = schema.getTimeDimension(attribute.getName()); if (timeDim == null) { return; } Argument timeGrainArgument = attribute.getArguments().stream() .filter(attr -> attr.getName().equals("grain")) .findAny() .orElse(null); TimeGrainDefinition requestedGrainDefinition; if (timeGrainArgument == null) { requestedGrainDefinition = timeDim.getSupportedGrains().iterator().next(); } else { String requestedGrainName = timeGrainArgument.getValue().toString().toUpperCase(Locale.ENGLISH); TimeGrain requestedGrain; try { requestedGrain = TimeGrain.valueOf(requestedGrainName); } catch (IllegalArgumentException e) { throw new InvalidOperationException(String.format("Invalid grain %s", requestedGrainName)); } requestedGrainDefinition = timeDim.getSupportedGrains().stream() .filter(supportedGrainDef -> supportedGrainDef.grain().equals(requestedGrain)) .findAny() .orElseThrow(() -> new InvalidOperationException( String.format("Requested grain %s, not supported on %s", requestedGrainName, attribute.getName()))); } timeDims.add(timeDim.toProjectedDimension(requestedGrainDefinition)); })); return timeDims; }

Target:
private Set<TimeDimensionProjection> resolveTimeDimensions() { return entityProjection.getAttributes().stream() .filter(attribute -> schema.getTimeDimension(attribute.getName()) != null) .map(attribute -> { TimeDimensionColumn timeDim = schema.getTimeDimension(attribute.getName()); Argument timeGrainArgument = attribute.getArguments().stream() .filter(attr -> attr.getName().equals("grain")) .findAny() .orElse(null); TimeGrainDefinition requestedGrainDefinition; if (timeGrainArgument == null) { requestedGrainDefinition = timeDim.getSupportedGrains().stream() .findFirst() .orElseThrow(() -> new IllegalStateException( String.format("Requested default grain, no grain defined on %s", attribute.getName()))); } else { String requestedGrainName = timeGrainArgument.getValue().toString().toUpperCase(Locale.ENGLISH); TimeGrain requestedGrain; try { requestedGrain = TimeGrain.valueOf(requestedGrainName); } catch (IllegalArgumentException e) { throw new InvalidOperationException(String.format("Invalid grain %s", requestedGrainName)); } requestedGrainDefinition = timeDim.getSupportedGrains().stream() .filter(supportedGrainDef -> supportedGrainDef.grain().equals(requestedGrain)) .findAny() .orElseThrow(() -> new InvalidOperationException( String.format("Requested grain %s, not supported on %s", requestedGrainName, attribute.getName()))); } return timeDim.toProjectedDimension(requestedGrainDefinition); }) .collect(Collectors.toCollection(LinkedHashSet::new)); }
Source:
public final int numberOfHosts() { Preconditions.checkState(thriftHosts().size() == cqlHosts().size()); return thriftHosts().size(); }

Target:
public int numberOfHosts() { return Math.max(thriftHosts().size(), cqlHosts().size()); }
Source:
private void validate(Schema inputSchema) { if (!Strings.isNullOrEmpty(featuresToExclude) && !Strings.isNullOrEmpty(featuresToInclude)) { throw new IllegalArgumentException("Cannot specify values for both featuresToInclude and featuresToExclude. " + "Please specify fields for one"); } List<String> fields = getFeatureList(inputSchema); for (String field : fields) { Schema.Field inputField = inputSchema.getField(field); Schema schema = inputField.getSchema(); Schema.Type features = schema.isNullableSimple() ? schema.getNonNullable().getType() : schema.getType(); Preconditions.checkArgument(features.isSimpleType(), "Field to be used for training must be of type number: " + "int, long, float, double but was of type %s for field %s ", features, field); if (features.equals(Schema.Type.BYTES) || features.equals(Schema.Type.STRING) || features.equals(Schema.Type.BOOLEAN)) { throw new IllegalArgumentException(String.format("Field to be used for training must be of type : int," + " double, float, long but was of type %s for field %s ", features, field)); } Preconditions.checkArgument(!features.equals(Schema.Type.NULL), "Field to classify must not be of type null"); } Schema.Field prediction = inputSchema.getField(labelField); if (labelField == null) { throw new IllegalArgumentException(String.format("Prediction field %s does not exists in the input schema", labelField)); } Schema predictionSchema = prediction.getSchema(); Schema.Type predictionFieldType = predictionSchema.isNullableSimple() ? predictionSchema.getNonNullable().getType() : predictionSchema.getType(); if (predictionFieldType != Schema.Type.DOUBLE) { throw new IllegalArgumentException(String.format("Prediction field must be of type Double, but was %s.", predictionFieldType)); } }

Target:
public void validate(Schema inputSchema) { SparkUtils.validateConfigParameters(inputSchema, featuresToInclude, featuresToExclude, labelField, cardinalityMapping); SparkUtils.validateLabelFieldForTrainer(inputSchema, labelField); }
Source:
public void shutdown() { paxosResources.leadershipComponents().shutdown(); sqliteDataSource.close(); timestampStorage.timestampCreator().close(); }

Target:
public void shutdown() { paxosResources.leadershipComponents().shutdown(); sqliteDataSource.close(); timestampStorage.close(); }
Source:
} catch (Exception e) { throw new RuntimeException("Failed to obtain okhttp HostnameVerifier", e); }

Target:
} catch (Exception e) { throw new AssertionError("Failed to obtain okhttp HostnameVerifier", e); }
Source:
public synchronized void close() throws LibraryIOException { if (!closed) { OutputStream propertiesOS = null; GenericOutputVFS goVFS = null; try { goVFS = new GenericOutputVFS(vfs); OutputVFile libraryPropertiesOut = goVFS.getRootOutputVDir().createOutputVFile(LIBRARY_PROPERTIES_VPATH); propertiesOS = libraryPropertiesOut.getOutputStream(); libraryProperties.store(propertiesOS, "Library properties"); propertiesOS.close(); try { for (InputOutputVFS intputOutputVFS : sectionVFS.values()) { intputOutputVFS.close(); } } catch (IOException e) { throw new LibraryIOException(getLocation(), e); } } catch (CannotCreateFileException e) { throw new LibraryIOException(getLocation(), e); } catch (IOException e) { throw new LibraryIOException(getLocation(), e); } finally { try { if (propertiesOS != null) { propertiesOS.close(); } if (goVFS != null) { goVFS.close(); } } catch (IOException e) { throw new LibraryIOException(getLocation(), e); } } closed = true; } }

Target:
public synchronized void close() throws LibraryIOException { if (!closed) { GenericOutputVFS goVFS = null; try { goVFS = new GenericOutputVFS(vfs); OutputVFile libraryPropertiesOut = goVFS.getRootOutputVDir().createOutputVFile(LIBRARY_PROPERTIES_VPATH); OutputStream propertiesOS = null; try { propertiesOS = libraryPropertiesOut.getOutputStream(); libraryProperties.store(propertiesOS, "Library properties"); } finally { if (propertiesOS != null) { propertiesOS.close(); } } try { for (InputOutputVFS intputOutputVFS : sectionVFS.values()) { intputOutputVFS.close(); } } catch (IOException e) { throw new LibraryIOException(getLocation(), e); } } catch (CannotCreateFileException e) { throw new LibraryIOException(getLocation(), e); } catch (IOException e) { throw new LibraryIOException(getLocation(), e); } finally { try { if (goVFS != null) { goVFS.close(); } } catch (IOException e) { throw new LibraryIOException(getLocation(), e); } } closed = true; } }
Source:
public void write(final ChannelHandlerContext context, final Object message, final ChannelPromise promise) { this.traceOperation(context, "write", message); if (message.getClass() == RntbdRequestRecord.class) { final RntbdRequestRecord record = (RntbdRequestRecord) message; this.timestamps.channelWriteAttempted(); context.writeAndFlush(this.addPendingRequestRecord(context, record), promise).addListener(completed -> { record.stage(RntbdRequestRecord.Stage.SENT); if (completed.isSuccess()) { this.timestamps.channelWriteCompleted(); } }); return; } if (message == RntbdHealthCheckRequest.MESSAGE) { context.writeAndFlush(RntbdHealthCheckRequest.MESSAGE, promise).addListener(completed -> { if (completed.isSuccess()) { this.timestamps.channelPingCompleted(); } }); return; } final IllegalStateException error = new IllegalStateException(lenientFormat("message of %s: %s", message.getClass(), message)); reportIssue(context, "", error); this.exceptionCaught(context, error); }

Target:
public void write(final ChannelHandlerContext context, final Object message, final ChannelPromise promise) { this.traceOperation(context, "write", message); if (message.getClass() == RntbdRequestRecord.class) { final RntbdRequestRecord record = (RntbdRequestRecord) message; this.timestamps.channelWriteAttempted(); context.write(this.addPendingRequestRecord(context, record), promise).addListener(completed -> { record.stage(RntbdRequestRecord.Stage.SENT); if (completed.isSuccess()) { this.timestamps.channelWriteCompleted(); } }); return; } if (message == RntbdHealthCheckRequest.MESSAGE) { context.writeAndFlush(RntbdHealthCheckRequest.MESSAGE, promise).addListener(completed -> { if (completed.isSuccess()) { this.timestamps.channelPingCompleted(); } }); return; } final IllegalStateException error = new IllegalStateException(lenientFormat("message of %s: %s", message.getClass(), message)); reportIssue(context, "", error); this.exceptionCaught(context, error); }
Source:
public void toJSON(OutputWriter extensionWriter, PluginInfo extension) { super.toJSON(extensionWriter, extension); ConfigRepoPluginInfo configRepoPluginInfo = (ConfigRepoPluginInfo) extension; if (configRepoPluginInfo.getCapabilities() != null) { extensionWriter.addChild("capabilities", capabilitiesWriter -> capabilitiesWriter.add("supports_pipeline_export", configRepoPluginInfo.getCapabilities().isSupportsPipelineExport()) .add("supports_parse_content", configRepoPluginInfo.getCapabilities().isSupportsParseContent())); } }

Target:
public void toJSON(OutputWriter extensionWriter, PluginInfo extension) { super.toJSON(extensionWriter, extension); ConfigRepoPluginInfo configRepoPluginInfo = (ConfigRepoPluginInfo) extension; extensionWriter.addChild("capabilities", capabilitiesWriter -> capabilitiesWriter.add("supports_pipeline_export", configRepoPluginInfo.getCapabilities().isSupportsPipelineExport()) .add("supports_parse_content", configRepoPluginInfo.getCapabilities().isSupportsParseContent())); }
Source:
public RabbitMQProducer(RabbitMQStore store) { if (store == null) { log.error("Cannot initialize."); return; } this.store = store; isInitialized = true; }

Target:
public RabbitMQProducer(RabbitMQStore store) { if (store == null) { log.error("Cannot initialize producer: " + getId()); return; } this.store = store; isInitialized = true; }
Source:
public void configureCloud() throws Exception { cloud = setupCloud(); createSecret(cloud.connect()); cloud.getTemplates().clear(); cloud.addTemplate(buildBusyboxTemplate("busybox")); URL url = r.getURL(); String hostAddress = System.getProperty("jenkins.host.address"); if (hostAddress == null) { hostAddress = InetAddress.getLocalHost().getHostAddress(); } URL nonLocalhostUrl = new URL(url.getProtocol(), hostAddress, url.getPort(), url.getFile()); JenkinsLocationConfiguration.get().setUrl(nonLocalhostUrl.toString()); r.jenkins.clouds.add(cloud); DescribableList<NodeProperty<?>, NodePropertyDescriptor> list = r.jenkins.getGlobalNodeProperties(); list.getAll(hudson.slaves.EnvironmentVariablesNodeProperty.class); EnvironmentVariablesNodeProperty newEnvVarsNodeProperty = new hudson.slaves.EnvironmentVariablesNodeProperty(); list.add(newEnvVarsNodeProperty); EnvVars envVars = newEnvVarsNodeProperty.getEnvVars(); envVars.put("GLOBAL", "GLOBAL"); r.jenkins.save(); }

Target:
public void configureCloud() throws Exception { cloud = setupCloud(this); createSecret(cloud.connect()); cloud.getTemplates().clear(); cloud.addTemplate(buildBusyboxTemplate("busybox")); URL url = r.getURL(); String hostAddress = System.getProperty("jenkins.host.address"); if (hostAddress == null) { hostAddress = InetAddress.getLocalHost().getHostAddress(); } URL nonLocalhostUrl = new URL(url.getProtocol(), hostAddress, url.getPort(), url.getFile()); JenkinsLocationConfiguration.get().setUrl(nonLocalhostUrl.toString()); r.jenkins.clouds.add(cloud); DescribableList<NodeProperty<?>, NodePropertyDescriptor> list = r.jenkins.getGlobalNodeProperties(); EnvironmentVariablesNodeProperty newEnvVarsNodeProperty = new hudson.slaves.EnvironmentVariablesNodeProperty(); list.add(newEnvVarsNodeProperty); EnvVars envVars = newEnvVarsNodeProperty.getEnvVars(); envVars.put("GLOBAL", "GLOBAL"); envVars.put("JAVA_HOME_X", "java-home-x"); r.jenkins.save(); }
Source:
private void upsertWorkerTokensInCreds(Map<String, String> creds, String user, String topologyId) { if (workerTokenManager != null) { final long renewIfExpirationBefore = workerTokenManager.getMaxExpirationTimeForRenewal(); for (WorkerTokenServiceType type : WorkerTokenServiceType.values()) { boolean shouldAdd = true; WorkerToken oldToken = AuthUtils.readWorkerToken(creds, type); if (oldToken != null) { try { WorkerTokenInfo info = AuthUtils.getWorkerTokenInfo(oldToken); if (info.is_set_expirationTimeMillis() || info.get_expirationTimeMillis() > renewIfExpirationBefore) { shouldAdd = false; } } catch (Exception e) { LOG.error("Could not deserialize token info", e); } } if (shouldAdd) { AuthUtils.setWorkerToken(creds, workerTokenManager.createOrUpdateTokenFor(type, user, topologyId)); } } stormClusterState.removeExpiredWorkerKeys(topologyId); } }

Target:
private void upsertWorkerTokensInCreds(Map<String, String> creds, String user, String topologyId) { if (workerTokenManager != null) { final long renewIfExpirationBefore = workerTokenManager.getMaxExpirationTimeForRenewal(); for (WorkerTokenServiceType type : WorkerTokenServiceType.values()) { boolean shouldAdd = true; WorkerToken oldToken = AuthUtils.readWorkerToken(creds, type); if (oldToken != null) { try { WorkerTokenInfo info = AuthUtils.getWorkerTokenInfo(oldToken); if (info.is_set_expirationTimeMillis() || info.get_expirationTimeMillis() > renewIfExpirationBefore) { shouldAdd = false; } } catch (Exception e) { LOG.error("Could not deserialize token info", e); } } if (shouldAdd) { AuthUtils.setWorkerToken(creds, workerTokenManager.createOrUpdateTokenFor(type, user, topologyId)); } } stormClusterState.removeExpiredPrivateWorkerKeys(topologyId); } }
Source:
public DeviceWithState deserialize(Map<String, Object> map) { DeviceBuildInfo buildInfo = new DeviceBuildInfo( MapUtils.<String>getOrThrow(map, "manufacturer"), MapUtils.<String>getOrThrow(map, "model"), MapUtils.<String>getOrThrow(map, "osVersion"), MapUtils.<Integer>getOrThrow(map, "apiLevel"), MapUtils.<String>getOrThrow(map, "osBuild"), MapUtils.<String>getOrThrow(map, "fingerprint"), MapUtils.<String>getOrThrow(map, "tags"), MapUtils.<String>getOrThrow(map, "brand"), MapUtils.<String[]>getOrThrow(map, "cpuAbis") ); String time = MapUtils.getOrNull(map, "time"); return new DeviceWithState( buildInfo, buildInfo.getCpuAbis(), MapUtils.<Boolean>getOrNull(map, "jailbroken"), MapUtils.<String>getOrNull(map, "id"), MapUtils.<String>getOrNull(map, "locale"), MapUtils.<Long>getOrNull(map, "totalMemory"), MapUtils.<Long>getOrNull(map, "freeDisk"), MapUtils.<Long>getOrNull(map, "freeMemory"), MapUtils.<String>getOrNull(map, "orientation"), DateUtils.fromIso8601(time) ); }

Target:
public DeviceWithState deserialize(Map<String, Object> map) { DeviceBuildInfo buildInfo = new DeviceBuildInfo( MapUtils.<String>getOrThrow(map, "manufacturer"), MapUtils.<String>getOrThrow(map, "model"), MapUtils.<String>getOrThrow(map, "osVersion"), MapUtils.<Integer>getOrThrow(map, "apiLevel"), MapUtils.<String>getOrThrow(map, "osBuild"), MapUtils.<String>getOrThrow(map, "fingerprint"), MapUtils.<String>getOrThrow(map, "tags"), MapUtils.<String>getOrThrow(map, "brand"), MapUtils.<String[]>getOrThrow(map, "cpuAbis") ); String time = MapUtils.getOrNull(map, "time"); Date date = null; if (time != null) { date = DateUtils.fromIso8601(time); } return new DeviceWithState( buildInfo, MapUtils.<Boolean>getOrNull(map, "jailbroken"), MapUtils.<String>getOrNull(map, "id"), MapUtils.<String>getOrNull(map, "locale"), MapUtils.<Long>getOrNull(map, "totalMemory"), MapUtils.<Long>getOrNull(map, "freeDisk"), MapUtils.<Long>getOrNull(map, "freeMemory"), MapUtils.<String>getOrNull(map, "orientation"), date ); }
Source:
public void close() { rateLimiters.read().close(); rateLimiters.write().close(); }

Target:
public void close() { try { rateLimiters.read().close(); } finally { rateLimiters.write().close(); } }
Source:
public Side getOpposite() { if (this == OFFENSE) { return DEFENSE; } else { return OFFENSE; } }

Target:
public Side getOpposite() { return this == OFFENSE ? DEFENSE : OFFENSE; }
Source:
public void testAddComponentWithLeakAwareByteBuf() { NoopResourceLeakTracker<ByteBuf> tracker = new NoopResourceLeakTracker<ByteBuf>(); ByteBuf buffer = wrappedBuffer("hello world".getBytes()).slice(6, 5); ByteBuf leakAwareBuf = wrap(buffer, tracker); CompositeByteBuf composite = compositeBuffer(); composite.addComponent(true, leakAwareBuf); byte[] result = new byte[5]; composite.component(0).readBytes(result); assertArrayEquals("world".getBytes(), result); }

Target:
public void testAddComponentWithLeakAwareByteBuf() { NoopResourceLeakTracker<ByteBuf> tracker = new NoopResourceLeakTracker<ByteBuf>(); ByteBuf buffer = wrappedBuffer("hello world".getBytes(CharsetUtil.US_ASCII)).slice(6, 5); ByteBuf leakAwareBuf = wrap(buffer, tracker); CompositeByteBuf composite = compositeBuffer(); composite.addComponent(true, leakAwareBuf); byte[] result = new byte[5]; composite.component(0).readBytes(result); assertArrayEquals("world".getBytes(CharsetUtil.US_ASCII), result); composite.release(); }
Source:
protected void scriptConsoleInitialized(ScriptConsole console){ console.getCommand().addInputStreamListener(new ChartStreamDaemon2(console, dataSet, parser)); try { IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(GraphingPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); IViewPart ivp = p.showView(GraphSelectorView.ID); String name = console.getName(); ((GraphSelectorView)ivp).createScriptSet(name.substring(name.lastIndexOf('/')+1), dataSet); } catch(WorkbenchException we) { we.printStackTrace(); } }

Target:
protected void scriptConsoleInitialized(ScriptConsole console){ console.getCommand().addInputStreamListener(new ChartStreamDaemon2(console, dataSet, parser)); try { IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(GraphingPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); IViewPart ivp = p.showView(GraphSelectorView.ID); String name = console.getName(); ((GraphSelectorView)ivp).createScriptSet(name.substring(name.lastIndexOf('/')+1), dataSet); } catch(WorkbenchException we) { MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.RunScriptChartAction_couldNotSwitchToGraphicPerspective, Messages.RunScriptChartAction_couldNotSwitchToGraphicPerspective + ": " + we.getMessage()); } }
Source:
public InputStream getInputStream(GzipEntry entry) { if (entry.equals(fEntry)) { return fInternalEntryStream; } throw new IllegalArgumentException(); }

Target:
public InputStream getInputStream(GzipEntry entry) { if (entry != fEntry) { throw new IllegalArgumentException(); } return fInternalEntryStream; }
Source:
public JobResult process(final Job job) { String path = (String) job.getProperty(CacheInvalidationJobConstants.PAYLOAD_KEY_DATA_CHANGE_PATH); if (StringUtils.isEmpty(path)) { log.error("Invalidation job doesn't have path information."); return JobResult.CANCEL; } invalidate(path); if(invalidateRefs) { invalidateReferences(path); } log.trace("Invalidation job for the path '[}' processed.", path); return JobResult.OK; }

Target:
public JobResult process(final Job job) { String path = (String) job.getProperty(CacheInvalidationJobConstants.PAYLOAD_KEY_DATA_CHANGE_PATH); if (StringUtils.isEmpty(path)) { log.error("Invalidation job doesn't have path information."); return JobResult.CANCEL; } invalidate(path); if(invalidateRefs) { invalidateReferences(path); } log.trace("Invalidation job for the path [ ] processed.", path); return JobResult.OK; }
Source:
public void instrumentationSmokeTest() throws IOException { getTimestampService(CLIENT_1).getFreshTimestamp(); getLockService(CLIENT_1).currentTimeMillis(); JsonNode metrics = getMetricsOutput(); System.out.println(new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT).writeValueAsString(metrics)); assertContainsTimer(metrics, "com.palantir.atlasdb.timelock.paxos.ManagedTimestampService.test.getFreshTimestamp"); assertContainsTimer(metrics, "com.palantir.lock.LockService.test.currentTimeMillis"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosLearner.learn"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosAcceptor.accept"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosProposer.propose"); assertContainsTimer(metrics, "com.palantir.leader.PingableLeader.ping"); assertContainsTimer(metrics, "com.palantir.leader.LeaderElectionService.blockOnBecomingLeader"); assertContainsTimer(metrics, "com.palantir.timestamp.TimestampBoundStore.test.getUpperLimit"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosLearner.test.getGreatestLearnedValue"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosAcceptor.test.accept"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosProposer.test.propose"); }

Target:
public void instrumentationSmokeTest() throws IOException { getTimestampService(CLIENT_1).getFreshTimestamp(); getLockService(CLIENT_1).currentTimeMillis(); JsonNode metrics = getMetricsOutput(); assertContainsTimer(metrics, "com.palantir.atlasdb.timelock.paxos.ManagedTimestampService.test.getFreshTimestamp"); assertContainsTimer(metrics, "com.palantir.lock.LockService.test.currentTimeMillis"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosLearner.learn"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosAcceptor.accept"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosProposer.propose"); assertContainsTimer(metrics, "com.palantir.leader.PingableLeader.ping"); assertContainsTimer(metrics, "com.palantir.leader.LeaderElectionService.blockOnBecomingLeader"); assertContainsTimer(metrics, "com.palantir.timestamp.TimestampBoundStore.test.getUpperLimit"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosLearner.test.getGreatestLearnedValue"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosAcceptor.test.accept"); assertContainsTimer(metrics, "com.palantir.paxos.PaxosProposer.test.propose"); }
Source:
protected String formatTime(String time) { long microseconds = 0; try { String[] times = time.split("\\."); microseconds += Long.parseLong(times[0]) * 1000000; microseconds += Long.parseLong(times[1]); } catch (NumberFormatException ex) { GdbPlugin.log(ex); } Date date = new Date(microseconds / 1000); return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date); }

Target:
protected String formatTime(String time) { long milliseconds = getTimeMilliseconds(time); Date date = new Date(milliseconds); long currentTime = System.currentTimeMillis(); long days = TimeUnit.MILLISECONDS.toDays(currentTime - milliseconds); if (days == 0) { return TracepointsMessages.bind(TracepointsMessages.TraceControlView_today, DateFormat.getTimeInstance(DateFormat.SHORT).format(date)); } else if (days == 1) { return TracepointsMessages.bind(TracepointsMessages.TraceControlView_yesterday, DateFormat.getTimeInstance(DateFormat.SHORT).format(date)); } return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date); }
Source:
public Color getColor(RGB rgb) { Color color = fColorTable.get(rgb); if (color == null) { Display.getDefault().syncExec(() -> fColorTable.put(rgb, new Color(Display.getCurrent(), rgb))); color = fColorTable.get(rgb); } return color; }

Target:
public Color getColor(RGB rgb) { Color color = fColorTable.get(rgb); if (color == null) { PlatformUI.getWorkbench().getDisplay().syncExec(() -> fColorTable.put(rgb, new Color(Display.getCurrent(), rgb))); color = fColorTable.get(rgb); } return color; }
Source:
public void resetPassword(String userId, String token, String newPassword) throws com.dotmarketing.business.NoSuchUserException, DotSecurityException, DotInvalidTokenException, DotInvalidPasswordException { try { if(UtilMethods.isSet(userId) && UtilMethods.isSet(token)) { User user = APILocator.getUserAPI().loadUserById(userId); if (user == null){ throw new com.dotmarketing.business.NoSuchUserException(""); } String tokenInfo = user.getIcqId(); if(UtilMethods.isSet(tokenInfo) && tokenInfo.matches("^[a-zA-Z0-9]+:[0-9]+$")) { String userToken = tokenInfo.substring(0,tokenInfo.indexOf(':')); if(userToken.equals(token)) { Calendar ttl = Calendar.getInstance(); ttl.setTimeInMillis(Long.parseLong(tokenInfo.substring(tokenInfo.indexOf(':')+1))); ttl.add(Calendar.MINUTE, Config.getIntProperty("RECOVER_PASSWORD_TOKEN_TTL_MINS", 20)); if(ttl.after(Calendar.getInstance())) { APILocator.getUserAPI().updatePassword(user, newPassword, APILocator.getUserAPI().getSystemUser(), false); } else { throw new DotInvalidTokenException(tokenInfo, true); } } else { throw new DotInvalidTokenException(tokenInfo); } }else{ throw new DotInvalidTokenException(tokenInfo); } } } catch (DotDataException e) { throw new IllegalArgumentException(); } }

Target:
public void resetPassword(String userId, String token, String newPassword) throws com.dotmarketing.business.NoSuchUserException, DotSecurityException, DotInvalidTokenException, DotInvalidPasswordException { try { if(UtilMethods.isSet(userId) && UtilMethods.isSet(token)) { User user = APILocator.getUserAPI().loadUserById(userId); if (user == null){ throw new com.dotmarketing.business.NoSuchUserException(""); } ResetPasswordTokenUtil.checkToken(user, token); } } catch (DotDataException e) { throw new IllegalArgumentException(); } }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_course_unit_video, container, false); messageContainer = view.findViewById(R.id.message_container); transcriptListView = (ListView) view.findViewById(R.id.transcript_listview); if (showCastMiniController()) { view.findViewById(R.id.fl_mini_controller).setVisibility(View.VISIBLE); } else { view.findViewById(R.id.fl_mini_controller).setVisibility(View.GONE); } return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_course_unit_video, container, false); messageContainer = view.findViewById(R.id.message_container); transcriptListView = view.findViewById(R.id.transcript_listview); if (showCastMiniController()) { view.findViewById(R.id.fl_mini_controller).setVisibility(View.VISIBLE); } else { view.findViewById(R.id.fl_mini_controller).setVisibility(View.GONE); } return view; }
Source:
public void insertUserAuthorities(UserDetails user) { for (GrantedAuthority auth : user.getAuthorities()) { getJdbcTemplate().update(createAuthoritySql, user.getUsername(), auth.getAuthority()); } }

Target:
private void insertUserAuthorities(UserDetails user) { for (GrantedAuthority auth : user.getAuthorities()) { getJdbcTemplate().update(createAuthoritySql, user.getUsername(), auth.getAuthority()); } }
Source:
public <Q, R> AsyncFuture<R> request( final GrpcDescriptor<Q, R> endpoint, final Q entity, final CallOptions options ) { return channel.doto(channel -> { final byte[] body; try { body = mapper.writeValueAsBytes(entity); } catch (JsonProcessingException e) { return async.failed(e); } final ClientCall<byte[], byte[]> call = channel.newCall(endpoint.descriptor(), options); final Metadata metadata = new Metadata(); final ResolvableFuture<R> future = async.future(); call.start(new ClientCall.Listener<byte[]>() { @Override public void onMessage(final byte[] message) { final R response; try { response = mapper.readValue(message, endpoint.responseType()); } catch (IOException e) { future.fail(e); return; } future.resolve(response); } @Override public void onClose(final Status status, final Metadata trailers) { if (status.isOk()) { if (!future.isDone()) { future.fail(new RuntimeNodeException(getUri(), "Request finished without response")); } } else { future.fail(new RuntimeNodeException(getUri(), "Request finished with status code (" + status + ")")); } } @Override public void onHeaders(final Metadata headers) { } @Override public void onReady() { } }, metadata); call.sendMessage(body); call.setMessageCompression(true); call.request(1); call.halfClose(); return future.onFailed(e -> errors.mark()); }); }

Target:
public <Q, R> AsyncFuture<R> request( final GrpcDescriptor<Q, R> endpoint, final Q entity, final CallOptions options ) { return channel.doto(channel -> { final byte[] body; try { body = mapper.writeValueAsBytes(entity); } catch (JsonProcessingException e) { return async.failed(e); } final ClientCall<byte[], byte[]> call = channel.newCall(endpoint.descriptor(), options); final Metadata metadata = new Metadata(); final ResolvableFuture<R> future = async.future(); call.start(new ClientCall.Listener<byte[]>() { @Override public void onMessage(final byte[] message) { final R response; try { response = mapper.readValue(message, endpoint.responseType()); } catch (IOException e) { future.fail(e); return; } future.resolve(response); } @Override public void onClose(final Status status, final Metadata trailers) { if (status.isOk()) { if (!future.isDone()) { future.fail(new RuntimeException("Request finished without response")); } } else { future.fail(new RuntimeException( "Request finished with status code (" + status + ")")); } } @Override public void onHeaders(final Metadata headers) { } @Override public void onReady() { } }, metadata); call.sendMessage(body); call.setMessageCompression(true); call.request(1); call.halfClose(); return future.onFailed(e -> errors.mark()); }); }
Source:
public static void build(StringBuilder result, HaxeFieldModel namedComponent, boolean isGetter) { Boolean isStatic = namedComponent.isStatic(); String name = namedComponent.getName(); String type = namedComponent.getResultType().isUnknown() ? "" : namedComponent.getResultType().toStringWithoutConstant(); if (isStatic) { result.append("static "); } result.append("function "); result.append(isGetter ? HaxePresentableUtil.getterName(name) : HaxePresentableUtil.setterName(name)); result.append("("); if (!isGetter) { result.append("value"); if (!type.isEmpty()) { result.append(":"); result.append(type); } } result.append(")"); if (isGetter && !type.isEmpty()) { result.append(":"); result.append(type); } result.append("{\n"); if (isGetter) { result.append("return "); result.append(name); result.append(";"); } else { result.append("return "); if (!isStatic) { result.append("this."); } result.append(name); result.append("= value;"); } result.append("\n}"); }

Target:
public static void build(StringBuilder result, HaxeFieldModel namedComponent, boolean isGetter) { Boolean isStatic = namedComponent.isStatic(); String name = namedComponent.getName(); String type = namedComponent.getResultType().isUnknown() ? "" : namedComponent.getResultType().toStringWithoutConstant(); if (isStatic) { result.append("static "); } result.append("function "); result.append(isGetter ? HaxePresentableUtil.getterName(name) : HaxePresentableUtil.setterName(name)); result.append("("); if (!isGetter) { result.append("value"); if (!type.isEmpty()) { result.append(":"); result.append(type); } } result.append(")"); if (!type.isEmpty()) { result.append(":"); result.append(type); } result.append("{\n"); if (isGetter) { result.append("return "); result.append(name); result.append(";"); } else { result.append("return "); if (!isStatic) { result.append("this."); } result.append(name); result.append("= value;"); } result.append("\n}"); }
Source:
private void loadConfig() { Object type = module.getConfiguration().get(SCRIPT_TYPE); Object script = module.getConfiguration().get(SCRIPT); if (isNotValid(type) || isNotValid(script)) { throw new IllegalStateException( String.format("Type is missing in the configuration of module '%s'.", module.getId())); } else { this.type = (String) type; this.script = (String) script; } }

Target:
private void loadConfig() { Object type = module.getConfiguration().get(SCRIPT_TYPE); Object script = module.getConfiguration().get(SCRIPT); if (!isValid(type)) { throw new IllegalStateException(String.format("Type is missing in the configuration of module '%s'.", module.getId())); } else if (!isValid(script)) { throw new IllegalStateException(String.format("Script is missing in the configuration of module '%s'.", module.getId())); } else { this.type = (String) type; this.script = (String) script; } }
Source:
@Test void testNiladicForBigQuery() throws Exception { final SchemaPlus rootSchema = Frameworks.createRootSchema(true); final FrameworkConfig config = Frameworks.newConfigBuilder() .parserConfig(SqlParser.config().withConformance(SqlConformanceEnum.BIG_QUERY)) .defaultSchema(rootSchema) .build(); Planner planner = Frameworks.getPlanner(config); SqlNode node = planner.parse("select current_time, current_time(), current_date, " + "current_date(), current_timestamp, current_timestamp()"); planner.validate(node); }

Target:
@Test void testNiladicForBigQuery() { sql("select current_time, current_time(), current_date, " + "current_date(), current_timestamp, current_timestamp()") .withConformance(SqlConformanceEnum.BIG_QUERY).ok(); }
Source:
public FSDataInputStream openFile(Path path, HiveFileContext hiveFileContext) throws Exception { URIStatus uriStatus = mFileSystem.getStatus(getAlluxioPath(path)); AlluxioURIStatus alluxioURIStatus = new AlluxioURIStatus(uriStatus.getFileInfo(), hiveFileContext); FileInStream fileInStream = mFileSystem.openFile(alluxioURIStatus, OpenFilePOptions.getDefaultInstance()); return new FSDataInputStream(new AlluxioCachingHdfsFileInputStream(fileInStream, fileSystem.openFile(path, hiveFileContext), cacheValidationEnabled)); }

Target:
public FSDataInputStream openFile(Path path, HiveFileContext hiveFileContext) throws Exception { URIStatus uriStatus = mFileSystem.getStatus(getAlluxioPath(path)); AlluxioURIStatus alluxioURIStatus = new AlluxioURIStatus(uriStatus.getFileInfo(), hiveFileContext); FileInStream fileInStream = mFileSystem.openFile(alluxioURIStatus, OpenFilePOptions.getDefaultInstance()); return new FSDataInputStream(new AlluxioCachingHdfsFileInputStream( fileInStream, (cacheValidationEnabled ? Optional.of(fileSystem.openFile(path, hiveFileContext)) : Optional.empty()), cacheValidationEnabled)); }
Source:
public boolean isOwner() { if (canPerform(OWN, (short) 1)) { return true; } if (!RefRight.ALL.equals(getRefName()) && getProjectControl().isOwner()) { return true; } return false; }

Target:
public boolean isOwner() { if (canPerform(OWN, (short) 1)) { return true; } if (getRefName().equals( RefRight.ALL.substring(0, RefRight.ALL.length() - 1)) && getProjectControl().isOwner()) { return true; } return false; }
Source:
public void checkIfNamespaceIsAllowed(String namespaceName) throws ValidationException { if (allowUserDefinedNamespaces) { return; } String defaultNamespace = evalPlaceholders(defaultNamespaceName, EnvironmentContext.getCurrent().getSubject(), null); if (!namespaceName.equals(defaultNamespace)) { throw new ValidationException( "User defined namespaces are not allowed. You're able to specify only admin configured which is '" + defaultNamespaceName + '\''); } }

Target:
public void checkIfNamespaceIsAllowed(String namespaceName) throws ValidationException { if (allowUserDefinedNamespaces) { return; } String defaultNamespace = evalPlaceholders(defaultNamespaceName, EnvironmentContext.getCurrent().getSubject(), null); if (!namespaceName.equals(defaultNamespace)) { throw new ValidationException( format( "User defined namespaces are not allowed. Only the default namespace '%s' is available.", defaultNamespaceName)); } }
Source:
public void init() { String multipleImportStr = System.getProperty(DASHBUILDER_RUNTIME_MULTIPLE_IMPORT, "false"); String allowExternalStr = System.getProperty(ALLOW_EXTERNAL_FILE_REGISTER_PROP, "true"); importFileLocation = System.getProperty(IMPORT_FILE_LOCATION_PROP); importsBaseDir = System.getProperty(IMPORTS_BASE_DIR_PROP, "/tmp/dashbuilder"); multipleImport = Boolean.parseBoolean(multipleImportStr); allowExternal = Boolean.parseBoolean(allowExternalStr); uploadSize = DEFAULT_UPLOAD_SIZE; String uploadSizeStr = System.getProperty(UPLOAD_SIZE_PROP); if (uploadSizeStr != null) { try { uploadSize = 1024 * Integer.parseInt(uploadSizeStr); } catch (Exception e) { logger.warn("Not able to parse upload size {}", uploadSizeStr); logger.debug("Not able to parse upload size {}", uploadSizeStr, e); } } }

Target:
public void init() { String multipleImportStr = System.getProperty(DASHBUILDER_RUNTIME_MULTIPLE_IMPORT, Boolean.FALSE.toString()); String allowExternalStr = System.getProperty(ALLOW_EXTERNAL_FILE_REGISTER_PROP, Boolean.FALSE.toString()); importFileLocation = System.getProperty(IMPORT_FILE_LOCATION_PROP); importsBaseDir = System.getProperty(IMPORTS_BASE_DIR_PROP, "/tmp/dashbuilder"); multipleImport = Boolean.parseBoolean(multipleImportStr); allowExternal = Boolean.parseBoolean(allowExternalStr); uploadSize = DEFAULT_UPLOAD_SIZE; String uploadSizeStr = System.getProperty(UPLOAD_SIZE_PROP); if (uploadSizeStr != null) { try { uploadSize = 1024 * Integer.parseInt(uploadSizeStr); } catch (Exception e) { logger.warn("Not able to parse upload size {}", uploadSizeStr); logger.debug("Not able to parse upload size {}", uploadSizeStr, e); } } }
Source:
public XWikiAttachment removeAttachment(XWikiAttachment attachmentToRemove, boolean toRecycleBin) { List<XWikiAttachment> list = getAttachmentList(); if (!list.contains(attachmentToRemove)) { attachmentToRemove = null; } else { list.remove(attachmentToRemove); this.attachmentsToRemove.add(new XWikiAttachmentToRemove(attachmentToRemove, toRecycleBin)); setMetaDataDirty(true); } return attachmentToRemove; }

Target:
public XWikiAttachment removeAttachment(XWikiAttachment attachmentToRemove, boolean toRecycleBin) { if (this.attachmentList.remove(attachmentToRemove)) { this.attachmentsToRemove.add(new XWikiAttachmentToRemove(attachmentToRemove, toRecycleBin)); setMetaDataDirty(true); } else { attachmentToRemove = null; } return attachmentToRemove; }
Source:
SearchResult queryJira(JiraCheck jiraCheck) { Map<String, String> requestParams = new HashMap<>(); requestParams.put("maxResults", "30"); requestParams.put("jql", jiraCheck.getJql()); final String jiraApiUrl = jiraCheck.getUrl() + "/rest/api/2/search"; log.debug("Retrieving jira status with JQL {}", jiraCheck.getJql()); final SearchResult searchResult; try { final String resultAsString = restClient.create() .withCredentials(jiraCheck.getUserName(), jiraCheck.getPassword()) .withQueryParameters(requestParams) .withTimeout(CloseableHttpClientRestClient.THIRTY_SECONS_IN_MS) .withHeader("accept-encoding", "application/json") .get(jiraApiUrl); searchResult = gson.fromJson(resultAsString, SearchResult.class); } catch (Exception e) { log.error("error fetching jira results", e); throw new RuntimeException(e.getMessage(), e); } if (searchResult == null) { log.error("deserialized to null. [Url= " + jiraApiUrl + ",Query=" + jiraCheck.getJql() + "]"); throw new IllegalStateException("deserialized to null. [Query=" + jiraCheck.getJql() + "]"); } return searchResult; }

Target:
SearchResult queryJira(JiraCheck jiraCheck) { Map<String, String> requestParams = new HashMap<>(); requestParams.put("maxResults", "30"); requestParams.put("jql", jiraCheck.getJql()); final String jiraApiUrl = jiraCheck.getUrl() + "/rest/api/2/search"; log.debug("Retrieving jira status with JQL {}", jiraCheck.getJql()); final SearchResult searchResult; try { final String resultAsString = restClient.create() .withCredentials(jiraCheck.getUserName(), jiraCheck.getPassword()) .withQueryParameters(requestParams) .withTimeout(CloseableHttpClientRestClient.THIRTY_SECONS_IN_MS) .withHeader("accept-encoding", "gzip;q=0") .get(jiraApiUrl); searchResult = gson.fromJson(resultAsString, SearchResult.class); } catch (Exception e) { log.error("error fetching jira results", e); throw new RuntimeException(e.getMessage(), e); } if (searchResult == null) { log.error("deserialized to null. [Url= " + jiraApiUrl + ",Query=" + jiraCheck.getJql() + "]"); throw new IllegalStateException("deserialized to null. [Query=" + jiraCheck.getJql() + "]"); } return searchResult; }
Source:
public void init() throws MessagingException { headerName = getInitParameter("headerName", String.class); if (headerName == null || headerName.equals("")) { throw new MessagingException("Please configure a header name to contain the classification (if any)."); } }

Target:
public void init() throws MessagingException { headerName = getInitParameter("headerName"); if (headerName == null || headerName.equals("")) { throw new MessagingException("Please configure a header name to contain the classification (if any)."); } }
Source:
private boolean doesPageContentsHaveContainer( final Table<String, String, Set<PersonalizedContentlet>> pageContents, final ContainerUUID containerUUID, final Container container) { if(pageContents.contains(container.getIdentifier(), containerUUID.getUUID())){ return true; } else if(pageContents.contains(container.getIdentifier(), ParseContainer.PARSE_CONTAINER_UUID_PREFIX + containerUUID.getUUID())) { return true; } else if (ContainerUUID.UUID_LEGACY_VALUE.equals(containerUUID.getUUID())) { boolean pageContenstContains = pageContents.contains(containerUUID.getIdentifier(), ContainerUUID.UUID_START_VALUE); if (!pageContenstContains && container instanceof FileAssetContainer) { pageContenstContains = pageContents.contains(container.getIdentifier(), ContainerUUID.UUID_START_VALUE); } return pageContenstContains; } else { return false; } }

Target:
protected boolean doesPageContentsHaveContainer( final Table<String, String, Set<PersonalizedContentlet>> pageContents, final ContainerUUID containerUUID, final Container container) { if(pageContents.contains(container.getIdentifier(), containerUUID.getUUID())){ return true; } else if(pageContents.contains(container.getIdentifier(), ParseContainer.PARSE_CONTAINER_UUID_PREFIX + containerUUID.getUUID())) { return true; } else if (ContainerUUID.UUID_LEGACY_VALUE.equals(containerUUID.getUUID())) { boolean pageContenstContains = pageContents.contains(containerUUID.getIdentifier(), ContainerUUID.UUID_START_VALUE); if (!pageContenstContains && container instanceof FileAssetContainer) { pageContenstContains = pageContents.contains(container.getIdentifier(), ContainerUUID.UUID_START_VALUE); } return pageContenstContains; } else { return false; } }
Source:
public void changeStatus(Integer requestId, String oldStatus, String newStatus) { Validate.isTrue(requestId != null, "Request id must be non null"); Validate.isTrue(StringUtils.isNotBlank(oldStatus), "Old status must be non-blank"); Validate.isTrue(StringUtils.isNotBlank(newStatus), "New status must be non-blank"); Validate.isTrue(!oldStatus.equals(newStatus), "Statuses must be different"); Date now = new Date(); seriesImportDao.changeStatus(new UpdateImportRequestStatusDbDto(requestId, now, oldStatus, newStatus)); }

Target:
public void changeStatus(Integer requestId, String oldStatus, String newStatus) { Validate.isTrue(requestId != null, "Request id must be non null"); Validate.isTrue(StringUtils.isNotBlank(oldStatus), "Old status must be non-blank"); Validate.isTrue(StringUtils.isNotBlank(newStatus), "New status must be non-blank"); Validate.isTrue(!oldStatus.equals(newStatus), "Statuses must be different"); Date now = new Date(); UpdateImportRequestStatusDbDto status = new UpdateImportRequestStatusDbDto(requestId, now, oldStatus, newStatus); seriesImportDao.changeStatus(status); }
Source:
public void prepare() throws Exception { projectName = NameGenerator.generate("project", 4); WorkspaceConfigDto workspace = DtoFactory.getInstance() .createDtoFromJson( readFileToString(new File(WS_CONFIG_PATH), Charset.forName("UTF-8")), WorkspaceConfigDto.class); workspace .getEnvironments() .get("replaced_name") .getMachines() .get("dev-machine") .setServers( Collections.singletonMap( GWT_CODESERVER_NAME, newDto(ServerConfigDto.class).withProtocol("http").withPort("9876"))); testWorkspace = new TestWorkspaceImpl( NameGenerator.generate("check-gwt-test", 4), testUser, 4, workspace, workspaceServiceClient); URL resource = getClass().getResource("/projects/web-gwt-java-simple"); testProjectServiceClient.importProject( testWorkspace.getId(), Paths.get(resource.toURI()), projectName, ProjectTemplates.MAVEN_SPRING); testCommandServiceClient.createCommand( "cd /projects/" + projectName + " && mvn clean install -DskipTests", BUILD_COMMAND, CUSTOM, testWorkspace.getId()); testCommandServiceClient.createCommand( "mvn clean gwt:run-codeserver -f ${current.project.path} -Dgwt.bindAddress=0.0.0.0", RUN_GWT_COMMAND, CUSTOM, testWorkspace.getId()); }

Target:
public void prepare() throws Exception { projectName = NameGenerator.generate("project", 4); WorkspaceConfigDto workspace = workspaceDtoDeserializer.deserializeWorkspaceTemplate(CODENVY_UBUNTU_JDK8); workspace .getEnvironments() .get("replaced_name") .getMachines() .get("dev-machine") .getServers() .put( GWT_CODESERVER_NAME, newDto(ServerConfigDto.class).withProtocol("http").withPort("9876")); testWorkspace = new TestWorkspaceImpl( NameGenerator.generate("check-gwt-test", 4), testUser, 4, workspace, workspaceServiceClient); URL resource = getClass().getResource("/projects/web-gwt-java-simple"); testProjectServiceClient.importProject( testWorkspace.getId(), Paths.get(resource.toURI()), projectName, ProjectTemplates.MAVEN_SPRING); testCommandServiceClient.createCommand( "cd /projects/" + projectName + " && mvn clean install -DskipTests", BUILD_COMMAND, CUSTOM, testWorkspace.getId()); testCommandServiceClient.createCommand( "mvn clean gwt:run-codeserver -f ${current.project.path} -Dgwt.bindAddress=0.0.0.0", RUN_GWT_COMMAND, CUSTOM, testWorkspace.getId()); }
Source:
public void afterClass() throws Exception { String testClassName = this.getShortClassName(); System.out.println("AfterClass: " + testClassName + " of TestTaskSchedulingTwoCurrentStates called."); super.afterClass(); }

Target:
public void afterClass() throws Exception { super.afterClass(); }
Source:
public void checkIndentation() { final DetailAST modifiers = getMainAst().findFirstToken(TokenTypes.MODIFIERS); final DetailAST ident = getMainAst().findFirstToken(TokenTypes.IDENT); if (getMainAst().getType() == TokenTypes.ANNOTATION_DEF) { checkWrappingIndentation(getMainAst(), modifiers); checkAnnotatioDefIndent(ident); } else { checkWrappingIndentation(getMainAst(), getListChild()); } if (modifiers.getChildCount() == 0) { final int lineStart = getLineStart(ident); if (!getIndent().isAcceptable(lineStart)) { logError(ident, "ident", lineStart); } } else { checkModifiers(); } super.checkIndentation(); }

Target:
public void checkIndentation() { final DetailAST modifiers = getMainAst().findFirstToken(TokenTypes.MODIFIERS); if (modifiers.getChildCount() == 0) { if (getMainAst().getType() != TokenTypes.ANNOTATION_DEF) { final DetailAST ident = getMainAst().findFirstToken(TokenTypes.IDENT); final int lineStart = getLineStart(ident); if (!getIndent().isAcceptable(lineStart)) { logError(ident, "ident", lineStart); } } } else { checkModifiers(); } if (getMainAst().getType() == TokenTypes.ANNOTATION_DEF) { final DetailAST atAst = getMainAst().findFirstToken(TokenTypes.AT); if (isOnStartOfLine(atAst)) { checkWrappingIndentation(getMainAst(), getListChild(), 0, getIndent().getFirstIndentLevel(), false); } } else { checkWrappingIndentation(getMainAst(), getListChild()); } super.checkIndentation(); }