auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public SpinnerWidget(Context context, FormEntryPrompt prompt, boolean autoAdvance) { super(context, prompt); if (context instanceof AdvanceToNextListener) { listener = (AdvanceToNextListener) context; } View view = inflate(context, R.layout.spinner_layout, null); spinner = view.findViewById(R.id.spinner); choices = new String[items.size() + 1]; for (int i = 0; i < items.size(); i++) { choices[i] = prompt.getSelectChoiceText(items.get(i)); } choices[items.size()] = getContext().getString(R.string.select_one); SpinnerAdapter adapter = new SpinnerAdapter(getContext(), android.R.layout.simple_spinner_item, choices, TypedValue.COMPLEX_UNIT_DIP, getQuestionFontSize()); spinner.setAdapter(adapter); spinner.setPrompt(prompt.getQuestionText()); spinner.setEnabled(!prompt.isReadOnly()); spinner.setFocusable(!prompt.isReadOnly()); String s = null; if (prompt.getAnswerValue() != null) { s = ((Selection) prompt.getAnswerValue().getValue()).getValue(); } <START> programmaticallySetSelection(items.size()); <END> if (s != null) { for (int i = 0; i < items.size(); ++i) { String match = items.get(i).getValue(); if (match.equals(s)) { programmaticallySetSelection(i); } } } spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (userActionOnSpinner) { if (position != items.size() && autoAdvance && listener != null) { listener.advance(); } widgetValueChanged(); } userActionOnSpinner = true; } @Override public void onNothingSelected(AdapterView<?> arg0) { } }); addAnswerView(view); }</code><technical_language>Is case in this happen a user-initiated selection set? If not, I clearer a flag track of time not</technical_language>

Target:
public SpinnerWidget(Context context, FormEntryPrompt prompt, boolean autoAdvance) { super(context, prompt); if (context instanceof AdvanceToNextListener) { listener = (AdvanceToNextListener) context; } View view = inflate(context, R.layout.spinner_layout, null); spinner = view.findViewById(R.id.spinner); spinnerAdapter = new SpinnerAdapter(getContext(), getChoices(prompt)); spinner.setAdapter(spinnerAdapter); spinner.setPrompt(prompt.getQuestionText()); spinner.setEnabled(!prompt.isReadOnly()); spinner.setFocusable(!prompt.isReadOnly()); spinner.setId(ViewIds.generateViewId()); spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (!firstSetSelectionCall) { if (position != items.size() && autoAdvance && listener != null) { listener.advance(); } widgetValueChanged(); } spinnerAdapter.updateSelectedItemPosition(spinner.getSelectedItemPosition()); firstSetSelectionCall = false; } @Override public void onNothingSelected(AdapterView<?> arg0) { } }); fillInPreviousAnswer(prompt); addAnswerView(view); }
Source:
<code>protected void addBlobToDocument(String docId, String xpath, String fileName, String extension) throws IOException { <START> File file = Files.createTempFile(fileName, ".".concat(extension)).toFile(); <END> RestHelper.operation("Blob.AttachOnDocument", file, Map.of(), Map.of("document", docId, "xpath", xpath)); }</code><technical_language>simple concatenation: suggestion File file = Files.createTempFile(fileName, "." + extension).toFile();</technical_language>

Target:
protected void addBlobToDocument(String docId, String xpath, String fileName, String extension) throws IOException { File file = Files.createTempFile(fileName, "." + extension).toFile(); RestHelper.operation("Blob.AttachOnDocument", file, Map.of(), Map.of("document", docId, "xpath", xpath)); }
Source:
<code>@Test public void triggersNewBuild() throws Exception { TaskListener listener = new StreamTaskListener(System.out, Charset.defaultCharset()); Launcher launcher = j.jenkins.createLauncher(listener); FreeStyleProject project = j.createFreeStyleProject(); MercurialSCM scm = new MercurialSCM(null, tmp.getRoot().getPath(), null, null, null, null, false, null); project.setScm(scm); File repo = tmp.getRoot(); m.hg(repo, "init"); m.touchAndCommit(repo, "x"); PollingResult pr = scm.compare( launcher, listener, <START> new MercurialTagAction("tip","",null,"default"), <END> listener.getLogger(), Computer.currentComputer().getNode(), new FilePath(tmp.getRoot()), project); assertEquals(PollingResult.Change.SIGNIFICANT, pr.change); }</code><technical_language>I guess this null (same in MercurialSCMTest)</technical_language>

Target:
@Test public void triggersNewBuild() throws Exception { TaskListener listener = new StreamTaskListener(System.out, Charset.defaultCharset()); Launcher launcher = j.jenkins.createLauncher(listener); FreeStyleProject project = j.createFreeStyleProject(); MercurialSCM scm = new MercurialSCM(null, tmp.getRoot().getPath(), null, null, null, null, false, null); project.setScm(scm); File repo = tmp.getRoot(); m.hg(repo, "init"); m.touchAndCommit(repo, "x"); PollingResult pr = scm.compare( launcher, listener, new MercurialTagAction("tip","",null,null), listener.getLogger(), Computer.currentComputer().getNode(), new FilePath(tmp.getRoot()), project); assertEquals(PollingResult.Change.SIGNIFICANT, pr.change); }
Source:
<code>protected void processStatsReport( ITestDevice device, InputStreamSource dataStream, DeviceMetricData runData) { <START> Integer count = reportsPerDevice.putIfAbsent(device, 1); if (count != null) { reportsPerDevice.put(device, count + 1); } <END> }</code><technical_language>FYI computeIfPresent() computeIfAbsent this a bit cleaner, this is you</technical_language>

Target:
protected void processStatsReport( ITestDevice device, InputStreamSource dataStream, DeviceMetricData runData) { reportsPerDevice.computeIfPresent(device, (k, v) -> v + 1); reportsPerDevice.putIfAbsent(device, 1); }
Source:
<code>String systemTempPath() throws IOException { <START> return context.tempFolder.getRoot().getCanonicalPath().replace("\\", "/"); <END> }</code><technical_language>replace context.tempFolder.getRoot() simply context.getTempFolder(), expose tempFolder in GeoGig's FunctionalContext class</technical_language>

Target:
String systemTempPath() throws IOException { return context.getTempFolder().getCanonicalPath().replace("\\", "/"); }
Source:
<code>public void test_forExpression_simple() { final String expression = "x == \"j.y\""; final JoinConditionAnalysis analysis = analyze(expression); Assert.assertEquals(expression, analysis.getOriginalExpression()); Assert.assertTrue(analysis.canHashJoin()); Assert.assertFalse(analysis.isAlwaysTrue()); Assert.assertFalse(analysis.isAlwaysFalse()); Assert.assertEquals( ImmutableList.of(Pair.of("x", "y")), equalitiesToPairs(analysis.getEquiConditions()) ); Assert.assertEquals( ImmutableList.of(), exprsToStrings(analysis.getNonEquiConditions()) ); <START> Assert.assertThat(analysis.getRightKeyColumns(), CoreMatchers.is(ImmutableList.of("y"))); <END> }</code><technical_language>Is this Assert.assertEquals</technical_language>

Target:
public void test_forExpression_simple() { final String expression = "x == \"j.y\""; final JoinConditionAnalysis analysis = analyze(expression); Assert.assertEquals(expression, analysis.getOriginalExpression()); Assert.assertTrue(analysis.canHashJoin()); Assert.assertFalse(analysis.isAlwaysTrue()); Assert.assertFalse(analysis.isAlwaysFalse()); Assert.assertEquals( ImmutableList.of(Pair.of("x", "y")), equalitiesToPairs(analysis.getEquiConditions()) ); Assert.assertEquals( ImmutableList.of(), exprsToStrings(analysis.getNonEquiConditions()) ); Assert.assertEquals(analysis.getRightEquiConditionKeys(), ImmutableSet.of("y")); }
Source:
<code>private static boolean isSameDay(Date date1, Date date2) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date1); <START> Calendar calendar2 = Calendar.getInstance(); <END> calendar2.setTime(date2); return calendar.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR) && calendar.get(Calendar.DAY_OF_YEAR) == calendar2.get(Calendar.DAY_OF_YEAR); }</code><technical_language>This isSameDay called frequently <LINK_0> kinda confused is this getInstance returning a new object? If cache objects</technical_language>

Target:
private static boolean isSameDay(Date date1, Date date2) { calendar.setTime(date1); calendar2.setTime(date2); return calendar.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR) && calendar.get(Calendar.DAY_OF_YEAR) == calendar2.get(Calendar.DAY_OF_YEAR); }
Source:
<code>public @Nullable Range getFixedYRange() { return <START> this.fFixedYRange; <END> }</code><technical_language>remove this</technical_language>

Target:
public @Nullable Range getFixedYRange() { return fFixedYRange; }
Source:
<code>public JsonObject getFeRegion(BigDecimal latitude, BigDecimal longitude) throws IOException, MalformedURLException { <START> final URL url = new URL(String.format("%s?type=fe&latitude=%s&longitude=%s", this.endpointUrl, <END> URLEncoder.encode(latitude.toString(), "UTF-8"), URLEncoder.encode(longitude.toString(), "UTF-8"))); try (InputStream in = StreamUtils.getURLInputStream(url, this.connectTimeout, this.readTimeout)) { JsonReader reader = Json.createReader(in); JsonObject json = reader.readObject(); reader.close(); return json.getJsonObject("fe"); } }</code><technical_language>String.format is slow. Preferrer StringBuilder simple string concatenation +</technical_language>

Target:
public JsonObject getFeRegion(BigDecimal latitude, BigDecimal longitude) throws IOException, MalformedURLException { final URL url = new URL(this.endpointUrl + "?type=fe" + "&latitude=" + URLEncoder.encode(latitude.toString(), "UTF-8") + "&longitude=" + URLEncoder.encode(longitude.toString(), "UTF-8") ); try (InputStream in = StreamUtils.getURLInputStream(url, this.connectTimeout, this.readTimeout)) { JsonReader reader = Json.createReader(in); JsonObject json = reader.readObject(); reader.close(); return json.getJsonObject("fe"); } }
Source:
<code>public void testList() { for (String region : api.getConfiguredRegions()) { StackApi stackApi = api.getStackApi(region); List<Stack> stacks = stackApi.list(); <START> assertThat(stacks).isNotNull(); <END> } }</code><technical_language>Is this enough guarantee call works? check if is empty, setup test in a returns a non-empty list, assert (including deserialization) works</technical_language>

Target:
public void testList() { for (String region : api.getConfiguredRegions()) { StackApi stackApi = api.getStackApi(region); List<Stack> stacks = stackApi.list(); assertThat(stacks).isNotEmpty(); int oldStackSize = stacks.size(); CreateStack createStack = CreateStack.builder().name(getName()).templateUrl(TEMPLATE_URL).build(); Stack stack = stackApi.create(createStack); assertThat(stack).isNotNull(); stacks = stackApi.list(); assertThat(stacks.size()).isEqualTo(oldStackSize + 1); } }
Source:
<code>public void sendMessage(String topic, String message) { ZooKeeperNode zookeeper = cluster.getZooKeeper(); <START> for(Entity e : cluster.getCluster().getChildren()) { <END> if(e instanceof KafkaBroker) { break; } } Optional<Entity> anyBrokerNodeInCluster = Iterables.tryFind(cluster.getCluster().getChildren(), Predicates.and( Predicates.instanceOf(KafkaBroker.class), EntityPredicates.attributeEqualTo(KafkaBroker.SERVICE_UP, true))); if (anyBrokerNodeInCluster.isPresent()) { KafkaBroker broker = (KafkaBroker)anyBrokerNodeInCluster.get(); Properties props = new Properties(); props.put("metadata.broker.list", format("%s:%d", broker.getAttribute(KafkaBroker.HOSTNAME), broker.getKafkaPort())); props.put("bootstrap.servers", format("%s:%d", broker.getAttribute(KafkaBroker.HOSTNAME), broker.getKafkaPort())); props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); Producer<String, String> producer = new KafkaProducer<>(props); try { ((KafkaZooKeeper)cluster.getZooKeeper()).createTopic(topic); Thread.sleep(Duration.seconds(1).toMilliseconds()); ProducerRecord<String, String> data = new ProducerRecord<>(topic, message); producer.send(data); producer.close(); } catch (InterruptedException e) { e.printStackTrace(); } } else { throw new InvalidParameterException("No kafka broker node found"); } }</code><technical_language>this loop omitted</technical_language>

Target:
public void sendMessage(String topic, String message) { Optional<Entity> anyBrokerNodeInCluster = Iterables.tryFind(cluster.getCluster().getChildren(), Predicates.and( Predicates.instanceOf(KafkaBroker.class), EntityPredicates.attributeEqualTo(KafkaBroker.SERVICE_UP, true))); if (anyBrokerNodeInCluster.isPresent()) { KafkaBroker broker = (KafkaBroker)anyBrokerNodeInCluster.get(); Properties props = new Properties(); props.put("metadata.broker.list", format("%s:%d", broker.getAttribute(KafkaBroker.HOSTNAME), broker.getKafkaPort())); props.put("bootstrap.servers", format("%s:%d", broker.getAttribute(KafkaBroker.HOSTNAME), broker.getKafkaPort())); props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); Producer<String, String> producer = new KafkaProducer<>(props); try { ((KafkaZooKeeper)cluster.getZooKeeper()).createTopic(topic); Thread.sleep(Duration.seconds(1).toMilliseconds()); ProducerRecord<String, String> data = new ProducerRecord<>(topic, message); producer.send(data); producer.close(); } catch (InterruptedException e) { e.printStackTrace(); } } else { throw new InvalidParameterException("No kafka broker node found"); } }
Source:
<code>public Response getRunnerDependencies( @ApiParam(value = "The Dockstore client version") @QueryParam("client_version") String clientVersion, @ApiParam(value = "Python version, only relevant for the cwltool runner") @DefaultValue("2") @QueryParam("python_version") String pythonVersion, @ApiParam(value = "The tool runner", allowableValues = "cwltool") @DefaultValue("cwltool") @QueryParam("runner") String runner, @ApiParam(value = "Response type", allowableValues = "json, text") @DefaultValue("text") @QueryParam("output") String output, @Context ContainerRequestContext containerRequestContext) { if (!("cwltool").equals(runner)) { return Response.noContent().build(); } boolean unwrap = !("json").equals(output); String fileVersion = PipHelper.convertSemVerToAvailableVersion(clientVersion); try { String content = Resources.toString(this.getClass().getClassLoader() .getResource("requirements/" + fileVersion + "/requirements" + (pythonVersion.startsWith("3") ? "3" : "") + ".txt"), StandardCharsets.UTF_8); Map<String, String> pipDepMap = PipHelper.convertPipRequirementsStringToMap(content); return Response.status(Response.Status.OK).type(unwrap ? MediaType.TEXT_PLAIN : MediaType.APPLICATION_JSON) .entity(unwrap ? content : pipDepMap).build(); } catch (IOException e) { <START> e.printStackTrace(); <END> return Response.serverError().build(); } }</code><technical_language>LOG.error a stack trace throw a CustomWebApplicationException other end points, error code 500 in this case</technical_language>

Target:
public Response getRunnerDependencies( @ApiParam(value = "The Dockstore client version") @QueryParam("client_version") String clientVersion, @ApiParam(value = "Python version, only relevant for the cwltool runner") @DefaultValue("2") @QueryParam("python_version") String pythonVersion, @ApiParam(value = "The tool runner", allowableValues = "cwltool") @DefaultValue("cwltool") @QueryParam("runner") String runner, @ApiParam(value = "Response type", allowableValues = "json, text") @DefaultValue("text") @QueryParam("output") String output, @Context ContainerRequestContext containerRequestContext) { if (!("cwltool").equals(runner)) { return Response.noContent().build(); } boolean unwrap = !("json").equals(output); String fileVersion = PipHelper.convertSemVerToAvailableVersion(clientVersion); try { String content = Resources.toString(this.getClass().getClassLoader() .getResource("requirements/" + fileVersion + "/requirements" + (pythonVersion.startsWith("3") ? "3" : "") + ".txt"), StandardCharsets.UTF_8); Map<String, String> pipDepMap = PipHelper.convertPipRequirementsStringToMap(content); return Response.status(Response.Status.OK).type(unwrap ? MediaType.TEXT_PLAIN : MediaType.APPLICATION_JSON) .entity(unwrap ? content : pipDepMap).build(); } catch (IOException e) { throw new CustomWebApplicationException("Could not retrieve runner dependencies file: " + e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } }
Source:
<code>public static String extractStringFromTokens(final String tokenString, final String tokens) { String resultString = ""; final StringTokenizer tk = new StringTokenizer(tokenString, tokens); final StringBuffer outString = new StringBuffer(); <START> while (tk.hasMoreTokens()) { <END> outString.append(tk.nextToken()); } resultString = outString.toString(); return resultString; }</code><technical_language>guaranteed tokenString tokens null extractStringFromTokens method is called? If not, while (tk.hasMoreTokens()) wil throuw a NPE. Reference: <LINK_0>,%20java.lang.String)</technical_language>

Target:
public static String extractStringFromTokens(final String tokenString, final String tokens) { String resultString = ""; if (StringUtils.isNotEmpty(tokens)) { final StringTokenizer tk = new StringTokenizer(tokenString, tokens); final StringBuffer outString = new StringBuffer(); while (tk.hasMoreTokens()) { outString.append(tk.nextToken()); } resultString = outString.toString(); } else { resultString = tokenString; } return resultString; }
Source:
<code>public void updateBookmark() { ReadingList.DAO.anyListContainsTitleAsync(ReadingListDaoProxy.key(getTitle()), new CallbackTask.Callback<ReadingListPage>() { @Override public void success(@Nullable ReadingListPage page) { <START> if (page != null) { <END> getActivity().setResult(PageActivity.RESULT_PAGE_SAVED); } if (!isAdded()) { return; } if (page != null) { pageActionTabsCallback.updateBookmark(true); page.touch(); ReadingListPageDao.instance().upsert(page); if (page.savedOrSaving()) { ReadingListPageDao.instance().markOutdated(page); } } else { pageActionTabsCallback.updateBookmark(false); } } }); }</code><technical_language>I this isAdded() check</technical_language>

Target:
public void updateBookmark() { ReadingList.DAO.anyListContainsTitleAsync(ReadingListDaoProxy.key(getTitle()), new CallbackTask.Callback<ReadingListPage>() { @Override public void success(@Nullable ReadingListPage page) { if (!isAdded()) { return; } if (page != null) { pageActionTabsCallback.updateBookmark(true); page.touch(); ReadingListPageDao.instance().upsert(page); if (page.savedOrSaving()) { ReadingListPageDao.instance().markOutdated(page); } } else { pageActionTabsCallback.updateBookmark(false); } } }); }
Source:
<code>public CommandSpec build() { if (this.childCommandMap == null) { checkNotNull(this.executor, "An executor is required"); } else { ChildCommandElementExecutor childDispatcher = new ChildCommandElementExecutor(this.executor); for (Map.Entry<List<String>, ? extends CommandCallable> spec : this.childCommandMap.entrySet()) { childDispatcher.register(spec.getValue(), spec.getKey()); } if (this.args == DEFAULT_ARG) { arguments(this.executor == null ? childDispatcher : optional(childDispatcher)); } else { if (this.executor == null) { arguments(this.args, childDispatcher); } else { arguments(firstParsing(childDispatcher, this.args)); } } executor(childDispatcher); } return new CommandSpec(this.args, this.executor, this.description, this.extendedDescription, this.permission, <START> this.argumentParser, sourceType, sourceTypeDeep); <END> }</code><technical_language>this.sourceType this.sourceTypeDeep</technical_language>

Target:
public CommandSpec build() { if (this.childCommandMap == null) { checkNotNull(this.executor, "An executor is required"); } else { ChildCommandElementExecutor childDispatcher = new ChildCommandElementExecutor(this.executor); for (Map.Entry<List<String>, ? extends CommandCallable> spec : this.childCommandMap.entrySet()) { childDispatcher.register(spec.getValue(), spec.getKey()); } if (this.args == DEFAULT_ARG) { arguments(this.executor == null ? childDispatcher : optional(childDispatcher)); } else { if (this.executor == null) { arguments(this.args, childDispatcher); } else { arguments(firstParsing(childDispatcher, this.args)); } } executor(childDispatcher); } return new CommandSpec(this.args, this.executor, this.description, this.extendedDescription, this.permission, this.argumentParser, this.sourceType, this.sourceTypeDeep); }
Source:
<code>public void updateStatus(Component component, Collection<DefaultIssue> newIssues) { <START> Collection<DefaultIssue> shortBranchIssues = shortBranchIssuesFactory.create(component); <END> Tracking<DefaultIssue, DefaultIssue> tracking = tracker.track(newIssues, shortBranchIssues); for (Map.Entry<DefaultIssue, DefaultIssue> e : tracking.getMatchedRaws().entrySet()) { issueLifecycle.copyResolution(e.getKey(), e.getValue()); } }</code><technical_language>shortBranchIssuesFactory more a loader now, rename class create method</technical_language>

Target:
public void updateStatus(Component component, Collection<DefaultIssue> newIssues) { Collection<ShortBranchIssue> shortBranchIssues = resolvedShortBranchIssuesLoader.create(component); Tracking<DefaultIssue, ShortBranchIssue> tracking = tracker.track(newIssues, shortBranchIssues); for (Map.Entry<DefaultIssue, ShortBranchIssue> e : tracking.getMatchedRaws().entrySet()) { ShortBranchIssue issue = e.getValue(); issueLifecycle.copyResolution(e.getKey(), issue.getStatus(), issue.getResolution()); } }
Source:
<code>protected List<SearchItem> execute(SearchImagesCmd command) { WebTarget webResource = null; Integer limit = command.getLimit(); if (limit == null) { webResource = getBaseResource() .path("/images/search") .queryParam("term", command.getTerm()); } else { webResource = getBaseResource() .path("/images/search") .queryParam("term", command.getTerm()) <START> .queryParam("limit", command.getLimit()); <END> } LOGGER.trace("GET: {}", webResource); return webResource.request().accept(MediaType.APPLICATION_JSON).get(new TypeReference<List<SearchItem>>() { }); }</code><technical_language>add if check duplication I.e. <LINK_0></technical_language>

Target:
protected List<SearchItem> execute(SearchImagesCmd command) { WebTarget webResource = getBaseResource().path("/images/search") .queryParam("term", command.getTerm()); if (command.getLimit() != null) { webResource = webResource.queryParam("limit", command.getLimit()); } LOGGER.trace("GET: {}", webResource); return webResource.request().accept(MediaType.APPLICATION_JSON).get(new TypeReference<List<SearchItem>>() { }); }
Source:
<code>public void handleRequest(final HttpServerExchange exchange) throws Exception { if (exchange.getRequestMethod().equals(Methods.GET) || exchange.getRequestMethod().equals(Methods.POST)) { serveResource(exchange, true); } else if (exchange.getRequestMethod().equals(Methods.HEAD)) { serveResource(exchange, false); } else { if (KNOWN_METHODS.contains(exchange.getRequestMethod())) { exchange.setStatusCode(StatusCodes.METHOD_NOT_ALLOWED); exchange.getResponseHeaders().add(Headers.ALLOW, String.join(", ", Methods.GET_STRING, Methods.HEAD_STRING, Methods.POST_STRING)); } else { exchange.setStatusCode(StatusCodes.NOT_IMPLEMENTED); } <START> if ( this.next != null ) { <END> next.handleRequest(exchange) } else { exchange.endExchange(); } } }</code><technical_language>This get hit if method is of following. java KNOWN_METHODS.add(Methods.OPTIONS); KNOWN_METHODS.add(Methods.GET); KNOWN_METHODS.add(Methods.HEAD); KNOWN_METHODS.add(Methods.POST); KNOWN_METHODS.add(Methods.PUT); KNOWN_METHODS.add(Methods.DELETE); KNOWN_METHODS.add(Methods.TRACE); KNOWN_METHODS.add(Methods.CONNECT); get handled this return method allowed. code trigger if is a standard HTTP method. appears set status code NOT_IMPLEMENTED handler expecting. break normal functionality of this handler rely on. this opt in functionality changing default behavior</technical_language>

Target:
public void handleRequest(final HttpServerExchange exchange) throws Exception { if (exchange.getRequestMethod().equals(Methods.GET) || exchange.getRequestMethod().equals(Methods.POST)) { serveResource(exchange, true); } else if (exchange.getRequestMethod().equals(Methods.HEAD)) { serveResource(exchange, false); } else { this.unsupportedMethodHandler.handleRequest( exchange ); } }
Source:
<code>public void addingUniqueNodeWithUnrelatedValueShouldNotAffectLookup() throws Exception { createConstraint( "Person", "id" ); long ourNode; { Statement statement = statementInNewTransaction( AnonymousContext.writeToken() ); ourNode = createLabeledNode( statement, "Person", "id", 1 ); commit(); } Statement statement = statementInNewTransaction( AnonymousContext.writeToken() ); ReadOperations readOps = statement.readOperations(); int person = readOps.labelGetForName( "Person" ); int propId = readOps.propertyKeyGetForName( "id" ); final int labelId = person; final int[] propertyKeyIds = new int[]{propId}; NewIndexDescriptor idx = readOps <START> .uniqueIndexGetForLabelAndPropertyKey( SchemaDescriptorFactory.forLabel( labelId, propertyKeyIds ) ); <END> createLabeledNode( statement, "Person", "id", 2 ); assertThat( readOps.nodeGetFromUniqueIndexSeek( idx, exact( propId, 1 ) ), equalTo( ourNode )); }</code><technical_language>ping</technical_language>

Target:
public void addingUniqueNodeWithUnrelatedValueShouldNotAffectLookup() throws Exception { createConstraint( "Person", "id" ); long ourNode; { Statement statement = statementInNewTransaction( AnonymousContext.writeToken() ); ourNode = createLabeledNode( statement, "Person", "id", 1 ); commit(); } Statement statement = statementInNewTransaction( AnonymousContext.writeToken() ); ReadOperations readOps = statement.readOperations(); int person = readOps.labelGetForName( "Person" ); int propId = readOps.propertyKeyGetForName( "id" ); NewIndexDescriptor idx = readOps .uniqueIndexGetForLabelAndPropertyKey( SchemaDescriptorFactory.forLabel( person, propId ) ); createLabeledNode( statement, "Person", "id", 2 ); assertThat( readOps.nodeGetFromUniqueIndexSeek( idx, exact( propId, 1 ) ), equalTo( ourNode )); }
Source:
<code>public Iterable<Object> loadObjects( EntityProjection projection, RequestScope scope) { Class<?> entityClass = projection.getType(); Pagination pagination = projection.getPagination(); FilterExpression filterExpression = projection.getFilterExpression(); if (pagination != null && pagination.returnPageTotals()) { pagination.setPageTotals(getTotalRecords(projection, entityClass, Optional.ofNullable(filterExpression), scope.getDictionary())); } final QueryWrapper query = (QueryWrapper) new RootCollectionFetchQueryBuilder(projection, entityClass, <START> scope.getDictionary(), sessionWrapper) <END> .withPossibleFilterExpression(Optional.ofNullable(filterExpression)) .build(); if (isScrollEnabled) { return new ScrollableIterator<>(query.getQuery().scroll()); } return query.getQuery().list(); }</code><technical_language>remove entityClass param</technical_language>

Target:
public Iterable<Object> loadObjects( EntityProjection projection, RequestScope scope) { Pagination pagination = projection.getPagination(); final QueryWrapper query = (QueryWrapper) new RootCollectionFetchQueryBuilder(projection, scope.getDictionary(), sessionWrapper) .build(); Iterable results; final boolean hasResults; if (isScrollEnabled) { results = new ScrollableIterator<>(query.getQuery().scroll()); hasResults = ((ScrollableIterator) results).hasNext(); } else { results = query.getQuery().list(); hasResults = ! ((Collection) results).isEmpty(); } if (pagination != null) { if (pagination.returnPageTotals() && (hasResults || pagination.getLimit() == 0)) { pagination.setPageTotals(getTotalRecords(projection, scope.getDictionary())); } } return results; }
Source:
<code>private synchronized void recompute() { VersionedType<T> freshVersion = supplier.get(); if (!Objects.equals(freshVersion.version(), lastSuppliedVersion)) { lastSuppliedVersion = freshVersion.version(); cached = function.apply(freshVersion.value()); <START> } <END> }</code><technical_language>In general for this class clear concurrency semantics require. guessing timestamp service uniqueness requirement (i.e. if request A finishes request B, version returned B A). In case get killing of volatile reads/writes flipping order of 53/54; if wrong cached volatile</technical_language>

Target:
private synchronized void recompute() { VersionedType<T> freshVersion = supplier.get(); if (!Objects.equals(freshVersion.version(), lastSuppliedVersion)) { cached = function.apply(freshVersion.value()); lastSuppliedVersion = freshVersion.version(); } }
Source:
<code>public void clickOnSortStacksByNameButton() { seleniumWebDriverHelper.waitAndClick(By.xpath(Locators.SORT_STACKS_BY_NAME_BUTTON_XPATH)); <START> WaitUtils.sleepQuietly(1); <END> }</code><technical_language>waiting on</technical_language>

Target:
public void clickOnSortStacksByNameButton() { seleniumWebDriverHelper.waitAndClick(By.id(Locators.SORT_STACKS_BY_NAME_ID)); }
Source:
<code>public void testOneOffsDontMoveDuringDecomission() { SingularityRequestBuilder bldr = new SingularityRequestBuilder(requestId, RequestType.ON_DEMAND); requestResource.postRequest(bldr.build()); deploy("d2"); <START> requestResource.scheduleImmediately(requestId, Optional.absent()); <END> validateTaskDoesntMoveDuringDecommission(); }</code><technical_language>sense create a method parameter</technical_language>

Target:
public void testOneOffsDontMoveDuringDecomission() { SingularityRequestBuilder bldr = new SingularityRequestBuilder(requestId, RequestType.ON_DEMAND); requestResource.postRequest(bldr.build()); deploy("d2"); requestResource.scheduleImmediately(requestId); validateTaskDoesntMoveDuringDecommission(); }
Source:
<code>public Object parse(ElementInstance instance, Node node, Object value) throws Exception { String text = null; if ((value != null) && value instanceof String) { text = ((String) value) ; if ("".equals(text)) { text = null; } } if (node.getChildren().isEmpty() && node.getAttributes().isEmpty() && (text != null)) { return text; } if ((node.getChildren().size() == 1) && node.getAttributes().isEmpty() && (text == null)) { return node.getChildValue(0); } if ((node.getAttributes().size() == 1) && node.getChildren().isEmpty() && (text == null)) { return ((Node) node.getAttributes().get(0)).getValue(); } <START> Map<String, Object> map = new HashMap<String, Object>(); <END> List attributes = node.getAttributes(); List children = node.getChildren(); mapBinding(map, attributes); mapBinding(map, children); if ((text != null) && !"".equals(text.trim())) { map.put(null, text ); } return map; }</code><technical_language>new HashMap<>();</technical_language>

Target:
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { String text = null; if ((value != null) && value instanceof String) { text = ((String) value); if ("".equals(text.trim())) { text = null; } } if (node.getChildren().isEmpty() && node.getAttributes().isEmpty() && (text != null)) { return text; } if ((node.getChildren().size() == 1) && node.getAttributes().isEmpty() && (text == null)) { return node.getChildValue(0); } if ((node.getAttributes().size() == 1) && node.getChildren().isEmpty() && (text == null)) { return ((Node) node.getAttributes().get(0)).getValue(); } Map<String, Object> map = new HashMap<>(); List attributes = node.getAttributes(); List children = node.getChildren(); mapBinding(map, attributes); mapBinding(map, children); if ((text != null) && !"".equals(text.trim())) { map.put(null, text); } return map; }
Source:
<code>void reload() { if (isAdded()) { getAdapter().setMediaList(getFilteredMedia()); <START> setFilter(mFilter); <END> } }</code><technical_language>setFilter method contains getAdapter().setMediaList(getFilteredMedia()) statement remove reload method avoid duplicate calls</technical_language>

Target:
void reload() { if (isAdded()) { getAdapter().setMediaList(getFilteredMedia()); } }
Source:
<code>public void strong() { String html = parseToHtml("*foo bar*"); assertEquals(html,"<p><strong>foo bar</strong></p>\n"); <START> } <END></code><technical_language>tests for strong preceding character content, character content. (those areas troubles before)</technical_language>

Target:
public void strong() { String html = parseToHtml("*foo bar*"); assertEquals("<p><strong>foo bar</strong></p>\n", html); }
Source:
<code>private void updateGpsTelem() { final Drone drone = getDrone(); final View popupView = gpsPopup.getContentView(); TextView satNoView = (TextView) popupView.findViewById(R.id.bar_gps_satno); <START> TextView hdopView = (TextView) popupView.findViewById(R.id.bar_gps_hdop); <END> final String update; final int gpsIcon; if (!drone.isConnected()) { update = getString(R.string.empty_content); gpsIcon = R.drawable.ic_gps_off_black_24dp; satNoView.setText(update); hdopView.setText(update); } else { Gps droneGps = drone.getAttribute(AttributeType.GPS); final String fixStatus = droneGps.getFixStatus(); if (appPrefs.shouldGpsHdopBeDisplayed()) { update = String.format(Locale.ENGLISH, "%.1f", droneGps.getGpsEph()); } else { update = String.format(Locale.ENGLISH, "%s", fixStatus); } switch(fixStatus){ case Gps.LOCK_3D: gpsIcon = R.drawable.ic_gps_fixed_black_24dp; break; case Gps.LOCK_2D: case Gps.NO_FIX: default: gpsIcon = R.drawable.ic_gps_not_fixed_black_24dp; break; } satNoView.setText(String.format("Satellites %d", droneGps.getSatellitesCount())); hdopView.setText(String.format("HDOP %.1f", droneGps.getGpsEph())); } gpsTelem.setText(update); gpsTelem.setCompoundDrawablesWithIntrinsicBounds(gpsIcon, 0, 0, 0); gpsPopup.update(); }</code><technical_language>@funtastix if gps hdop is displayed default, hdopView visibility set gone, avoiding a repeat of information</technical_language>

Target:
private void updateGpsTelem() { final Drone drone = getDrone(); final View popupView = gpsPopup.getContentView(); TextView satNoView = (TextView) popupView.findViewById(R.id.bar_gps_satno); TextView hdopStatusView = (TextView) popupView.findViewById(R.id.bar_gps_hdop_status); final String update; final int gpsIcon; if (!drone.isConnected()) { update = getString(R.string.empty_content); gpsIcon = R.drawable.ic_gps_off_black_24dp; satNoView.setText(update); hdopStatusView.setText(update); } else { Gps droneGps = drone.getAttribute(AttributeType.GPS); final String fixStatus = droneGps.getFixStatus(); if (appPrefs.shouldGpsHdopBeDisplayed()) { update = String.format(Locale.ENGLISH, "%.1f", droneGps.getGpsEph()); } else { update = String.format(Locale.ENGLISH, "%s", fixStatus); } switch(fixStatus){ case Gps.LOCK_3D: gpsIcon = R.drawable.ic_gps_fixed_black_24dp; break; case Gps.LOCK_2D: case Gps.NO_FIX: default: gpsIcon = R.drawable.ic_gps_not_fixed_black_24dp; break; } satNoView.setText(String.format(Locale.ENGLISH, "Satellites %d", droneGps.getSatellitesCount())); if (appPrefs.shouldGpsHdopBeDisplayed()) { hdopStatusView.setText(String.format(Locale.ENGLISH, "%s", fixStatus)); } else { hdopStatusView.setText(String.format(Locale.ENGLISH, "HDOP %.1f", droneGps.getGpsEph())); } } gpsTelem.setText(update); gpsTelem.setCompoundDrawablesWithIntrinsicBounds(gpsIcon, 0, 0, 0); gpsPopup.update(); }
Source:
<code>private static List<Class<? extends Cipher>> getCipherClasses(Properties props) { <START> List<Class<? extends Cipher>> result = new ArrayList(); <END> String cipherClassString = Utils.getCipherClassString(props); if (cipherClassString == null) { LOG.debug("No cipher classes configured."); return null; } for (String c : Utils.splitClassNames(cipherClassString, ",")) { try { Class<?> cls = ReflectionUtils.getClassByName(c); result.add(cls.asSubclass(Cipher.class)); } catch (ClassCastException e) { LOG.error("Class is not a Cipher.", c); } catch (ClassNotFoundException e) { LOG.error("Cipher not found.", c); } } return result; }</code><technical_language>new ArrayList<>(). some point recommend enabling more compiler warnings</technical_language>

Target:
private static List<Class<? extends Cipher>> getCipherClasses(Properties props) { List<Class<? extends Cipher>> result = new ArrayList<>(); String cipherClassString = Utils.getCipherClassString(props); if (cipherClassString == null) { LOG.debug("No cipher classes configured."); return null; } for (String c : Utils.splitClassNames(cipherClassString, ",")) { try { Class<?> cls = ReflectionUtils.getClassByName(c); result.add(cls.asSubclass(Cipher.class)); } catch (ClassCastException e) { LOG.error("Class is not a Cipher.", c); } catch (ClassNotFoundException e) { LOG.error("Cipher not found.", c); } } return result; }
Source:
<code>public Calendar deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { Calendar calendar = new GregorianCalendar(); try { if (json.isJsonPrimitive()) { String value = json.getAsString(); Locale locale = localization.getLocale(); if (locale == null) locale = Locale.getDefault(); DateFormat format = DateFormat.getDateInstance(DateFormat.SHORT, locale); Date date = format.parse(value); calendar.setTime(date); } else { JsonObject value = json.getAsJsonObject(); String timezone = value.get("timezone").getAsString(); <START> Long time = value.get("time").getAsLong(); <END> calendar.setTimeZone(TimeZone.getTimeZone(timezone)); calendar.setTimeInMillis(time); } return calendar; } catch (ParseException e) { throw new ConversionError("Error to convert Calendar: " + e.getMessage()); } }</code><technical_language>throw a conversion error if object time timezone properties if values invalid</technical_language>

Target:
public Calendar deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { Calendar calendar = new GregorianCalendar(); try { if (json.isJsonPrimitive()) { String value = json.getAsString(); Locale locale = localization.getLocale(); if (locale == null) locale = Locale.getDefault(); DateFormat format = DateFormat.getDateInstance(DateFormat.SHORT, locale); Date date = format.parse(value); calendar.setTime(date); } else { JsonObject value = json.getAsJsonObject(); String timezone = value.get("timezone").getAsString(); Long time = value.get("time").getAsLong(); calendar.setTimeZone(TimeZone.getTimeZone(timezone)); calendar.setTimeInMillis(time); } return calendar; } catch (JsonParseException e) { throw new ConversionError("Invalid Json format to convert Calendar: " + e.getMessage()); } catch (ParseException e) { throw new ConversionError("Error to convert Calendar: " + e.getMessage()); } }
Source:
<code>public MapView createViewInstance(ThemedReactContext context) { mapView = new MapView(context, "pk.foo"); <START> mapView.onCreate(null); <END> return mapView; }</code><technical_language>@bsudekum want set a style mapView.setStyle(Style.MAPBOX_STREETS) for example</technical_language>

Target:
public MapView createViewInstance(ThemedReactContext context) { mapView = new MapView(context, "pk.foo"); mapView.onCreate(null); StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); return mapView; }
Source:
<code>private SqlNode createLeftCall(SqlOperator op, List<SqlNode> nodeList) { <START> if (nodeList.size() == 2) { <END> return op.createCall(new SqlNodeList(nodeList, POS)); } SqlNode node = op.createCall(new SqlNodeList(nodeList.subList(0, 2), POS)); for (int i = 2; i < nodeList.size(); i++) { node = op.createCall(new SqlNodeList(ImmutableList.of(node, nodeList.get(i)), POS)); } return node; }</code><technical_language>I drop this "== 2" specialization method is longer recursive +1</technical_language>

Target:
private SqlNode createLeftCall(SqlOperator op, List<SqlNode> nodeList) { assert nodeList != null && nodeList.size() >= 2; SqlNode node = op.createCall(new SqlNodeList(nodeList.subList(0, 2), POS)); for (int i = 2; i < nodeList.size(); i++) { node = op.createCall(new SqlNodeList(ImmutableList.of(node, nodeList.get(i)), POS)); } return node; }
Source:
<code>public List<VmNumaNode> getVmNumaNodes(VM vm) { int vcpus = FeatureSupported.supportedInConfig(ConfigValues.HotPlugCpuSupported, vm.getCompatibilityVersion(), vm.getClusterArch()) ? VmCpuCountHelper.calcMaxVCpu(vm, vm.getClusterCompatibilityVersion()) : vm.getNumOfCpus(); List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); if (!vmNumaNodes.isEmpty()) { <START> if (vcpus != vm.getNumOfCpus()) { <END> int numaCount = vmNumaNodes.size(); int index = 0; if (numaCount > vcpus) { numaCount = vcpus; } for (VmNumaNode vmNode : vmNumaNodes) { vmNode.getCpuIds().clear(); if (numaCount <= 0) { continue; } for (int i = 0; i < vcpus / numaCount; i++) { vmNode.getCpuIds().add(index++); } vcpus -= vcpus / numaCount; --numaCount; } } return vmNumaNodes; } if (FeatureSupported.hotPlugMemory(vm.getCompatibilityVersion(), vm.getClusterArch())) { VmNumaNode vmNode = new VmNumaNode(); vmNode.setIndex(0); vmNode.setMemTotal(vm.getMemSizeMb()); for (int i = 0; i < vcpus; i++) { vmNode.getCpuIds().add(i); } return Collections.singletonList(vmNode); } return Collections.emptyList(); }</code><technical_language>this is a place in this function(1174,1205) essentially ask offline vCPUs not. Please a helper variable</technical_language>

Target:
public List<VmNumaNode> getVmNumaNodes(VM vm) { int numOfVmCpus = vm.getNumOfCpus(); int vcpus = FeatureSupported.supportedInConfig(ConfigValues.HotPlugCpuSupported, vm.getCompatibilityVersion(), vm.getClusterArch()) ? VmCpuCountHelper.calcMaxVCpu(vm, vm.getClusterCompatibilityVersion()) : numOfVmCpus; List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); if (!vmNumaNodes.isEmpty()) { if (vcpus != numOfVmCpus) { int numaCount = vmNumaNodes.size(); int index = -1; for (VmNumaNode vmNode : vmNumaNodes) { for (Integer cpuId : vmNode.getCpuIds()) { if (index < cpuId) { index = cpuId; } } } for (VmNumaNode vmNode : vmNumaNodes) { if (numaCount <= 0) { break; } for (int i = vmNode.getCpuIds().size(); i < vcpus / numaCount; i++) { vmNode.getCpuIds().add(++index); } vcpus -= vcpus / numaCount; --numaCount; } } return vmNumaNodes; } if (FeatureSupported.hotPlugMemory(vm.getCompatibilityVersion(), vm.getClusterArch())) { VmNumaNode vmNode = new VmNumaNode(); vmNode.setIndex(0); vmNode.setMemTotal(vm.getMemSizeMb()); for (int i = 0; i < vcpus; i++) { vmNode.getCpuIds().add(i); } return Collections.singletonList(vmNode); } return Collections.emptyList(); }
Source:
<code>protected void prepareUserDirectory(URI targetFolder) { User user = Helper.getCurrentUser(); if (user != null) { try { fileService.createDirectoryForUser(targetFolder, user.getLogin()); } catch (Exception e) { <START> logger.error(e.getMessage(), e); <END> Helper.setFehlerMeldung("Export canceled, could not create destination directory: " + targetFolder, e); } } }</code><technical_language>setErrorMessage</technical_language>

Target:
protected void prepareUserDirectory(URI targetFolder) { User user = Helper.getCurrentUser(); if (user != null) { try { fileService.createDirectoryForUser(targetFolder, user.getLogin()); } catch (IOException | RuntimeException e) { Helper.setErrorMessage("Export canceled, could not create destination directory: " + targetFolder, logger, e); } } }
Source:
<code><START> private void postConstruct() { <END> CLASS_TO_MAPPER_MAP.put(SpecialDaysRequestData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(ReadAlarmRegisterData.class, this.monitoringMapper); CLASS_TO_MAPPER_MAP.put(FindEventsQuery.class, this.managementMapper); CLASS_TO_MAPPER_MAP.put(ActualMeterReadsData.class, this.monitoringMapper); CLASS_TO_MAPPER_MAP.put(GetAdministrativeStatusData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(PushSetupAlarm.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SmsDetails.class, this.adhocMapper); CLASS_TO_MAPPER_MAP.put(AdministrativeStatusType.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SetConfigurationObjectRequest.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(PushSetupSms.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(ActivityCalendar.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(AlarmNotifications.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(KeySet.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SmartMeteringDevice.class, this.installationMapper); }</code><technical_language>![MAJOR](<LINK_1> Private method 'postConstruct' is used. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void postConstruct() { CUSTOM_CONVERTER_FOR_CLASS.put(PeriodicMeterReadsGasRequestData.class, this.periodicReadsRequestGasDataConverter); CUSTOM_CONVERTER_FOR_CLASS.put(ActualMeterReadsGasRequestData.class, this.actualReadsRequestGasDataConverter); CUSTOM_CONVERTER_FOR_CLASS.put(SetEncryptionKeyExchangeOnGMeterRequestData.class, this.setEncryptionKeyExchangeOnGMeterDataConverter); CLASS_TO_MAPPER_MAP.put(PeriodicMeterReadsRequestData.class, this.monitoringMapper); CLASS_TO_MAPPER_MAP.put(ActualMeterReadsRequestData.class, this.commonMapper); CLASS_TO_MAPPER_MAP.put(SpecialDaysRequestData.class, this.commonMapper); CLASS_TO_MAPPER_MAP.put(ReadAlarmRegisterData.class, this.monitoringMapper); CLASS_TO_MAPPER_MAP.put(FindEventsQuery.class, this.managementMapper); CLASS_TO_MAPPER_MAP.put(GetAdministrativeStatusData.class, this.commonMapper); CLASS_TO_MAPPER_MAP.put(AdministrativeStatusTypeData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(ActivityCalendarData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SetConfigurationObjectRequestData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SetAlarmNotificationsRequestData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SetConfigurationObjectRequestData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SetPushSetupAlarmRequestData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SetPushSetupSmsRequestData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SynchronizeTimeRequestData.class, this.commonMapper); CLASS_TO_MAPPER_MAP.put(GetConfigurationRequestData.class, this.commonMapper); CLASS_TO_MAPPER_MAP.put(GetFirmwareVersionRequestData.class, this.commonMapper); CLASS_TO_MAPPER_MAP.put(KeySet.class, this.configurationMapper); }
Source:
<code><START> public void setJDKs(Collection<? extends JDK> jdks) { <END> this.jdks = new ArrayList<JDK>(jdks); }</code><technical_language>restricted, especially if consider moving JDK installer plugin</technical_language>

Target:
public synchronized void setJDKs(Collection<? extends JDK> jdks) { this.jdks = new ArrayList<JDK>(jdks); }
Source:
<code>public void deliverResponse(Exchange exchange, Response response) { if (exchange == null) <START> throw new NullPointerException("no CoAP exchange!"); <END> if (exchange.getRequest() == null) throw new NullPointerException("no CoAP request!"); if (response == null) throw new NullPointerException("no CoAP response!"); exchange.getRequest().setResponse(response); }</code><technical_language>sense throw exception here? log fact is exchange ignore response. WDYT</technical_language>

Target:
public void deliverResponse(Exchange exchange, Response response) { if (exchange == null) { throw new NullPointerException("no CoAP exchange!"); } if (exchange.getRequest() == null) { throw new NullPointerException("no CoAP request!"); } if (response == null) { throw new NullPointerException("no CoAP response!"); } exchange.getRequest().setResponse(response); }