auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public RaygunEnvironmentMessage() { try { OperatingSystemMXBean osMXBean = ManagementFactory.getOperatingSystemMXBean(); com.sun.management.OperatingSystemMXBean sunMxBean = (com.sun.management.OperatingSystemMXBean) osMXBean; architecture = sunMxBean.getArch(); processorCount = Runtime.getRuntime().availableProcessors(); windowBoundsWidth = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().width; windowBoundsHeight = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().height; locale = Locale.getDefault().getLanguage() + "-" + Locale.getDefault().getCountry(); <START> utcOffset = Calendar.getInstance().getTimeZone().getOffset(Calendar.getInstance().getTimeInMillis()) / 3600000; <END> availablePhysicalMemory = sunMxBean.getFreePhysicalMemorySize(); totalPhysicalMemory = sunMxBean.getTotalPhysicalMemorySize(); totalVirtualMemory = sunMxBean.getTotalSwapSpaceSize(); availableVirtualMemory = sunMxBean.getFreeSwapSpaceSize(); processorCount = sunMxBean.getAvailableProcessors(); osVersion = sunMxBean.getName() + " - " +sunMxBean.getVersion(); } catch (Exception e) { } }</code><technical_language>able TimeZone.getDefault().getRawOffset() / 3600000? I get value, a bit simpler</technical_language>

Target:
public RaygunEnvironmentMessage() { try { OperatingSystemMXBean osMXBean = ManagementFactory.getOperatingSystemMXBean(); com.sun.management.OperatingSystemMXBean sunMxBean = (com.sun.management.OperatingSystemMXBean) osMXBean; architecture = sunMxBean.getArch(); processorCount = Runtime.getRuntime().availableProcessors(); windowBoundsWidth = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().width; windowBoundsHeight = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().height; locale = Locale.getDefault().getLanguage() + "-" + Locale.getDefault().getCountry(); utcOffset = TimeZone.getDefault().getRawOffset() / 3600000.0; availablePhysicalMemory = sunMxBean.getFreePhysicalMemorySize(); totalPhysicalMemory = sunMxBean.getTotalPhysicalMemorySize(); totalVirtualMemory = sunMxBean.getTotalSwapSpaceSize(); availableVirtualMemory = sunMxBean.getFreeSwapSpaceSize(); processorCount = sunMxBean.getAvailableProcessors(); osVersion = sunMxBean.getName() + " - " +sunMxBean.getVersion(); } catch (Exception e) { } }
Source:
<code>protected void finishWrite() throws Exception { sequenceFile.hflush(); sequenceFile.close(); super.finishWrite(); <START> LOG.info("Closing writer with " + counter.get() + " items"); <END> }</code><technical_language>this info log spammy? Is this more of a debug thing</technical_language>

Target:
protected void finishWrite() throws Exception { sequenceFile.hflush(); sequenceFile.close(); super.finishWrite(); LOG.debug("Closing writer with " + counter.get() + " items"); }
Source:
<code>public static void validateCacheName(String name) throws IllegalArgumentException { A.ensure(name != null && !name.isEmpty(), "Cache name must not be null or empty."); <START> A.ensure(name.length() <= MAX_FILE_NAME_LENGTH, "Length of cache name can not exceed "+ MAX_FILE_NAME_LENGTH +"."); <END> }</code><technical_language>Code style issue - whitespace " +</technical_language>

Target:
public static void validateCacheName(String name) throws IllegalArgumentException { A.ensure(name != null && !name.isEmpty(), "Cache name must not be null or empty."); A.ensure(name.length() <= CACHE_NAME_MAX_LENGTH, "Length of cache name can not exceed " + CACHE_NAME_MAX_LENGTH + "."); }
Source:
<code>private KeyStore saveSecretsStore(final KeyStore keyStore) { final File secretStoreFile = new File(secretsKeyStorePath); final File secretStoreFileTmp = new File(secretStoreFile.getParent(), "dotSecretsStore_" + System.currentTimeMillis() + ".p12.tmp"); secretStoreFileTmp.getParentFile().mkdirs(); try (OutputStream fos = Files.newOutputStream(secretStoreFileTmp.toPath())) { keyStore.store(fos, loadStorePassword()); FileUtil.copyFile(secretStoreFileTmp, secretStoreFile); <START> secretStoreFileTmp.delete(); <END> } catch (Exception e) { Logger.warn(this.getClass(), "unable to save secrets store " + secretStoreFileTmp + ": " + e); throw new DotRuntimeException(e); } return keyStore; }</code><technical_language>create a temporal file FileUtil.createTemporalFile instead of handling yourself. If need do this anyhow, add a delete in a finally sentence</technical_language>

Target:
private KeyStore saveSecretsStore(final KeyStore keyStore) { final File secretStoreFile = new File(secretsKeyStorePath); final File secretStoreFileTmp = new File(secretStoreFile.getParent(), "dotSecretsStore_" + System.currentTimeMillis() + ".p12.tmp"); secretStoreFileTmp.getParentFile().mkdirs(); try (OutputStream fos = Files.newOutputStream(secretStoreFileTmp.toPath())) { keyStore.store(fos, loadStorePassword()); FileUtil.copyFile(secretStoreFileTmp, secretStoreFile); secretStoreFileTmp.delete(); } catch (Exception e) { Logger.error(this.getClass(), "unable to save secrets store " + secretStoreFileTmp + ": " + e); throw new DotRuntimeException(e); } return keyStore; }
Source:
<code>public void parseArguments(List<String> args) throws Exception { args.remove(0); ArgumentsParser parser; try (InputStream stream = getClass().getResourceAsStream("arguments.properties")) { parser = new ArgumentsParser(stream, "module"); } parser.parse(args); <START> moduleArgs = parser.getArgMap(); <END> if((Boolean)moduleArgs.get("help")) { printUsage(parser); throw new ExitException("Help", 0); } if(args.size() < 1) { logger.error("Please provide action."); throw new ExitException("Action not provided", 1); } String action = args.remove(0); actionMethod = actions.get(action); if(actionMethod == null) { throw new IllegalArgumentException( String.format("No such action '%1$s' exists for module '%2$s'", action, getName()) ); } try (InputStream stream = getClass().getResourceAsStream("arguments.properties")) { parser = new ArgumentsParser(stream, action); } parser.parse(args); actionArgs = parser.getArgMap(); List<Throwable> actionErrors = parser.getErrors(); if((Boolean)actionArgs.get("help")) { printUsage(parser); throw new ExitException("Help", 0); } else if(!actionErrors.isEmpty()) { for(Throwable t : actionErrors) { logger.error(t.getMessage()); logger.debug(t.getMessage(), t); } throw new ExitException("Parsing error", 1); } logger.debug( "Using action arguments: extension-name='{}' message='{}' level={}", actionArgs.get("extension-name"), actionArgs.get("message"), actionArgs.get("level") ); }</code><technical_language>do check for errors</technical_language>

Target:
public void parseArguments(List<String> args) throws Exception { args.remove(0); ArgumentsParser parser; try (InputStream stream = getClass().getResourceAsStream("arguments.properties")) { parser = new ArgumentsParser(stream, "module"); } parser.parse(args); moduleArgs = parser.getParsedArgs(); if((Boolean)moduleArgs.get("help")) { printUsage(parser); throw new ExitException("Help", 0); } if(!parser.getErrors().isEmpty()) { for(Throwable t : parser.getErrors()) { logger.error(t.getMessage()); logger.debug(t.getMessage(), t); } throw new ExitException("Parsing error", 1); } if(args.size() < 1) { logger.error("Please provide action."); throw new ExitException("Action not provided", 1); } String action = args.remove(0); actionMethod = actions.get(action); if(actionMethod == null) { throw new IllegalArgumentException( String.format("No such action '%1$s' exists for module '%2$s'", action, getName()) ); } try (InputStream stream = getClass().getResourceAsStream("arguments.properties")) { parser = new ArgumentsParser(stream, action); } parser.parse(args); actionArgs = parser.getParsedArgs(); if((Boolean)actionArgs.get("help")) { printUsage(parser); throw new ExitException("Help", 0); } if(!parser.getErrors().isEmpty()) { for(Throwable t : parser.getErrors()) { logger.error(t.getMessage()); logger.debug(t.getMessage(), t); } throw new ExitException("Parsing error", 1); } logger.debug( "Using action arguments: extension-name='{}' message='{}' level={}", actionArgs.get("extension-name"), actionArgs.get("message"), actionArgs.get("level") ); }
Source:
<code>void initTable(final ApplicationConstants constants) { getTable().addColumn(new HostStatusColumn(), constants.empty(), "30px"); TextColumnWithTooltip<VDS> nameColumn = new TextColumnWithTooltip<VDS>() { @Override public String getValue(VDS object) { return object.getvds_name(); } }; getTable().addColumn(nameColumn, constants.nameClusterHost()); TextColumnWithTooltip<VDS> hostColumn = new TextColumnWithTooltip<VDS>() { @Override public String getValue(VDS object) { return object.gethost_name(); } }; getTable().addColumn(hostColumn, constants.hostIpClusterHost()); TextColumnWithTooltip<VDS> statusColumn = new EnumColumn<VDS, VDSStatus>() { @Override public VDSStatus getRawValue(VDS object) { return object.getstatus(); } }; getTable().addColumn(statusColumn, constants.statusClusterHost()); <START> if (ApplicationModeHelper.getUiMode() != ApplicationMode.GlusterOnly) { <END> TextColumnWithTooltip<VDS> loadColumn = new TextColumnWithTooltip<VDS>() { @Override public String getValue(VDS object) { return object.getvm_active() + " " + constants.vmsClusterHost(); } }; getTable().addColumn(loadColumn, constants.loadClusterHost()); } }</code><technical_language>I change this (AND VIRT > 0) do say</technical_language>

Target:
void initTable(final ApplicationConstants constants) { getTable().addColumn(new HostStatusColumn(), constants.empty(), "30px"); TextColumnWithTooltip<VDS> nameColumn = new TextColumnWithTooltip<VDS>() { @Override public String getValue(VDS object) { return object.getvds_name(); } }; getTable().addColumn(nameColumn, constants.nameClusterHost()); TextColumnWithTooltip<VDS> hostColumn = new TextColumnWithTooltip<VDS>() { @Override public String getValue(VDS object) { return object.gethost_name(); } }; getTable().addColumn(hostColumn, constants.hostIpClusterHost()); TextColumnWithTooltip<VDS> statusColumn = new EnumColumn<VDS, VDSStatus>() { @Override public VDSStatus getRawValue(VDS object) { return object.getstatus(); } }; getTable().addColumn(statusColumn, constants.statusClusterHost()); if (ApplicationModeHelper.isModeSupported(ApplicationMode.VirtOnly)) { TextColumnWithTooltip<VDS> loadColumn = new TextColumnWithTooltip<VDS>() { @Override public String getValue(VDS object) { return object.getvm_active() + " " + constants.vmsClusterHost(); } }; getTable().addColumn(loadColumn, constants.loadClusterHost()); } }
Source:
<code>protected void traceAddAnnotation(Event event, Tracer tracer, long elapsed, String listener) { Map<String, AttributeValue> attributes = new HashMap<>(); attributes.put("event", AttributeValue.stringAttributeValue(event.getName())); attributes.put("listener", AttributeValue.stringAttributeValue(listener)); attributes.put("duration_ms", AttributeValue.longAttributeValue(elapsed)); EventContext eventContext = event.getContext(); if (eventContext instanceof DocumentEventContext) { <START> DocumentEventContext docContext = ((DocumentEventContext) eventContext); <END> if (docContext.getSourceDocument() != null) { Path docPath = docContext.getSourceDocument().getPath(); if (docPath != null) { attributes.put("doc", AttributeValue.stringAttributeValue(docPath.toString())); } String id = docContext.getSourceDocument().getId(); if (id != null) { attributes.put("doc_id", AttributeValue.stringAttributeValue(docContext.getSourceDocument().getId())); } } } tracer.getCurrentSpan().addAnnotation("Event fired", attributes); }</code><technical_language>Remove extra parentheses</technical_language>

Target:
protected void traceAddAnnotation(Event event, Tracer tracer, long elapsed, String listener) { Map<String, AttributeValue> attributes = new HashMap<>(); attributes.put("event", AttributeValue.stringAttributeValue(event.getName())); attributes.put("listener", AttributeValue.stringAttributeValue(listener)); attributes.put("duration_ms", AttributeValue.longAttributeValue(elapsed)); EventContext eventContext = event.getContext(); if (eventContext instanceof DocumentEventContext) { DocumentEventContext docContext = (DocumentEventContext) eventContext; if (docContext.getSourceDocument() != null) { Path docPath = docContext.getSourceDocument().getPath(); if (docPath != null) { attributes.put("doc", AttributeValue.stringAttributeValue(docPath.toString())); } String id = docContext.getSourceDocument().getId(); if (id != null) { attributes.put("doc_id", AttributeValue.stringAttributeValue(id)); } } } tracer.getCurrentSpan().addAnnotation("EventService#fireEvent Event fired", attributes); }
Source:
<code>private Iterable<ThriftStructFieldInfo> getFieldInfos(ThriftStructCodec c) { Class<? extends ThriftStructCodec> klass = c.getClass(); if (isUnion(klass)){ return getFieldInfosForUnion(klass); } else { try { Object r = klass.getMethod("fieldInfos").invoke(c); Iterable<ThriftStructFieldInfo> a = JavaConversions$.MODULE$.asJavaIterable((scala.collection.Iterable<ThriftStructFieldInfo>)r); return a; <START> } catch (Exception e) { <END> throw new RuntimeException("can not get field Info from: " + c.toString(), e); } } }</code><technical_language>exception</technical_language>

Target:
private Iterable<ThriftStructFieldInfo> getFieldInfos(ThriftStructCodec c) { Class<? extends ThriftStructCodec> klass = c.getClass(); if (isUnion(klass)){ return getFieldInfosForUnion(klass); } else { try { Object r = klass.getMethod("fieldInfos").invoke(c); Iterable<ThriftStructFieldInfo> a = JavaConversions$.MODULE$.asJavaIterable((scala.collection.Iterable<ThriftStructFieldInfo>)r); return a; } catch (ReflectiveOperationException e) { throw new ScroogeSchemaConversionException("can not get field Info from: " + c.toString(), e); } } }
Source:
<code>GHGistUpdater(GHGist base) { this.base = base; <START> this.builder = base.root.retrieve().method("POST"); <END> files = new LinkedHashMap<>(); }</code><technical_language>leave this.builder = base.retrieve() in method of this class public GHGist update() throws IOException overriding HTTP method</technical_language>

Target:
GHGistUpdater(GHGist base) { this.base = base; this.builder = base.root.createRequest(); files = new LinkedHashMap<>(); }
Source:
<code><T> Mono<Response<T>> getDocumentWithResponse(String key, Class<T> modelClass, List<String> selectedFields, RequestOptions requestOptions, Context context) { try { return restClient.documents() .getWithRestResponseAsync(key, selectedFields, RequestOptionsConverter.map(requestOptions), context) .onErrorMap(DocumentResponseConversions::exceptionMapper) .map(res -> { <START> SearchObjectMapper.getInstance().setSerializationInclusion(JsonInclude.Include.ALWAYS); <END> if (SearchDocument.class.getTypeName().equals(modelClass.getTypeName())) { TypeReference<Map<String, Object>> typeReference = new TypeReference<Map<String, Object>>() { }; SearchDocument doc = new SearchDocument(SearchObjectMapper.getInstance() .convertValue(res.getValue(), typeReference)); return new SimpleResponse<T>(res, (T) doc); } T document = SearchObjectMapper.getInstance().convertValue(res.getValue(), modelClass); return new SimpleResponse<>(res, document); }) .map(Function.identity()); } catch (RuntimeException ex) { return monoError(logger, ex); } }</code><technical_language>reason setting setSerializationInclusion property constructing mapper instance? This lead a race condition if is mutated while used</technical_language>

Target:
<T> Mono<Response<T>> getDocumentWithResponse(String key, Class<T> modelClass, List<String> selectedFields, RequestOptions requestOptions, Context context) { try { return restClient.documents() .getWithRestResponseAsync(key, selectedFields, RequestOptionsConverter.map(requestOptions), context) .onErrorMap(DocumentResponseConversions::exceptionMapper) .map(res -> { if (SearchDocument.class == modelClass) { TypeReference<Map<String, Object>> typeReference = new TypeReference<Map<String, Object>>() { }; SearchDocument doc = new SearchDocument(MAPPER.convertValue(res.getValue(), typeReference)); return new SimpleResponse<T>(res, (T) doc); } T document = MAPPER.convertValue(res.getValue(), modelClass); return new SimpleResponse<>(res, document); }) .map(Function.identity()); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
<code>public void run() { final Display display = Display.getDefault(); if ((display == null) || display.isDisposed()) { return; } Display.getDefault().asyncExec(new Runnable() { @Override public void run() { <START> if (!display.isDisposed()) { <END> scrollView.scrollBy(deltaX, deltaY); } } }); }</code><technical_language>close view ScrollView control disposed display. check if scrollView.isDisposed</technical_language>

Target:
public void run() { final Display display = Display.getDefault(); if ((display == null) || display.isDisposed()) { return; } display.asyncExec(new Runnable() { @Override public void run() { if (!scrollView.isDisposed()) { scrollView.scrollBy(deltaX, deltaY); } } }); }
Source:
<code>public void acquireToken(Activity activity, String resource, String clientId, String redirectUri, String loginHint, String extraQueryParameters, AuthenticationCallback<AuthenticationResult> callback) { redirectUri = checkInputParameters(resource, clientId, redirectUri, callback); final APIEvent apiEvent = new APIEvent(EventStrings.API_EVENT, mContext, clientId); final String requestId = Telemetry.registerNewRequest(); apiEvent.setRequestId(requestId); apiEvent.setAPIId(EventStrings.ACQUIRE_TOKEN_2); apiEvent.setAuthority(getAuthority()); <START> Telemetry.getInstance().startEvent(requestId, apiEvent.getEventName()); <END> final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, PromptBehavior.Auto, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); }</code><technical_language>) please wrap a seperate method, call method in acquire token API call. #Closed</technical_language>

Target:
public void acquireToken(Activity activity, String resource, String clientId, String redirectUri, String loginHint, String extraQueryParameters, AuthenticationCallback<AuthenticationResult> callback) { if (checkPreRequirements(resource, clientId, callback)) { final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_2); apiEvent.setLoginHint(loginHint); redirectUri = getRedirectUri(redirectUri); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, PromptBehavior.Auto, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); } }
Source:
<code>public void pidFilePreventsStart() throws Exception { Node node1 = TestUtils.createSwarmClient( j, processDestroyer, temporaryFolder, "-pidFile", getPidFile().getAbsolutePath()); TestUtils.SwarmClientProcessWrapper node2 = TestUtils.runSwarmClient( "agent_fail", j, processDestroyer, temporaryFolder, "-pidFile", getPidFile().getAbsolutePath()); <START> node2.process.waitFor(5, TimeUnit.SECONDS); <END> assertFalse("Second client should fail to start", node2.process.isAlive()); assertEquals("Exit code", 1, node2.process.exitValue()); assertTrue("Log message mentions 'already exists'", Files.readAllLines(node2.stderr.toPath()).stream().anyMatch(line -> line.contains("already exists"))); }</code><technical_language>this more bulletproof, variant of waitFor() takes arguments? Jenkins test harness puts a timeout test, if code test failed, test eventually time out. In contrast, this approach implicit assumption CI system running a speed, rely Jenkins project's CI system performance guarantees</technical_language>

Target:
public void pidFilePreventsStart() throws Exception { File pidFile = getPidFile(); TestUtils.createSwarmClient( j, processDestroyer, temporaryFolder, "-pidFile", pidFile.getAbsolutePath()); int firstClientPid = readPidFromFile(pidFile); TestUtils.SwarmClientProcessWrapper node2 = TestUtils.runSwarmClient( "agent_fail", j, processDestroyer, temporaryFolder, "-pidFile", pidFile.getAbsolutePath()); node2.process.waitFor(); assertFalse("Second client should fail to start", node2.process.isAlive()); assertEquals("Exit code", 1, node2.process.exitValue()); assertTrue( "Log message mentions 'already exists' in: " + Files.readAllLines(node2.stderr.toPath()), Files.readAllLines(node2.stderr.toPath()).stream() .anyMatch(line -> line.contains("already exists"))); assertNotNull("Original client should still be running", os.getProcess(firstClientPid)); assertEquals("PID in PID file should not change", firstClientPid, readPidFromFile(pidFile)); }
Source:
<code>private void constructFeatureModel(MultiFeatureModel fm) { fm.reset(); IFeature root; if (rootModel.getRootFeatures().length == 1) { final Feature f = rootModel.getRootFeatures()[0]; root = parseFeature(fm, null, f); } else { root = MultiFeatureModelFactory.getInstance().createFeature(fm, "Root"); Arrays.asList(rootModel.getRootFeatures()).forEach(f -> parseFeature(fm, root, f)); } fm.getStructure().setRoot(root.getStructure()); final List<Object> ownConstraints = Arrays.asList(rootModel.getOwnConstraints()); <START> Arrays.asList(rootModel.getConstraints()).stream().filter(c -> !ownConstraints.contains(c)).forEach(c -> parseConstraint(fm, c)); <END> ownConstraints.forEach(c -> parseOwnConstraint(fm, c)); Arrays.asList(rootModel.getImports()).forEach(i -> parseImport(fm, i)); fm.addAttribute(NS_ATTRIBUTE_FEATURE, NS_ATTRIBUTE_NAME, rootModel.getNamespace()); }</code><technical_language>call Arrays.stream()</technical_language>

Target:
private void constructFeatureModel(MultiFeatureModel fm) { fm.reset(); IFeature root; if (rootModel.getRootFeatures().length == 1) { final Feature f = rootModel.getRootFeatures()[0]; root = parseFeature(fm, null, f); } else { root = MultiFeatureModelFactory.getInstance().createFeature(fm, "Root"); Arrays.stream(rootModel.getRootFeatures()).forEach(f -> parseFeature(fm, root, f)); } fm.getStructure().setRoot(root.getStructure()); final List<Object> ownConstraints = Arrays.asList(rootModel.getOwnConstraints()); Arrays.stream(rootModel.getConstraints()).filter(c -> !ownConstraints.contains(c)).forEach(c -> parseConstraint(fm, c)); ownConstraints.forEach(c -> parseOwnConstraint(fm, c)); Arrays.stream(rootModel.getImports()).forEach(i -> parseImport(fm, i)); fm.addAttribute(NS_ATTRIBUTE_FEATURE, NS_ATTRIBUTE_NAME, rootModel.getNamespace()); }
Source:
<code>public static MSLevel[] cropValues() { MSLevel[] values = MSLevel.values(); MSLevel[] array = new MSLevel[values.length - 1]; <START> for (int i = 0; i < array.length; i++) <END> array[i] = values[i]; return array; }</code><technical_language>Arrays.copyOf() instead of this manually (the cropValues() function removed)</technical_language>

Target:
public static MSLevel[] cropValues() { MSLevel[] values = MSLevel.values(); return Arrays.copyOf(values, values.length-1); }
Source:
<code><START> public List<Snippet> getSnippets() throws GitLabApiException { <END> Response response = get(Response.Status.OK, getDefaultPerPageParam(), "snippets"); List<Snippet> snippets = (response.readEntity(new GenericType<List<Snippet>>() {})); for (Snippet snippet : snippets) { snippet.setContent(getSnippetContent(snippet.getId())); } return snippets; }</code><technical_language>Add a parameter this method indicating download content, i.e.: public List<Snippet> getSnippets(boolean downloadContent) throws GitLabApiException { fetching content optional based this. add another method parameter calls this method downloadContent = false . default false act GitLab Snippets API</technical_language>

Target:
public List<Snippet> getSnippets() throws GitLabApiException { return getSnippets(false); }
Source:
<code>private Map<Long, Pair<ITmfStateSystem, Integer>> getSelectedEntries(Map<String, Object> fetchParameters) { Collection<Long> selectedItems = DataProviderParameterUtils.extractSelectedItems(fetchParameters); if (selectedItems == null) { return Collections.emptyMap(); } <START> Map<Long, Pair<ITmfStateSystem, Integer>> IdToQuark = new HashMap<>(); <END> for (Long id : selectedItems) { Pair<ITmfStateSystem, Integer> pair = fIDToDisplayQuark.get(id); if (pair != null) { IdToQuark.put(id, pair); } } return IdToQuark; }</code><technical_language>idToQuark, lowercase i</technical_language>

Target:
private Map<Long, Pair<ITmfStateSystem, Integer>> getSelectedEntries(Map<String, Object> fetchParameters) { Collection<Long> selectedItems = DataProviderParameterUtils.extractSelectedItems(fetchParameters); if (selectedItems == null) { return Collections.emptyMap(); } Map<Long, Pair<ITmfStateSystem, Integer>> idToQuark = new HashMap<>(); for (Long id : selectedItems) { Pair<ITmfStateSystem, Integer> pair = fIDToDisplayQuark.get(id); if (pair != null) { idToQuark.put(id, pair); } } return idToQuark; }
Source:
<code>private ColumnChunk readMap(GroupField field) throws IOException { List<Type> parameters = field.getType().getTypeParameters(); checkArgument(parameters.size() == 2, "Maps must have two type parameters, found %d", parameters.size()); Block[] blocks = new Block[parameters.size()]; ColumnChunk columnChunk = readColumnChunk(field.getChildren().get(0).get()); blocks[0] = columnChunk.getBlock(); <START> blocks[1] = readColumnChunk(field.getChildren().get(1).get()).getBlock(); <END> IntList offsets = new IntArrayList(); BooleanList valueIsNull = new BooleanArrayList(); ParquetListColumnReader.calculateCollectionOffsets(field, offsets, valueIsNull, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); Block mapBlock = ((MapType) field.getType()).createBlockFromKeyValue(valueIsNull.toBooleanArray(), offsets.toIntArray(), blocks[0], blocks[1]); return new ColumnChunk(mapBlock, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); }</code><technical_language>question optional applies L159 below</technical_language>

Target:
private ColumnChunk readMap(GroupField field) throws IOException { List<Type> parameters = field.getType().getTypeParameters(); checkArgument(parameters.size() == 2, "Maps must have two type parameters, found %d", parameters.size()); Block[] blocks = new Block[parameters.size()]; ColumnChunk columnChunk = readColumnChunk(field.getChildren().get(0).get()); blocks[0] = columnChunk.getBlock(); blocks[1] = readColumnChunk(field.getChildren().get(1).get()).getBlock(); IntList offsets = new IntArrayList(); BooleanList valueIsNull = new BooleanArrayList(); calculateCollectionOffsets(field, offsets, valueIsNull, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); Block mapBlock = ((MapType) field.getType()).createBlockFromKeyValue(valueIsNull.toBooleanArray(), offsets.toIntArray(), blocks[0], blocks[1]); return new ColumnChunk(mapBlock, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); }
Source:
<code>public SellerAsTakerProtocol(SellerAsTakerTrade trade) { super(trade); Offer offer = checkNotNull(trade.getOffer()); processModel.getTradingPeer().setPubKeyRing(offer.getPubKeyRing()); <START> processModel.getTradeManager().requestPersistence(); <END> }</code><technical_language>I get a NPE here, processModel.tradeManager is null</technical_language>

Target:
public SellerAsTakerProtocol(SellerAsTakerTrade trade) { super(trade); Offer offer = checkNotNull(trade.getOffer()); processModel.getTradingPeer().setPubKeyRing(offer.getPubKeyRing()); }
Source:
<code><START> public GraphQLException(final String message, final HttpResponse httpResponse) { <END> super(message); }</code><technical_language>do need this constructor? 2nd parameter..</technical_language>

Target:
public GraphQLException(final String message, final HttpResponse httpResponse) { super(message + "\n" + httpResponse.toString()); }
Source:
<code>private void checkForExistingDOIForWorkflowVersion(WorkflowVersion workflowVersion) { String workflowVersionDoiURL = workflowVersion.getDoiURL(); if (workflowVersionDoiURL != null && !workflowVersionDoiURL.isEmpty()) { LOG.error("Workflow version " + workflowVersion.getName() + " already has DOI " + workflowVersionDoiURL <START> + ". Dockstore will only create one DOI per version."); <END> throw new CustomWebApplicationException("Workflow version " + workflowVersion.getName() + " already has DOI " + workflowVersionDoiURL + ". Dockstore will only create one DOI per version.", HttpStatus.SC_METHOD_NOT_ALLOWED); } }</code><technical_language>Dockstore only..</technical_language>

Target:
private void checkForExistingDOIForWorkflowVersion(WorkflowVersion workflowVersion) { String workflowVersionDoiURL = workflowVersion.getDoiURL(); if (workflowVersionDoiURL != null && !workflowVersionDoiURL.isEmpty()) { LOG.error("Workflow version " + workflowVersion.getName() + " already has DOI " + workflowVersionDoiURL + ". Dockstore can only create one DOI per version."); throw new CustomWebApplicationException("Workflow version " + workflowVersion.getName() + " already has DOI " + workflowVersionDoiURL + ". Dockstore can only create one DOI per version.", HttpStatus.SC_METHOD_NOT_ALLOWED); } }
Source:
<code>private Platform findPlatformByTarget(Target target) { for (Platform p : availablePlatforms) { if (p.apiLevel.equals(target.apiLevel)) { return p; } } <START> return null; <END> }</code><technical_language>platfrom null? exception thrown here, similarly target</technical_language>

Target:
private Platform findPlatformByTarget(Target target) { for (Platform platform : availablePlatforms) { if (platform.apiLevel.equals(target.apiLevel)) { return platform; } } throw new AndroidContainerConfigurationException( String.format("Platform you are trying to find for target '%s' is unknown.", target)); }
Source:
<code><START> public InMemoryMessageExchangeStore(final NetworkConfig config) { <END> if (config == null) { throw new NullPointerException("Configuration must not be null"); } this.config = config; this.tokenProvider = new InMemoryRandomTokenProvider(this.config); LOGGER.log(Level.CONFIG, "using default TokenProvider {0}", InMemoryRandomTokenProvider.class.getName()); LOGGER.log(Level.CONFIG, "using tokens of {0} bytes in length", config.getInt(NetworkConfig.Keys.TOKEN_SIZE_LIMIT)); }</code><technical_language>simply do a this(config, null) handle null case appropriately in other constructor</technical_language>

Target:
public InMemoryMessageExchangeStore(final NetworkConfig config) { this(config, new InMemoryRandomTokenProvider(config)); LOGGER.log(Level.CONFIG, "using default TokenProvider {0}", InMemoryRandomTokenProvider.class.getName()); }
Source:
<code>public void loadMaternalAgeNonZero(){ BaseObject data = mock(BaseObject.class); doReturn(data).when(this.doc).getXObject(any(EntityReference.class)); doReturn(AGE_NON_ZERO).when(data).getIntValue(MATERNAL_AGE); doReturn(AGE_ZERO).when(data).getIntValue(PATERNAL_AGE); PatientData<Integer> testData = this.parentalAgeController.load(this.patient); Assert.assertEquals("parentalAge", testData.getName()); <START> Assert.assertTrue(testData.get(MATERNAL_AGE) == 25); <END> Assert.assertNull(testData.get(PATERNAL_AGE)); }</code><technical_language>a magic number (25) instead of a AGE_NON_ZERO</technical_language>

Target:
public void loadMaternalAgeNonZero(){ BaseObject data = mock(BaseObject.class); doReturn(data).when(this.doc).getXObject(any(EntityReference.class)); doReturn(AGE_NON_ZERO).when(data).getIntValue(MATERNAL_AGE); doReturn(AGE_ZERO).when(data).getIntValue(PATERNAL_AGE); PatientData<Integer> testData = this.parentalAgeController.load(this.patient); Assert.assertEquals("parentalAge", testData.getName()); Assert.assertTrue(testData.get(MATERNAL_AGE) == AGE_NON_ZERO); Assert.assertNull(testData.get(PATERNAL_AGE)); }
Source:
<code>public boolean putJobIfAbsent(T job, boolean asFirst) throws InternalErrorException { if(job == null) throw new InternalErrorException("Can't put null job to list of waiting jobs."); jobsAccessLock.lock(); if(runningJobs.contains(job)) return false; if(waitingJobs.contains(job) && !asFirst) { return false; } else { waitingJobs.remove(job); } if(asFirst) { waitingJobs.addFirst(job); } else { waitingJobs.addLast(job); } notEmptyPoolSemaphore.release(); <START> jobsAccessLock.unlock(); <END> return true; }</code><technical_language>a bast practice unlock in "finally" block ensure unlocking in case of exception in preceding code</technical_language>

Target:
public boolean putJobIfAbsent(T job, boolean asFirst) throws InternalErrorException { if(job == null) throw new InternalErrorException("Can't put null job to list of waiting jobs."); try { jobsAccessLock.lock(); if (runningJobs.contains(job)) return false; if (waitingJobs.contains(job)) { if (!asFirst) { return false; } else { waitingJobs.remove(job); } } if (asFirst) { waitingJobs.addFirst(job); } else { waitingJobs.addLast(job); } notEmptyPoolSemaphore.release(); } finally { jobsAccessLock.unlock(); } return true; }
Source:
<code>public int category(Object element) { IResource adapter = (IResource) getAdapter(element, IResource.class); if (adapter != null) { if (adapter instanceof IContainer) { return FOLDERCATEGORY; } if (adapter instanceof IFile) { IFile file = (IFile) adapter; IPath path = new Path(repositoryMapping .getRepoRelativePath(file)); if (leftOnlyPaths.contains(path)) return ADDEDCATEGORY; if (equalContentPaths.contains(path)) return UNCHANGEDCATEGORY; return CHANGEDCATEGORY; } } <START> if (element instanceof PathNodeAdapter) { <END> return DELETEDCATEGORY; } return UNKNOWNCATEGORY; }</code><technical_language>style nit: braces</technical_language>

Target:
public int category(Object element) { IResource adapter = (IResource) getAdapter(element, IResource.class); if (adapter != null) { if (adapter instanceof IContainer) { return FOLDERCATEGORY; } if (adapter instanceof IFile) { IFile file = (IFile) adapter; IPath path = new Path(repositoryMapping .getRepoRelativePath(file)); if (addedPaths.contains(path)) return ADDEDCATEGORY; if (equalContentPaths.contains(path)) return UNCHANGEDCATEGORY; return CHANGEDCATEGORY; } } if (element instanceof PathNodeAdapter) return DELETEDCATEGORY; return UNKNOWNCATEGORY; }
Source:
<code>public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception { <START> LogWriter logwriter = new LogWriter(logger,delimiter); <END> graphiteWriter.write(logwriter, server, query, results); }</code><technical_language>This logwriter a field, need instantiate a new for message</technical_language>

Target:
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception { graphiteWriter.write(logwriter, server, query, results); }
Source:
<code><START> @Override protected javax.sql.DataSource getDataSource() { <END> JdbcDataSource dataSource = new JdbcDataSource(); dataSource.setURL(JDBC_URL); dataSource.setUser("sa"); dataSource.setPassword(""); return dataSource; }</code><technical_language>why? format properly, ok before. annotations method definitions lines</technical_language>

Target:
protected DataSource getDataSource() { JdbcDataSource dataSource = new JdbcDataSource(); dataSource.setURL(JDBC_URL); dataSource.setUser("sa"); dataSource.setPassword(""); return dataSource; }
Source:
<code>public void uploadFromHome(User user, Process process) { URI after; try { after = serviceManager.getUserService().getHomeDirectory(user); } catch (Exception ioe) { logger.error("Exception uploadFromHome(...)", ioe); Helper.setFehlerMeldung("Aborted upload from home, error", ioe.getMessage()); return; } if (user.isWithMassDownload()) { after = Paths.get(new File(after).getPath(), process.getProject().getTitle()).toUri(); after = Paths.get(new File(after).getPath().replaceAll(" ", "__")).toUri(); URI projectDirectory = after; if (!fileService.fileExist(projectDirectory) && !fileService.isDirectory(fileService.createResource(projectDirectory.toString()))) { List<String> param = new ArrayList<>(); param.add(new File(after).getPath().replaceAll(" ", "__")); Helper.setFehlerMeldung(Helper.getTranslation("MassDownloadProjectCreationError", param)); logger.error("Can not create project directory " + Paths.get(new File(after).getPath().replaceAll(" ", "__")).toUri()); return; } } after = Paths.get(new File(after).getPath(), getEncodedProcessLinkName(process)).toUri(); URI userHome = after; <START> fileService.deleteSymLink((userHome)); <END> }</code><technical_language>this 3 lines java = Paths.get(new File(after).getPath(), getEncodedProcessLinkName(process)).toUri(); URI userHome = after; fileService.deleteSymLink((userHome)); simplified java = Paths.get(new File(after).getPath(), getEncodedProcessLinkName(process)).toUri(); fileService.deleteSymLink(after);</technical_language>

Target:
public void uploadFromHome(User user, Process process) { URI destination; try { destination = serviceManager.getUserService().getHomeDirectory(user); } catch (Exception ioe) { logger.error("Exception uploadFromHome(...)", ioe); Helper.setFehlerMeldung("Aborted upload from home, error", ioe.getMessage()); return; } if (user.isWithMassDownload()) { destination = Paths.get(new File(destination).getPath(), process.getProject().getTitle()).toUri(); destination = Paths.get(new File(destination).getPath().replaceAll(" ", "__")).toUri(); if (!fileService.fileExist(destination) && !fileService.isDirectory(fileService.createResource(destination.toString()))) { List<String> param = new ArrayList<>(); param.add(new File(destination).getPath().replaceAll(" ", "__")); Helper.setFehlerMeldung(Helper.getTranslation("MassDownloadProjectCreationError", param)); logger.error("Can not create project directory " + Paths.get(new File(destination).getPath().replaceAll(" ", "__")).toUri()); return; } } destination = Paths.get(new File(destination).getPath(), getEncodedProcessLinkName(process)).toUri(); fileService.deleteSymLink((destination)); }
Source:
<code>static String buildColumns(List<HiveColumnHandle> columns) { if (columns == null || columns.isEmpty()) { return EMPTY_STRING; } <START> return Joiner.on(",").join(columns.stream().map(HiveColumnHandle::getName).collect(Collectors.toList())); <END> }</code><technical_language>static import toList</technical_language>

Target:
private static String buildColumns(List<HiveColumnHandle> columns) { if (columns == null || columns.isEmpty()) { return EMPTY_STRING; } return columns.stream().map(HiveColumnHandle::getName).collect(Collectors.joining(",")); }
Source:
<code>public Response addParser(@FormDataParam("parserJar") final InputStream inputStream, @FormDataParam("parserJar") final FormDataContentDisposition contentDispositionHeader, @FormDataParam("parserInfo") final String parserInfoStr, @FormDataParam("schemaFromParserJar") boolean schemaFromParserJar) { LOG.debug("schemaFromParser {}", schemaFromParserJar); try { <START> String jarStoragePath = UUID.randomUUID().toString() + ".jar"; <END> String name = ""; if (contentDispositionHeader != null && contentDispositionHeader.getFileName() != null) { name = contentDispositionHeader.getFileName(); } this.jarStorage.uploadJar(inputStream, jarStoragePath); inputStream.close(); ParserInfo parserInfo = objectMapper.readValue(parserInfoStr, ParserInfo.class); parserInfo.setJarStoragePath(jarStoragePath); parserInfo.setUploadedFileName(name); if (parserInfo.getParserSchema() == null && schemaFromParserJar) { parserInfo.setParserSchema(loadSchemaFromParserJar(jarStoragePath, parserInfo.getClassName())); } ParserInfo result = catalogService.addParserInfo(parserInfo); return WSUtils.respond(CREATED, SUCCESS, parserInfo); } catch (Exception ex) { return WSUtils.respond(INTERNAL_SERVER_ERROR, EXCEPTION, ex.getMessage()); } }</code><technical_language>Instead of putting random UUID. add parser-name dir store parser jar it. easier for some for parser jar disk</technical_language>

Target:
public Response addParser(@FormDataParam("parserJar") final InputStream inputStream, @FormDataParam("parserJar") final FormDataContentDisposition contentDispositionHeader, @FormDataParam("parserInfo") final String parserInfoStr, @FormDataParam("schemaFromParserJar") boolean schemaFromParserJar) { LOG.debug("schemaFromParser {}", schemaFromParserJar); try { ParserInfo parserInfo = objectMapper.readValue(parserInfoStr, ParserInfo.class); String prefix = StringUtils.isBlank(parserInfo.getName()) ? "parser-" : parserInfo.getName() + "-"; String jarStoragePath = prefix + UUID.randomUUID().toString() + ".jar"; String uploadedPath = this.jarStorage.uploadJar(inputStream, jarStoragePath); inputStream.close(); LOG.debug("Jar file uploaded to {}", uploadedPath); parserInfo.setJarStoragePath(jarStoragePath); Schema schema = loadSchemaFromParserJar(jarStoragePath, parserInfo.getClassName()); if (schema == null) { throw new RuntimeException("Cannot load parser class from uploaded Jar: " + parserInfo.getClassName()); } if (parserInfo.getParserSchema() == null && schemaFromParserJar) { parserInfo.setParserSchema(schema); } ParserInfo result = catalogService.addParserInfo(parserInfo); return WSUtils.respond(CREATED, SUCCESS, result); } catch (Exception ex) { return WSUtils.respond(INTERNAL_SERVER_ERROR, EXCEPTION, ex.getMessage()); } }
Source:
<code>public ResultModel showMissingDiskStore() { Set<DistributedMember> dataMembers = DiskStoreCommandsUtils.getNormalMembers((InternalCache) getCache()); List<ColocatedRegionDetails> missingRegions = null; boolean cacheMemberExist = false; if (!dataMembers.isEmpty()) { <START> cacheMemberExist = true; <END> missingRegions = getMissingColocatedRegionList(dataMembers); } DistributedSystemMXBean dsMXBean = ManagementService.getManagementService(getCache()).getDistributedSystemMXBean(); PersistentMemberDetails[] missingDiskStores = dsMXBean.listMissingDiskStores(); return toMissingDiskStoresTabularResult(missingDiskStores, missingRegions, cacheMemberExist); }</code><technical_language>I need this boolean. If servers, missingRegions null, otherwise, empty data</technical_language>

Target:
public ResultModel showMissingDiskStore() { Set<DistributedMember> dataMembers = DiskStoreCommandsUtils.getNormalMembers((InternalCache) getCache()); List<ColocatedRegionDetails> missingRegions = null; if (!dataMembers.isEmpty()) { missingRegions = getMissingColocatedRegionList(dataMembers); } DistributedSystemMXBean dsMXBean = ManagementService.getManagementService(getCache()).getDistributedSystemMXBean(); PersistentMemberDetails[] missingDiskStores = dsMXBean.listMissingDiskStores(); return toMissingDiskStoresTabularResult(missingDiskStores, missingRegions); }
Source:
<code>@Override public SqlMonotonicity getMonotonicity(SqlOperatorBinding call) { if (getName().equals("/")) { final SqlMonotonicity mono0 = call.getOperandMonotonicity(0); final SqlMonotonicity mono1 = call.getOperandMonotonicity(1); if (mono1 == SqlMonotonicity.CONSTANT) { if (call.isOperandNull(1, true)) { return SqlMonotonicity.CONSTANT; <START> } <END> if (call.isOperandLiteral(1, false)) { switch (call.getOperandLiteralValue(1, BigDecimal.class).signum()) { case -1: return mono0.reverse().unstrict(); case 0: return SqlMonotonicity.CONSTANT; default: return mono0.unstrict(); } } } } return super.getMonotonicity(call); }</code><technical_language>if assumption "if operand1 is null monotonicity is CONSTANT" for binary operator, i this change is radical</technical_language>

Target:
@Override public SqlMonotonicity getMonotonicity(SqlOperatorBinding call) { if (hasNullOperand(call)) { switch (this.kind) { case DIVIDE: return SqlMonotonicity.CONSTANT; } } if (getName().equals("/")) { final SqlMonotonicity mono0 = call.getOperandMonotonicity(0); final SqlMonotonicity mono1 = call.getOperandMonotonicity(1); if (mono1 == SqlMonotonicity.CONSTANT) { if (call.isOperandLiteral(1, false)) { switch (call.getOperandLiteralValue(1, BigDecimal.class).signum()) { case -1: return mono0.reverse().unstrict(); case 0: return SqlMonotonicity.CONSTANT; default: return mono0.unstrict(); } } } } return super.getMonotonicity(call); }
Source:
<code>private static boolean methodInvocationOnThisInstance(MethodInvocationTree methodInvocation) { ExpressionTree expression = methodInvocation.methodSelect(); if (expression.is(Tree.Kind.MEMBER_SELECT)) { expression = ((MemberSelectExpressionTree) expression).expression(); return expression.is(Tree.Kind.IDENTIFIER) && ((IdentifierTree) expression).name().equals("this"); } <START> return expression.is(Tree.Kind.IDENTIFIER); <END> }</code><technical_language>If method is static and/or statically imported this return true. This is a discrepancy name implementation</technical_language>

Target:
private static boolean methodInvocationOnThisInstance(MethodInvocationTree methodInvocation) { if (methodInvocation.symbol().isStatic()) { return false; } ExpressionTree expression = methodInvocation.methodSelect(); if (expression.is(Tree.Kind.MEMBER_SELECT)) { expression = ((MemberSelectExpressionTree) expression).expression(); return expression.is(Tree.Kind.IDENTIFIER) && ((IdentifierTree) expression).name().equals("this"); } return expression.is(Tree.Kind.IDENTIFIER); }
Source:
<code>private static H2ODrm zip(final Frame fra, final Vec keysa, final Frame frb, final Vec keysb) { Vec vecs[] = new Vec[fra.vecs().length + frb.vecs().length]; int d = 0; for (Vec vfra : fra.vecs()) <START> vecs[d++] = vfra; <END> for (Vec vfrb : frb.vecs()) vecs[d++] = vfrb; Frame fr = new Frame(vecs); return new H2ODrm(fr, keysa); }</code><technical_language>for loop needs braces ... in a other places</technical_language>

Target:
private static H2ODrm zip(final Frame fra, final Vec keysa, final Frame frb, final Vec keysb) { Vec vecs[] = new Vec[fra.vecs().length + frb.vecs().length]; int d = 0; for (Vec vfra : fra.vecs()) { vecs[d++] = vfra; } for (Vec vfrb : frb.vecs()) { vecs[d++] = vfrb; } Frame fr = new Frame(vecs); return new H2ODrm(fr, keysa); }
Source:
<code>private static List<Integer> extractIntegerList(Map<String, Object> xmlRpcStruct, String propertyName) { if (!xmlRpcStruct.containsKey(propertyName)){ return Collections.emptyList(); } Object[] items = (Object[]) xmlRpcStruct.get(propertyName); if (items.length == 0) { return Collections.emptyList(); } List<Integer> list = new ArrayList<>(); <START> Arrays.stream(items).forEach(item -> list.add((Integer) item)); <END> return list; }</code><technical_language>I Java 8 is below: List<Integer> list = Arrays.stream(items).map(item -> (Integer)item).collect(Collectors.toList());</technical_language>

Target:
private static List<Integer> extractIntegerList(Map<String, Object> xmlRpcStruct, String propertyName) { if (!xmlRpcStruct.containsKey(propertyName)){ return Collections.emptyList(); } Object[] items = (Object[]) xmlRpcStruct.get(propertyName); if (items.length == 0) { return Collections.emptyList(); } return Arrays.stream(items).map(item -> (Integer) item).collect(Collectors.toList()); }
Source:
<code><START> public Schedule(final DataloadProcess process, final String executable, final Schedule triggerSchedule) { <END> notNull(process, "process"); this.type = MSETL_TYPE; this.state = ScheduleState.ENABLED.name(); this.params = new HashMap<>(); this.params.put(PROCESS_ID, process.getId()); process.validateExecutable(executable); this.nextExecutionTime = null; this.consecutiveFailedExecutionCount = 0; this.params.put(EXECUTABLE, executable); this.triggerScheduleId = notEmpty(triggerSchedule.getId(), "trigger schedule ID cannot be null!"); this.links = Collections.emptyMap(); }</code><technical_language>do need a new constructor, setter enough</technical_language>

Target:
public Schedule(final DataloadProcess process, final String executable, final Schedule triggerSchedule) { this(process, executable); this.triggerScheduleId = notEmpty(notNull(triggerSchedule, "triggerSchedule").getId(), "triggerSchedule ID"); }