auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testParseAnyType() throws Exception { <START> AnyType xml = new AnyType(); <END> XmlPullParser parser = Xml.createParser(); parser.setInput(new StringReader(XML)); XmlNamespaceDictionary namespaceDictionary = new XmlNamespaceDictionary(); Xml.parseElement(parser, xml, namespaceDictionary, null); assertTrue(xml.attr instanceof String); assertTrue(xml.elem.toString(), xml.elem instanceof ArrayList<?>); assertTrue(xml.rep.toString(), xml.rep instanceof ArrayList<?>); assertTrue(xml.value instanceof ValueType); assertTrue(xml.value.content instanceof XmlEnumTest.AnyEnum); assertTrue(xml.anyEnum instanceof XmlEnumTest.AnyEnum); assertTrue(xml.anotherEnum instanceof XmlEnumTest.AnyEnum); assertTrue(xml.anyEnum.equals(AnyEnum.ENUM_1)); assertTrue(xml.anotherEnum.equals(AnyEnum.ENUM_2)); assertTrue(xml.value.content.equals(AnyEnum.ENUM_1)); XmlSerializer serializer = Xml.createSerializer(); ByteArrayOutputStream out = new ByteArrayOutputStream(); serializer.setOutput(out, "UTF-8"); namespaceDictionary.serialize(serializer, "any", xml); assertEquals(XML, out.toString()); }</code><technical_language>this variable unused</technical_language>

Target:
public void testParseAnyType() throws Exception { AnyType xml = new AnyType(); XmlPullParser parser = Xml.createParser(); parser.setInput(new StringReader(XML)); XmlNamespaceDictionary namespaceDictionary = new XmlNamespaceDictionary(); Xml.parseElement(parser, xml, namespaceDictionary, null); assertTrue(xml.attr instanceof String); assertTrue(xml.elem.toString(), xml.elem instanceof ArrayList<?>); assertTrue(xml.rep.toString(), xml.rep instanceof ArrayList<?>); assertNotNull(xml.value); assertNotNull(xml.value.content); assertNotNull(xml.anyEnum); assertNotNull(xml.anotherEnum); assertEquals(xml.anyEnum, AnyEnum.ENUM_1); assertEquals(xml.anotherEnum, AnyEnum.ENUM_2); assertEquals(xml.value.content, AnyEnum.ENUM_1); XmlSerializer serializer = Xml.createSerializer(); ByteArrayOutputStream out = new ByteArrayOutputStream(); serializer.setOutput(out, "UTF-8"); namespaceDictionary.serialize(serializer, "any", xml); assertEquals(XML, out.toString()); }
Source:
<code>public <T> void writeJson(T object, TypeHandler<T> typeHandler, Writer writer) throws IOException { GsonPersistedData persistedData = (GsonPersistedData) typeHandler.serialize(object, new GsonPersistedDataSerializer()); gson.toJson(persistedData.getElement(), writer); <START> writer.close(); <END> }</code><technical_language>a method is passed AutoCloseable object (like a Writer) argument, method is absolved of responsibility of closing -- is callee's responsibility close resource. I of this -- person creates AutoCloseable (e.g. Writer) is responsible for closing it. in mind, suggest do call writer.close() here, instead move writeJson(T, TypeHandler<T>, File) overload, is culprit. creates a FileWriter, closes it, in fact is responsibility (by principle)</technical_language>

Target:
public <T> void writeJson(T object, TypeHandler<T> typeHandler, Writer writer) { GsonPersistedData persistedData = (GsonPersistedData) typeHandler.serialize(object, new GsonPersistedDataSerializer()); gson.toJson(persistedData.getElement(), writer); }
Source:
<code>public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertEscalationEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, ""); <END> assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertEscalationEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertEscalationEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public List<RestError> getErrors() { <START> return Optional.ofNullable(errors).orElse(Collections.emptyList()); <END> }</code><technical_language>I simply return errors is initialized constructor, ? (if unmodifiable prevent changes returned collection)</technical_language>

Target:
public List<RestError> getErrors() { return unmodifiableList(ofNullable(errors).orElse(emptyList())); }
Source:
<code>public void stop() { if (isRunning()) { process.destroy(); try { if (stdout !=null) { <START> stdout.close(); <END> } if (stdin !=null) { stdin.close(); } } catch (IOException e) { throw new RuntimeException(e.getMessage(),e); } finally { running.set(false); } } }</code><technical_language>Is this needed</technical_language>

Target:
public void stop() { if (isRunning()) { process.destroy(); running.set(false); } }
Source:
<code>private KafkaController createController() { Properties props = new Properties(); <START> props.put("bootstrap.servers", kafkaHosts); <END> props.put("group.id", groupId); props.put("enable.auto.commit", false); props.put("key.deserializer", io.confluent.kafka.serializers.KafkaAvroDeserializer.class); props.put("value.deserializer", io.confluent.kafka.serializers.KafkaAvroDeserializer.class); props.put("schema.registry.url", schemaRegistries); props.put("specific.avro.reader", false); props.put("auto.offset.reset", "earliest"); props.put("max.poll.records", "200"); KafkaConsumer<?, ?> kafkaConsumer; kafkaConsumer = new KafkaConsumer(props); this.controller = new KafkaController(kafkaConsumer, messageStream); return controller; }</code><technical_language>weird string property names constants for producer</technical_language>

Target:
private KafkaController createController() { Properties props = new Properties(); props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaHosts); props.put(ConsumerConfig.GROUP_ID_CONFIG, groupId); props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false); props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, io.confluent.kafka.serializers.KafkaAvroDeserializer.class); props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, io.confluent.kafka.serializers.KafkaAvroDeserializer.class); props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 200); props.put(KafkaAvroDeserializerConfig.SCHEMA_REGISTRY_URL_CONFIG, schemaRegistries); props.put(KafkaAvroDeserializerConfig.SPECIFIC_AVRO_READER_CONFIG, false); final KafkaConsumer<?, ?> kafkaConsumer = new KafkaConsumer(props); return new KafkaController(kafkaConsumer, new MessageStream()); }
Source:
<code>public OperationResult<Long> d_msetnx(final String... keysvalues) { if (CompressionStrategy.NONE == connPool.getConfiguration().getCompressionStrategy()) { return connPool.executeWithFailover(new MultiKeyOperation<Long>(Arrays.asList(keysvalues), OpName.MSETNX) { @Override public Long execute(Jedis client, ConnectionContext state) { return client.msetnx(keysvalues); } }); } else { return connPool.executeWithFailover(new CompressionValueMultiKeyOperation<Long>(Arrays.asList(keysvalues), OpName.MSETNX) { @Override <START> public Long execute(final Jedis client, final ConnectionContext state) throws DynoException { <END> return client.msetnx(keysvalues); } }); } }</code><technical_language>compressing values here</technical_language>

Target:
public OperationResult<Long> d_msetnx(final String... keysvalues) { if (CompressionStrategy.NONE == connPool.getConfiguration().getCompressionStrategy()) { return connPool.executeWithFailover(new MultiKeyOperation<Long>(Arrays.asList(keysvalues), OpName.MSETNX) { @Override public Long execute(Jedis client, ConnectionContext state) { return client.msetnx(keysvalues); } }); } else { return connPool.executeWithFailover(new CompressionValueMultiKeyOperation<Long>(Arrays.asList(keysvalues), OpName.MSETNX) { @Override public Long execute(final Jedis client, final ConnectionContext state) { return client.msetnx(compressMultiKeyValue(state,keysvalues)); } }); } }
Source:
<code>public Result preprocessEnter(@NotNull PsiFile file, @NotNull Editor editor, @NotNull Ref<Integer> caretOffset, @NotNull Ref<Integer> caretAdvance, @NotNull DataContext dataContext, @Nullable EditorActionHandler originalHandler) { if (!(file instanceof BashFile)) { return Result.Continue; } int offset = caretOffset.get(); PsiElement psi = file.findElementAt(offset); <START> if (psi == null || psi.getNode().getElementType() == BashTokenTypes.LINE_FEED) { <END> return Result.Continue; } boolean isWrapping = Boolean.TRUE.equals(DataManager.getInstance().loadFromDataContext(dataContext, AutoHardWrapHandler.AUTO_WRAP_LINE_IN_PROGRESS_KEY)); boolean inString = findWrappingContext(psi) instanceof BashString; if (!inString && !isWrapping) { return Result.Continue; } if (offset >= psi.getTextOffset() && psi.getNode().getElementType() != BashTokenTypes.LINE_FEED) { EditorModificationUtil.insertStringAtCaret(editor, "\\\n"); PsiDocumentManager mgr = PsiDocumentManager.getInstance(file.getProject()); mgr.commitDocument(editor.getDocument()); return Result.Stop; } return Result.Continue; }</code><technical_language>psi.getNode() null</technical_language>

Target:
public Result preprocessEnter(@NotNull PsiFile file, @NotNull Editor editor, @NotNull Ref<Integer> caretOffset, @NotNull Ref<Integer> caretAdvance, @NotNull DataContext dataContext, @Nullable EditorActionHandler originalHandler) { if (!(file instanceof BashFile)) { return Result.Continue; } int offset = caretOffset.get(); CharSequence content = editor.getDocument().getCharsSequence(); if (offset >= content.length() || content.charAt(offset) == '\n') { return Result.Continue; } if (PsiDocumentManager.getInstance(file.getProject()).isUncommited(editor.getDocument())) { return Result.Continue; } PsiElement psi = file.findElementAt(offset); if (psi == null || psi.getNode() == null) { return Result.Continue; } boolean isUserTyping = !Boolean.TRUE.equals(DataManager.getInstance().loadFromDataContext(dataContext, AutoHardWrapHandler.AUTO_WRAP_LINE_IN_PROGRESS_KEY)); if (isUserTyping && !isInString(psi)) { return Result.Continue; } if (offset >= psi.getTextOffset() && psi.getNode().getElementType() != BashTokenTypes.LINE_FEED) { EditorModificationUtil.insertStringAtCaret(editor, "\\\n"); return Result.Stop; } return Result.Continue; }
Source:
<code><START> public void testExtraBufferSpace_Public() throws <END> Exception { PrivateKey privateKey = DefaultKeys.getPrivateKey("RSA"); byte[] encoded = privateKey.getEncoded(); byte[] longBuffer = new byte[encoded.length + 147]; System.arraycopy(encoded, 0, longBuffer, 0, encoded.length); KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(longBuffer)); }</code><technical_language>wrong name (should _Private)</technical_language>

Target:
public void testExtraBufferSpace_Public() throws Exception { PublicKey publicKey = DefaultKeys.getPublicKey("RSA"); byte[] encoded = publicKey.getEncoded(); byte[] longBuffer = new byte[encoded.length + 147]; System.arraycopy(encoded, 0, longBuffer, 0, encoded.length); KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(longBuffer)); }
Source:
<code>public void upgradeSchema(SQLiteDatabase db, int fromVersion, int toVersion) { if (fromVersion < getDBVersionIntroducedAt()) { createTables(db, toVersion); return; } String tableName = getTableName(); ArrayList<Column> columns = getElements(fromVersion + 1, toVersion); if (columns.size() == 0) { return; } ArrayList<String> columnCommands = new ArrayList<String>(columns.size()); for (Column column : columns) { columnCommands.add("ADD COLUMN " + column); } <START> String string = "ALTER TABLE " + tableName + " " + TextUtils.join(", ", columnCommands) + ";"; <END> Log.d("Wikipedia", string); db.execSQL(string); }</code><technical_language>I prefer a more meaningful name for this variable, alterTableStatement, similar</technical_language>

Target:
public void upgradeSchema(SQLiteDatabase db, int fromVersion, int toVersion) { if (fromVersion < getDBVersionIntroducedAt()) { createTables(db, toVersion); return; } String tableName = getTableName(); ArrayList<Column> columns = getElements(fromVersion + 1, toVersion); if (columns.size() == 0) { return; } ArrayList<String> columnCommands = new ArrayList<String>(columns.size()); for (Column column : columns) { columnCommands.add("ADD COLUMN " + column); } String alterTableString = "ALTER TABLE " + tableName + " " + TextUtils.join(", ", columnCommands) + ";"; Log.d("Wikipedia", alterTableString); db.execSQL(alterTableString); }
Source:
<code>public void toRequestDocs_Test() throws IOException, ParserException { final NameMapper nameMapper = new NameMapper(TEST_NAME_MAPPER_FILE); <START> final List<RequestDescriptor> rds = Arrays.asList( <END> createAmazonRequestDescriptor(), createSpectraRequestDescriptor()); final ImmutableMap<String, String> result = toRequestDocs(rds, nameMapper); assertThat(result.size(), is(2)); assertThat(result.get(AMAZON_NAME_AFTER), is(AMAZON_DESCRIPTOR)); assertThat(result.get(SPECTRA_NAME_AFTER), is(SPECTRA_DESCRIPTOR)); }</code><technical_language>This ImmutableList</technical_language>

Target:
public void toRequestDocs_Test() throws IOException, ParserException { final NameMapper nameMapper = new NameMapper(TEST_NAME_MAPPER_FILE); final ImmutableList<RequestDescriptor> rds = ImmutableList.of( createAmazonRequestDescriptor(), createSpectraRequestDescriptor()); final ImmutableMap<String, String> result = toRequestDocs(rds, nameMapper); assertThat(result.size(), is(2)); assertThat(result.get(AMAZON_NAME_AFTER), is(AMAZON_DESCRIPTOR)); assertThat(result.get(SPECTRA_NAME_AFTER), is(SPECTRA_DESCRIPTOR)); }
Source:
<code>public void delete_GivenUnarchivedContentAndDontValidateMeInTrue_ShouldDeleteSuccessfully () throws Exception { Structure testStructure = null; try { testStructure = createStructure("JUnit Test Structure_" + String.valueOf(new Date().getTime()), "junit_test_structure_" + String.valueOf(new Date().getTime())); Contentlet newContentlet = createContentlet(testStructure, null, false); newContentlet.setStringProperty(Contentlet.DONT_VALIDATE_ME, "anarchy"); contentletAPI.delete(newContentlet, user, false); Contentlet foundContentlet = contentletAPI.find(newContentlet.getInode(), user, false); <START> assertTrue( foundContentlet == null || foundContentlet.getInode() == null || foundContentlet.getInode().isEmpty() ); <END> AssetUtil.assertDeleted(newContentlet.getInode(), newContentlet.getIdentifier(), "contentlet"); } finally { APILocator.getStructureAPI().delete(testStructure, user); } }</code><technical_language>this replaced UtilMethods.isSet()</technical_language>

Target:
public void delete_GivenUnarchivedContentAndDontValidateMeInTrue_ShouldDeleteSuccessfully () throws Exception { Structure testStructure = null; try { testStructure = createStructure("JUnit Test Structure_" + String.valueOf(new Date().getTime()), "junit_test_structure_" + String.valueOf(new Date().getTime())); final Contentlet newContentlet = createContentlet(testStructure, null, false); newContentlet.setStringProperty(Contentlet.DONT_VALIDATE_ME, "anarchy"); contentletAPI.delete(newContentlet, user, false); final Contentlet foundContentlet = contentletAPI.find(newContentlet.getInode(), user, false); assertTrue( !UtilMethods.isSet(foundContentlet) || !UtilMethods.isSet(foundContentlet.getInode()) ); AssetUtil.assertDeleted(newContentlet.getInode(), newContentlet.getIdentifier(), "contentlet"); } finally { APILocator.getStructureAPI().delete(testStructure, user); } }
Source:
<code>protected void execResource(final String p) { try { try (InputStream in = JythonShell.class.getClassLoader().getResourceAsStream(p)) { if (in != null) { execStream(in, "resource " + p); } else { log.error("Cannot load resource " + p); } } <START> } catch (IOException e) { <END> log.error(e.getMessage(), e); } }</code><technical_language>catch part of innter try block, need nest blocks</technical_language>

Target:
protected void execResource(final String p) { try (InputStream in = JythonShell.class.getClassLoader().getResourceAsStream(p)) { if (in != null) { execStream(in, "resource " + p); } else { log.error("Cannot load resource " + p); } } catch (IOException e) { log.error(e.getMessage(), e); } }
Source:
<code>public Response sendRequest(String method, String url, long timeoutMs, Map<String, String> headers, String body) { try { OkHttpClient client = getClient(timeoutMs); okhttp3.Response response = null; try { okhttp3.Request.Builder builder = new okhttp3.Request.Builder().url(url); switch (method) { case "get": builder.get(); break; case "delete": builder.delete(RequestBody.create(JSON, body)); break; <START> case "patch": <END> builder.patch(RequestBody.create(JSON, body)); break; case "post": builder.post(RequestBody.create(JSON, body)); break; case "put": builder.put(RequestBody.create(JSON, body)); break; default: throw new IllegalArgumentException("Unknown method type: " + method); } for (Map.Entry<String, String> entry : headers.entrySet()) { builder.addHeader(entry.getKey(), entry.getValue()); } Call call = client.newCall(builder.build()); response = call.execute(); ResponseBody responseBody = response.body(); String result = ""; if (responseBody != null) { result = responseBody.string(); } return OkHttpResponse.httpResponse(response.code(), parseHeaders(response.headers()), result); } catch (IOException ex) { return OkHttpResponse.ioError(ex.toString()); } catch (Exception ex) { return OkHttpResponse.unknownError(ex.toString()); } finally { if (response != null) { response.close(); } } } catch (Exception e) { return OkHttpResponse.unknownError(e.toString()); } }</code><technical_language>Nitpick: I extract constants,</technical_language>

Target:
public Response sendRequest(String method, String url, long timeoutMs, Map<String, String> headers, String body) { try { OkHttpClient client = getClient(timeoutMs); okhttp3.Response response = null; try { okhttp3.Request request = makeRequest(method, url, headers, body); Call call = client.newCall(request); response = call.execute(); ResponseBody responseBody = response.body(); String result = ""; if (responseBody != null) { result = responseBody.string(); } return OkHttpResponse.httpResponse(response.code(), parseHeaders(response.headers()), result); } catch (IOException ex) { return OkHttpResponse.ioError(ex.toString()); } catch (Exception ex) { return OkHttpResponse.unknownError(ex.toString()); } finally { if (response != null) { response.close(); } } } catch (Exception e) { return OkHttpResponse.unknownError(e.toString()); } }
Source:
<code><START> private String aliasesFor(final UserProfile up) { <END> final User user = up.getUser(); final Person person = user.getPerson(); final StringBuilder builder = new StringBuilder(user.getUsername()); if (person != null) { if (person.getEmployee() != null) { addAlias(builder, person.getEmployee().getEmployeeNumber()); } if (person.getStudent() != null) { addAlias(builder, person.getStudent().getNumber()); } } return builder.toString(); }</code><technical_language>this return jsonArray strings</technical_language>

Target:
private JsonArray aliasesFor(final UserProfile up) { final User user = up.getUser(); final Person person = user.getPerson(); final JsonArray result = new JsonArray(); result.add(new JsonPrimitive(user.getUsername())); if (person != null) { if (person.getEmployee() != null) { result.add(new JsonPrimitive(person.getEmployee().getEmployeeNumber())); } if (person.getStudent() != null) { result.add(new JsonPrimitive(person.getStudent().getNumber())); } } return result; }
Source:
<code>public Response button() throws Exception { final PNGTranscoder transcoder = new PNGTranscoder(); transcoder.addTranscodingHint( PNGTranscoder.KEY_WIDTH, (float) Tv.HUNDRED ); transcoder.addTranscodingHint( PNGTranscoder.KEY_HEIGHT, (float) Tv.FIFTY ); final ByteArrayOutputStream png = new ByteArrayOutputStream(); transcoder.transcode( <START> new TranscoderInput(IOUtils.toInputStream(svg())), <END> new TranscoderOutput(png) ); return Response .ok(png.toByteArray(), MediaType.SVG_UTF_8.toString()) .build(); }</code><technical_language>this.svg()</technical_language>

Target:
public Response button() throws Exception { final PNGTranscoder transcoder = new PNGTranscoder(); transcoder.addTranscodingHint( PNGTranscoder.KEY_WIDTH, (float) Tv.HUNDRED ); transcoder.addTranscodingHint( PNGTranscoder.KEY_HEIGHT, (float) Tv.FIFTY ); final ByteArrayOutputStream png = new ByteArrayOutputStream(); transcoder.transcode( new TranscoderInput(IOUtils.toInputStream(this.svg())), new TranscoderOutput(png) ); return Response .ok(png.toByteArray(), MediaType.SVG_UTF_8.toString()) .build(); }
Source:
<code><START> default void setWarnings(List<PrestoWarning> warnings) <END></code><technical_language>Silent defaults this code hard reason compile time *and* run time</technical_language>

Target:
default void setWarnings(List<PrestoWarning> warnings) { throw new UnsupportedOperationException(); }
Source:
<code>public FileBasedConfig openSystemConfig(Config parent, FS fs) { File <START> config = <END> fs.discoverGitSystemConfig(); if (config == null) { return new FileBasedConfig(null, fs) { public void load() { } public boolean isOutdated() { return false; } }; } return new FileBasedConfig(parent, config, fs); }</code><technical_language>name this configFile</technical_language>

Target:
public FileBasedConfig openSystemConfig(Config parent, FS fs) { File configFile = fs.discoverGitSystemConfig(); if (configFile == null) { return new FileBasedConfig(null, fs) { public void load() { } public boolean isOutdated() { return false; } }; } return new FileBasedConfig(parent, configFile, fs); }
Source:
<code>void setOperationException(RouterException exception) { <START> RouterUtils.replaceOperationException(operationException, (RouterException) exception, this::getPrecedenceLevel); <END> }</code><technical_language>need cast accepting a RouterException</technical_language>

Target:
void setOperationException(RouterException exception) { RouterUtils.replaceOperationException(operationException, exception, this::getPrecedenceLevel); }
Source:
<code>public JUnit5EngineExecutionContext prepare(JUnit5EngineExecutionContext context) throws Exception { ExtensionRegistry extensionRegistry = populateNewExtensionRegistryFromExtendWith(testMethod, context.getExtensionRegistry()); Object testInstance = context.getTestInstanceProvider().getTestInstance(); TestExtensionContext testExtensionContext = new MethodBasedTestExtensionContext(context.getExtensionContext(), context.getExecutionListener(), this, testInstance); return context.extend().withExtensionRegistry(extensionRegistry).withExtensionContext(testExtensionContext).build(); <START> } <END></code><technical_language>Please do collapse this</technical_language>

Target:
public JUnit5EngineExecutionContext prepare(JUnit5EngineExecutionContext context) throws Exception { ExtensionRegistry extensionRegistry = populateNewExtensionRegistryFromExtendWith(this.testMethod, context.getExtensionRegistry()); Object testInstance = context.getTestInstanceProvider().getTestInstance(); TestExtensionContext testExtensionContext = new MethodBasedTestExtensionContext(context.getExtensionContext(), context.getExecutionListener(), this, testInstance); return context.extend() .withExtensionRegistry(extensionRegistry) .withExtensionContext(testExtensionContext) .build(); }
Source:
<code>private String getVepInput(JobExecution jobExecution) { JobParameters jobParameters = jobExecution.getJobParameters(); <START> return VepUtils.resolveVepInput( <END> jobParameters.getString(JobParametersNames.OUTPUT_DIR_ANNOTATION), jobParameters.getString(JobParametersNames.INPUT_STUDY_ID), jobParameters.getString(JobParametersNames.INPUT_VCF_ID)); }</code><technical_language>I thought methods VepUtils moved URLHelper, path handling together</technical_language>

Target:
private String getVepInput(JobExecution jobExecution) { JobParameters jobParameters = jobExecution.getJobParameters(); return URLHelper.resolveVepInput( jobParameters.getString(JobParametersNames.OUTPUT_DIR_ANNOTATION), jobParameters.getString(JobParametersNames.INPUT_STUDY_ID), jobParameters.getString(JobParametersNames.INPUT_VCF_ID)); }
Source:
<code>public void shouldDeleteAllAllergies() throws Exception { handle(newDeleteRequest(getURI(), new Parameter("reason", "unit test"))); Allergy allergy = Context.getPatientService().getAllergyByUuid(getUuid()); Allergies allergies = Context.getPatientService().getAllergies(allergy.getPatient()); Assert.assertTrue(allergy.isVoided()); <START> Assert.assertEquals("unit test", allergy.getVoidReason()); <END> Assert.assertEquals(Allergies.UNKNOWN, allergies.getAllergyStatus()); }</code><technical_language>I thought assert status is unknown making request</technical_language>

Target:
public void shouldDeleteAllAllergies() throws Exception { Allergy allergy = Context.getPatientService().getAllergyByUuid(getUuid()); Allergies allergies = Context.getPatientService().getAllergies(allergy.getPatient()); Assert.assertEquals(Allergies.SEE_LIST, allergies.getAllergyStatus()); Assert.assertFalse(allergy.isVoided()); handle(newDeleteRequest(getURI(), new Parameter("reason", "unit test"))); allergy = Context.getPatientService().getAllergyByUuid(getUuid()); allergies = Context.getPatientService().getAllergies(allergy.getPatient()); Assert.assertTrue(allergy.isVoided()); Assert.assertEquals("unit test", allergy.getVoidReason()); Assert.assertEquals(Allergies.UNKNOWN, allergies.getAllergyStatus()); }
Source:
<code>public ValidationResult validate(Object value) { <START> assert value instanceof String; <END> String cidr = (String) value; ValidationResult result = new ValidationResult(); if (!CidrValidator.isCidrFormatValid(cidr)) { return failWith(result, getThisFieldMustContainCidrInFormatMsg()); } else if (!CidrValidator.isCidrNetworkAddressValid(cidr)) { return failWith(result, getCidrNotNetworkAddress()); } else { result.setSuccess(true); return result; } }</code><technical_language>1. check assert (value == null || instanceof String)? 2. Please add some text explaining this assertion in case fails (e.g. "This validation applied a String")</technical_language>

Target:
public ValidationResult validate(Object value) { assert value==null ||value instanceof String; String cidr = (String) value; ValidationResult result = new ValidationResult(); result.setSuccess(true); if (!CidrValidator.isCidrFormatValid(cidr)) { failWith(result, getThisFieldMustContainCidrInFormatMsg()); } else if (!CidrValidator.isCidrNetworkAddressValid(cidr)) { failWith(result, getCidrNotNetworkAddress()); } return result; }
Source:
<code>private FileTailerState getSaveStateFromFile() { FileTailerState fileTailerState; try { <START> fileTailerState = fileTailerStateProcessor.loadState(); <END> } catch (FileTailerStateProcessorException e) { LOG.info("Fail state do not exist. Start reading all directory"); return null; } return fileTailerState; }</code><technical_language>simply return fileTailerStateProcessor.loadState();. eliminate local variable</technical_language>

Target:
private FileTailerState getSaveStateFromFile() { try { return fileTailerStateProcessor.loadState(); } catch (FileTailerStateProcessorException e) { LOG.info("Fail state do not exist. Start reading all directory"); return null; } }
Source:
<code>private double[] getPointByDate(Date date) { double[] point = {0, 0}; IIssue[] items; Date dueDate = new Date(date.getTime() + mOneDay); for (IIssue issue : mStories) { double estimation; if (issue.getStatusUpdated(dueDate, ITSEnum.CLOSED_STATUS) != null) { continue; } try { point[0] += getStoryPoint(dueDate, issue); <START> ArrayList<TaskObject> tmpTasks = mTaskMap.get(issue.getIssueID()); <END> for (TaskObject task : tmpTasks) { if (task.getStatus(dueDate) == TaskObject.STATUS_DONE) continue; point[1] += getTaskPoint(dueDate, task); } } catch (Exception e) { continue; } } for (IIssue issue : mDropedStories) { double estimation; if (issue.getStatusUpdated(dueDate, ITSEnum.CLOSED_STATUS) != null) continue; try { point[0] += getStoryPoint(dueDate, issue); ArrayList<TaskObject> tmpTasks = mDropedTaskMap.get(issue.getIssueID()); for (TaskObject task : tmpTasks) { if (task.getStatus(dueDate) == TaskObject.STATUS_DONE) continue; point[1] += getTaskPoint(dueDate, task); } } catch (Exception e) { continue; } } return point; }</code><technical_language>issue -> story</technical_language>

Target:
private double[] getPointByDate(Date date) { double[] point = {0, 0}; Date dueDate = new Date(date.getTime() + mOneDay); for (IIssue story : mStories) { if (story.getStatusUpdated(dueDate, ITSEnum.CLOSED_STATUS) != null) { continue; } try { point[0] += getStoryPoint(dueDate, story); ArrayList<TaskObject> tmpTasks = mStoryIdToTasks.get(story.getIssueID()); for (TaskObject task : tmpTasks) { if (task.getStatus(dueDate) == TaskObject.STATUS_DONE) continue; point[1] += getTaskPoint(dueDate, task); } } catch (Exception e) { continue; } } for (IIssue issue : mDroppedStories) { double estimation; if (issue.getStatusUpdated(dueDate, ITSEnum.CLOSED_STATUS) != null) continue; try { point[0] += getStoryPoint(dueDate, issue); ArrayList<TaskObject> tmpTasks = mDroppedStoryIdToTasks.get(issue.getIssueID()); for (TaskObject task : tmpTasks) { if (task.getStatus(dueDate) == TaskObject.STATUS_DONE) continue; point[1] += getTaskPoint(dueDate, task); } } catch (Exception e) { continue; } } return point; }
Source:
<code>public String getUuidProperty() { <START> return getObject().getUuid(); <END> }</code><technical_language>log entry a uuid return uuid of source</technical_language>

Target:
public String getUuidProperty() { return LOG_ENTRY_IDENTIFIER; }
Source:
<code>public synchronized void stop(final StopContext context) { <START> router.ifPresent(r -> r.stop()); <END> }</code><technical_language>able pass r::stop</technical_language>

Target:
public synchronized void stop(final StopContext context) { if (router != null) { router.stop(); } }
Source:
<code>public SourceRequest createOrUpdateRequest(Publisher source, UsageType usageType, <START> Id applicationId, String applicationUrl, String email, String reason) throws UnsupportedEncodingException, MessagingException { <END> Optional<SourceRequest> existing = sourceRequestStore.getBy(applicationId, source); Preconditions.checkNotNull(source); Preconditions.checkNotNull(applicationId); Preconditions.checkNotNull(usageType); if (existing.isPresent()) { return updateSourceRequest(existing.get(), usageType, applicationUrl, email, reason); } else { return createSourceRequest(source, usageType, applicationId, applicationUrl, email, reason); } }</code><technical_language>odd place throw UnsupportedEncodingException, thrown a RTE</technical_language>

Target:
public SourceRequest createOrUpdateRequest(Publisher source, UsageType usageType, Id applicationId, String applicationUrl, String email, String reason) throws MessagingException { Optional<SourceRequest> existing = sourceRequestStore.getBy(applicationId, source); Preconditions.checkNotNull(source); Preconditions.checkNotNull(applicationId); Preconditions.checkNotNull(usageType); if (existing.isPresent()) { return updateSourceRequest(existing.get(), usageType, applicationUrl, email, reason); } else { try { return createSourceRequest(source, usageType, applicationId, applicationUrl, email, reason); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } }
Source:
<code>public long count(String name, String namePattern, Long networkId, String networkName, HivePrincipal principal) { final CriteriaBuilder cb = criteriaBuilder(); final CriteriaQuery<Device> criteria = cb.createQuery(Device.class); final Root<Device> from = criteria.from(Device.class); final Predicate[] predicates = CriteriaHelper.deviceListPredicates(cb, from, ofNullable(name), ofNullable(namePattern), ofNullable(networkId), ofNullable(networkName), ofNullable(principal)); criteria.where(predicates); final TypedQuery<Device> query = createQuery(criteria); <START> return query.getResultList().size(); <END> }</code><technical_language>Change getResultList().size() predicate count</technical_language>

Target:
public long count(String name, String namePattern, Long networkId, String networkName, HivePrincipal principal) { final CriteriaBuilder cb = criteriaBuilder(); final CriteriaQuery<Long> criteria = cb.createQuery(Long.class); final Root<Device> from = criteria.from(Device.class); final Predicate[] predicates = CriteriaHelper.deviceCountPredicates(cb, from, ofNullable(name), ofNullable(namePattern), ofNullable(networkId), ofNullable(networkName), ofNullable(principal)); criteria.where(predicates); criteria.select(cb.count(from)); return count(criteria); }
Source:
<code>public void showDuplicatePicturePopup() { String uploadTitleFormat = getString(R.string.upload_title_duplicate); DialogUtil.showAlertDialog(getActivity(), getString(R.string.warning), String.format(Locale.getDefault(), uploadTitleFormat, uploadItem.getFileName()), () -> { uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP); onNextButtonClicked(); }, <START> () -> { <END> }); }</code><technical_language>DialogUtil class supports passing null for a click action, I 3 lines</technical_language>

Target:
public void showDuplicatePicturePopup() { String uploadTitleFormat = getString(R.string.upload_title_duplicate); DialogUtil.showAlertDialog(getActivity(), getString(R.string.warning), String.format(Locale.getDefault(), uploadTitleFormat, uploadItem.getFileName()), () -> { uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP); onNextButtonClicked(); }, null); }
Source:
<code>public void start(BundleContext context) throws Exception { super.start(context); PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); adapterFactory = createAdapterFactory(); descriptorsToImages = new HashMap<ImageWithDimensionDescriptor, Image>(); ressourceMissingDocumentProvider = new ResourceMissingDocumentProvider(); workspaceImageFigureRefresher = new WorkspaceImageFigureRefresher(); workspaceImageFigureRefresher.init(); imageSelectorDescriptorRegistryListener = new ImageSelectorDescriptorRegistryListener(); imageSelectorDescriptorRegistryListener.init(); workspaceImageResourceChangeListener = new WorkspaceImageResourceChangeListener(); <START> ResourcesPlugin.getWorkspace().addResourceChangeListener(workspaceImageResourceChangeListener); <END> layoutDataManagerRegistryListener = new LayoutDataManagerRegistryListener(); layoutDataManagerRegistryListener.init(); UIJob job = new UIJob("InitSynchronizedCommand") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class); Command command = commandService.getCommand("org.eclipse.sirius.diagram.ui.command.synchronizedDiagram"); command.isEnabled(); return new Status(IStatus.OK, ID, "Init synchronized command performed succesfully"); } }; job.schedule(); }</code><technical_language>I prefer this listener registration lazy added in specific class (even access) instead of in a plugin activator. a org.eclipse.sirius.business.api.componentization.ViewpointRegistry.getInstance() done in a threadsafe way</technical_language>

Target:
public void start(BundleContext context) throws Exception { super.start(context); PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); adapterFactory = createAdapterFactory(); descriptorsToImages = new HashMap<ImageWithDimensionDescriptor, Image>(); ressourceMissingDocumentProvider = new ResourceMissingDocumentProvider(); workspaceImageFigureRefresher = new WorkspaceImageFigureRefresher(); workspaceImageFigureRefresher.init(); imageSelectorDescriptorRegistryListener = new ImageSelectorDescriptorRegistryListener(); imageSelectorDescriptorRegistryListener.init(); layoutDataManagerRegistryListener = new LayoutDataManagerRegistryListener(); layoutDataManagerRegistryListener.init(); UIJob job = new UIJob("InitSynchronizedCommand") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class); Command command = commandService.getCommand("org.eclipse.sirius.diagram.ui.command.synchronizedDiagram"); command.isEnabled(); return new Status(IStatus.OK, ID, "Init synchronized command performed succesfully"); } }; job.schedule(); }
Source:
<code>public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { ClassLoader old = pushClassLoader(name); try { NotificationListener notificationListener = new NotificationListener() { @Override public void handleNotification(Notification notification, Object handback) { ClassLoader previous = null; try { <START> previous = Thread.currentThread().getContextClassLoader(); <END> Thread.currentThread().setContextClassLoader(listener.getClass().getClassLoader()); listener.handleNotification(notification, handback); } finally { Thread.currentThread().setContextClassLoader(previous); } } }; listeners.put(listener, notificationListener); delegate.addNotificationListener(name, notificationListener, filter, handback); } finally { resetClassLoader(old); } }</code><technical_language>This needs WildFlySecurityManager.getContextClassLoaderPrivileged()</technical_language>

Target:
public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { ClassLoader old = pushClassLoader(name); try { NotificationListener notificationListener = new NotificationListener() { @Override public void handleNotification(Notification notification, Object handback) { ClassLoader previous = null; try { previous = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(listener.getClass().getClassLoader()); listener.handleNotification(notification, handback); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(previous); } } }; listeners.put(listener, notificationListener); delegate.addNotificationListener(name, notificationListener, filter, handback); } finally { resetClassLoader(old); } }
Source:
<code>private static List<String> parsePath(String path) { String basePath; int endIndex = path.indexOf(QUERY_SEPARATOR); if (endIndex >= 0) { basePath = path.substring(0, endIndex); } else { basePath = path; } try { basePath = URLDecoder.decode(basePath, <START> StandardCharsets.UTF_8.name()); <END> } catch (UnsupportedEncodingException exception) { throw new IllegalStateException("Cannot decode URL " + basePath, exception); } verifyRelativePath(basePath); List<String> splitList = Arrays.asList(basePath.split(PATH_SEPARATOR)); if (basePath.endsWith(PATH_SEPARATOR)) { List<String> result = new ArrayList<>(splitList.size() + 1); result.addAll(splitList); result.add(""); return result; } else { return splitList; } }</code><technical_language>Unclear if routes % character supported, this change a regression for these. For instance: @Route("percent%man") public class SpaceMan extends VerticalLayout { ... } this point in code, % is for some reason encoded (as %25), causing call URLDecoder.decode throw</technical_language>

Target:
private static List<String> parsePath(String path) { String basePath; int endIndex = path.indexOf(QUERY_SEPARATOR); if (endIndex >= 0) { basePath = path.substring(0, endIndex); } else { basePath = path; } basePath = decode(basePath, "path"); verifyRelativePath(basePath); List<String> splitList = Arrays.asList(basePath.split(PATH_SEPARATOR)); if (basePath.endsWith(PATH_SEPARATOR)) { List<String> result = new ArrayList<>(splitList.size() + 1); result.addAll(splitList); result.add(""); return result; } else { return splitList; } }
Source:
<code>public void process(Exchange exchange) throws Exception { <START> final String minionHandle = exchange.getIn().getBody(String.class); <END> OnmsMinion minion; if (minionDao != null) { minion = minionDao.findById(minionHandle); if (minion == null) { minion = new OnmsMinion(); minion.setId(minionHandle); minion.setLocation("localhost"); } Date lastCheckedIn = new Date(); minion.setLastCheckedIn(lastCheckedIn); minionDao.saveOrUpdate(minion); } }</code><technical_language>passing a serialized version of MinionIdentity instead of a string here</technical_language>

Target:
public void process(Exchange exchange) throws Exception { final MinionIdentityDTO minionHandle = exchange.getIn().getBody(MinionIdentityDTO.class); String minionId = minionHandle.getId(); String minionLocation = minionHandle.getLocation(); OnmsMinion minion; if (minionDao != null) { minion = minionDao.findById(minionId); if (minion == null) { minion = new OnmsMinion(); minion.setId(minionId); minion.setLocation(minionLocation); } Date lastCheckedIn = new Date(); minion.setLastCheckedIn(lastCheckedIn); minionDao.saveOrUpdate(minion); } }
Source:
<code>public AdapterPatientLocationQuerySecuredResponseType adapterPatientLocationQuerySecured( AdapterPatientLocationQuerySecuredRequestType request) { <START> context.toString(); <END> return PatientLocationQueryImpl.getPatientLocationQuery().getAdapterPLQSecuredResponse(request); }</code><technical_language>Do need this</technical_language>

Target:
public AdapterPatientLocationQuerySecuredResponseType adapterPatientLocationQuerySecured( AdapterPatientLocationQuerySecuredRequestType request) { return PatientLocationQueryImpl.getPatientLocationQuery().getAdapterPLQSecuredResponse(request); }
Source:
<code>private void notifySerialDataReceived(final String address, final byte[] data) { try { synchronized (serialDataReceiveListeners) { <START> ScheduledExecutorService executor = Executors.newScheduledThreadPool(serialDataReceiveListeners.size()); <END> for (final ISerialDataReceiveListener listener:serialDataReceiveListeners) { executor.execute(new Runnable() { public void run() { listener.serialDataReceived(address, data); } }); } executor.shutdown(); } } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>moment thread pool size number of listeners notify. want set a thread limit a constant (that modified) set thread pool size minimum constant real listeners size. This way, if notify for example 60 listeners do create 60 threads</technical_language>

Target:
private void notifySerialDataReceived(final String address, final byte[] data) { try { synchronized (serialDataReceiveListeners) { ScheduledExecutorService executor = Executors.newScheduledThreadPool(Math.min(MAXIMUM_PARALLEL_LISTENER_THREADS, packetReceiveListeners.size())); for (final ISerialDataReceiveListener listener:serialDataReceiveListeners) { executor.execute(new Runnable() { public void run() { listener.serialDataReceived(address, data); } }); } executor.shutdown(); } } catch (Exception e) { e.printStackTrace(); } }
Source:
<code>private void checkParentPermission(Package newPackage, AbstractRowLevelSecurityRepositoryDecorator.Action action) { Package parent = newPackage.getParent(); if (parent != null) { boolean checkPackage = isParentUpdated(action, newPackage); if (checkPackage && !userPermissionEvaluator.hasPermission(new PackageIdentity(parent.getId()), PackagePermission.WRITEMETA)) { <START> throw new MolgenisDataException( <END> String.format("No [%s] permission on package '%s'", toMessagePermission(action), parent.getLabel())); } } else { if (!currentUserIsSuOrSystem() && isParentUpdated(action, newPackage)) { throw new MolgenisDataException("Only superusers are allowed to create packages without a parent."); } } }</code><technical_language>expect a permission exception here</technical_language>

Target:
private void checkParentPermission(Package newPackage, AbstractRowLevelSecurityRepositoryDecorator.Action action) { Package parent = newPackage.getParent(); if (parent != null) { boolean checkPackage = isParentUpdated(action, newPackage); if (checkPackage && !userPermissionEvaluator.hasPermission(new PackageIdentity(parent.getId()), PackagePermission.WRITEMETA)) { throw new PackagePermissionException(PackagePermission.WRITEMETA, parent); } } else { if (!currentUserIsSuOrSystem() && isParentUpdated(action, newPackage)) { throw new NullParentPackageNotSuException(); } } }
Source:
<code>public IncrementalScoreDirector(IncrementalScoreDirectorFactory scoreDirectorFactory, boolean constraintMatchEnabledPreference, IncrementalScoreCalculator<Solution_> incrementalScoreCalculator) { super(scoreDirectorFactory, constraintMatchEnabledPreference); if (constraintMatchEnabledPreference && !(incrementalScoreCalculator instanceof ConstraintMatchAwareIncrementalScoreCalculator)) { throw new IllegalStateException("The score calculator " + incrementalScoreCalculator + " must implement " + ConstraintMatchAwareIncrementalScoreCalculator.class.getSimpleName() + " when constraintMatchEnabledPreference is true."); <START> } <END> this.incrementalScoreCalculator = incrementalScoreCalculator; }</code><technical_language>I fear able add this fail fast (although I proposal add more fail fasts :)). other fail fasts added in PR fine</technical_language>

Target:
public IncrementalScoreDirector(IncrementalScoreDirectorFactory scoreDirectorFactory, boolean constraintMatchEnabledPreference, IncrementalScoreCalculator<Solution_> incrementalScoreCalculator) { super(scoreDirectorFactory, constraintMatchEnabledPreference); this.incrementalScoreCalculator = incrementalScoreCalculator; }
Source:
<code>public static synchronized SpanObserver subscribe(String name, SpanObserver observer) { if (observers.containsKey(name)) { log.warn("Overwriting existing SpanObserver with name by new observer: {}", <START> UnsafeArg.of("name", name), <END> UnsafeArg.of("observer", observer)); } if (observers.size() >= 5) { log.warn("Five or more SpanObservers registered: {}", UnsafeArg.of("observers", observers.keySet())); } SpanObserver currentValue = observers.put(name, observer); computeObserversList(); return currentValue; }</code><technical_language>this safe</technical_language>

Target:
public static synchronized SpanObserver subscribe(String name, SpanObserver observer) { if (observers.containsKey(name)) { log.warn("Overwriting existing SpanObserver with name by new observer: {}", SafeArg.of("name", name), UnsafeArg.of("observer", observer)); } if (observers.size() >= 5) { log.warn("Five or more SpanObservers registered: {}", SafeArg.of("observers", observers.keySet())); } SpanObserver currentValue = observers.put(name, observer); computeObserversList(); return currentValue; }
Source:
<code>public synchronized void setApprovedSignatures(String[] signatures) throws IOException { Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); approvedSignatures.clear(); List<String> goodSignatures = new ArrayList<>(signatures.length); for (String signature : signatures) { try { StaticWhitelist.parse(signature); goodSignatures.add(signature); } catch (IOException e) { <START> LOG.warning("Ignoring malformed signature: " + signature); <END> } } approvedSignatures.addAll(goodSignatures); save(); reconfigure(); }</code><technical_language>Add exception warning is some diagnostics</technical_language>

Target:
public synchronized void setApprovedSignatures(String[] signatures) throws IOException { Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); approvedSignatures.clear(); List<String> goodSignatures = new ArrayList<>(signatures.length); for (String signature : signatures) { try { StaticWhitelist.parse(signature); goodSignatures.add(signature); } catch (IOException e) { LOG.warning("Ignoring malformed signature: " + signature + " (Occurred exception: " + e.toString() + ")"); } } approvedSignatures.addAll(goodSignatures); save(); reconfigure(); }