auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addChain(Chain c) { EntityInfo info = c.getEntityInfo(); if ( info == null || info.getType() == null) { <START> logger.debug("No entity info could be found while adding chain with asym id (author id {}). Will consider it a polymer chain.", c.getId(), c.getName()); <END> polyChains.add(c); } else if ( info.getType() == EntityType.POLYMER) { polyChains.add(c); } else if (info.getType() == EntityType.NONPOLYMER) { nonPolyChains.add(c); } else if (info.getType() == EntityType.WATER) { waterChains.add(c); } else if (info.getType() == EntityType.MACROLIDE) { logger.warn("Chain with asym id (author id {}) has entity type 'macrolide', considering it non-polymeric", c.getId(), c.getName()); nonPolyChains.add(c); } else { logger.warn("Chain with asym id (author id {}) has unsupported entity type '{}'. Will not add it to the Structure.", c.getId(), c.getName(), info.getType().toString()); } }</code><technical_language>this INFO level, this is a strong indication wrong in reading structure</technical_language>

Target:
public void addChain(Chain c) { EntityInfo info = c.getEntityInfo(); if ( info == null || info.getType() == null) { logger.info("No entity info could be found while adding chain with asym id (author id {}). Will consider it a polymer chain.", c.getId(), c.getName()); polyChains.add(c); } else if ( info.getType() == EntityType.POLYMER) { polyChains.add(c); } else if (info.getType() == EntityType.NONPOLYMER) { nonPolyChains.add(c); } else if (info.getType() == EntityType.WATER) { waterChains.add(c); } else if (info.getType() == EntityType.MACROLIDE) { logger.warn("Chain with asym id (author id {}) has entity type 'macrolide', considering it non-polymeric", c.getId(), c.getName()); nonPolyChains.add(c); } else { logger.warn("Chain with asym id (author id {}) has unsupported entity type '{}'. Will not add it to the Structure.", c.getId(), c.getName(), info.getType().toString()); } }
Source:
<code>private static void fireOnCommit(final NodeProvisioner.PlannedNode plannedNode, final Node newNode) { for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { try { cl.onCommit(plannedNode, newNode); <START> } catch (Throwable e) { <END> LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + "processing onCommit() listener call in " + cl + " for agent " + plannedNode.displayName, e); } } }</code><technical_language>Throwable suppresses Errors OutOfMemory exception. errors supposed fatal in Java. I handle Exceptions (FindBugs IIRC) propagate Errors</technical_language>

Target:
private static void fireOnCommit(final NodeProvisioner.PlannedNode plannedNode, final Node newNode) { for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { try { cl.onCommit(plannedNode, newNode); } catch (Error e) { throw e; } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + "processing onCommit() listener call in " + cl + " for agent " + newNode.getDisplayName(), e); } } }
Source:
<code><START> public SchedulePage createMeeting(String organizer, String subject, int minutesFrom, <END> int minutesTo, String attendee, String password) { String startTime = TimeManager.getTime(minutesFrom, "hh:mm a"); String endTime = TimeManager.getTime(minutesTo, "hh:mm a"); setOrganizerTxtBox(organizer); setSubjectTxtBox(subject); setStartTimeDate(startTime); setEndTimeDate(endTime); setAttendeeTxtBox(attendee); clickCreateBtn(); confirmCredentials(password); return waitForMaskDisappears(); }</code><technical_language>Method duplicated</technical_language>

Target:
public SchedulePage createMeeting(String organizer, String subject, int minutesFrom, int minutesTo, String attendee, String password) { String startTime = TimeManager.getTime(minutesFrom, "hh:mm a"); String endTime = TimeManager.getTime(minutesTo, "hh:mm a"); setOrganizerTxtBox(organizer); setSubjectTxtBox(subject); setStartTimeDate(startTime); setEndTimeDate(endTime); setAttendeeTxtBox(attendee); clickCreateBtn(); confirmCredentials(password); isMessageMeetingCreatedDisplayed(); return this; }
Source:
<code>AdHocCompilerCache(int maxLiteralEntries, int maxCoreEntries) { MAX_LITERAL_ENTRIES = maxLiteralEntries; MAX_CORE_ENTRIES = maxCoreEntries; <START> m_literalCache = new MemoryBoundedLinkedHashMap<String, AdHocPlannedStatement>(MAX_LITERAL_ENTRIES, MAX_LITERAL_MEM); <END> m_coreCache = new LinkedHashMap<String, List<BoundPlan> >(MAX_CORE_ENTRIES * 2, .75f, true) { private static final long serialVersionUID = 1L; @Override public boolean removeEldestEntry(Map.Entry<String, List<BoundPlan> > eldest) { if (size() > MAX_CORE_ENTRIES) { ++m_planEvictions; return true; } return false; } }; }</code><technical_language>template MemoryBoundedLinkedHashMap call AdHocStatementCache extends LinkedHashMap<String, AdHocPlannedStatement></technical_language>

Target:
AdHocCompilerCache(int maxLiteralEntries, int maxCoreEntries) { MAX_LITERAL_ENTRIES = maxLiteralEntries; MAX_CORE_ENTRIES = maxCoreEntries; m_literalCache = new AdHocStatementCache(MAX_LITERAL_ENTRIES, MAX_LITERAL_MEM); m_coreCache = new LinkedHashMap<String, List<BoundPlan> >(MAX_CORE_ENTRIES * 2, .75f, true) { private static final long serialVersionUID = 1L; @Override public boolean removeEldestEntry(Map.Entry<String, List<BoundPlan> > eldest) { if (size() > MAX_CORE_ENTRIES) { ++m_planEvictions; return true; } return false; } }; }
Source:
<code>public static Document openXmlFromZip(File zipFile, String xmlFile) throws IOException, ZipException { XMLParser parser = new XMLParser(); ZipUnArchiver zip = new ZipUnArchiver(zipFile); <START> TemporaryFolder zipFolder = new TemporaryFolder(); <END> zipFolder.create(); try { zip.extract(xmlFile, zipFolder.getRoot()); return parser.parse(new XMLIOSource(new File(zipFolder.getRoot(), xmlFile))); } finally { zipFolder.delete(); } }</code><technical_language>do this streaming, temp folder required</technical_language>

Target:
public static Document openXmlFromZip(File zipFile, String xmlFile) throws IOException, ZipException { XMLParser parser = new XMLParser(); ZipFile zip = new ZipFile(zipFile); try { ZipEntry entry = zip.getEntry(xmlFile); return parser.parse(new XMLIOSource(zip.getInputStream(entry))); } finally { zip.close(); } }
Source:
<code>public void sanity() { profile.define(context); Map<String, BuiltInActiveRule> activeRules = getActiveRulesByRuleKey(context); assertThat(activeRules.size()).isEqualTo(3); assertThat(activeRules.keySet()).contains("HTL-0"); assertThat(activeRules.keySet()).contains("HTL-3"); <START> <END> }</code><technical_language>This line is needed</technical_language>

Target:
public void sanity() { profile.define(context); Map<String, BuiltInActiveRule> activeRules = getActiveRulesByRuleKey(context); assertThat(activeRules.size()).isEqualTo(4); assertThat(activeRules.keySet()).contains("HTL-0"); assertThat(activeRules.keySet()).contains("HTL-1"); assertThat(activeRules.keySet()).contains("HTL-6"); }
Source:
<code>public String getCommandName() { return s_name; <START> } <END></code><technical_language>I more specific catch clauses. catch'm'all is a bit crude (and happen ApiServlet level</technical_language>

Target:
public String getCommandName() { return APINAME.toLowerCase() + BaseAsyncCmd.RESPONSE_SUFFIX; }
Source:
<code>public void parseOneFile( Project project, ProjectMetadata metadata, ImportingJob job, String fileSource, Reader reader, int limit, JSONObject options, List<Exception> exceptions ) { String sep = JSONUtilities.getString(options, "separator", "\\t"); if (sep == null || "".equals(sep)) { sep = "\\t"; } sep = StringEscapeUtils.unescapeJava(sep); boolean processQuotes = JSONUtilities.getBoolean(options, "processQuotes", true); boolean strictQuotes = JSONUtilities.getBoolean(options, "strictQuotes", false); Character quote = CSVParser.DEFAULT_QUOTE_CHARACTER; String quoteCharacter = JSONUtilities.getString(options, "quoteCharacter", null); if (!StringUtils.isBlank(quoteCharacter)) { <START> quote = quoteCharacter.charAt(0); <END> } final CSVParser parser = new CSVParser( sep, quote, (char) 0, strictQuotes, CSVParser.DEFAULT_IGNORE_LEADING_WHITESPACE, !processQuotes); final LineNumberReader lnReader = new LineNumberReader(reader); TableDataReader dataReader = new TableDataReader() { @Override public List<Object> getNextRowOfCells() throws IOException { String line = lnReader.readLine(); if (line == null) { return null; } else { return getCells(line, parser, lnReader); } } }; TabularImportingParserBase.readTable(project, metadata, job, dataReader, fileSource, limit, options, exceptions); super.parseOneFile(project, metadata, job, fileSource, lnReader, limit, options, exceptions); }</code><technical_language>this handled front end allow 1 char(or restriction char used)? If input [blank]'[blank] problem</technical_language>

Target:
public void parseOneFile( Project project, ProjectMetadata metadata, ImportingJob job, String fileSource, Reader reader, int limit, JSONObject options, List<Exception> exceptions ) { String sep = JSONUtilities.getString(options, "separator", "\\t"); if (sep == null || "".equals(sep)) { sep = "\\t"; } sep = StringEscapeUtils.unescapeJava(sep); boolean processQuotes = JSONUtilities.getBoolean(options, "processQuotes", true); boolean strictQuotes = JSONUtilities.getBoolean(options, "strictQuotes", false); Character quote = CSVParser.DEFAULT_QUOTE_CHARACTER; String quoteCharacter = JSONUtilities.getString(options, "quoteCharacter", null); if (quoteCharacter != null && quoteCharacter.trim().length() == 1) { quote = quoteCharacter.trim().charAt(0); } final CSVParser parser = new CSVParser( sep, quote, (char) 0, strictQuotes, CSVParser.DEFAULT_IGNORE_LEADING_WHITESPACE, !processQuotes); final LineNumberReader lnReader = new LineNumberReader(reader); TableDataReader dataReader = new TableDataReader() { @Override public List<Object> getNextRowOfCells() throws IOException { String line = lnReader.readLine(); if (line == null) { return null; } else { return getCells(line, parser, lnReader); } } }; TabularImportingParserBase.readTable(project, metadata, job, dataReader, fileSource, limit, options, exceptions); super.parseOneFile(project, metadata, job, fileSource, lnReader, limit, options, exceptions); }
Source:
<code>public static String getCompanyName(User user) { <START> String result = null; <END> if (user != null && user.company != null && user.company.trim().length() > 0) { result = user.company.trim(); } return result ; }</code><technical_language>Returning null in this case is useful... return empty string instead</technical_language>

Target:
public static String getCompanyName(User user) { String result = ""; if (user != null && user.company != null && user.company.trim().length() > 0) { result = user.company.trim(); } return result ; }
Source:
<code>public void testTcpGateways() { TestingUtilities.waitListening(this.server1, null); this.client1.setPort(this.server1.getPort()); IntegrationFlow flow = f -> f .handle(Tcp.outboundGateway(this.client1)) .transform(Transformers.objectToString()); IntegrationFlowRegistration theFlow = this.flowContext.registration(flow).register(); <START> assertThat(theFlow.getMessagingTemplate().convertSendAndReceive("foo", String.class), equalTo("FOO")); <END> }</code><technical_language>Cool observation for unit testing :smile:</technical_language>

Target:
public void testTcpGateways() { TestingUtilities.waitListening(this.server1, null); IntegrationFlow flow = f -> f .handle(Tcp.outboundGateway(Tcp.netClient("localhost", this.server1.getPort()) .serializer(TcpCodecs.crlf()) .deserializer(TcpCodecs.lengthHeader1()) .id("client1")) .remoteTimeout(m -> 5000)) .transform(Transformers.objectToString()); IntegrationFlowRegistration theFlow = this.flowContext.registration(flow).register(); assertThat(theFlow.getMessagingTemplate().convertSendAndReceive("foo", String.class), equalTo("FOO")); }
Source:
<code>public void testAddPotentialOwnersToNonExistentTask() { processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument"); assertNotNull(processInstanceId); List<TaskSummary> tasks = runtimeDataService.getTasksAssignedAsPotentialOwner("salaboy", new QueryFilter()); assertEquals(1, tasks.size()); TaskSummary task = tasks.get(0); userTaskService.release(task.getId(), "salaboy"); <START> userTaskAdminService.addPotentialOwners(15456, false, factory.newUser("john")); <END> }</code><technical_language>Assertions methods catch exception a specific place, opposed catching exception @Test</technical_language>

Target:
public void testAddPotentialOwnersToNonExistentTask() { processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument"); Assertions.assertThat(processInstanceId).isNotNull(); List<TaskSummary> tasks = runtimeDataService.getTasksAssignedAsPotentialOwner("salaboy", new QueryFilter()); Assertions.assertThat(tasks).hasSize(1); TaskSummary task = tasks.get(0); userTaskService.release(task.getId(), "salaboy"); Assertions.assertThatThrownBy( () -> userTaskAdminService.addPotentialOwners(15456, false, factory.newUser("john"))) .hasMessageContaining("Task with id 15456 not found"); }
Source:
<code>public List<Location> getLocation(@NotNull String protocolId, @NotNull String locationData, @NotNull final Project project) { if (!PROTOCOL.equals(protocolId)) { return Collections.emptyList(); } List<Location> locations = ContainerUtil.newArrayList(); String[] locationDataItems = locationData.split("\\."); if (locationDataItems.length == 1) { Collection<GoFunctionDeclaration> goFunctionDeclarations = GoFunctionIndex.find( locationData, project, GlobalSearchScope.projectScope(project)); for (GoFunctionDeclaration goFunctionDeclaration : goFunctionDeclarations) { Location<GoFunctionDeclaration> functionLocation = PsiLocation.fromPsiElement(project, goFunctionDeclaration); <START> if (functionLocation == null) { <END> continue; } locations.add(functionLocation); } return locations; } if (locationDataItems.length == 2) { Collection<GoTypeSpec> goTypeSpecs = GoTypesIndex.find( locationDataItems[0], project, GlobalSearchScope.projectScope(project)); for (GoTypeSpec goTypeSpec : goTypeSpecs) { Location<GoTypeSpec> typeLocation = PsiLocation.fromPsiElement(project, goTypeSpec); if (typeLocation == null) { continue; } for (GoMethodDeclaration method : typeLocation.getPsiElement().getMethods()) { if (locationDataItems[1].equals(method.getName())) { Location<GoMethodDeclaration> methodLocation = PsiLocation.fromPsiElement(method); if (methodLocation == null) { continue; } locations.add(methodLocation); } } } return locations; } throw new RuntimeException("Unsupported location: " + locationData); }</code><technical_language>ContainerUtil.addIfNotNull</technical_language>

Target:
public List<Location> getLocation(@NotNull String protocolId, @NotNull String locationData, @NotNull final Project project) { if (!PROTOCOL.equals(protocolId)) { return Collections.emptyList(); } List<Location> locations = ContainerUtil.newArrayList(); String[] locationDataItems = locationData.split("\\."); if (locationDataItems.length == 1) { Collection<GoFunctionDeclaration> goFunctionDeclarations = GoFunctionIndex.find( locationData, project, GlobalSearchScope.projectScope(project)); for (GoFunctionDeclaration goFunctionDeclaration : goFunctionDeclarations) { Location<GoFunctionDeclaration> functionLocation = PsiLocation.fromPsiElement(project, goFunctionDeclaration); ContainerUtil.addIfNotNull(locations, functionLocation); } return locations; } if (locationDataItems.length == 2) { Collection<GoTypeSpec> goTypeSpecs = GoTypesIndex.find( locationDataItems[0], project, GlobalSearchScope.projectScope(project)); for (GoTypeSpec goTypeSpec : goTypeSpecs) { for (GoMethodDeclaration method : goTypeSpec.getMethods()) { if (locationDataItems[1].equals(method.getName())) { Location<GoMethodDeclaration> methodLocation = PsiLocation.fromPsiElement(method); ContainerUtil.addIfNotNull(locations, methodLocation); } } } return locations; } throw new RuntimeException("Unsupported location: " + locationData); }
Source:
<code>private static void insertFromJson(Session session) { User alice = new User("alice", 30); User bob = new User("bob", 35); ObjectNode aliceScores = JsonNodeFactory.instance.objectNode() .put("call_of_duty", 4.8) <START> .put("pockemon_go", 9.7); <END> ObjectNode bobScores = JsonNodeFactory.instance.objectNode() .put("zelda", 8.3) .put("pockemon_go", 12.4); Statement stmt = insertInto("examples", "json_jackson_function") .value("id", 1) .value("user", fromJson(alice)) .value("scores", fromJson(aliceScores)); session.execute(stmt); PreparedStatement pst = session.prepare( insertInto("examples", "json_jackson_function") .value("id", bindMarker("id")) .value("user", fromJson(bindMarker("user"))) .value("scores", fromJson(bindMarker("scores")))); session.execute(pst.bind() .setInt("id", 2) .set("user", bob, User.class) .set("scores", bobScores, JsonNode.class)); }</code><technical_language>pockemon -> pokemon</technical_language>

Target:
private static void insertFromJson(Session session) { User alice = new User("alice", 30); User bob = new User("bob", 35); ObjectNode aliceScores = JsonNodeFactory.instance.objectNode() .put("call_of_duty", 4.8) .put("pokemon_go", 9.7); ObjectNode bobScores = JsonNodeFactory.instance.objectNode() .put("zelda", 8.3) .put("pokemon_go", 12.4); Statement stmt = insertInto("examples", "json_jackson_function") .value("id", 1) .value("user", fromJson(alice)) .value("scores", fromJson(aliceScores)); session.execute(stmt); PreparedStatement pst = session.prepare( insertInto("examples", "json_jackson_function") .value("id", bindMarker("id")) .value("user", fromJson(bindMarker("user"))) .value("scores", fromJson(bindMarker("scores")))); session.execute(pst.bind() .setInt("id", 2) .set("user", bob, User.class) .set("scores", bobScores, JsonNode.class)); }
Source:
<code>public AddVdsVDSCommand(P parameters) { <START> super(parameters, false); <END> }</code><technical_language>false=>true (after changing isNewHost)</technical_language>

Target:
public AddVdsVDSCommand(P parameters) { super(parameters, true); }
Source:
<code>public static MambuAPIServiceFactory getFactory(Protocol protocol, String domain, String username, String password) { <START> Injector injector = Guice.createInjector(new MambuAPIModule(protocol, domain, username, password, "Mambu SDKv1.0")); <END> return new MambuAPIServiceFactory(injector); }</code><technical_language>this is hardcoded application (MambuAPIFactory, MambuAPIServiceFactory), extracted a constant</technical_language>

Target:
public static MambuAPIServiceFactory getFactory(Protocol protocol, String domain, String username, String password) { Injector injector = Guice.createInjector(new MambuAPIModule(protocol, domain, username, password, DEFAULT_USER_AGENT_HEADER_VALUE)); return new MambuAPIServiceFactory(injector); }
Source:
<code>public String getId() { <START> return "itemcategory-uncategorized"; <END> }</code><technical_language>ant: itemcategory- prefix? uncategorized standaloneprojects</technical_language>

Target:
public String getId() { return ID; }
Source:
<code>public void testResponseExceptionMapper() throws Exception { ExceptionMappingClient client = new CxfTypeSafeClientBuilder() .register(NotFoundExceptionMapper.class) .register(NotFoundClientReqFilter.class) .baseUrl(new URL("http://localhost/null")) .build(ExceptionMappingClient.class); Response r = client.getEntity(); <START> System.out.println(r.getStatus()); <END> fail("Did not throw expected mapped exception: NoSuchEntityException"); }</code><technical_language>move SOP fail method</technical_language>

Target:
public void testResponseExceptionMapper() throws Exception { ExceptionMappingClient client = new CxfTypeSafeClientBuilder() .register(NotFoundExceptionMapper.class) .register(NotFoundClientReqFilter.class) .baseUrl(new URL("http://localhost/null")) .build(ExceptionMappingClient.class); Response r = client.getEntity(); fail(r, "Did not throw expected mapped exception: NoSuchEntityException"); }
Source:
<code>public byte[] request(FContext context, boolean oneway, byte[] payload) throws TTransportException { if (oneway) { flush(payload); return null; } BlockingQueue<byte[]> queue = new ArrayBlockingQueue<>(1); lock.lock(); if (queueMap.containsKey(context.getOpId())) { lock.unlock(); throw new TTransportException("request already in flight for context"); } queueMap.put(context.getOpId(), queue); lock.unlock(); try { flush(payload); byte[] response; try { response = queue.poll(context.getTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { throw new TTransportException("request: interrupted"); } if (response == null) { throw new TTransportException(TTransportException.TIMED_OUT, "request: timed out"); } if (response == POISON_PILL) { throw new TTransportException(TTransportException.NOT_OPEN, "request: transport closed, request canceled"); } return response; } finally { <START> lock.lock(); <END> queueMap.remove(context.getOpId()); lock.unlock(); } }</code><technical_language>need this lock a concurrent hash map</technical_language>

Target:
public TTransport request(FContext context, boolean oneway, byte[] payload) throws TTransportException { if (oneway) { flush(payload); return null; } BlockingQueue<byte[]> queue = new ArrayBlockingQueue<>(1); synchronized (this) { if (queueMap.containsKey(getOpId(context))) { throw new TTransportException("request already in flight for context"); } queueMap.put(getOpId(context), queue); } try { flush(payload); byte[] response; try { response = queue.poll(context.getTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { throw new TTransportException("request: interrupted"); } if (response == null) { throw new TTransportException(TTransportException.TIMED_OUT, "request: timed out"); } if (response == POISON_PILL) { throw new TTransportException(TTransportException.NOT_OPEN, "request: transport closed, request canceled"); } return new TMemoryInputTransport(response); } finally { synchronized (this) { queueMap.remove(getOpId(context)); } } }
Source:
<code>default boolean getBooleanValue(JsonObject jsonObject) throws DataException { try { return jsonObject.getBoolean(this.toString()); <START> } catch (RuntimeException e) { <END> throw new DataException("Not possible to retrieve boolean value for key " + this.toString() + ". Exception: " + e.getMessage()); } }</code><technical_language>catch RuntimeException based class here? I NullPointerException ClassCastException official thrown</technical_language>

Target:
default boolean getBooleanValue(JsonObject jsonObject) throws DataException { try { return jsonObject.getBoolean(this.toString()); } catch (ClassCastException | NullPointerException e) { throw new DataException("Not possible to retrieve boolean value for key " + this.toString() + ". Exception: " + e.getMessage()); } }
Source:
<code>public Map<Object, Object> instantiate(Target<?> target, Parameters parameters) { <START> List<br.com.caelum.iogi.parameters.Parameter> params = parameters.forTarget(target); <END> if (params.isEmpty()) { return emptyMap(); } String key = getParameterKey(params); if (params.get(0).isDecorated()) { List<Object> values = new ArrayList<>(); for (Parameter value : params) { values.add(value.getValue()); } return createSingletonMap(key, values); } return createSingletonMap(key, params.get(0).getValue()); }</code><technical_language>Remove br.com.caelum.iogi.parameters import</technical_language>

Target:
public Map<Object, Object> instantiate(Target<?> target, Parameters parameters) { List<Parameter> params = parameters.forTarget(target); if (params.isEmpty()) { return emptyMap(); } String key = getParameterKey(params); if (params.get(0).isDecorated()) { List<Object> values = new ArrayList<>(); for (Parameter value : params) { values.add(value.getValue()); } return createSingletonMap(key, values); } return createSingletonMap(key, params.get(0).getValue()); }
Source:
<code>public void testModelWithImportsAndFactName() { final ScoreCardModel model = new ScoreCardModel(); model.setName("test"); model.setPackageName("org.drools.workbench.models.guided.scorecard.backend"); model.getImports().addImport(new Import("org.smurf.Pupa")); model.setFactName("org.drools.MoreCheese"); PMML pmmlDocument = GuidedScoreCardDRLPersistence.createPMMLDocument(model); final String drl = GuidedScoreCardDRLPersistence.marshal(model); assertNotNull(drl); assertTrue(drl.contains("package org.drools.workbench.models.guided.scorecard.backend")); assertEquals(16, StringUtil.countMatches(drl, <START> "rule \"")); <END> assertEquals(15, StringUtil.countMatches(drl, "import ")); assertTrue(drl.contains("import org.smurf.Pupa")); assertTrue(drl.contains("import org.drools.MoreCheese")); }</code><technical_language>I stay "magic number" based tests. a simple change rules generated, underlying templates, break</technical_language>

Target:
public void testModelWithImportsAndFactName() { final ScoreCardModel model = new ScoreCardModel(); model.setName("test"); model.setPackageName("org.drools.workbench.models.guided.scorecard.backend"); model.getImports().addImport(new Import("org.smurf.Pupa")); model.setFactName("org.drools.MoreCheese"); PMML pmmlDocument = GuidedScoreCardDRLPersistence.createPMMLDocument(model); final String drl = GuidedScoreCardDRLPersistence.marshal(model); assertNotNull(drl); assertTrue(drl.contains("package org.drools.workbench.models.guided.scorecard.backend")); assertTrue(drl.contains("import org.smurf.Pupa")); assertTrue(drl.contains("import org.drools.MoreCheese")); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { BasicConfigurationDialog.show(); <START> IStructuredSelection selection = (IStructuredSelection) HandlerUtil <END> .getCurrentSelectionChecked(event); Object selected = selection.getFirstElement(); Ref ref = getRef(selected); final Repository repository = getRepository(event); if (ref == null) { RebaseTargetSelectionDialog rebaseTargetSelectionDialog = new RebaseTargetSelectionDialog( getShell(event), repository); if (rebaseTargetSelectionDialog.open() == IDialogConstants.OK_ID) { String refName = rebaseTargetSelectionDialog.getRefName(); try { ref = repository.getRef(refName); } catch (IOException e) { throw new ExecutionException(e.getMessage(), e); } } else return null; } String jobname = NLS.bind( UIText.RebaseCurrentRefCommand_RebasingCurrentJobName, ref .getName()); RebaseHelper.runRebaseJob(repository, jobname, ref); return null; }</code><technical_language>simply cast (I learned this hard way; framework return anthing here). Check returned object for instanceof IStructuredSelection simply return null otherwise</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { BasicConfigurationDialog.show(); Ref ref; ISelection currentSelection = getCurrentSelectionChecked(event); if (currentSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) currentSelection; Object selected = selection.getFirstElement(); ref = getRef(selected); } else ref = null; final Repository repository = getRepository(event); if (ref == null) { RebaseTargetSelectionDialog rebaseTargetSelectionDialog = new RebaseTargetSelectionDialog( getShell(event), repository); if (rebaseTargetSelectionDialog.open() == IDialogConstants.OK_ID) { String refName = rebaseTargetSelectionDialog.getRefName(); try { ref = repository.getRef(refName); } catch (IOException e) { throw new ExecutionException(e.getMessage(), e); } } else return null; } String jobname = NLS.bind( UIText.RebaseCurrentRefCommand_RebasingCurrentJobName, ref .getName()); RebaseHelper.runRebaseJob(repository, jobname, ref); return null; }
Source:
<code>INDArray phi(INDArray diffSquared, INDArray sigma) { INDArray minustwovariance = Transforms.pow(sigma, 2).mul(2).negi(); <START> INDArray normalPart = Transforms.pow(sigma.mul(SQRT_TWO_PI), (double)mLabelWidth); <END> INDArray exponentPart = Transforms.exp( diffSquared.div(minustwovariance) ); INDArray likelihoods = exponentPart.div(normalPart); return likelihoods; }</code><technical_language>Transforms.pow(sigma.mul(SQRT_TWO_PI), (double)mLabelWidth, false); avoid extra array allocation</technical_language>

Target:
private INDArray phi(INDArray diffSquared, INDArray sigma) { INDArray minustwovariance = sigma.mul(sigma).muli(2).negi(); INDArray likelihoods = Transforms.exp(diffSquared.divi(minustwovariance)) .divi(Transforms.pow(sigma.mul(SQRT_TWO_PI), (double)mLabelWidth)); return likelihoods; }
Source:
<code>private String getKey(MongoClientSettings clientSettings) { String hosts = clientSettings.getClusterSettings().getHosts().stream().map(h -> h.getHost() + ":" + h.getPort()) .collect(Collectors.joining(",")); String replicaSet = clientSettings.getClusterSettings().getRequiredReplicaSetName(); <START> String userName = clientSettings.getCredential() == null ? "" : clientSettings.getCredential().getUserName(); <END> return String.join(";", Arrays.asList(hosts, replicaSet, userName, databaseName)); }</code><technical_language>Optional here</technical_language>

Target:
private String getKey(MongoClientSettings clientSettings) { String hosts = clientSettings.getClusterSettings().getHosts().stream().map(h -> h.getHost() + ":" + h.getPort()) .collect(Collectors.joining(",")); String replicaSet = clientSettings.getClusterSettings().getRequiredReplicaSetName(); String userName = Optional.ofNullable(clientSettings.getCredential()).map(MongoCredential::getUserName).orElse(""); return String.join(";", Arrays.asList(hosts, replicaSet, userName, databaseName)); }
Source:
<code>public void endInput() throws Exception { <START> if (owner instanceof BoundedOneInput && inputId == 1) { <END> ((BoundedOneInput) owner).endInput(); } else if (owner instanceof BoundedMultiInput) { ((BoundedMultiInput) owner).endInput(inputId); } }</code><technical_language>other inputId 1</technical_language>

Target:
public void endInput() throws Exception { EndOfInputUtil.endInput(owner, inputId); }
Source:
<code>public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException { String token = request.getHeader(OpenShiftAuthenticationFilter.AUTHORIZATION_HEADER); String tenant = request.getHeader(HAWKULAR_TENANT); if (token == null || tenant == null) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "The '" + OpenShiftAuthenticationFilter.AUTHORIZATION_HEADER + "' and '" + HAWKULAR_TENANT + "' headers" + " are required"); return; } if (isAuthorized(request.getMethod(), token, tenant)) { filterChain.doFilter(request, response); <START> return; <END> } else { response.sendError(HttpServletResponse.SC_FORBIDDEN); return; } }</code><technical_language>Pointless return</technical_language>

Target:
public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException { String token = request.getHeader(OpenShiftAuthenticationFilter.AUTHORIZATION_HEADER); String tenant = request.getHeader(HAWKULAR_TENANT); if (token == null || tenant == null) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "The '" + OpenShiftAuthenticationFilter.AUTHORIZATION_HEADER + "' and '" + HAWKULAR_TENANT + "' headers" + " are required"); } else if (isAuthorized(request.getMethod(), token, tenant)) { filterChain.doFilter(request, response); } else { response.sendError(HttpServletResponse.SC_FORBIDDEN); } }
Source:
<code>public void toWordML(Producer producer, IOseeBranch branch, RelationOrderData relationOrderData) { WordMLProducer writer = (WordMLProducer) producer; try { writer.startTable(); writer.addWordMl("<w:tblPr><w:tblW w:w=\"8200\" w:type=\"dxa\"/><w:jc w:val=\"center\"/></w:tblPr>"); if (!relationOrderData.hasEntries()) { writer.addTableRow(NO_DATA_TAG); } else { writer.addTableRow("Relation Type", "Side Name", "Side", "Order Type", "Related Artifacts"); for (Entry<Pair<String, String>, Pair<String, List<String>>> entry : relationOrderData.getOrderedEntrySet()) { String relationTypeName = entry.getKey().getFirst(); String relationSide = entry.getKey().getSecond(); String sorterGuid = entry.getValue().getFirst(); List<String> guidList = entry.getValue().getSecond(); List<String> mlLinks = guidResolver.resolveAsOseeLinks(branch, guidList); RelationType relationType = relationCache.getUniqueByName(relationTypeName); RelationSide side = RelationSide.fromString(relationSide); try { writeTableRow(writer, relationType, side, resolveSorter(sorterGuid), mlLinks); } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } } } writer.endTable(); } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } finally { try { <START> writer.endTable(); <END> } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } } }</code><technical_language>this writer.endTable get called if succeeded time. i.e. finally block runs</technical_language>

Target:
public void toWordML(Producer producer, IOseeBranch branch, RelationOrderData relationOrderData) { WordMLProducer writer = (WordMLProducer) producer; try { writer.startTable(); writer.addWordMl("<w:tblPr><w:tblW w:w=\"8200\" w:type=\"dxa\"/><w:jc w:val=\"center\"/></w:tblPr>"); if (!relationOrderData.hasEntries()) { writer.addTableRow(NO_DATA_TAG); } else { writer.addTableRow("Relation Type", "Side Name", "Side", "Order Type", "Related Artifacts"); for (Entry<Pair<String, String>, Pair<String, List<String>>> entry : relationOrderData.getOrderedEntrySet()) { String relationTypeName = entry.getKey().getFirst(); String relationSide = entry.getKey().getSecond(); String sorterGuid = entry.getValue().getFirst(); List<String> guidList = entry.getValue().getSecond(); List<String> mlLinks = guidResolver.resolveAsOseeLinks(branch, guidList); RelationType relationType = relationCache.getUniqueByName(relationTypeName); RelationSide side = RelationSide.fromString(relationSide); try { writeTableRow(writer, relationType, side, resolveSorter(sorterGuid), mlLinks); } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } } } } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } finally { try { writer.endTable(); } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } } }
Source:
<code>public GatewayConnectionConfig getGatewayConnectionConfig() { return gatewayConnectionConfig; <START> } <END></code><technical_language>exposing public getters for other CosmosClientBuilder apis</technical_language>

Target:
GatewayConnectionConfig getGatewayConnectionConfig() { return gatewayConnectionConfig; }
Source:
<code><START> default <U> Validation<U, T> mapError(Function<Seq<? extends E>, ? extends U> f) { <END> Objects.requireNonNull(f, "f is null"); if (isInvalid()) { final Seq<? extends E> errors = this.getErrors(); return Validation.invalid(f.apply(errors)); } else { return Validation.valid(this.get()); } }</code><technical_language>contra-variant position: java Function<? super Seq<? super E>, ? extends U> **However**, is I recognized: implicitely errors of type Seq<U> a type Validation<U, T>. natural describe map _one_ error? I.e. java default <U> Validation<U, T> mapError(Function<? super E, ? extends U> f) { Objects.requireNonNull(f, "f is null"); if (isInvalid()) { return Validation.invalid(f.apply(errors)); } else { return (Validation<U, T>) this; } } I know, **please discuss!** (maybe affect fold, bimap, ... ?) need change name: mapErrors instead of mapError</technical_language>

Target:
default <U> Validation<U, T> mapError(Function<Seq<? extends E>, ? extends U> f) { Objects.requireNonNull(f, "f is null"); if (isInvalid()) { return Validation.invalid(f.apply(this.getErrors())); } else { return Validation.valid(this.get()); } }
Source:
<code>public boolean isReserved(String componentId) { final SnomedIdentifier identifier = SnomedIdentifiers.of(componentId); <START> synchronized (reservations) { <END> for (Reservation reservation : getReservations()) { if (reservation.conflicts(identifier)) { return true; } } } return false; }</code><technical_language>This synchronized block is longer necessary</technical_language>

Target:
public boolean isReserved(String componentId) { final SnomedIdentifier identifier = SnomedIdentifiers.of(componentId); for (Reservation reservation : getReservations()) { if (reservation.includes(identifier)) { return true; } } return false; }
Source:
<code>public boolean onCreateActionMode(final ActionMode mode, Menu menu) { mode.setTag(ACTION_MODE_TAG); mode.getMenuInflater().inflate(R.menu.menu_action_mode_search, menu); searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.menu_search_view)); searchView.setIconified(false); searchView.setQueryHint(getSearchHintString()); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String s) { return false; } @Override public boolean onQueryTextChange(String s) { onQueryChange(s); return true; } }); searchView.setOnCloseListener(new SearchView.OnCloseListener() { @Override public boolean onClose() { mode.finish(); return <START> false; <END> } }); return true; }</code><technical_language>return true if listener wants override default behavior of clearing text field dismissing it, false otherwise. I this true handling it? want clear listener in onDestroyActionMode() searchView is nonnull</technical_language>

Target:
public boolean onCreateActionMode(final ActionMode mode, Menu menu) { mode.setTag(ACTION_MODE_TAG); mode.getMenuInflater().inflate(R.menu.menu_action_mode_search, menu); searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.menu_search_view)); searchView.setIconified(false); searchView.setQueryHint(getSearchHintString()); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String s) { return false; } @Override public boolean onQueryTextChange(String s) { onQueryChange(s); return true; } }); searchView.setOnCloseListener(new SearchView.OnCloseListener() { @Override public boolean onClose() { searchView.setOnQueryTextListener(null); searchView.setOnCloseListener(null); mode.finish(); return true; } }); return true; }
Source:
<code><START> public void testIsSubStageNode() throws Exception { <END> setupForSubStage(); assertTrue(CaseManagementCommandUtil.isSubStageNode(child)); }</code><technical_language>Exception is thrown</technical_language>

Target:
public void testIsSubStageNode() { setupForSubStage(); assertTrue(CaseManagementCommandUtil.isSubStageNode(child)); }
Source:
<code>public EntitySpec<?> resolve(String type, BrooklynClassLoadingContext loader, Set<String> encounteredTypes) { String yaml; try { yaml = ResourceUtils.create(this).getResourceAsString(type); } catch (Exception e) { <START> log.warn("AssemblyTemplate type " + type + " which looks like a URL can't be fetched.", e); <END> return null; } List<EntitySpec<?>> serviceSpecs = CampUtils.createServiceSpecs(yaml, loader, encounteredTypes); if (serviceSpecs.size() > 1) { throw new UnsupportedOperationException("Only supporting single service in remotely referenced plans: got "+serviceSpecs); } return serviceSpecs.get(0); }</code><technical_language>reword "AssemblyTemplate type .. a URL fetched"</technical_language>

Target:
public EntitySpec<?> resolve(String type, BrooklynClassLoadingContext loader, Set<String> encounteredTypes) { String yaml; try { yaml = ResourceUtils.create(this).getResourceAsString(type); } catch (Exception e) { log.warn("AssemblyTemplate type " + type + " looks like a URL that can't be fetched.", e); return null; } List<EntitySpec<?>> serviceSpecs = CampUtils.createServiceSpecs(yaml, loader, encounteredTypes); if (serviceSpecs.size() > 1) { throw new UnsupportedOperationException("Only supporting single service in remotely referenced plans: got "+serviceSpecs); } return serviceSpecs.get(0); }
Source:
<code>public BVDesignOutput runBVDesign(final WorkbenchService workbenchService, final FieldbookProperties fieldbookProperties, final MainDesign design) throws IOException { final String bvDesignPath = fieldbookProperties.getBvDesignPath(); <START> DESIGN_RUNNER_TIMEOUT_MILLIS *= Long.valueOf(fieldbookProperties.getBvDesignRunnerTimeout()); <END> int returnCode = -1; if (bvDesignPath != null && design != null && design.getDesign() != null) { final String xml = this.getXMLStringForDesign(design); final String filepath = this.inputWriter.write(xml, fieldbookProperties); returnCode = this.processRunner.run(bvDesignPath, "-i" + filepath); } final BVDesignOutput output = new BVDesignOutput(returnCode); if (returnCode == 0) { output.setResults(outputReader.read(design.getDesign().getParameterValue(ExperimentDesignGenerator.OUTPUTFILE_PARAM))); } return output; }</code><technical_language>need for DESIGN_RUNNER_TIMEOUT_MILLIS class variable (actually a constant of final keyword). declare a local variable is calculated product of Long.valueOf(fieldbookProperties.getBvDesignRunnerTimeout()) 60 * 1000</technical_language>

Target:
public BVDesignOutput runBVDesign(final WorkbenchService workbenchService, final FieldbookProperties fieldbookProperties, final MainDesign design) throws IOException { final String bvDesignPath = fieldbookProperties.getBvDesignPath(); bvDesignRunnerTimeout = 60 * 1000 * Long.valueOf(fieldbookProperties.getBvDesignRunnerTimeout()); int returnCode = -1; if (bvDesignPath != null && design != null && design.getDesign() != null) { final String xml = this.getXMLStringForDesign(design); final String filepath = this.inputWriter.write(xml, fieldbookProperties); returnCode = this.processRunner.run(bvDesignPath, "-i" + filepath); } final BVDesignOutput output = new BVDesignOutput(returnCode); if (returnCode == 0) { output.setResults(outputReader.read(design.getDesign().getParameterValue(ExperimentDesignGenerator.OUTPUTFILE_PARAM))); } return output; }
Source:
<code>public void run(String paragraphId) { Paragraph p = getParagraph(paragraphId); p.setListener(jobListenerFactory.getParagraphJobListener(this)); String requiredReplName = p.getRequiredReplName(); Interpreter intp = factory.getInterpreter(getId(), requiredReplName); if (intp == null) { if (conf.getUseJdbcAlias() && null != (intp = factory.getInterpreter(getId(), "jdbc"))) { String pText = p.getText().replaceFirst(requiredReplName, "jdbc(" + requiredReplName + ")"); logger.debug("New paragraph: {}", pText); p.setEffectiveText(pText); } else { InterpreterException intpException; <START> intpException = new InterpreterException( <END> "Pargaraph " + p.getJobName() + "'s Interpreter " + requiredReplName + " not found"); p.setReturn( new InterpreterResult(InterpreterResult.Code.ERROR, intpException.getMessage()), intpException); p.setStatus(Job.Status.ERROR); throw intpException; } } if (p.getConfig().get("enabled") == null || (Boolean) p.getConfig().get("enabled")) { intp.getScheduler().submit(p); } }</code><technical_language>a nitpick, declaration definition of this variable done a single line</technical_language>

Target:
public void run(String paragraphId) { Paragraph p = getParagraph(paragraphId); p.setListener(jobListenerFactory.getParagraphJobListener(this)); String requiredReplName = p.getRequiredReplName(); Interpreter intp = factory.getInterpreter(getId(), requiredReplName); if (intp == null) { if (conf.getUseJdbcAlias() && null != (intp = factory.getInterpreter(getId(), "jdbc"))) { String pText = p.getText().replaceFirst(requiredReplName, "jdbc(" + requiredReplName + ")"); logger.debug("New paragraph: {}", pText); p.setEffectiveText(pText); } else { String intpExceptionMsg = String.format("%s", p.getJobName() + "'s Interpreter " + requiredReplName + " not found" ); InterpreterException intpException = new InterpreterException(intpExceptionMsg); InterpreterResult intpResult = new InterpreterResult( InterpreterResult.Code.ERROR, intpException.getMessage() ); p.setReturn(intpResult, intpException); p.setStatus(Job.Status.ERROR); throw intpException; } } if (p.getConfig().get("enabled") == null || (Boolean) p.getConfig().get("enabled")) { intp.getScheduler().submit(p); } }
Source:
<code>private boolean isEquals(Object value1, Object value2, String fieldName) { if (Objects.equals(value1, value2)) { return true; } else { <START> logger.info("Field value does not match between ledger and connector [field_name={}] {}", fieldName, <END> kv(FIELD_NAME, fieldName)); return false; } }</code><technical_language>{} end of this log line StructuredArgument substituted string appearing a JSON field</technical_language>

Target:
private boolean isEquals(Object value1, Object value2, String fieldName) { if (Objects.equals(value1, value2)) { return true; } else { logger.info("Field value does not match between ledger and connector [field_name={}]", fieldName, kv(FIELD_NAME, fieldName)); return false; } }
Source:
<code>private static void createSolrCore(String coreName, CloseableHttpClient httpClient) throws IOException, SolrServerException { String solrUrl = getSolrUrl(); try (CloseableHttpClient closeableHttpClient = httpClient; HttpSolrClient client = (httpClient != null ? new HttpSolrClient.Builder(solrUrl).withHttpClient(httpClient).build() : new HttpSolrClient.Builder(solrUrl).build())) { HttpResponse ping = client.getHttpClient().execute(new HttpHead(solrUrl)); if (ping != null && ping.getStatusLine().getStatusCode() == 200) { ConfigurationFileProxy configProxy = new ConfigurationFileProxy(ConfigurationStore.getInstance()); configProxy.writeSolrConfiguration(coreName); if (!solrCoreExists(client, coreName)) { LOGGER.debug("Solr({}): Creating Solr core", coreName); String dataDir = getCoreDataDir(coreName); CoreAdminRequest.createCore( coreName, <START> getCoreDir(coreName), <END> client, DEFAULT_SOLRCONFIG_XML, DEFAULT_SCHEMA_XML, dataDir, dataDir); } else { LOGGER.debug("Solr({}): Solr core already exists; reloading it", coreName); CoreAdminRequest.reloadCore(coreName, client); } } else { LOGGER.debug("Solr({}): Unable to ping Solr core at {}", coreName, solrUrl); throw new SolrServerException("Unable to ping Solr core"); } } }</code><technical_language>This internally calls getCoreDir() means access controller multiple times for info</technical_language>

Target:
private void createSolrCore(String coreName, CloseableHttpClient httpClient) throws IOException, SolrServerException { String solrUrl = getSolrUrl(); try (CloseableHttpClient closeableHttpClient = httpClient; HttpSolrClient client = (httpClient != null ? new HttpSolrClient.Builder(solrUrl).withHttpClient(httpClient).build() : new HttpSolrClient.Builder(solrUrl).build())) { HttpResponse ping = client.getHttpClient().execute(new HttpHead(solrUrl)); if (ping != null && ping.getStatusLine().getStatusCode() == 200) { ConfigurationFileProxy configProxy = new ConfigurationFileProxy(ConfigurationStore.getInstance()); configProxy.writeSolrConfiguration(coreName); if (!solrCoreExists(client, coreName)) { LOGGER.debug("Solr({}): Creating Solr core", coreName); String dataDir = getCoreDataDir(coreName); CoreAdminRequest.createCore( coreName, getCoreDir(coreName), client, DEFAULT_SOLRCONFIG_XML, DEFAULT_SCHEMA_XML, dataDir, dataDir); } else { LOGGER.debug("Solr({}): Solr core already exists; reloading it", coreName); CoreAdminRequest.reloadCore(coreName, client); } } else { LOGGER.debug("Solr({}): Unable to ping Solr core at {}", coreName, solrUrl); throw new SolrServerException("Unable to ping Solr core"); } } }
Source:
<code>public GraphicsConsole get() { List<String> supportedIds = new ArrayList<>(); for (GraphicsConsole graphicsConsole : parent.list().getGraphicsConsoles()) { if (consoleId.equals(graphicsConsole.getId())) { return graphicsConsole; } supportedIds.add(graphicsConsole.getId()); } Fault fault = new Fault(); fault.setReason("Unsupported console ID"); fault.setDetail("Supported console IDs are: " + StringUtils.join(supportedIds, ", ")); <START> throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(fault).build()); <END> }</code><technical_language>This return 404 HTTP error code (not found)</technical_language>

Target:
public GraphicsConsole get() { List<String> supportedIds = new ArrayList<>(); for (GraphicsConsole graphicsConsole : parent.list().getGraphicsConsoles()) { if (consoleId.equals(graphicsConsole.getId())) { return graphicsConsole; } supportedIds.add(graphicsConsole.getId()); } throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build()); }