auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void transformResource(final ResourceTransformationContext ctx, final PathAddress address, final Resource original) throws OperationFailedException { final DiscardPolicy discardPolicy = determineDiscardPolicy(ctx, address); switch (discardPolicy) { case REJECT_AND_WARN: ctx.getLogger().logRejectedResourceWarning(address, null); return; case DISCARD_AND_WARN: <START> ctx.getLogger().logDiscardedResourceWarning(address); <END> case SILENT: ResourceTransformer.DISCARD.transformResource(ctx, address, original); return; } final Iterator<TransformationRule> iterator = rules.iterator(); final TransformationRule.ChainedResourceContext context = new TransformationRule.ChainedResourceContext(ctx) { @Override void invokeNext(final Resource resource) throws OperationFailedException { if(iterator.hasNext()) { final TransformationRule next = iterator.next(); next.transformResource(resource, address, this); } else { resourceTransformer.transformResource(ctx, address, resource); } } }; final TransformationRule rule = new AttributeTransformationRule(attributeTransformations); rule.transformResource(original, address, context); }</code><technical_language>I add a parameter for host name: ctx.getTarget().getHostName() good</technical_language>

Target:
public void transformResource(final ResourceTransformationContext ctx, final PathAddress address, final Resource original) throws OperationFailedException { final DiscardPolicy discardPolicy = determineDiscardPolicy(ctx, address); switch (discardPolicy) { case REJECT_AND_WARN: ctx.getLogger().logRejectedResourceWarning(address, null); return; case DISCARD_AND_WARN: ctx.getLogger().logDiscardedResourceWarning(address, ctx.getTarget().getHostName()); case SILENT: ResourceTransformer.DISCARD.transformResource(ctx, address, original); return; } final Iterator<TransformationRule> iterator = rules.iterator(); final TransformationRule.ChainedResourceContext context = new TransformationRule.ChainedResourceContext(ctx) { @Override void invokeNext(final Resource resource) throws OperationFailedException { if(iterator.hasNext()) { final TransformationRule next = iterator.next(); next.transformResource(resource, address, this); } else { resourceTransformer.transformResource(ctx, address, resource); } } }; final TransformationRule rule = new AttributeTransformationRule(attributeTransformations); rule.transformResource(original, address, context); }
Source:
<code>public Date unmarshal(@Nullable Object o) { <START> if (o instanceof String) { <END> try { return DEFAULT_FORMAT.parse((String) o); } catch (ParseException e) { return null; } } return null; }</code><technical_language>stored a long in UTC, ISO 8601</technical_language>

Target:
public Instant unmarshal(@Nullable Object o) { if (o instanceof String) { try { return Instant.from(FORMATTER.parse((String) o)); } catch(DateTimeParseException ignored) { return null; } } return null; }
Source:
<code>private <T> DtoProvider<T> getDtoProvider(Class<T> dtoInterface) { DtoProvider<?> dtoProvider = dtoInterface2Providers.get(dtoInterface); if (dtoProvider == null) { if (dtoInterface.isAnnotationPresent(DTO.class)) { <START> throw new IllegalArgumentException("Implementation for DTO type " + dtoInterface + " isn't found."); <END> } else { throw new IllegalArgumentException("Is not a DTO type " + dtoInterface); } } return (DtoProvider<T>)dtoProvider; }</code><technical_language>is _"Provider for DTO type ..."_</technical_language>

Target:
private <T> DtoProvider<T> getDtoProvider(Class<T> dtoInterface) { DtoProvider<?> dtoProvider = dtoInterface2Providers.get(dtoInterface); if (dtoProvider == null) { if (!dtoInterface.isInterface()) { throw new IllegalArgumentException(format("Only interfaces can be DTO, but %s is not", dtoInterface)); } if (hasDtoAnnotation(dtoInterface)) { throw new IllegalArgumentException(format("Provider of implementation for DTO type %s isn't found", dtoInterface)); } else { throw new IllegalArgumentException(dtoInterface + " is not a DTO type"); } } return (DtoProvider<T>)dtoProvider; }
Source:
<code>public void initialize() throws IOException { if (!(systemEnvironment.get(SystemEnvironment.USE_NEW_RAILS) && systemEnvironment.useCompressedJs())) { return; } String assetsDirPath = servletContext.getRealPath(servletContext.getInitParameter("rails.root") + "/public/assets/"); File assetsDir = new File(assetsDirPath); if (!assetsDir.exists()) { throw new RuntimeException(String.format("Assets directory does not exist %s", assetsDirPath)); } File manifestFile = null; <START> Iterator iterator = FileUtils.iterateFiles(assetsDir, new String[]{"json"}, false); <END> while (iterator.hasNext()) { File next = (File) iterator.next(); if (MANIFEST_FILE_PATTERN.matcher(next.getName()).matches()) { manifestFile = next; break; } } if (manifestFile == null) { throw new RuntimeException(String.format("Manifest json file was not found at %s", assetsDirPath)); } LOG.info(String.format("Found rails assets manifest file named %s ", manifestFile.getName())); String manifest = FileUtil.readContentFromFile(manifestFile); Gson gson = new Gson(); railsAssetsManifest = gson.fromJson(manifest, RailsAssetsManifest.class); LOG.info(String.format("Successfully read rails assets manifest file located at %s", manifestFile.getAbsolutePath())); }</code><technical_language>@jyotisingh FYI: Try FileUtils.listFiles instead</technical_language>

Target:
public void initialize() throws IOException { if (!(systemEnvironment.get(SystemEnvironment.USE_NEW_RAILS) && systemEnvironment.useCompressedJs())) { return; } String assetsDirPath = servletContext.getRealPath(servletContext.getInitParameter("rails.root") + "/public/assets/"); File assetsDir = new File(assetsDirPath); if (!assetsDir.exists()) { throw new RuntimeException(String.format("Assets directory does not exist %s", assetsDirPath)); } Collection files = FileUtils.listFiles(assetsDir, new RegexFileFilter(MANIFEST_FILE_PATTERN), null); if (files.isEmpty()) { throw new RuntimeException(String.format("Manifest json file was not found at %s", assetsDirPath)); } File manifestFile = (File) files.iterator().next(); LOG.info(String.format("Found rails assets manifest file named %s ", manifestFile.getName())); String manifest = FileUtil.readContentFromFile(manifestFile); Gson gson = new Gson(); railsAssetsManifest = gson.fromJson(manifest, RailsAssetsManifest.class); LOG.info(String.format("Successfully read rails assets manifest file located at %s", manifestFile.getAbsolutePath())); }
Source:
<code>protected GenotypeType determineType() { final List<Allele> alleles = getAlleles(); if ( alleles.isEmpty() ) { return GenotypeType.UNAVAILABLE; } boolean sawNoCall = false, sawMultipleAlleles = false; <START> Allele firstAllele = null; <END> for ( int i = 0; i < alleles.size(); i++ ) { final Allele allele = alleles.get(i); if ( allele.isNoCall() ) { sawNoCall = true; } else if ( firstAllele == null ) { firstAllele = allele; } else if ( !allele.equals(firstAllele) ) sawMultipleAlleles = true; } if ( sawNoCall ) { if ( firstAllele == null ) return GenotypeType.NO_CALL; return GenotypeType.MIXED; } if ( firstAllele == null ) throw new IllegalStateException("BUG: there are no alleles present in this genotype but the alleles list is not null"); return sawMultipleAlleles ? GenotypeType.HET : firstAllele.isReference() ? GenotypeType.HOM_REF : GenotypeType.HOM_VAR; }</code><technical_language>this rename sense. allele, non-no-call allele</technical_language>

Target:
protected GenotypeType determineType() { final List<Allele> alleles = getAlleles(); if ( alleles.isEmpty() ) { return GenotypeType.UNAVAILABLE; } boolean sawNoCall = false, sawMultipleAlleles = false; Allele firstCallAllele = null; for ( int i = 0; i < alleles.size(); i++ ) { final Allele allele = alleles.get(i); if ( allele.isNoCall() ) { sawNoCall = true; } else if ( firstCallAllele == null ) { firstCallAllele = allele; } else if ( !allele.equals(firstCallAllele) ) sawMultipleAlleles = true; } if ( sawNoCall ) { if ( firstCallAllele == null ) return GenotypeType.NO_CALL; return GenotypeType.MIXED; } if ( firstCallAllele == null ) throw new IllegalStateException("BUG: there are no alleles present in this genotype but the alleles list is not null"); return sawMultipleAlleles ? GenotypeType.HET : firstCallAllele.isReference() ? GenotypeType.HOM_REF : GenotypeType.HOM_VAR; }
Source:
<code>public TwilioRestClient(String accountSid, String authToken, String endpoint) { validateAccountSid(accountSid); validateAuthToken(authToken); this.accountSid = accountSid; this.authToken = authToken; if ((endpoint != null) && (!endpoint.equals(""))) { this.endpoint = endpoint; } ClientConnectionManager mgr = null; try { <START> Class.forName("com.google.appengine.api.urlfetch.HTTPRequest"); <END> } catch (ClassNotFoundException e) { mgr = new ThreadSafeClientConnManager(); ((ThreadSafeClientConnManager) mgr).setDefaultMaxPerRoute(10); } finally { if (mgr == null) { mgr = new TwilioGAEConnectionManager(); } } setHttpclient(new DefaultHttpClient(mgr)); httpclient.getParams().setParameter("http.protocol.version", HttpVersion.HTTP_1_1); httpclient.getParams().setParameter("http.socket.timeout", new Integer(CONNECTION_TIMEOUT)); httpclient.getParams().setParameter("http.connection.timeout", new Integer(CONNECTION_TIMEOUT)); httpclient.getParams().setParameter("http.protocol.content-charset", "UTF-8"); this.authAccount = new Account(this); this.authAccount.setSid(this.accountSid); this.authAccount.setAuthToken(this.authToken); }</code><technical_language>assign manager here</technical_language>

Target:
public TwilioRestClient(String accountSid, String authToken, String endpoint) { validateAccountSid(accountSid); validateAuthToken(authToken); this.accountSid = accountSid; this.authToken = authToken; if ((endpoint != null) && (!endpoint.equals(""))) { this.endpoint = endpoint; } ClientConnectionManager mgr = null; try { Class.forName("com.google.appengine.api.urlfetch.HTTPRequest"); mgr = new AppEngineClientConnectionManager(); } catch (ClassNotFoundException e) { mgr = new ThreadSafeClientConnManager(); ((ThreadSafeClientConnManager) mgr).setDefaultMaxPerRoute(10); } setHttpclient(new DefaultHttpClient(mgr)); httpclient.getParams().setParameter("http.protocol.version", HttpVersion.HTTP_1_1); httpclient.getParams().setParameter("http.socket.timeout", new Integer(CONNECTION_TIMEOUT)); httpclient.getParams().setParameter("http.connection.timeout", new Integer(CONNECTION_TIMEOUT)); httpclient.getParams().setParameter("http.protocol.content-charset", "UTF-8"); this.authAccount = new Account(this); this.authAccount.setSid(this.accountSid); this.authAccount.setAuthToken(this.authToken); }
Source:
<code>public String showAddNewMetadataGroup() { try { newMetadataGroup = new RenderableMetadataGroup(docStruct.getAddableMetadataGroupTypes(), process.getProject().getTitle()); } catch (ConfigurationException e) { Helper.setFehlerMeldung("Form_configuration_mismatch", e.getMessage()); <START> logger.error(e.getMessage(), e); <END> return ""; } modeAdd = false; modeAddPerson = false; addMetadataGroupMode = true; return !updateBlocked() ? "SperrungAbgelaufen" : ""; }</code><technical_language>setErrorMessage</technical_language>

Target:
public String showAddNewMetadataGroup() { try { newMetadataGroup = new RenderableMetadataGroup(docStruct.getAddableMetadataGroupTypes(), process.getProject().getTitle()); } catch (ConfigurationException e) { Helper.setErrorMessage("Form_configuration_mismatch", logger, e); return ""; } modeAdd = false; modeAddPerson = false; addMetadataGroupMode = true; return !updateBlocked() ? "SperrungAbgelaufen" : ""; }
Source:
<code>public Dialog onCreateDialog(Bundle savedInstance) { <START> <END> if (savedInstance != null) { name = (String) savedInstance.getSerializable("name"); position = (Integer) savedInstance.getSerializable("position"); keyword = (Keyword) savedInstance.getParcelable("keyword"); } LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.keyword_edit_name, null); nameEdit = (EditText) view.findViewById(R.id.keyword_name_edit); nameEdit.setText(name); nameEdit.setSelection(name.length()); final EditText nameEditFinal = nameEdit; TextView externalCode = (TextView) view.findViewById(R.id.keyword_external_code); externalCode.setText(keyword.getExternalCode()); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.keyword_edit_name_dialog_title) .setView(view) .setPositiveButton( android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { listener.onKeywordNameChanged( nameEditFinal.getText().toString(), position); } }) .setNegativeButton(android.R.string.cancel, null); Dialog dialog = builder.create(); dialog.getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); return dialog; }</code><technical_language>long</technical_language>

Target:
public Dialog onCreateDialog(Bundle savedInstance) { if (savedInstance != null) { name = (String) savedInstance.getSerializable("name"); position = (Integer) savedInstance.getSerializable("position"); keyword = (Keyword) savedInstance.getParcelable("keyword"); } LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.keyword_edit_name, null); nameEdit = (EditText) view.findViewById(R.id.keyword_name_edit); nameEdit.addTextChangedListener(new NameWatcher()); nameEdit.setText(name); nameEdit.setSelection(name.length()); final EditText nameEditFinal = nameEdit; TextView externalCode = (TextView) view.findViewById(R.id.keyword_external_code); externalCode.setText(keyword.getExternalCode()); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.keyword_edit_name_dialog_title) .setView(view) .setPositiveButton(android.R.string.ok, new OkListener()) .setNegativeButton(android.R.string.cancel, null); Dialog dialog = builder.create(); dialog.getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); return dialog; }
Source:
<code>public String html() { synchronized (Markdown.TIDY) { return Markdown.clean( new PegDownProcessor().markdownToHtml( Markdown.formatLinks(this.text) ) <START> ).replaceAll("(</a>)(\\w)", "$1 $2"); <END> } }</code><technical_language>@antonini compile regex leave a static field? This re-compile match regex always..</technical_language>

Target:
public String html() { synchronized (Markdown.TIDY) { return LINK_WHITESPACE.matcher( Markdown.clean( new PegDownProcessor().markdownToHtml( Markdown.formatLinks(this.text) ) ) ).replaceAll("$1 $2"); } }
Source:
<code>public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonObjectFormatVisitor jsonObjectFormatVisitor = visitor.expectObjectFormat(typeHint); JavaType numberType = visitor.getProvider().constructType(Number.class); JavaType currencyUnitType = visitor.getProvider().constructType(CurrencyUnit.class); JavaType stringType = visitor.getProvider().constructType(String.class); JsonSerializer<Object> numberSerializer = visitor.getProvider().findValueSerializer(Number.class); JsonSerializer<Object> currencyUnitSerializer = visitor.getProvider().findValueSerializer(CurrencyUnit.class); JsonSerializer<Object> stringSerializer = visitor.getProvider().findValueSerializer(String.class); <START> jsonObjectFormatVisitor.property(names.getAmount(), numberSerializer, numberType); <END> jsonObjectFormatVisitor.property(names.getCurrency(), currencyUnitSerializer, currencyUnitType); jsonObjectFormatVisitor.optionalProperty(names.getFormatted(), stringSerializer, stringType); }</code><technical_language>is a feature serialize amount string I is respected <LINK_0></technical_language>

Target:
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonObjectFormatVisitor jsonObjectFormatVisitor = visitor.expectObjectFormat(typeHint); JavaType amountType = visitor.getProvider().constructType(writer.getType()); JsonSerializer<Object> amountSerializer = visitor.getProvider().findValueSerializer(writer.getType()); jsonObjectFormatVisitor.property(names.getAmount(), amountSerializer, amountType); JavaType currencyUnitType = visitor.getProvider().constructType(CurrencyUnit.class); JsonSerializer<Object> currencyUnitSerializer = visitor.getProvider().findValueSerializer(CurrencyUnit.class); jsonObjectFormatVisitor.property(names.getCurrency(), currencyUnitSerializer, currencyUnitType); JavaType stringType = visitor.getProvider().constructType(String.class); JsonSerializer<Object> stringSerializer = visitor.getProvider().findValueSerializer(String.class); jsonObjectFormatVisitor.optionalProperty(names.getFormatted(), stringSerializer, stringType); }
Source:
<code>int resizeCalculationsGTK3 (long widget, int width, int height) { <START> int sizes = new int[2]; <END> if (OS.GTK_VERSION >= OS.VERSION(3, 20, 0)) { GtkRequisition requisition = new GtkRequisition(); OS.gtk_widget_get_preferred_size(widget, requisition, null); sizes[0] = (width - (requisition.width - width)) < 0 ? requisition.width : width; sizes[1] = (height - (requisition.height - height)) < 0 ? requisition.height : height; } else { sizes[0] = width; sizes[0] = height; } return sizes; }</code><technical_language>instantiate a Point width/height. Like: new Point(width, height). if gtk>3.20, update x/y value. Savings: 3 lines of code</technical_language>

Target:
Point resizeCalculationsGTK3 (long widget, int width, int height) { Point sizes = new Point (width, height); if (OS.GTK_VERSION >= OS.VERSION(3, 20, 0)) { GtkRequisition requisition = new GtkRequisition(); OS.gtk_widget_get_preferred_size(widget, requisition, null); sizes.x = (width - (requisition.width - width)) < 0 ? requisition.width : width; sizes.y = (height - (requisition.height - height)) < 0 ? requisition.height : height; } return sizes; }
Source:
<code>public void open(ReadableMap options) throws ActivityNotFoundException { super.open(options); <START> this.openIntentChooser(options); <END> }</code><technical_language>Also, need this change call intentChooser</technical_language>

Target:
public void open(ReadableMap options) throws ActivityNotFoundException { super.open(options); this.openIntentChooser(); }
Source:
<code>public String toString() { return "Account{" + "id=" + id + ", description='" + description + '\'' + ", creationDate='" + creationDate + '\'' + ", limits=" + limits + ", blurb=" + blurb.stream().map(Arrays::toString).collect(Collectors.toList()) + <START> ", unknownFieldSet='" + unknownFieldSet + '\'' + <END> ", currencies='" + Arrays.toString(currencies) + '\'' + '}'; }</code><technical_language>prefer unknownFieldSet printed stuff</technical_language>

Target:
public String toString() { return "Account{" + "id=" + id + ", description='" + description + '\'' + ", creationDate='" + creationDate + '\'' + ", limits=" + limits + ", blurb=" + blurb.stream().map(Arrays::toString).collect(Collectors.toList()) + ", currencies='" + Arrays.toString(currencies) + '\'' + ", unknownFieldSet='" + unknownFieldSet + '\'' + '}'; }
Source:
<code>public Path getRecordingPath(String title) { <START> return getRecordingsPath().resolve(title.replaceAll("[^A-Za-z0-9-_ ]", "")); <END> }</code><technical_language>extract duplicate regex constant</technical_language>

Target:
public Path getRecordingPath(String title) { return getRecordingsPath().resolve(title.replaceAll(REGEX, "")); }
Source:
<code>private static List<Property> applyPropertyOverride(List<Property> properties, List<Property> overrides) { Map<String, Expression> propertyMap = properties.stream() .collect(toImmutableMap(property -> property.getName().getValue().toLowerCase(ENGLISH), Property::getValue)); Map<String, Expression> overrideMap = overrides.stream() .collect(toImmutableMap(property -> property.getName().getValue().toLowerCase(ENGLISH), Property::getValue)); return Stream.concat(propertyMap.entrySet().stream(), overrideMap.entrySet().stream()) <START> .collect(Collectors.toMap(Entry::getKey, Entry::getValue, (first, second) -> second)) <END> .entrySet() .stream() .map(entry -> new Property(new Identifier(entry.getKey()), entry.getValue())) .collect(toImmutableList()); }</code><technical_language>naming (original, override) -> override</technical_language>

Target:
private static List<Property> applyPropertyOverride(List<Property> properties, List<Property> overrides) { Map<String, Expression> propertyMap = properties.stream() .collect(toImmutableMap(property -> property.getName().getValue().toLowerCase(ENGLISH), Property::getValue)); Map<String, Expression> overrideMap = overrides.stream() .collect(toImmutableMap(property -> property.getName().getValue().toLowerCase(ENGLISH), Property::getValue)); return Stream.concat(propertyMap.entrySet().stream(), overrideMap.entrySet().stream()) .collect(Collectors.toMap(Entry::getKey, Entry::getValue, (original, override) -> override)) .entrySet() .stream() .map(entry -> new Property(new Identifier(entry.getKey()), entry.getValue())) .collect(toImmutableList()); }
Source:
<code>public static boolean areRelated(final IService service, final IDeploymentConfig dc) { return service.getProject().getResources(ResourceKind.POD).stream() .filter(pod -> containsAll(service.getSelector(), pod.getLabels())) .filter(pod -> dc.getName().equals(pod.getAnnotation(OpenShiftAPIAnnotations.DEPLOYMENT_CONFIG_NAME))) <START> .count() > 0; <END> }</code><technical_language>nitpicking I filter is longer running - rearrange for performance, currently filter work number of pods</technical_language>

Target:
public static boolean areRelated(final IService service, final IDeploymentConfig dc) { return service.getProject().getResources(ResourceKind.POD).stream() .filter(pod -> dc.getName().equals(pod.getAnnotation(OpenShiftAPIAnnotations.DEPLOYMENT_CONFIG_NAME))) .filter(pod -> containsAll(service.getSelector(), pod.getLabels())) .count() > 0; }
Source:
<code>public DumpLogTool(VerifiableProperties verifiableProperties, StoreToolsMetrics metrics) throws Exception { fileToRead = verifiableProperties.getString("file.to.read"); hardwareLayoutFilePath = verifiableProperties.getString("hardware.layout.file.path"); partitionLayoutFilePath = verifiableProperties.getString("partition.layout.file.path"); blobIdList = verifiableProperties.getString("blobId.list", ""); logStartOffset = verifiableProperties.getLong("log.start.offset", -1); logEndOffset = verifiableProperties.getLong("log.end.offset", -1); bytesPerSec = verifiableProperties.getLong("bytes.per.sec", 10000); silent = verifiableProperties.getBoolean("silent", true); if (!new File(hardwareLayoutFilePath).exists() || !new File(partitionLayoutFilePath).exists()) { throw new IllegalArgumentException("Hardware or Partition Layout file does not exist"); } ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties); this.clusterMap = ((ClusterAgentsFactory) Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, hardwareLayoutFilePath, partitionLayoutFilePath)).getClusterMap(); if (bytesPerSec > 0) { this.throttler = new Throttler(bytesPerSec, 1000, true, SystemTime.getInstance()); <START> } else if (bytesPerSec < 0) { <END> throw new IllegalArgumentException("BlobsPerSec " + bytesPerSec + " cannot be negative "); } currentTimeInMs = SystemTime.getInstance().milliseconds(); this.metrics = metrics; }</code><technical_language>ensure this load property providing a range 0 Integer MAX</technical_language>

Target:
public DumpLogTool(VerifiableProperties verifiableProperties, StoreToolsMetrics metrics) throws Exception { fileToRead = verifiableProperties.getString("file.to.read"); hardwareLayoutFilePath = verifiableProperties.getString("hardware.layout.file.path"); partitionLayoutFilePath = verifiableProperties.getString("partition.layout.file.path"); blobIdList = verifiableProperties.getString("blobId.list", ""); logStartOffset = verifiableProperties.getLong("log.start.offset", -1); logEndOffset = verifiableProperties.getLong("log.end.offset", -1); bytesPerSec = verifiableProperties.getLongInRange("bytes.per.sec", 10000, 0, 100000000); silent = verifiableProperties.getBoolean("silent", true); if (!new File(hardwareLayoutFilePath).exists() || !new File(partitionLayoutFilePath).exists()) { throw new IllegalArgumentException("Hardware or Partition Layout file does not exist"); } ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties); this.clusterMap = ((ClusterAgentsFactory) Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, hardwareLayoutFilePath, partitionLayoutFilePath)).getClusterMap(); if (bytesPerSec > 0) { this.throttler = new Throttler(bytesPerSec, 1000, true, SystemTime.getInstance()); } currentTimeInMs = SystemTime.getInstance().milliseconds(); this.metrics = metrics; }
Source:
<code>public void run(PortBindings portBindings, Configuration conf, Map<String, String> parameters) throws Exception { String pigCountersJson = parameters.get(PIG_COUNTERS_PROPERTY); PigCounters pigCounters = pigCountersParser.parse(pigCountersJson); <START> Map<String, String> reportParams = collectReportParameters(parameters); <END> List<ReportParam> avroReportParams = convertToAvroReportParams(reportParams, pigCounters); FileSystem fs = FileSystem.get(conf); Path reportPath = portBindings.getOutput().get(REPORT_PORT_OUT_NAME); DataStore.create(avroReportParams, new FileSystemPath(fs, reportPath)); }</code><technical_language>I name this map 'reportCounterNames' give some explanation is map of pig counter names human readable report names. hard for understand is</technical_language>

Target:
public void run(PortBindings portBindings, Configuration conf, Map<String, String> parameters) throws Exception { String pigCountersJson = parameters.get(PIG_COUNTERS_PROPERTY); PigCounters pigCounters = pigCountersParser.parse(pigCountersJson); List<ReportPigCounterMapping> reportCountersMapping = collectReportCountersMapping(parameters); List<ReportParam> reportCounters = reportPigCountersResolver.resolveReportCounters(pigCounters, reportCountersMapping); FileSystem fs = FileSystem.get(conf); Path reportPath = portBindings.getOutput().get(REPORT_PORT_OUT_NAME); DataStore.create(reportCounters, new FileSystemPath(fs, reportPath)); }
Source:
<code>public void testHashCodeDifferent() { RuntimeSettingProvider runtimeSettingProvider1 = createPropsWithDriverName("org.talend.Driver1"); JdbcRuntimeInfo jarRuntimeInfo1 = new JdbcRuntimeInfo(runtimeSettingProvider1, "anyRuntimeClassName"); int hashCode1 = jarRuntimeInfo1.hashCode(); RuntimeSettingProvider runtimeSettingProvider2 = createPropsWithDriverName("org.talend.Driver2"); JdbcRuntimeInfo jarRuntimeInfo2 = new JdbcRuntimeInfo(runtimeSettingProvider2, "anyRuntimeClassName"); int hashCode2 = jarRuntimeInfo2.hashCode(); assertEquals(269161086, hashCode1); <START> assertEquals(269161087, hashCode2); <END> assertNotEquals(hashCode1, hashCode2); }</code><technical_language>hashcodes hardcoded ? depend HashCodeBuilder.toHashCode() implementation</technical_language>

Target:
public void testHashCodeDifferent() { RuntimeSettingProvider runtimeSettingProvider1 = createPropsWithDriverName("org.talend.Driver1"); JdbcRuntimeInfo jdbcRuntimeInfo1 = new JdbcRuntimeInfo(runtimeSettingProvider1, "anyRuntimeClassName"); int hashCode1 = jdbcRuntimeInfo1.hashCode(); RuntimeSettingProvider runtimeSettingProvider2 = createPropsWithDriverName("org.talend.Driver2"); JdbcRuntimeInfo jdbcRuntimeInfo2 = new JdbcRuntimeInfo(runtimeSettingProvider2, "anyRuntimeClassName"); int hashCode2 = jdbcRuntimeInfo2.hashCode(); assertNotEquals(hashCode1, hashCode2); }
Source:
<code>public OAuth2ServiceProvider addProvider(String serviceName, String description, String tokenServerURL, String authorizationServerURL, String userAuthorizationURL, String clientId, String clientSecret, List<String> scopes, Boolean isEnabled) { DirectoryService ds = Framework.getService(DirectoryService.class); try (Session session = ds.open(DIRECTORY_NAME)) { Map<String, Serializable> filter = new HashMap<>(); filter.put("serviceName", serviceName); List<DocumentModel> providers = queryProviders(filter, 1); <START> <END> DocumentModel creationEntry = BaseSession.createEntryModel(null, SCHEMA, null, null); DocumentModel entry = session.createEntry(creationEntry); entry.setProperty(SCHEMA, "serviceName", serviceName); entry.setProperty(SCHEMA, "description", description); entry.setProperty(SCHEMA, "authorizationServerURL", authorizationServerURL); entry.setProperty(SCHEMA, "tokenServerURL", tokenServerURL); entry.setProperty(SCHEMA, "userAuthorizationURL", userAuthorizationURL); entry.setProperty(SCHEMA, "clientId", clientId); entry.setProperty(SCHEMA, "clientSecret", clientSecret); entry.setProperty(SCHEMA, "scopes", StringUtils.join(scopes, ",")); boolean enabled = (clientId != null && clientSecret != null); entry.setProperty(SCHEMA, "enabled", enabled && isEnabled); if (!enabled) { log.info("OAuth2 provider for " + serviceName + " is disabled because clientId and/or clientSecret are empty"); } session.updateEntry(entry); return getProvider(serviceName); } }</code><technical_language>need for this extra empty space</technical_language>

Target:
public OAuth2ServiceProvider addProvider(String serviceName, String description, String tokenServerURL, String authorizationServerURL, String userAuthorizationURL, String clientId, String clientSecret, List<String> scopes, Boolean isEnabled) { DirectoryService ds = Framework.getService(DirectoryService.class); try (Session session = ds.open(DIRECTORY_NAME)) { Map<String, Serializable> filter = new HashMap<>(); filter.put("serviceName", serviceName); List<DocumentModel> providers = queryProviders(filter, 1); DocumentModel creationEntry = BaseSession.createEntryModel(null, SCHEMA, null, null); DocumentModel entry = session.createEntry(creationEntry); entry.setProperty(SCHEMA, "serviceName", serviceName); entry.setProperty(SCHEMA, "description", description); entry.setProperty(SCHEMA, "authorizationServerURL", authorizationServerURL); entry.setProperty(SCHEMA, "tokenServerURL", tokenServerURL); entry.setProperty(SCHEMA, "userAuthorizationURL", userAuthorizationURL); entry.setProperty(SCHEMA, "clientId", clientId); entry.setProperty(SCHEMA, "clientSecret", clientSecret); entry.setProperty(SCHEMA, "scopes", String.join(",", scopes)); boolean enabled = (clientId != null && clientSecret != null); entry.setProperty(SCHEMA, "enabled", enabled && (isEnabled == null ? false : isEnabled)); if (!enabled) { log.info("OAuth2 provider for " + serviceName + " is disabled because clientId and/or clientSecret are empty"); } session.updateEntry(entry); return getProvider(serviceName); } }
Source:
<code>private void updateRecipe() { if (!input.isEmpty()) { IRefineryRecipe recipe = BCARecipeManager.refinery.getRecipe(input.getFluid()); requiredHeat = recipe.getRequiredHeat(); lastRequiredHeat = requiredHeat; outputFluidStack = recipe.getOutput(); inputFluidStack = recipe.getInput(); } else <START> requiredHeat = 0; <END> }</code><technical_language>extra indentation here</technical_language>

Target:
private void updateRecipe() { if (!input.isEmpty()) { IRefineryRecipe recipe = BCARecipeManager.refinery.getRecipe(input.getFluid()); requiredHeat = recipe.getRequiredHeat(); lastRequiredHeat = requiredHeat; outputFluidStack = recipe.getOutput(); inputFluidStack = recipe.getInput(); } else { requiredHeat = 0; } }
Source:
<code><START> private void setPredicatePushdown(JobConf jobConf) { <END> if (this.filterPredicate != null) { ParquetInputFormat.setFilterPredicate(jobConf, this.filterPredicate); } }</code><technical_language>refer "predicate pushdown" in code, lets call this setFilterPredicate</technical_language>

Target:
private void setPredicatePushdown(JobConf jobConf) { if (this.config.filterPredicate != null) { ParquetInputFormat.setFilterPredicate(jobConf, this.config.filterPredicate); } }
Source:
<code>private void notifyListeners(List<CidrAddress> added, List<CidrAddress> removed) { List<CidrAddress> unmodifiableAddedList = Collections.unmodifiableList(added); List<CidrAddress> unmodifiableRemovedList = Collections.unmodifiableList(removed); networkAddressChangeListeners <START> .forEach(listener -> listener.onChanged(unmodifiableAddedList, unmodifiableRemovedList)); <END> }</code><technical_language>Listeners throw exceptions - "bad" listener break notification mechanism, others notified anymore. Also, do contract wrt return time expectation? In case, SafeCaller infrastructure for calls in external code</technical_language>

Target:
private void notifyListeners(List<CidrAddress> added, List<CidrAddress> removed) { List<CidrAddress> unmodifiableAddedList = Collections.unmodifiableList(added); List<CidrAddress> unmodifiableRemovedList = Collections.unmodifiableList(removed); for (NetworkAddressChangeListener listener : networkAddressChangeListeners) { if (safeCaller == null) { break; } NetworkAddressChangeListener safeListener = safeCaller.create(listener, NetworkAddressChangeListener.class) .withTimeout(15000) .onException(exception -> LOGGER.debug("NetworkAddressChangeListener exception {}", exception)) .build(); safeListener.onChanged(unmodifiableAddedList, unmodifiableRemovedList); } }
Source:
<code>static AccountingDate ofYearDay(AccountingChronology chronology, int prolepticYear, int dayOfYear) { if (chronology == null) { <START> throw new DateTimeException("A previously setup chronology is required."); <END> } YEAR.checkValidValue(prolepticYear); DAY_OF_YEAR_RANGE.checkValidValue(dayOfYear, DAY_OF_YEAR); boolean leap = chronology.isLeapYear(prolepticYear); if (dayOfYear > WEEKS_IN_YEAR * DAYS_IN_WEEK && !leap) { throw new DateTimeException("Invalid date 'DayOfYear " + dayOfYear + "' as '" + prolepticYear + "' is not a leap year"); } int month = (leap ? chronology.division.getMonthFromElapsedWeeks((dayOfYear - 1) / DAYS_IN_WEEK, chronology.leapWeekInMonth) : chronology.division.getMonthFromElapsedWeeks((dayOfYear - 1) / DAYS_IN_WEEK)); int dayOfMonth = dayOfYear - (leap ? chronology.division.getWeeksAtStartOfMonth(month, chronology.leapWeekInMonth) : chronology.division.getWeeksAtStartOfMonth(month)) * DAYS_IN_WEEK; return new AccountingDate(chronology, prolepticYear, month, dayOfMonth); }</code><technical_language>IllegalArgumentException DateTimeException for NPE checks (multiple occurrences)</technical_language>

Target:
static AccountingDate ofYearDay(AccountingChronology chronology, int prolepticYear, int dayOfYear) { Objects.requireNonNull(chronology, "A previously setup chronology is required."); YEAR.checkValidValue(prolepticYear); DAY_OF_YEAR_RANGE.checkValidValue(dayOfYear, DAY_OF_YEAR); boolean leap = chronology.isLeapYear(prolepticYear); if (dayOfYear > WEEKS_IN_YEAR * DAYS_IN_WEEK && !leap) { throw new DateTimeException("Invalid date 'DayOfYear " + dayOfYear + "' as '" + prolepticYear + "' is not a leap year"); } int month = (leap ? chronology.division.getMonthFromElapsedWeeks((dayOfYear - 1) / DAYS_IN_WEEK, chronology.leapWeekInMonth) : chronology.division.getMonthFromElapsedWeeks((dayOfYear - 1) / DAYS_IN_WEEK)); int dayOfMonth = dayOfYear - (leap ? chronology.division.getWeeksAtStartOfMonth(month, chronology.leapWeekInMonth) : chronology.division.getWeeksAtStartOfMonth(month)) * DAYS_IN_WEEK; return new AccountingDate(chronology, prolepticYear, month, dayOfMonth); }
Source:
<code>private void initNetworkInterfaces() { AsyncQuery getVmNicsQuery = new AsyncQuery(); getVmNicsQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { List<VmNetworkInterface> nics = (List<VmNetworkInterface>) result; initNetworkInterfaces(networkBehavior, nics); } }; <START> AsyncDataProvider.getVmNicList(getVmNicsQuery, vm.getId()); <END> }</code><technical_language>I"m do need get nics backend again. Changing dc/cluster affect nics. I call query dc/cluster change</technical_language>

Target:
private void initNetworkInterfaces() { if (networkInterfacesInited) { return; } AsyncQuery getVmNicsQuery = new AsyncQuery(); getVmNicsQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { List<VmNetworkInterface> nics = (List<VmNetworkInterface>) result; initNetworkInterfaces(networkBehavior, nics); networkInterfacesInited = true; } }; AsyncDataProvider.getVmNicList(getVmNicsQuery, vm.getId()); }
Source:
<code>public Response statusByDate(@PathParam("date") String date) throws Exception { JSONObject object = new JSONObject(); Optional<BackupMetadata> backupMetadataOptional = this.completedBkups .locate(date) .stream() <START> .filter(backupMetadata -> backupMetadata != null) <END> .filter(backupMetadata -> backupMetadata.getStatus() == Status.FINISHED) .filter( backupMetadata -> backupMetadata.getBackupVersion() == SnapshotBackup.BACKUP_VERSION) .findFirst(); if (!backupMetadataOptional.isPresent()) { object.put("Snapshotstatus", false); } else { object.put("Snapshotstatus", true); object.put("Details", backupMetadataOptional.get().toString()); } return Response.ok(object.toString(), MediaType.APPLICATION_JSON).build(); }</code><technical_language>nit: Objects::nonNull</technical_language>

Target:
public Response statusByDate(@PathParam("date") String date) throws Exception { JSONObject object = new JSONObject(); Optional<BackupMetadata> backupMetadataOptional = this.completedBkups .locate(date) .stream() .filter(Objects::nonNull) .filter(backupMetadata -> backupMetadata.getStatus() == Status.FINISHED) .filter( backupMetadata -> backupMetadata .getBackupVersion() .equals(BackupVersion.SNAPSHOT_BACKUP)) .findFirst(); if (!backupMetadataOptional.isPresent()) { object.put("Snapshotstatus", false); } else { object.put("Snapshotstatus", true); object.put("Details", backupMetadataOptional.get().toString()); } return Response.ok(object.toString(), MediaType.APPLICATION_JSON).build(); }
Source:
<code>public void testLoadUnknown() { Preferences preferences = anyPreferences(); PreferenceStorage storage = new PreferenceStorage(preferences); try { <START> assertEquals(new <END> Object(), storage.load(unknown)); fail("UnsupportedOperationException expected for unknown value class"); } catch (UnsupportedOperationException e) { } }</code><technical_language>I understand this - assertEquals call unreachable correct</technical_language>

Target:
public void testLoadUnknown() { Preferences preferences = anyPreferences(); OsgiPreferenceStorage storage = new OsgiPreferenceStorage(preferences); assertEquals(new Object(), storage.load(unknown)); fail("UnsupportedOperationException expected for unknown value type"); }
Source:
<code>public void testSetDelivery() { Configuration configuration = new Configuration("5d1ec5bd39a74caa1267142706a7fb21"); assertNull(configuration.getDelivery()); Delivery delivery = new Delivery() { @NotNull @Override public DeliveryStatus deliver(@NotNull SessionPayload payload, @NotNull DeliveryParams deliveryParams) { return null; } @NotNull @Override <START> public DeliveryStatus deliver(@NotNull EventPayload report, <END> @NotNull DeliveryParams deliveryParams) { return null; } }; configuration.setDelivery(delivery); assertFalse(configuration.getDelivery() instanceof DefaultDelivery); assertEquals(delivery, configuration.getDelivery()); }</code><technical_language>suggestion public DeliveryStatus deliver(@NotNull EventPayload payload,</technical_language>

Target:
public void testSetDelivery() { Configuration configuration = new Configuration("5d1ec5bd39a74caa1267142706a7fb21"); assertNull(configuration.getDelivery()); Delivery delivery = new Delivery() { @NotNull @Override public DeliveryStatus deliver(@NotNull SessionPayload payload, @NotNull DeliveryParams deliveryParams) { return null; } @NotNull @Override public DeliveryStatus deliver(@NotNull EventPayload payload, @NotNull DeliveryParams deliveryParams) { return null; } }; configuration.setDelivery(delivery); assertFalse(configuration.getDelivery() instanceof DefaultDelivery); assertEquals(delivery, configuration.getDelivery()); }
Source:
<code><START> FilterSupportStatus(boolean isSupported, String reason) { <END> this.isSupported = isSupported; this.reason = reason; }</code><technical_language>nit: FilterSupportStatus() private</technical_language>

Target:
private FilterSupportStatus(boolean isSupported, String reason) { this.isSupported = isSupported; this.reason = reason; }
Source:
<code>public void nonProtectedCheckMethodsTest() { final JavaClasses importedClasses = new ClassFileImporter() .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) .importPackages("com.puppycrawl.tools.checkstyle.checks"); final ArchRule checkMethodsShouldNotBeProtectedRule = methods().that() <START> .areDeclaredInClassesThat().haveNameMatching("^(Abstract).*Check") <END> .should().notBeProtected(); checkMethodsShouldNotBeProtectedRule.check(importedClasses); }</code><technical_language><LINK_1> > Checks protected methods fields. name matching "^(Abstract), this checking methods in classes named "Abstract" allowed protected methods? If is case, result in a failure point of abstract classes is protected methods. Example: <LINK_0> for protected methods in final classes, some overridden super class. Do need distinguish these</technical_language>

Target:
public void nonProtectedCheckMethodsTest() { final String[] methodsWithOverrideAnnotation = { "processFiltered", "getMethodName", "mustCheckName", "postProcessHeaderLines", "getLogMessageId", }; final String ignoreMethodList = String.join("|", methodsWithOverrideAnnotation); final JavaClasses importedClasses = new ClassFileImporter() .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) .importPackages("com.puppycrawl.tools.checkstyle.checks"); final ArchRule checkMethodsShouldNotBeProtectedRule = methods().that() .haveNameNotMatching(".*(" + ignoreMethodList + ")").and() .areDeclaredInClassesThat() .haveSimpleNameEndingWith("Check").and() .areDeclaredInClassesThat() .doNotHaveModifier(JavaModifier.ABSTRACT) .should().notBeProtected(); checkMethodsShouldNotBeProtectedRule.check(importedClasses); }
Source:
<code>private void createLegend(D3 d3Selection) { int titleSize = 5; int legendSquareSize = 12; int legendSize = titleSize + (legendSquareSize * COLORS_SCHEME.length); AtomicInteger rectPos = new AtomicInteger(); AtomicInteger textPos = new AtomicInteger(legendSquareSize); String translate = "translate(0, " + (height - legendSize - 2) + ")"; D3 legendGroup = d3Selection.append("g") .attr("transform", translate); <START> legendGroup.append("text") <END> .attr("class", "map-legend-caption") .attr("x", 0) .attr("y", titleSize * -1) .text(conf.getTitle()); D3 legendValuesGroup = legendGroup.append("g"); legendValuesGroup.selectAll("rect") .data(colorScale.range()) .enter().append("rect") .attr("height", legendSquareSize) .attr("width", legendSquareSize) .attr("y", (d, i, el) -> rectPos.getAndAdd(legendSquareSize)) .attr("fill", (d, i, el) -> d) .append("svg:title").text((d, i, el) -> { return String.join(" - ", getFormattedBoundaryValues((String) d)); }); legendValuesGroup.selectAll("text") .data(colorScale.range()) .enter().append("text") .attr("class", "map-legend-val") .attr("x", legendSquareSize + 2) .attr("y", (d, i, el) -> textPos.getAndAdd(legendSquareSize)) .text((d, i, el) -> { String[] values = getFormattedBoundaryValues((String) d); return "< " + values[1]; }); }</code><technical_language>sense protect this negative? Math.max(0 , height - legendSize - 2);</technical_language>

Target:
private void createLegend(D3 d3Selection) { int titleSize = 5; int legendSquareSize = 12; int legendSize = titleSize + (legendSquareSize * COLORS_SCHEME.length); AtomicInteger rectPos = new AtomicInteger(); AtomicInteger textPos = new AtomicInteger(legendSquareSize); String translate = "translate(0, " + (height - legendSize - 2) + ")"; D3 legendGroup = d3Selection.append("g").attr("transform", translate); legendGroup.append("text").attr("class", "map-legend-caption") .attr("x", 0).attr("y", titleSize * -1) .text(conf.getTitle()); D3 legendValuesGroup = legendGroup.append("g"); legendValuesGroup.selectAll("rect") .data(colorScale.range()).enter().append("rect") .attr("height", legendSquareSize).attr("width", legendSquareSize) .attr("y", (d, i, el) -> rectPos.getAndAdd(legendSquareSize)) .attr("fill", (d, i, el) -> d) .append("svg:title") .text((d, i, el) -> String.join(" - ", getFormattedBoundaryValues(d)) ); legendValuesGroup.selectAll("text").data(colorScale.range()).enter().append("text") .attr("class", "map-legend-val").attr("x", legendSquareSize + 2) .attr("y", (d, i, el) -> textPos.getAndAdd(legendSquareSize)).text( (d, i, el) -> buildLegendValue(d, i)); }
Source:
<code>private void registerShellListener() { <START> isActive.set(true); <END> final Display display = PlatformUI.getWorkbench().getDisplay(); if (display.isDisposed()) return; display.asyncExec(new Runnable() { public void run() { Shell shell = display.getActiveShell(); if (shell != null) { shell.addShellListener(new ShellAdapter() { public void shellActivated(ShellEvent e) { isActive.set(true); } public void shellClosed(ShellEvent e) { isActive.set(false); } public void shellDeactivated(ShellEvent e) { isActive.set(false); } }); } } }); }</code><technical_language>if display is active here, set isActive true. line is needed</technical_language>

Target:
private void registerShellListener() { isActive.set(true); final Display display = PlatformUI.getWorkbench().getDisplay(); if (display.isDisposed()) return; display.asyncExec(new Runnable() { public void run() { Shell shell = display.getActiveShell(); if (shell != null) { shell.addShellListener(new ShellAdapter() { public void shellActivated(ShellEvent e) { isActive.set(true); } public void shellClosed(ShellEvent e) { isActive.set(false); } public void shellDeactivated(ShellEvent e) { isActive.set(false); } }); } else handleIssue(IStatus.WARNING, UIText.Activator_CantRegisterShellListener, null, false); } }); }
Source:
<code>private Button createChangeAction() { <START> final Button createChange = new Button("Create change"); createChange.setTitle("Create change directly in browser"); <END> createChange.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { CreateChangeAction.call(createChange, getProjectKey().toString()); } }); return createChange; }</code><technical_language>* Move texts a .properties file. * Remove 'final' * style of button differs other action buttons [1] [1] <LINK_0></technical_language>

Target:
private Button createChangeAction() { final Button createChange = new Button(Util.C.buttonCreateChange()); createChange.setTitle(Util.C.buttonCreateChangeDescription()); createChange.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { CreateChangeAction.call(createChange, getProjectKey().get()); } }); return createChange; }
Source:
<code>private void setUnixLookAndFeel(){ try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { <START> Exceptions.printStackTrace(ex); <END> } }</code><technical_language>Please log error, print stdout. LAF if exception is thrown here</technical_language>

Target:
private void setUnixLookAndFeel(){ try { UIManager.put("swing.boldMetal", Boolean.FALSE); UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); setModuleSettings("true"); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { logger.log(Level.WARNING, "Error setting crossplatform look-and-feel, setting default look-and-feel",ex); setModuleSettings("false"); } }