auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void findTraditionalPageOne() throws Exception { getClient().perform(get("/api/config/submissionforms/traditionalpageone")) <START> .andExpect(status().isForbidden()); <END> String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/config/submissionforms/traditionalpageone")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$.id", is("traditionalpageone"))) .andExpect(jsonPath("$.name", is("traditionalpageone"))) .andExpect(jsonPath("$.type", is("submissionform"))) .andExpect(jsonPath("$._links.self.href", Matchers .startsWith(REST_SERVER_URL + "config/submissionforms/traditionalpageone"))) ; }</code><technical_language>isUnauthorized 403</technical_language>

Target:
public void findTraditionalPageOne() throws Exception { getClient().perform(get("/api/config/submissionforms/traditionalpageone")) .andExpect(status().isUnauthorized()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/config/submissionforms/traditionalpageone")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$.id", is("traditionalpageone"))) .andExpect(jsonPath("$.name", is("traditionalpageone"))) .andExpect(jsonPath("$.type", is("submissionform"))) .andExpect(jsonPath("$._links.self.href", Matchers .startsWith(REST_SERVER_URL + "config/submissionforms/traditionalpageone"))) ; }
Source:
<code>public OperatorCoordinator create(OperatorCoordinator.Context context) { final String coordinatorThreadName = "SourceCoordinator-" + operatorID; <START> ExecutorService coordinatorExecutor = Executors.newSingleThreadExecutor( <END> r -> new Thread(r, coordinatorThreadName)); SourceCoordinatorContext<SplitT> sourceCoordinatorContext = new SourceCoordinatorContext<>(coordinatorExecutor, coordinatorThreadName, numWorkerThreads, context); return new SourceCoordinator<>(coordinatorExecutor, source, sourceCoordinatorContext); }</code><technical_language>Executors UncaughtExceptionHandler. I suggest try reuse of existing thread factories, for example DispatcherThreadFactory for single threads, ExecutorThreadFactory for pools of threads</technical_language>

Target:
public OperatorCoordinator create(OperatorCoordinator.Context context) { final String coordinatorThreadName = "SourceCoordinator-" + operatorName; CoordinatorExecutorThreadFactory coordinatorThreadFactory = new CoordinatorExecutorThreadFactory(coordinatorThreadName); ExecutorService coordinatorExecutor = Executors.newSingleThreadExecutor(coordinatorThreadFactory); SourceCoordinatorContext<SplitT> sourceCoordinatorContext = new SourceCoordinatorContext<>(coordinatorExecutor, coordinatorThreadFactory, numWorkerThreads, context); return new SourceCoordinator<>(operatorName, coordinatorExecutor, source, sourceCoordinatorContext); }
Source:
<code>void put(Class<?> clazz, Boolean value) { if (indexedEntities != null) { throw new IllegalStateException("Autodetect mode is not enabled for cache " + cacheName); } if (value == null) { throw new IllegalArgumentException("Null values are not allowed"); } startInternalCache(); Transaction tx = transactionHelper.suspendTxIfExists(); try { while (true) { try { knownClassesCache.put(new KeyValuePair<>(cacheName, clazz), value); break; } catch (CacheException e) { <START> if (SuspectException.isSuspectExceptionInChain(e)) { <END> log.tracef("Ignoring suspect exception and retrying operation for internal cache %s", QUERY_KNOWN_CLASSES_CACHE_NAME); } else { throw e; } } } } finally { transactionHelper.resume(tx); } localCacheInsert(clazz, value); }</code><technical_language>This needed, get a SuspectException retry internally (in StateTransferInterceptor)</technical_language>

Target:
void put(Class<?> clazz, Boolean value) { if (indexedEntities != null) { throw new IllegalStateException("Autodetect mode is not enabled for cache " + cacheName); } if (value == null) { throw new IllegalArgumentException("Null values are not allowed"); } startInternalCache(); Transaction tx = transactionHelper.suspendTxIfExists(); try { knownClassesCache.put(new KeyValuePair<>(cacheName, clazz), value); } finally { transactionHelper.resume(tx); } localCacheInsert(clazz, value); }
Source:
<code>public IntegrationTestingConfig get() { return new IntegrationTestingConfig() { @Override public String getCoordinatorUrl() { return "http://" + dockerIp + ":8081"; } @Override public String getIndexerUrl() { return "http://" + dockerIp + ":8090"; } @Override public String getRouterUrl() { return "http://" + dockerIp + ":8888"; } @Override public String getBrokerUrl() { return "http://" + dockerIp + ":8082"; } @Override public String getHistoricalUrl() { return "http://" + dockerIp + ":8083"; } @Override public String getMiddleManagerHost() { return dockerIp; } @Override public String getZookeeperHosts() { <START> return "http://" + dockerIp + ":2181"; <END> } @Override public String getKafkaHost() { return "http://" + dockerIp + ":9092"; } @Override public String getProperty(String prop) { if (prop.equals("hadoopTestDir")) { return hadoopDir; } throw new UnsupportedOperationException("DockerConfigProvider does not support property " + prop); } @Override public String getUsername() { return null; } @Override public String getPassword() { return null; } }; }</code><technical_language>need http sense</technical_language>

Target:
public IntegrationTestingConfig get() { return new IntegrationTestingConfig() { @Override public String getCoordinatorUrl() { return "http://" + dockerIp + ":8081"; } @Override public String getIndexerUrl() { return "http://" + dockerIp + ":8090"; } @Override public String getRouterUrl() { return "http://" + dockerIp + ":8888"; } @Override public String getBrokerUrl() { return "http://" + dockerIp + ":8082"; } @Override public String getHistoricalUrl() { return "http://" + dockerIp + ":8083"; } @Override public String getMiddleManagerHost() { return dockerIp; } @Override public String getZookeeperHosts() { return dockerIp + ":2181"; } @Override public String getKafkaHost() { return dockerIp + ":9092"; } @Override public String getProperty(String prop) { if (prop.equals("hadoopTestDir")) { return hadoopDir; } throw new UnsupportedOperationException("DockerConfigProvider does not support property " + prop); } @Override public String getUsername() { return null; } @Override public String getPassword() { return null; } }; }
Source:
<code>public void parsePropertyFiles_Populates_Two_Files_One_Empty() { initWithProperties(SAMPLE_ONE_PROPERTIES); ReportParser reportParser = new ReportParser(configuration); propertyFiles.add(""); reportParser.parseClassificationsFiles(propertyFiles); List<Map.Entry<String, String>> returnedClassifications = configuration.getClassifications(); assertThat(returnedClassifications).hasSize(5); <START> assertThat(returnedClassifications).contains(new AbstractMap.SimpleEntry<>("AutUiVersion", "1.25.3"), Index.atIndex(1)); <END> assertThat(returnedClassifications).contains(new AbstractMap.SimpleEntry<>("firefoxVersion", "56.0"), Index.atIndex(4)); }</code><technical_language>nice if other mechanism for validating creating new AbstractMap satisfy API. If hard, OK this</technical_language>

Target:
public void parsePropertyFiles_Populates_Two_Files_One_Empty() { initWithProperties(SAMPLE_ONE_PROPERTIES); ReportParser reportParser = new ReportParser(configuration); classificationFiles.add(""); reportParser.parseClassificationsFiles(classificationFiles); List<Map.Entry<String, String>> returnedClassifications = configuration.getClassifications(); assertThat(returnedClassifications).hasSize(5); assertThat(returnedClassifications).contains(new AbstractMap.SimpleEntry<>("AutUiVersion", "1.25.3"), Index.atIndex(1)); assertThat(returnedClassifications).contains(new AbstractMap.SimpleEntry<>("firefoxVersion", "56.0"), Index.atIndex(4)); }
Source:
<code>public String includedToString() { StringBuilder sb = new StringBuilder(); if (isVisited()) { <START> Iterator it = edges.entrySet() .iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); if (((Edge) pair.getValue()).isIncluded()) { if (!((Edge) pair.getValue()).isPrinted()) { sb.append(getLabel()); sb.append(" --- "); sb.append(((Edge) pair.getValue()).getWeight()); sb.append(" --- "); sb.append(((Vertex) pair.getKey()).getLabel()); sb.append("\n"); ((Edge) pair.getValue()).setPrinted(true); } } } <END> } return sb.toString(); }</code><technical_language>Typed iterator</technical_language>

Target:
public String includedToString(){ StringBuilder sb = new StringBuilder(); if (isVisited()) { Iterator<Map.Entry<Vertex,Edge>> it = edges.entrySet().iterator(); while (it.hasNext()) { Map.Entry<Vertex,Edge> pair = it.next(); if (pair.getValue().isIncluded()) { if (!pair.getValue().isPrinted()) { sb.append(getLabel()); sb.append(" --- "); sb.append(pair.getValue().getWeight()); sb.append(" --- "); sb.append(pair.getKey().getLabel()); sb.append("\n"); pair.getValue().setPrinted(true); } } } } return sb.toString(); }
Source:
<code>public @Nullable SerialPortIdentifier getPortIdentifier(URI port) { CommPortIdentifier ident = null; if ((System.getProperty("os.name").toLowerCase().indexOf("linux") != -1)) { SerialPortUtil.appendSerialPortProperty(port.getPath()); } try { ident = CommPortIdentifier.getPortIdentifier(port.getPath()); } catch (gnu.io.NoSuchPortException e) { <START> logger.info("No SerialPortIdentifier found for: {}", port.getPath()); <END> return null; } return new SerialPortIdentifierImpl(ident); }</code><technical_language>This debug level</technical_language>

Target:
public @Nullable SerialPortIdentifier getPortIdentifier(URI port) { CommPortIdentifier ident = null; if ((System.getProperty("os.name").toLowerCase().indexOf("linux") != -1)) { SerialPortUtil.appendSerialPortProperty(port.getPath()); } try { ident = CommPortIdentifier.getPortIdentifier(port.getPath()); } catch (gnu.io.NoSuchPortException e) { logger.debug("No SerialPortIdentifier found for: {}", port.getPath()); return null; } return new SerialPortIdentifierImpl(ident); }
Source:
<code>private <T extends BaseContainer> void validateAndAssertResult(T container, boolean isValid) { Set<ConstraintViolation<T>> validate = validate(container); <START> Assert.assertTrue(isValid ? validate.isEmpty() : !validate.isEmpty()); <END> }</code><technical_language>This assertEquals instead of ternary operator</technical_language>

Target:
private <T> void validateAndAssertResult(T container, boolean isValid) { Set<ConstraintViolation<T>> validate = validator.validate(container); Assert.assertEquals(isValid, validate.isEmpty()); }
Source:
<code>private void setVmLeasesAvailability() { TModel model = getModel(); if (model.getSelectedCluster() == null) { return; } Version compVer = model.getSelectedCluster().getCompatibilityVersion(); if (model.getCustomCompatibilityVersion().getSelectedItem() != null) { compVer = model.getCustomCompatibilityVersion().getSelectedItem(); } boolean vmLeasesSupported = AsyncDataProvider.getInstance().isVmLeasesFeatureSupported(compVer); if (!vmLeasesSupported) { model.getLease().setIsChangeable(false, constants.vmLeasesSupported()); } else { boolean isLeaseStorageDomainChangeable = model.getIsHighlyAvailable().getEntity(); <START> <END> StorageDomain leaseStorageDomain = model.getLease().getSelectedItem(); if (leaseStorageDomain != null) { isLeaseStorageDomainChangeable &= leaseStorageDomain.getStatus() == StorageDomainStatus.Active; } model.getLease().setIsChangeable(isLeaseStorageDomainChangeable); if (!model.getIsHighlyAvailable().getEntity()) { model.getLease().setChangeProhibitionReason(constants.vmLeasesNotSupportedWithoutHA()); } if (leaseStorageDomain != null && leaseStorageDomain.getStatus() != StorageDomainStatus.Active) { getModel().getLease().setChangeProhibitionReason(constants.cannotEditNotActiveLeaseDomain()); } } }</code><technical_language>empty line removed.</technical_language>

Target:
private void setVmLeasesAvailability() { TModel model = getModel(); if (model.getSelectedCluster() == null) { return; } Version compVer = model.getSelectedCluster().getCompatibilityVersion(); if (model.getCustomCompatibilityVersion().getSelectedItem() != null) { compVer = model.getCustomCompatibilityVersion().getSelectedItem(); } boolean vmLeasesSupported = AsyncDataProvider.getInstance().isVmLeasesFeatureSupported(compVer); if (!vmLeasesSupported) { model.getLease().setIsChangeable(false, constants.vmLeasesSupported()); } else { StorageDomain leaseStorageDomain = model.getLease().getSelectedItem(); if (!model.getIsHighlyAvailable().getEntity()) { model.getLease().setIsChangeable(false); model.getLease().setChangeProhibitionReason(constants.vmLeasesNotSupportedWithoutHA()); } else if (leaseStorageDomain != null && leaseStorageDomain.getStatus() != StorageDomainStatus.Active) { model.getLease().setIsChangeable(false); model.getLease().setChangeProhibitionReason(constants.cannotEditNotActiveLeaseDomain()); } else { model.getLease().setIsChangeable(true); } } }
Source:
<code>public boolean checkTraceType(Class<? extends ITmfTrace> traceClass) { List<Element> elements = getElements(TmfXmlStrings.TRACETYPE); if (elements.isEmpty()) { return true; } for (Element element : elements) { String traceTypeId = element.getAttribute(TmfXmlStrings.ID); TraceTypeHelper helper = TmfTraceType.getInstance().getTraceType( <START> traceTypeId); <END> if (helper != null) { if (helper.getTrace().getClass().isAssignableFrom(traceClass)) { return true; } } } return false; }</code><technical_language>wrapping a ( is fine, in this case I improves readability (it's fine 120~ columns). A good metric is: if Gerrit wraps it, wrap it</technical_language>

Target:
public boolean checkTraceType(Class<? extends ITmfTrace> traceClass) { List<Element> elements = getElements(TmfXmlStrings.TRACETYPE); if (elements.isEmpty()) { return true; } for (Element element : elements) { String traceTypeId = element.getAttribute(TmfXmlStrings.ID); TraceTypeHelper helper = TmfTraceType.getInstance().getTraceType(traceTypeId); if (helper != null && helper.getTrace().getClass().isAssignableFrom(traceClass)) { return true; } } return false; }
Source:
<code>public void startRemoteCache(RemoteCacheHolder remoteCacheHolder) { RemoteCacheImpl<?, ?> remoteCache = remoteCacheHolder.remoteCache; <START> OperationsFactory operationsFactory = new OperationsFactory( <END> transportFactory, remoteCache.getName(), remoteCacheHolder.forceReturnValue, codec, listenerNotifier, asyncExecutorService, configuration); remoteCache.init(marshaller, asyncExecutorService, operationsFactory, configuration.keySizeEstimate(), configuration.valueSizeEstimate(), configuration.batchSize()); }</code><technical_language>Do need this public? I do package private if can</technical_language>

Target:
private void startRemoteCache(RemoteCacheHolder remoteCacheHolder) { RemoteCacheImpl<?, ?> remoteCache = remoteCacheHolder.remoteCache; OperationsFactory operationsFactory = new OperationsFactory( transportFactory, remoteCache.getName(), remoteCacheHolder.forceReturnValue, codec, listenerNotifier, asyncExecutorService, configuration); remoteCache.init(marshaller, asyncExecutorService, operationsFactory, configuration.keySizeEstimate(), configuration.valueSizeEstimate(), configuration.batchSize()); }
Source:
<code><START> private static boolean isAlternativeStereotype(BeanManagerImpl beanManager, Class<? extends Annotation> stereotype) { <END> final StereotypeModel<? extends Annotation> model = beanManager.getServices().get(MetaAnnotationStore.class).getStereotype(stereotype); if (model.isValid() && model.isAlternative()) { return true; } return false; }</code><technical_language>Is a reason this static? If not, I remove it</technical_language>

Target:
private boolean isAlternativeStereotype(BeanManagerImpl beanManager, Class<? extends Annotation> stereotype) { final StereotypeModel<? extends Annotation> model = beanManager.getServices().get(MetaAnnotationStore.class).getStereotype(stereotype); if (model.isValid() && model.isAlternative()) { return true; } return false; }
Source:
<code>private static int getGroupNumber(Pattern[] patterns, String name) { int bestIndex = patterns.length; int bestEnd = -1; int bestPos = Integer.MAX_VALUE; for (int i = 0; i < patterns.length; i++) { final Matcher matcher = patterns[i].matcher(name); if (matcher.find()) { if (matcher.start() < bestPos) { bestIndex = i; bestEnd = matcher.end(); bestPos = matcher.start(); } <START> else if (bestEnd < matcher.end()) { <END> bestIndex = i; bestEnd = matcher.end(); } } } return bestIndex; }</code><technical_language>Please matcher.end() > bestEnd. more readable this</technical_language>

Target:
private static int getGroupNumber(Pattern[] patterns, String name) { int bestIndex = patterns.length; int bestEnd = -1; int bestPos = Integer.MAX_VALUE; for (int i = 0; i < patterns.length; i++) { final Matcher matcher = patterns[i].matcher(name); if (matcher.find()) { if (matcher.start() < bestPos) { bestIndex = i; bestEnd = matcher.end(); bestPos = matcher.start(); } else if (matcher.end() > bestEnd) { bestIndex = i; bestEnd = matcher.end(); } } } return bestIndex; }
Source:
<code>public SecurityGroup removeIpPermission(IpProtocol protocol, int startPort, int endPort, Multimap<String, String> tenantIdGroupNamePairs, Iterable<String> ipRanges, Iterable<String> groupIds, SecurityGroup group) { String region = AWSUtils.getRegionFromLocationOrNull(group.getLocation()); String name = group.getName(); <START> String id = Iterables.get(client.getSecurityGroupApi().get().describeSecurityGroupsInRegion(region, name), 0).getId(); <END> IpPermission.Builder builder = IpPermission.builder(); builder.ipProtocol(protocol); builder.fromPort(startPort); builder.toPort(endPort); if (Iterables.size(ipRanges) > 0) { for (String cidr : ipRanges) { builder.cidrBlock(cidr); } } if (tenantIdGroupNamePairs.size() > 0) { for (String userId : tenantIdGroupNamePairs.keySet()) { for (String groupName : tenantIdGroupNamePairs.get(userId)) { builder.tenantIdGroupNamePair(userId, groupName); } } } client.getSecurityGroupApi().get().revokeSecurityGroupIngressInRegion(region, id, builder.build()); return getSecurityGroupById(new RegionAndName(region, group.getName()).slashEncode()); }</code><technical_language>Create a function for this line? repeated a bunch of times..</technical_language>

Target:
public SecurityGroup removeIpPermission(IpProtocol protocol, int startPort, int endPort, Multimap<String, String> tenantIdGroupNamePairs, Iterable<String> ipRanges, Iterable<String> groupIds, SecurityGroup group) { String region = AWSUtils.getRegionFromLocationOrNull(group.getLocation()); String name = group.getName(); String id = groupNameToId.apply(new RegionAndName(region, name).slashEncode()); IpPermission.Builder builder = IpPermission.builder(); builder.ipProtocol(protocol); builder.fromPort(startPort); builder.toPort(endPort); if (Iterables.size(ipRanges) > 0) { for (String cidr : ipRanges) { builder.cidrBlock(cidr); } } if (tenantIdGroupNamePairs.size() > 0) { for (String userId : tenantIdGroupNamePairs.keySet()) { for (String groupName : tenantIdGroupNamePairs.get(userId)) { builder.tenantIdGroupNamePair(userId, groupName); } } } client.getSecurityGroupApi().get().revokeSecurityGroupIngressInRegion(region, id, builder.build()); return getSecurityGroupById(new RegionAndName(region, group.getName()).slashEncode()); }
Source:
<code>private void writeMetadata(FeatureCollectionResponse featureCollection, String metadataFeatureName, BufferedWriter w) throws IOException { JDBCDataStore dataStore = getDataStoreForFeatureCollection(featureCollection); Connection cx = null; PreparedStatement stmt = null; ResultSet rs = null; try { cx = dataStore.getConnection(Transaction.AUTO_COMMIT); stmt = cx.prepareStatement("select * from " + metadataFeatureName); rs = stmt.executeQuery(); while (rs.next()) { <START> if (rs.getString(1) != null) { <END> w.write(rs.getString(1)); w.newLine(); } } w.newLine(); w.flush(); } catch (SQLException e) { LOGGER.warning(e.getMessage()); } finally { closeSafe(dataStore, cx, stmt, rs); } }</code><technical_language>store result of getString avoid duplicate getString method call? e.g. java while (rs.next()) { String = rs.getString(1); if (value != null) { w.write(value); w.newLine(); } }</technical_language>

Target:
private void writeMetadata(FeatureCollectionResponse featureCollection, String metadataFeatureName, BufferedWriter w) throws IOException { JDBCDataStore dataStore = getDataStoreForFeatureCollection(featureCollection); Connection cx = null; PreparedStatement stmt = null; ResultSet rs = null; try { cx = dataStore.getConnection(Transaction.AUTO_COMMIT); stmt = cx.prepareStatement("select * from " + metadataFeatureName); rs = stmt.executeQuery(); while (rs.next()) { String value = rs.getString(1); if (value != null) { w.write(value); w.newLine(); } } w.newLine(); w.flush(); } catch (SQLException e) { LOGGER.warning(e.getMessage()); } finally { closeSafe(dataStore, cx, stmt, rs); } }
Source:
<code>public URI getUrl() { if (uriTemplate == null) { return this.url; } final DefaultUriBuilderFactory defaultUriBuilderFactory = new DefaultUriBuilderFactory(); defaultUriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.URI_COMPONENT); <START> return defaultUriBuilderFactory.expand(uriTemplate.toString(), uriVariables); <END> }</code><technical_language>This factory a default instance, customized, a static variable is re-created for request</technical_language>

Target:
public URI getUrl() { if (uri == null) { return this.url; } return DEFAULT_URI_BUILDER_FACTORY.expand(uri, uriVariables); }
Source:
<code><START> public Response<DirectoryAsyncClient> createDirectory(String directoryName, Map<String, String> metadata) { <END> throw new UnsupportedOperationException(); }</code><technical_language>return AsyncClient here</technical_language>

Target:
public Response<DirectoryClient> createDirectory(String directoryName, Map<String, String> metadata) { throw new UnsupportedOperationException(); }
Source:
<code>private File writeInputStreamToFile(InputStream inputStream) throws IOException { if (inputStream == null) { throw new IllegalArgumentException("Invalid inputStream: " + inputStream); } File file = File.createTempFile("aws-s3", ".tmp"); if (!file.isFile()) { throw new IOException("Error creating a temporary file."); } try (OutputStream outStream = new FileOutputStream(file)) { byte[] buffer = new byte[1024]; int bytesRead; while ((bytesRead = inputStream.read(buffer)) != -1) { outStream.write(buffer, 0, bytesRead); outStream.flush(); } <START> inputStream.close(); <END> } catch (IOException e) { file.delete(); throw new IOException("Error writing the inputStream into a file.", e); } return file; }</code><technical_language>written, this inputStream closed if of code throw exception. solve this, add a finally block catch, close there, closed matter what. said, [whoever opens a stream is typically responsible for closing it](<LINK_0> customer opening InputStream, I leave customer close it</technical_language>

Target:
private File writeInputStreamToFile(InputStream inputStream) throws IOException { if (inputStream == null) { throw new IllegalArgumentException("Invalid inputStream: " + inputStream); } File file = File.createTempFile(TransferStatusUpdater.TEMP_FILE_PREFIX, ".tmp"); OutputStream outStream = new FileOutputStream(file); try { byte[] buffer = new byte[1024]; int bytesRead; while ((bytesRead = inputStream.read(buffer)) != -1) { outStream.write(buffer, 0, bytesRead); outStream.flush(); } } catch (IOException ioException) { file.delete(); throw new IOException("Error writing the inputStream into a file.", ioException); } finally { outStream.close(); } return file; }
Source:
<code>private void relaunchTask(SingularityTask task) { <START> taskManager.savePendingTask(task.getTaskRequest().getPendingTask()); <END> }</code><technical_language>iffy this here. This is partially status update handler write pending tasks, partially means reusing a pending task id. Generally SingularityScheduler do of work of creating a pending task responsibility for types of operations separate. removed bits status update handler a while avoid mutating pending task queue. Instead suggest requestManager add pending request queue. This scheduler do normal rebuild a full new pending task new unique ID pending request</technical_language>

Target:
private void relaunchTask(SingularityTask task) { SingularityPendingTask pendingTask = task.getTaskRequest().getPendingTask(); SingularityPendingRequest pendingRequest = new SingularityPendingRequestBuilder() .setRequestId(task.getTaskRequest().getRequest().getId()) .setDeployId(task.getTaskRequest().getDeploy().getId()) .setPendingType(PendingType.RETRY) .setUser(pendingTask.getUser()) .setRunId(pendingTask.getRunId()) .setCmdLineArgsList(pendingTask.getCmdLineArgsList()) .setSkipHealthchecks(pendingTask.getSkipHealthchecks()) .setMessage(pendingTask.getMessage()) .setResources(pendingTask.getResources()) .setS3UploaderAdditionalFiles(pendingTask.getS3UploaderAdditionalFiles()) .setRunAsUserOverride(pendingTask.getRunAsUserOverride()) .setEnvOverrides(pendingTask.getEnvOverrides()) .setExtraArtifacts(pendingTask.getExtraArtifacts()) .setActionId(pendingTask.getActionId()) .setRunAt(pendingTask.getPendingTaskId().getNextRunAt()) .setTimestamp(System.currentTimeMillis()) .build(); requestManager.addToPendingQueue(pendingRequest); }
Source:
<code>private static void adjustFeedbackResponseCommentId(FeedbackResponseCommentAttributes response) { FeedbackQuestionAttributes question = feedbackQuestionsPersisted.get(response.feedbackQuestionId); String newId = feedbackQuestionsLogic.getFeedbackQuestion( response.feedbackSessionName, response.courseId, question.questionNumber).getId(); feedbackQuestionIds.putIfAbsent(question.getId(), newId); <START> response.feedbackQuestionId = feedbackQuestionIds.get(question.getId()); <END> }</code><technical_language>revert two? in scope of getOrDefault</technical_language>

Target:
private static void adjustFeedbackResponseCommentId(FeedbackResponseCommentAttributes response) { FeedbackQuestionAttributes question = feedbackQuestionsPersisted.get(response.feedbackQuestionId); if (feedbackQuestionIds.containsKey(question.getId())) { response.feedbackQuestionId = feedbackQuestionIds.get(question.getId()); } else { String newId = feedbackQuestionsLogic.getFeedbackQuestion( response.feedbackSessionName, response.courseId, question.questionNumber).getId(); response.feedbackQuestionId = newId; feedbackQuestionIds.put(question.getId(), newId); } }
Source:
<code>List<String> getLogSegmentsNotInJournal() { LogSegment logSegment = log.getFirstSegment(); Offset firstOffsetInJournal = journal.getFirstOffset(); <START> List<String> logSegmentsToReturn = new ArrayList<>(); <END> while (logSegment != null) { if (!logSegment.getName().equals(firstOffsetInJournal.getName())) { logSegmentsToReturn.add(logSegment.getName()); } else { break; } logSegment = log.getNextSegment(logSegment); } return logSegmentsToReturn; }</code><technical_language>minor: logSegmentNamesToReturn</technical_language>

Target:
List<String> getLogSegmentsNotInJournal() { LogSegment logSegment = log.getFirstSegment(); Offset firstOffsetInJournal = journal.getFirstOffset(); List<String> logSegmentNamesToReturn = new ArrayList<>(); while (logSegment != null) { if (!logSegment.getName().equals(firstOffsetInJournal.getName())) { logSegmentNamesToReturn.add(logSegment.getName()); } else { break; } logSegment = log.getNextSegment(logSegment); } return logSegmentNamesToReturn.size() > 0 ? logSegmentNamesToReturn : null; }
Source:
<code>public int nextAsInt() throws NumberFormatException { long l = nextAsLong(); <START> if (l > Integer.MAX_VALUE) { <END> throw new NumberFormatException(String.format("Token '%d' cannot be interpreted as an integer as it's value is greater than %d.", l, Integer.MAX_VALUE)); } return (int) l; }</code><technical_language>l < Integer.MIN_VALUE</technical_language>

Target:
public int nextAsInt() throws NumberFormatException { long asLongValue = nextAsLong(); if (asLongValue < Integer.MIN_VALUE) { throw new NumberFormatException(String.format("Token '%d' cannot be interpreted as an integer as its value is less than %d.", asLongValue, Integer.MIN_VALUE)); } else if (asLongValue > Integer.MAX_VALUE) { throw new NumberFormatException(String.format("Token '%d' cannot be interpreted as an integer as its value is greater than %d.", asLongValue, Integer.MAX_VALUE)); } return (int) asLongValue; }
Source:
<code>public void readFromNBT(NBTTagCompound nbt) { NBTTagCompound causeTag = nbt.getCompoundTag("cause"); try { <START> cause = (Cause) Class.forName(causeTag.getString("class")).newInstance(); <END> } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) { throw new RuntimeException(e); } cause.readFromNBT(causeTag.getCompoundTag("data")); NBTTagList targetsTag = nbt.getTagList("targets", Constants.NBT.TAG_COMPOUND); IntStream.range(0, targetsTag.tagCount()).mapToObj(targetsTag::getCompoundTagAt).map(targetTag -> { Target target; try { target = (Target) Class.forName(targetTag.getString("class")).newInstance(); } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) { throw new RuntimeException(e); } target.readFromNBT(targetTag.getCompoundTag("data")); return target; }).forEach(targets::add); }</code><technical_language>read a class name NBT this. a registry instead, a BiMap<String, Class<? extends Cause>> instead. a Map<Class<?> String>, a Map<String, Supplier<Cause>> reflection time catch error</technical_language>

Target:
public void readFromNBT(NBTTagCompound nbt) { NBTTagCompound causeTag = nbt.getCompoundTag("cause"); try { cause = NBTUtilBC.readEnum(causeTag.getTag("type"), Cause.EnumCause.class).clazz.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } cause.readFromNBT(causeTag.getCompoundTag("data")); NBTUtilBC.readCompoundList(nbt.getTagList("targets", Constants.NBT.TAG_COMPOUND)).map(targetTag -> { Target target; try { target = NBTUtilBC.readEnum(targetTag.getTag("type"), Target.EnumTarget.class).clazz.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } target.readFromNBT(targetTag.getCompoundTag("data")); return target; }).forEach(targets::add); }
Source:
<code>public void postProcessClassTree(ClassTree tree) { TypesIntoElements.store(processingEnv, this, tree); DeclarationsIntoElements.store(processingEnv, this, tree); if (checker.hasOption("infer") && wholeProgramInference != null) { <START> WholeProgramInference.OutputKind outputKind = <END> "stubs".equals(checker.getOption("infer")) ? WholeProgramInference.OutputKind.STUB : WholeProgramInference.OutputKind.JAIF; wholeProgramInference.saveResults(outputKind); } }</code><technical_language>this extracted field wholeProgramInference is set, avoid re-computing this classtree</technical_language>

Target:
public void postProcessClassTree(ClassTree tree) { TypesIntoElements.store(processingEnv, this, tree); DeclarationsIntoElements.store(processingEnv, this, tree); if (wholeProgramInference != null) { wholeProgramInference.writeResultsToFile(wpiOutputFormat, this.checker); } }
Source:
<code>public void testBounceOffEventIsOnlySentToDynamicSprites() { final int testXValue = 444; final int testYValue = 555; <START> WhenBounceOffScript firstSpriteWhenBounceOffScript = new WhenBounceOffScript(null); <END> firstSpriteWhenBounceOffScript.setSpriteToBounceOffName(sprite2.getName()); firstSpriteWhenBounceOffScript.addBrick(new PlaceAtBrick(-testXValue, -testYValue)); sprite.addScript(firstSpriteWhenBounceOffScript); sprite.initializeEventThreads(EventId.START); WhenBounceOffScript secondSpriteWhenBounceOffScript = new WhenBounceOffScript(null); secondSpriteWhenBounceOffScript.setSpriteToBounceOffName(sprite.getName()); secondSpriteWhenBounceOffScript.addBrick(new PlaceAtBrick(testXValue, testYValue)); sprite2.addScript(secondSpriteWhenBounceOffScript); sprite2.initializeEventThreads(EventId.START); rule.simulateFullCollision(); while (!allActionsOfAllSpritesAreFinished()) { for (Sprite spriteOfList : project.getDefaultScene().getSpriteList()) { spriteOfList.look.act(1.0f); } } assertNotNull(sprite.look.getLookData()); assertNotNull(sprite2.look.getLookData()); assertNotSame((float) testXValue, sprite2.look.getXInUserInterfaceDimensionUnit()); assertNotSame((float) testYValue, sprite2.look.getYInUserInterfaceDimensionUnit()); assertEquals((float) -testXValue, sprite.look.getXInUserInterfaceDimensionUnit()); assertEquals((float) -testYValue, sprite.look.getYInUserInterfaceDimensionUnit()); }</code><technical_language>pass sprite2.getName() int ctor</technical_language>

Target:
public void testBounceOffEventIsOnlySentToDynamicSprites() { final int testXValue = 444; final int testYValue = 555; WhenBounceOffScript firstSpriteWhenBounceOffScript = new WhenBounceOffScript(sprite2.getName()); firstSpriteWhenBounceOffScript.addBrick(new PlaceAtBrick(-testXValue, -testYValue)); sprite.addScript(firstSpriteWhenBounceOffScript); sprite.initializeEventThreads(EventId.START); WhenBounceOffScript secondSpriteWhenBounceOffScript = new WhenBounceOffScript(sprite.getName()); secondSpriteWhenBounceOffScript.addBrick(new PlaceAtBrick(testXValue, testYValue)); sprite2.addScript(secondSpriteWhenBounceOffScript); sprite2.initializeEventThreads(EventId.START); rule.simulateFullCollision(); while (!allActionsOfAllSpritesAreFinished()) { for (Sprite spriteOfList : project.getDefaultScene().getSpriteList()) { spriteOfList.look.act(1.0f); } } assertNotEquals((float) testXValue, sprite2.look.getXInUserInterfaceDimensionUnit()); assertNotEquals((float) testYValue, sprite2.look.getYInUserInterfaceDimensionUnit()); assertEquals((float) -testXValue, sprite.look.getXInUserInterfaceDimensionUnit()); assertEquals((float) -testYValue, sprite.look.getYInUserInterfaceDimensionUnit()); }
Source:
<code>public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics) { RevisionInfo[] infos = new RevisionInfo[ids.size()]; List<RevisionInfo> infosToLoad = createRevisionInfos(ids, branchPoint, prefetchDepth, loadOnDemand, infos); List<CDORevision> primaryLoadedRevisions = null; List<InternalCDORevision> additionalRevisions = null; if (infosToLoad != null) { additionalRevisions = loadRevisions(infosToLoad, branchPoint, referenceChunk, prefetchDepth); <START> primaryLoadedRevisions = getResultsAndSynthetics(infosToLoad.toArray(new RevisionInfo[0]), synthetics); <END> } if (primaryLoadedRevisions != null) { List<CDORevision> loadedRevisions = new ArrayList<CDORevision>(primaryLoadedRevisions); if (additionalRevisions != null) { loadedRevisions.addAll(additionalRevisions); } fireEvent(new RevisionsLoadedEvent(this, loadedRevisions)); } return getResultsAndSynthetics(infos, synthetics); }</code><technical_language>I calls getResultsAndSynthetics() bad. intent</technical_language>

Target:
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics) { RevisionInfo[] infos = new RevisionInfo[ids.size()]; List<RevisionInfo> infosToLoad = createRevisionInfos(ids, branchPoint, prefetchDepth, loadOnDemand, infos); List<CDORevision> primaryLoadedRevisions = null; List<InternalCDORevision> additionalRevisions = null; if (infosToLoad != null) { additionalRevisions = loadRevisions(infosToLoad, branchPoint, referenceChunk, prefetchDepth); primaryLoadedRevisions = getResultsAndSynthetics(infosToLoad.toArray(new RevisionInfo[0]), null); } if (primaryLoadedRevisions != null) { List<CDORevision> loadedRevisions = new ArrayList<CDORevision>(primaryLoadedRevisions); if (additionalRevisions != null) { loadedRevisions.addAll(additionalRevisions); } fireEvent(new RevisionsLoadedEvent(this, loadedRevisions)); } return getResultsAndSynthetics(infos, synthetics); }
Source:
<code>void maybeAddRoutingKey(String name, Object value) { if (routingKeyValues == null || name == null || value == null || Utils.containsSpecialValue(value)) return; for (int i = 0; i < partitionKey.size(); i++) { <START> if (name.equalsIgnoreCase(partitionKey.get(i).getName())) { <END> routingKeyValues.set(i, value); return; } } }</code><technical_language>Great catch! I worry do quoted identifiers. For example a table schema: CREATE TABLE simple.blah ( "hI" int PRIMARY KEY, "Hi" int, int ) equalsIgnoreCase, "Hi" match "hI" considered part of routing key values, want. I work this use: java Metadata.handleId(name).equals(partitionKey.get(i).getName())</technical_language>

Target:
void maybeAddRoutingKey(String name, Object value) { if (routingKeyValues == null || name == null || value == null || Utils.containsSpecialValue(value)) return; for (int i = 0; i < partitionKey.size(); i++) { if (Utils.handleId(name).equals(partitionKey.get(i).getName())) { routingKeyValues.set(i, value); return; } } }
Source:
<code>private static String getIdAttribute(View element) { int id = element.getId(); if (id == View.NO_ID) { return null; } String idString = null; if (resourceHasPackage(id)) { Resources r = element.getResources(); if (r != null) { try { String prefix; String prefixSeparator; switch (id & 0xff000000) { case 0x7f000000: prefix = ""; prefixSeparator = ""; break; case 0x01000000: prefix = "android"; prefixSeparator = ":"; break; default: prefix = r.getResourcePackageName(id); prefixSeparator = ":"; break; } String typeName = r.getResourceTypeName(id); String entryName = r.getResourceEntryName(id); StringBuilder sb = new StringBuilder(1 + prefix.length() + prefixSeparator.length() + typeName.length() + 1 + entryName.length()); sb.append("@"); sb.append(prefix); sb.append(prefixSeparator); sb.append(typeName); sb.append("/"); sb.append(entryName); idString = sb.toString(); } catch (Resources.NotFoundException e) { <START> } <END> } } if (idString == null) { idString = "#" + Integer.toHexString(id); } return idString; }</code><technical_language>LogUtil -- I this means in practice; if happens, I want more info :)</technical_language>

Target:
private static String getIdAttribute(View element) { int id = element.getId(); if (id == View.NO_ID) { return null; } String idString = null; Resources r = element.getResources(); if (r != null) { try { String prefix; String prefixSeparator; switch (getResourcePackageId(id)) { case 0x7f: prefix = ""; prefixSeparator = ""; break; default: prefix = r.getResourcePackageName(id); prefixSeparator = ":"; break; } String typeName = r.getResourceTypeName(id); String entryName = r.getResourceEntryName(id); StringBuilder sb = new StringBuilder( 1 + prefix.length() + prefixSeparator.length() + typeName.length() + 1 + entryName.length()); sb.append("@"); sb.append(prefix); sb.append(prefixSeparator); sb.append(typeName); sb.append("/"); sb.append(entryName); idString = sb.toString(); } catch (Resources.NotFoundException e) { LogUtil.w(e, "Could not retrieve resource info for element: %s", element); } } if (idString == null) { idString = "#" + Integer.toHexString(id); } return idString; }
Source:
<code><START> public <T extends Object> boolean contains(AttributeDefinition<T> def) { <END> return contains(def.name()); }</code><technical_language>I <T extends Object> is needed, <T> is enough</technical_language>

Target:
public <T> boolean contains(AttributeDefinition<T> def) { return contains(def.name()); }
Source:
<code>private void handleSelectionChangedFromDiagramEditor(IWorkbenchPart part, ISelection selection) { if(isLinkingEnabled()) { if(part instanceof IEditorPart) { if(selection instanceof IStructuredSelection) { Iterator<?> selectionIterator = ((IStructuredSelection)selection).iterator(); ArrayList<Object> semanticElementList = new ArrayList<Object>(); while(selectionIterator.hasNext()) { Object currentSelection = selectionIterator.next(); Object semanticElement = EMFHelper.getEObject(currentSelection); if(semanticElement != null) { semanticElementList.add(semanticElement); } } <START> if(this instanceof NavigationTarget) { <END> revealElement(semanticElementList); } } } if(part instanceof ModelExplorerPageBookView && !selection.isEmpty()) { if(selection instanceof IStructuredSelection) { IStructuredSelection sSelection = (IStructuredSelection)selection; LinkHelperService linkService = getLinkHelperService(); ILinkHelper[] helpers = linkService.getLinkHelpersFor(sSelection.getFirstElement()); if(helpers.length > 0) { helpers[0].activateEditor(part.getSite().getPage(), sSelection); } } } } }</code><technical_language>"this" is instanceof NavigationTarget</technical_language>

Target:
private void handleSelectionChangedFromDiagramEditor(IWorkbenchPart part, ISelection selection) { if(isLinkingEnabled()) { if(part instanceof IEditorPart) { if(selection instanceof IStructuredSelection) { Iterator<?> selectionIterator = ((IStructuredSelection)selection).iterator(); ArrayList<Object> semanticElementList = new ArrayList<Object>(); while(selectionIterator.hasNext()) { Object currentSelection = selectionIterator.next(); Object semanticElement = EMFHelper.getEObject(currentSelection); if(semanticElement != null) { semanticElementList.add(semanticElement); } } revealSemanticElement(semanticElementList); } } if(part instanceof ModelExplorerPageBookView && !selection.isEmpty()) { if(selection instanceof IStructuredSelection) { IStructuredSelection sSelection = (IStructuredSelection)selection; LinkHelperService linkService = getLinkHelperService(); ILinkHelper[] helpers = linkService.getLinkHelpersFor(sSelection.getFirstElement()); if(helpers.length > 0) { helpers[0].activateEditor(part.getSite().getPage(), sSelection); } } } } }
Source:
<code>private int getSelectionValue(long time) { int thread = -1; ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace()); if (traces == null) { return thread; } for (ITmfTrace trace : traces) { if (thread > 0) { break; } LttngKernelAnalysisModule module = trace.getAnalysisModules(LttngKernelAnalysisModule.class).get(LttngKernelAnalysisModule.ID); if (module == null) { continue; } ITmfStateSystem ssq = module.getStateSystem(); if (ssq == null) { continue; } if (time >= ssq.getStartTime() && time <= ssq.getCurrentEndTime()) { List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); for (int currentThreadQuark : currentThreadQuarks) { try { ITmfStateInterval currentThreadInterval = ssq.querySingleState(time, currentThreadQuark); int currentThread = currentThreadInterval.getStateValue().unboxInt(); if (currentThread > 0) { int statusQuark = ssq.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThread), Attributes.STATUS); ITmfStateInterval statusInterval = ssq.querySingleState(time, statusQuark); if (statusInterval.getStartTime() == time) { thread = currentThread; break; } } <START> } catch (AttributeNotFoundException e) { <END> e.printStackTrace(); } catch (TimeRangeException e) { e.printStackTrace(); } catch (StateValueTypeException e) { e.printStackTrace(); } catch (StateSystemDisposedException e) { } } } } return thread; }</code><technical_language>multicatch, also, do want printstacktraces</technical_language>

Target:
private int getSelectionValue(long time) { int thread = -1; ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace()); if (traces == null) { return thread; } for (ITmfTrace trace : traces) { if (thread > 0) { break; } LttngKernelAnalysisModule module = trace.getAnalysisModules(LttngKernelAnalysisModule.class).get(LttngKernelAnalysisModule.ID); if (module == null) { continue; } ITmfStateSystem ssq = module.getStateSystem(); if (ssq == null) { continue; } if (time >= ssq.getStartTime() && time <= ssq.getCurrentEndTime()) { List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); for (int currentThreadQuark : currentThreadQuarks) { try { ITmfStateInterval currentThreadInterval = ssq.querySingleState(time, currentThreadQuark); int currentThread = currentThreadInterval.getStateValue().unboxInt(); if (currentThread > 0) { int statusQuark = ssq.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThread), Attributes.STATUS); ITmfStateInterval statusInterval = ssq.querySingleState(time, statusQuark); if (statusInterval.getStartTime() == time) { thread = currentThread; break; } } } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) { e.printStackTrace(); } catch (StateSystemDisposedException e) { } } } } return thread; }
Source:
<code>protected void onInitUI() { super.onInitUI(); setPageTitle(Util.C.projectListTitle()); initPageHeader(); projects = new ProjectsTable() { @Override protected void initColumnHeaders() { super.initColumnHeaders(); if (Gerrit.getGitwebLink() != null) { <START> table.setText(0, ProjectsTable.C_PROJECT_REPO_BROWSER, Util.C.projectRepoBrowser()); <END> table.getFlexCellFormatter(). addStyleName(0, ProjectsTable.C_PROJECT_REPO_BROWSER, Gerrit.RESOURCES.css().dataHeader()); } } @Override protected void onOpenRow(final int row) { History.newItem(link(getRowItem(row))); } private String link(final ProjectInfo item) { return Dispatcher.toProject(item.name_key()); } @Override protected void insert(int row, ProjectInfo k) { super.insert(row, k); if (Gerrit.getGitwebLink() != null) { table.getFlexCellFormatter(). addStyleName(row, ProjectsTable.C_PROJECT_REPO_BROWSER, Gerrit.RESOURCES.css().dataCell()); } } @Override protected void populate(final int row, final ProjectInfo k) { FlowPanel fp = new FlowPanel(); fp.add(new ProjectSearchLink(k.name_key())); fp.add(new HighlightingInlineHyperlink(k.name(), link(k), subname)); table.setWidget(row, ProjectsTable.C_NAME, fp); table.setText(row, ProjectsTable.C_DESCRIPTION, k.description()); GitwebLink l = Gerrit.getGitwebLink(); if (l != null) { table.setWidget(row, ProjectsTable.C_PROJECT_REPO_BROWSER, new Anchor(l.getLinkName(), false, l.toProject(k .name_key()))); } setRowItem(row, k); } }; projects.setSavePointerId(PageLinks.ADMIN_PROJECTS); add(projects); }</code><technical_language>Please wrap long lines</technical_language>

Target:
protected void onInitUI() { super.onInitUI(); setPageTitle(Util.C.projectListTitle()); initPageHeader(); projects = new ProjectsTable() { @Override protected void initColumnHeaders() { super.initColumnHeaders(); if (Gerrit.getGitwebLink() != null) { table.setText(0, ProjectsTable.C_REPO_BROWSER, Util.C.projectRepoBrowser()); table.getFlexCellFormatter(). addStyleName(0, ProjectsTable.C_REPO_BROWSER, Gerrit.RESOURCES.css().dataHeader()); } } @Override protected void onOpenRow(final int row) { History.newItem(link(getRowItem(row))); } private String link(final ProjectInfo item) { return Dispatcher.toProject(item.name_key()); } @Override protected void insert(int row, ProjectInfo k) { super.insert(row, k); if (Gerrit.getGitwebLink() != null) { table.getFlexCellFormatter(). addStyleName(row, ProjectsTable.C_REPO_BROWSER, Gerrit.RESOURCES.css().dataCell()); } } @Override protected void populate(final int row, final ProjectInfo k) { FlowPanel fp = new FlowPanel(); fp.add(new ProjectSearchLink(k.name_key())); fp.add(new HighlightingInlineHyperlink(k.name(), link(k), subname)); table.setWidget(row, ProjectsTable.C_NAME, fp); table.setText(row, ProjectsTable.C_DESCRIPTION, k.description()); GitwebLink l = Gerrit.getGitwebLink(); if (l != null) { table.setWidget(row, ProjectsTable.C_REPO_BROWSER, new Anchor(l.getLinkName(), false, l.toProject(k .name_key()))); } setRowItem(row, k); } }; projects.setSavePointerId(PageLinks.ADMIN_PROJECTS); add(projects); }
Source:
<code>public void setUp() { <START> final Props props = new Props(); <END> final Injector injector = Guice.createInjector(new AbstractModule() { @Override protected void configure() { new AzkabanCommonModule(props); } }); SERVICE_PROVIDER.unsetInjector(); SERVICE_PROVIDER.setInjector(injector); }</code><technical_language>If this logic is need, please find a reduce code duplication. azkaban.test.Utils#initServiceProvider</technical_language>

Target:
public void setUp() { initServiceProvider(); }
Source:
<code>public WordCountITCase(){ <START> this.config.setInteger(ConfigConstants.LOCAL_INSTANCE_MANAGER_NUMBER_TASK_MANAGER, 2); <END> }</code><technical_language>Nice. setting default > 1 in order test network stack cases. this result in a a problem time Travis</technical_language>

Target:
public WordCountITCase(){ setNumTaskManager(2); }