auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void verifyAccessibleForStudentsOfTheSameCourse(String[] submissionParams) { ______TS("students of the same course can access"); InstructorAttributes instructor1OfCourse1 = data.instructors.get("instructor1OfCourse1"); StudentAttributes student1InCourse1 = data.students.get("student1InCourse1"); gaeSimulation.loginAsStudent(student1InCourse1.googleId); <START> verifyCanAccess(addUserIdToParams(student1InCourse1.googleId, submissionParams)); <END> verifyCannotMasquerade(addUserIdToParams(instructor1OfCourse1.googleId, submissionParams)); }</code><technical_language>Is this necessary</technical_language>

Target:
protected void verifyAccessibleForStudentsOfTheSameCourse(String[] submissionParams) { ______TS("students of the same course can access"); InstructorAttributes instructor1OfCourse1 = data.instructors.get("instructor1OfCourse1"); StudentAttributes student1InCourse1 = data.students.get("student1InCourse1"); gaeSimulation.loginAsStudent(student1InCourse1.googleId); verifyCanAccess(submissionParams); verifyCannotMasquerade(addUserIdToParams(instructor1OfCourse1.googleId, submissionParams)); }
Source:
<code>public boolean isKeepAliveLimitReached(final IntStream keepAlive) { <START> return batchKeepAliveIterations.map(it -> keepAlive.allMatch(v -> v >= it) && it > 0).orElse(false); <END> }</code><technical_language>@m99coder thank for contribution. I place check condition StreamParameters constructor <LINK_0> a place handle special values of stream parameters default values</technical_language>

Target:
public boolean isKeepAliveLimitReached(final IntStream keepAlive) { return batchKeepAliveIterations.map(it -> keepAlive.allMatch(v -> v >= it)).orElse(false); }
Source:
<code>public void onPositiveClicked(@NonNull String instanceTag) { switch (instanceTag) { case TAG_ADD_SITE_ICON_DIALOG: case TAG_CHANGE_SITE_ICON_DIALOG: ActivityLauncher.showPhotoPickerForResult(getActivity(), MediaBrowserType.SITE_ICON_PICKER, getSelectedSite()); break; case TAG_EDIT_SITE_ICON_PERMISSIONS_DIALOG: break; case TAG_QUICK_START_DIALOG: startQuickStart(); <START> AnalyticsTracker.track(AnalyticsTracker.Stat.QUICK_START_REQUEST_POSITIVE_TAPPED); <END> break; default: AppLog.e(T.EDITOR, "Dialog instanceTag is not recognized"); throw new UnsupportedOperationException("Dialog instanceTag is not recognized"); } }</code><technical_language>remove unnecessary AnalyticsTracker qualification AnalyticsTracker.Stat.QUICK_START_REQUEST_POSITIVE_TAPPED produce AnalyticsTracker.track(Stat.QUICK_START_REQUEST_POSITIVE_TAPPED); for simplicity</technical_language>

Target:
public void onPositiveClicked(@NonNull String instanceTag) { switch (instanceTag) { case TAG_ADD_SITE_ICON_DIALOG: case TAG_CHANGE_SITE_ICON_DIALOG: ActivityLauncher.showPhotoPickerForResult(getActivity(), MediaBrowserType.SITE_ICON_PICKER, getSelectedSite()); break; case TAG_EDIT_SITE_ICON_PERMISSIONS_DIALOG: break; case TAG_QUICK_START_DIALOG: startQuickStart(); AnalyticsTracker.track(Stat.QUICK_START_REQUEST_DIALOG_POSITIVE_TAPPED); break; default: AppLog.e(T.EDITOR, "Dialog instanceTag is not recognized"); throw new UnsupportedOperationException("Dialog instanceTag is not recognized"); } }
Source:
<code>public void testShift() throws Exception { logger.info("To run this test, you need a SAMP Hub running with Sherpa-SAMP connected."); double[] y = new double[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }; double[] yerr = new double[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }; double[] x = new double[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; <START> controller = new SAMPController.Builder("SEDStacker").buildAndStart(30000); <END> RedshiftPayload payload = (RedshiftPayload) SAMPFactory.get(RedshiftPayload.class); payload.setX(x); payload.setY(y); payload.setYerr(yerr); payload.setFromRedshift(1); payload.setToRedshift(0); SAMPMessage message = SAMPFactory.createMessage(REDSHIFT_MTYPE, payload, RedshiftPayload.class); SherpaClient client = SherpaClient.create(controller); Response rspns = client.sendMessage(message); RedshiftPayload response = (RedshiftPayload) SAMPFactory.get(rspns.getResult(), RedshiftPayload.class); double[] controlYerr = new double[]{ 1, 21, 11, 2, 22, 12, 3, 23, 13, 4, 24, 14, 25, 15, 5, 16, 6, 26, 17, 7, 27, 18, 8, 28, 29, 19, 9, 20, 10, 30 }; for (int i = 0; i < response.getY().length; i++) { assertEquals(controlYerr[i], response.getYerr()[i], 0.00001); } }</code><technical_language>changes in #203, this super class's controller; creating a new one. This I missed in #203</technical_language>

Target:
public void testShift() throws Exception { logger.info("To run this test, you need a SAMP Hub running with Sherpa-SAMP connected."); double[] y = new double[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }; double[] yerr = new double[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }; double[] x = new double[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; RedshiftPayload payload = (RedshiftPayload) SAMPFactory.get(RedshiftPayload.class); payload.setX(x); payload.setY(y); payload.setYerr(yerr); payload.setFromRedshift(1); payload.setToRedshift(0); SAMPMessage message = SAMPFactory.createMessage(REDSHIFT_MTYPE, payload, RedshiftPayload.class); Response rspns = client.sendMessage(message); RedshiftPayload response = (RedshiftPayload) SAMPFactory.get(rspns.getResult(), RedshiftPayload.class); double[] controlYerr = new double[]{ 1, 21, 11, 2, 22, 12, 3, 23, 13, 4, 24, 14, 25, 15, 5, 16, 6, 26, 17, 7, 27, 18, 8, 28, 29, 19, 9, 20, 10, 30 }; for (int i = 0; i < response.getY().length; i++) { assertEquals(controlYerr[i], response.getYerr()[i], 0.00001); } }
Source:
<code>private SessionScript getScriptInterface(ScriptWrapper script) { try { <START> return getScriptsExtension().getInterface(script, SessionScript.class); <END> } catch (Exception e) { getScriptsExtension() .handleFailedScriptInterface( script, Constant.messages.getString( "session.method.script.dialog.error.text.interface", script.getName())); } return null; }</code><technical_language>static</technical_language>

Target:
private static SessionScript getScriptInterface(ScriptWrapper script) { try { return getScriptsExtension().getInterface(script, SessionScript.class); } catch (Exception e) { getScriptsExtension() .handleFailedScriptInterface( script, Constant.messages.getString( "session.method.script.dialog.error.text.interface", script.getName())); } return null; }
Source:
<code>protected void init() { if (getVm() == null) { return; } super.init(); if (getParameters().getCustomCpuName() != null) { <START> if (getVm().isUseHostCpuFlags()) { getVm().setUseHostCpuFlags(false); } <END> getVm().setCustomCpuName(getParameters().getCustomCpuName()); } if (getParameters().getCustomEmulatedMachine() != null) { getVm().setEmulatedMachine(getParameters().getCustomEmulatedMachine()); } if (getParameters().getBootMenuEnabled() != null) { getVm().setBootMenuEnabled(getParameters().getBootMenuEnabled()); } if (getParameters().getSpiceFileTransferEnabled() != null) { getVm().setSpiceFileTransferEnabled(getParameters().getSpiceFileTransferEnabled()); } if (getParameters().getSpiceCopyPasteEnabled() != null) { getVm().setSpiceCopyPasteEnabled(getParameters().getSpiceCopyPasteEnabled()); } if (getParameters().getBootSequence() != null) { getVm().setBootSequence(getParameters().getBootSequence()); } getVm().setVolatileRun(getParameters().isVolatileRun()); getVm().setInitrdUrl(getParameters().getInitrdUrl()); getVm().setKernelUrl(getParameters().getKernelUrl()); getVm().setKernelParams(getParameters().getKernelParams()); getVm().setCustomProperties(getParameters().getCustomProperties()); getVm().setRunOnce(true); }</code><technical_language>replacing with: getVm().setUseHostCpuFlags(false);</technical_language>

Target:
protected void init() { if (getVm() == null) { return; } super.init(); if (getParameters().getCustomCpuName() != null) { getVm().setUseHostCpuFlags(false); getVm().setCustomCpuName(getParameters().getCustomCpuName()); } if (getParameters().getCustomEmulatedMachine() != null) { getVm().setEmulatedMachine(getParameters().getCustomEmulatedMachine()); } if (getParameters().getBootMenuEnabled() != null) { getVm().setBootMenuEnabled(getParameters().getBootMenuEnabled()); } if (getParameters().getSpiceFileTransferEnabled() != null) { getVm().setSpiceFileTransferEnabled(getParameters().getSpiceFileTransferEnabled()); } if (getParameters().getSpiceCopyPasteEnabled() != null) { getVm().setSpiceCopyPasteEnabled(getParameters().getSpiceCopyPasteEnabled()); } if (getParameters().getBootSequence() != null) { getVm().setBootSequence(getParameters().getBootSequence()); } getVm().setVolatileRun(getParameters().isVolatileRun()); getVm().setInitrdUrl(getParameters().getInitrdUrl()); getVm().setKernelUrl(getParameters().getKernelUrl()); getVm().setKernelParams(getParameters().getKernelParams()); getVm().setCustomProperties(getParameters().getCustomProperties()); getVm().setRunOnce(true); }
Source:
<code>public void updateFields() { Gist gist = new Gist(); assertEquals(3, gist.setComments(3).getComments()); assertEquals(new Date(5000), gist.setCreatedAt(new Date(5000)) .getCreatedAt()); assertEquals("desc", gist.setDescription("desc").getDescription()); assertEquals(Collections.emptyMap(), gist.setFiles(Collections.<String, GistFile> emptyMap()) .getFiles()); assertEquals("pull", gist.setGitPullUrl("pull").getGitPullUrl()); assertEquals("push", gist.setGitPushUrl("push").getGitPushUrl()); assertEquals(Collections.emptyList(), gist.setHistory(Collections.<GistRevision> emptyList()) .getHistory()); assertEquals("html", gist.setHtmlUrl("html").getHtmlUrl()); assertEquals("id", gist.setId("id").getId()); assertEquals(new Date(1000), gist.setUpdatedAt(new Date(1000)) .getUpdatedAt()); assertEquals("url", gist.setUrl("url").getUrl()); <START> User user = new User().setLogin("use"); <END> assertTrue(gist.setPublic(true).isPublic()); }</code><technical_language>getOwner()/setOwner()</technical_language>

Target:
public void updateFields() { Gist gist = new Gist(); assertEquals(3, gist.setComments(3).getComments()); assertEquals(new Date(5000), gist.setCreatedAt(new Date(5000)) .getCreatedAt()); assertEquals("desc", gist.setDescription("desc").getDescription()); assertEquals(Collections.emptyMap(), gist.setFiles(Collections.<String, GistFile> emptyMap()) .getFiles()); assertEquals("pull", gist.setGitPullUrl("pull").getGitPullUrl()); assertEquals("push", gist.setGitPushUrl("push").getGitPushUrl()); assertEquals(Collections.emptyList(), gist.setHistory(Collections.<GistRevision> emptyList()) .getHistory()); assertEquals("html", gist.setHtmlUrl("html").getHtmlUrl()); assertEquals("id", gist.setId("id").getId()); assertEquals(new Date(1000), gist.setUpdatedAt(new Date(1000)) .getUpdatedAt()); assertEquals("url", gist.setUrl("url").getUrl()); User user = new User().setLogin("use"); assertEquals(user, gist.setOwner(user).getOwner()); assertTrue(gist.setPublic(true).isPublic()); }
Source:
<code>private int computeAndSaveScores() { int processed = 0; <START> for (String pillID: this.toProccessedIDs) { <END> final Long accountID = this.pillAccountID.get(pillID); final SortedSet<SensorSample> data = this.pillData.get(pillID); if (data.isEmpty()) { LOGGER.error("No data for scoring {}", pillID); continue; } final List<SleepScore> scores = SleepScore.computeSleepScore(accountID, pillID, data, this.dateMinuteBucket); final Map<String, Integer> stats = this.sleepScoreDAO.saveScores(scores); final int saved = (stats.get("updated") + stats.get("inserted")); this.numUpdates += stats.get("updated"); this.numInserts += stats.get("inserted"); this.numScores += scores.size(); if (saved > 0) { this.numPillsProcessed++; this.pillData.removeAll(pillID); this.pillAccountID.remove(pillID); this.toProccessedIDs.remove(pillID); processed++; } } return processed; }</code><technical_language>final String pillID</technical_language>

Target:
private int computeAndSaveScores() { int processed = 0; for (final String pillID: this.toProccessedIDs) { final Long accountID = this.pillAccountID.get(pillID); final SortedSet<PillSample> data = this.pillData.get(pillID); if (data.isEmpty()) { LOGGER.error("No data for scoring {}", pillID); continue; } final List<SleepScore> scores = SleepScore.computeSleepScore(accountID, pillID, data, this.dateMinuteBucket); final Map<String, Integer> stats = this.sleepScoreDAO.saveScores(scores); final int saved = (stats.get("updated") + stats.get("inserted")); this.numUpdates += stats.get("updated"); this.numInserts += stats.get("inserted"); this.numScores += scores.size(); if (saved > 0) { this.numPillsProcessed++; this.pillData.removeAll(pillID); this.pillAccountID.remove(pillID); this.toProccessedIDs.remove(pillID); processed++; } } return processed; }
Source:
<code><START> protected void setSegmentMetadataHolder(final DataSegment segment, final SegmentMetadataHolder segmentMetadataHolder) <END> { synchronized (lock) { TreeMap<DataSegment, SegmentMetadataHolder> dataSourceSegments = segmentMetadataInfo.computeIfAbsent( segment.getDataSource(), x -> new TreeMap<>(SEGMENT_ORDER) ); if (dataSourceSegments.put(segment, segmentMetadataHolder) == null) { totalSegments++; } } }</code><technical_language>this package-private</technical_language>

Target:
void setSegmentMetadataHolder(final DataSegment segment, final SegmentMetadataHolder segmentMetadataHolder) { synchronized (lock) { TreeMap<DataSegment, SegmentMetadataHolder> dataSourceSegments = segmentMetadataInfo.computeIfAbsent( segment.getDataSource(), x -> new TreeMap<>(SEGMENT_ORDER) ); if (dataSourceSegments.put(segment, segmentMetadataHolder) == null) { totalSegments++; } } }
Source:
<code>public Object convert(String tuple) { try { return reader.readValue(tuple); } catch (JsonProcessingException e) { <START> logger.error("Error while converting tuple ", tuple + " " + e.getMessage()); <END> } catch (IOException e) { DTThrowable.rethrow(e); } return null; }</code><technical_language>for log message</technical_language>

Target:
public Object convert(String tuple) { try { return reader.readValue(tuple); } catch (JsonProcessingException e) { logger.debug("Error while converting tuple {}",tuple,e.getMessage()); } catch (IOException e) { DTThrowable.rethrow(e); } return null; }
Source:
<code>public void duplicatedBlocks_should_be_activated_by_default() { orchestrator.resetData(); Map<String, Rules.ActiveList> actives = newWsClient().rules().search(new SearchWsRequest() .setLanguages(singletonList("js")) .setRepositories(singletonList("common-js")) .setFields(singletonList("actives"))).getActives().getActives(); assertThat(actives.get("common-js:InsufficientCommentDensity").getActiveListList()).isEmpty(); <START> assertThat(actives.get("common-js:DuplicatedBlocks").getActiveListList()).hasSize(1); <END> }</code><technical_language>@julienlancelot I understand is happening here, add assert profile? (unless that)</technical_language>

Target:
public void duplicatedBlocks_should_be_activated_by_default() { orchestrator.resetData(); Map<String, Rules.ActiveList> actives = newWsClient().rules().search(new SearchWsRequest() .setLanguages(singletonList("js")) .setRepositories(singletonList("common-js")) .setFields(singletonList("actives"))).getActives().getActives(); Map<String, String> jsProfileNameById = jsProfileNamesById(); assertThat(ruleActivations(actives, jsProfileNameById, "common-js:InsufficientCommentDensity")).isEmpty(); assertThat(ruleActivations(actives, jsProfileNameById, "common-js:DuplicatedBlocks")).containsExactly("Sonar way"); }
Source:
<code>public KeyMaterial materialize() throws IOException, InterruptedException { final FilePath tempCredsDir; if (credentials != null) { String key = credentials.getClientSecretKeyInPEM(); String cert = credentials.getClientCertificateInPEM(); String ca = credentials.getServerCaCertificateInPEM(); if (key != null && cert != null && ca != null) { tempCredsDir = new FilePath(baseDir, UUID.randomUUID().toString()); copyInto(tempCredsDir,"key.pem", key); copyInto(tempCredsDir,"cert.pem", cert); copyInto(tempCredsDir,"ca.pem", ca); tempCredsDir.chmod(0600); } else { tempCredsDir = null; } } else { tempCredsDir = null; } EnvVars e = new EnvVars(); if (host!=null) { e.put("DOCKER_HOST",host); } if (tempCredsDir !=null) { e.put("DOCKER_TLS_VERIFY", "1"); e.put("DOCKER_CERT_PATH", tempCredsDir.getRemote()); } <START> return new KeyMaterial(e) { <END> @Override public void close() throws IOException { try { if (tempCredsDir !=null) { tempCredsDir.deleteRecursive(); } } catch (InterruptedException e) { throw new IOException(e); } } }; }</code><technical_language>a static class safely serialized</technical_language>

Target:
public KeyMaterial materialize() throws IOException, InterruptedException { final FilePath tempCredsDir; if (credentials != null) { String key = credentials.getClientSecretKeyInPEM(); String cert = credentials.getClientCertificateInPEM(); String ca = credentials.getServerCaCertificateInPEM(); if (key != null && cert != null && ca != null) { tempCredsDir = new FilePath(baseDir, UUID.randomUUID().toString()); copyInto(tempCredsDir,"key.pem", key); copyInto(tempCredsDir,"cert.pem", cert); copyInto(tempCredsDir,"ca.pem", ca); tempCredsDir.chmod(0600); } else { tempCredsDir = null; } } else { tempCredsDir = null; } EnvVars e = new EnvVars(); if (host!=null) { e.put("DOCKER_HOST",host); } if (tempCredsDir !=null) { e.put("DOCKER_TLS_VERIFY", "1"); e.put("DOCKER_CERT_PATH", tempCredsDir.getRemote()); } return new ServerKeyMaterial(e, tempCredsDir); }
Source:
<code>public void printBody(final OutputStream output) throws IOException { final InputStream body = this.body(); try { final byte[] buf = new byte[4096]; while (true) { <START> final int actual = body.read(buf); <END> if (actual < 0) { break; } output.write(buf, 0, actual); } } finally { body.close(); } }</code><technical_language>@dmzaytsev call bytes for clarity</technical_language>

Target:
public void printBody(final OutputStream output) throws IOException { final InputStream body = this.body(); try { final byte[] buf = new byte[4096]; while (true) { final int bytes = body.read(buf); if (bytes < 0) { break; } output.write(buf, 0, bytes); } } finally { body.close(); } }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Tuple5)) return false; Tuple5<?, ?, ?, ?, ?> tuple5 = (Tuple5<?, ?, ?, ?, ?>) o; if (!Objects.equals(first, tuple5.first)) return false; if (!Objects.equals(second, tuple5.second)) return false; if (!Objects.equals(third, tuple5.third)) return false; if (!Objects.equals(forth, tuple5.forth)) return false; return Objects.equals(fifth, tuple5.fifth); <START> <END> }</code><technical_language>Extra blank line</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Tuple5)) return false; Tuple5<?, ?, ?, ?, ?> tuple5 = (Tuple5<?, ?, ?, ?, ?>) o; if (!Objects.equals(first, tuple5.first)) return false; if (!Objects.equals(second, tuple5.second)) return false; if (!Objects.equals(third, tuple5.third)) return false; if (!Objects.equals(fourth, tuple5.fourth)) return false; return Objects.equals(fifth, tuple5.fifth); }
Source:
<code>protected PropertyGenerator getPropertyGenerator(VariableElement field, DeclaredTypeName fieldType) { List<? extends TypeName> typeArgs = fieldType.getTypeArgs(); if (typeArgs != null && typeArgs.size() == 1) { TypeName enumType = typeArgs.get(0); if (enumType instanceof DeclaredTypeName) { return new EnumPropertyGenerator(modelSpec, field, utils, (DeclaredTypeName) enumType); <START> } <END> } return null; }</code><technical_language>log a warning in else case</technical_language>

Target:
protected PropertyGenerator getPropertyGenerator(VariableElement field, DeclaredTypeName fieldType) { List<? extends TypeName> typeArgs = fieldType.getTypeArgs(); if (typeArgs != null && typeArgs.size() == 1 && typeArgs.get(0) instanceof DeclaredTypeName) { return new EnumPropertyGenerator(modelSpec, field, utils, (DeclaredTypeName) typeArgs.get(0)); } utils.getMessager().printMessage(Kind.WARNING, "EnumProperty must use a declared type argument; it cannot be raw or use a generic type argument", field); return null; }
Source:
<code>public Void call() throws Exception { if (keys == null) { preIndex(); KeyValueFilter filter = getFilter(); try (Stream<CacheEntry<Object, Object>> stream = cache.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL) .cacheEntrySet().stream()) { Iterator<CacheEntry<Object, Object>> iterator = stream.filter(CacheFilters.predicate(filter)).iterator(); while (iterator.hasNext()) { CacheEntry<Object, Object> next = iterator.next(); Object value = extractValue(next.getValue()); if (value != null && value.getClass().equals(entity)) indexUpdater.updateIndex(next.getKey(), value); } } postIndex(); } else { for (Object key : keys) { Object value = extractValue(cache.get(key)); if (value != null) { indexUpdater.updateIndex(key, value); <START> indexUpdater.flush(value.getClass()); <END> } } } return null; }</code><technical_language>flush potentially expensive operation, do keys indexed</technical_language>

Target:
public Void call() throws Exception { if (keys == null || keys.size() == 0) { preIndex(); KeyValueFilter filter = getFilter(); try (Stream<CacheEntry<Object, Object>> stream = cache.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL) .cacheEntrySet().stream()) { Iterator<CacheEntry<Object, Object>> iterator = stream.filter(CacheFilters.predicate(filter)).iterator(); while (iterator.hasNext()) { CacheEntry<Object, Object> next = iterator.next(); Object value = extractValue(next.getValue()); if (value != null && value.getClass().equals(entity)) indexUpdater.updateIndex(next.getKey(), value); } } postIndex(); } else { Set<Class<?>> classSet = new HashSet<>(); for (Object key : keys) { Object value = extractValue(cache.get(key)); if (value != null) { indexUpdater.updateIndex(key, value); classSet.add(value.getClass()); } } for (Class<?> clazz : classSet) indexUpdater.flush(clazz); } return null; }
Source:
<code>public List<Patient> getDuplicatePatientsByAttributes(List<String> attributes) { List<Patient> patients = new Vector<Patient>(); List<Integer> patientIds = new Vector<Integer>(); <START> <END> if (attributes.size() > 0) { String sqlString = getDuplicatePatientsSQLString(attributes); try { SQLQuery sqlquery = sessionFactory.getCurrentSession().createSQLQuery(sqlString); patientIds = sqlquery.list(); if (patientIds.size() >= 1) { Query query = sessionFactory.getCurrentSession().createQuery( "from Patient p1 where p1.patientId in (:ids)"); query.setParameterList("ids", patientIds); patients = query.list(); } } catch (HibernateException ex) { log.warn("Hibernate exception: " + ex.getStackTrace().toString()); throw ex; } finally } sortDuplicatePatients(patients, patientIds); return patients; }</code><technical_language>I understand this logic, issues</technical_language>

Target:
public List<Patient> getDuplicatePatientsByAttributes(List<String> attributes) { List<Patient> patients = new Vector<Patient>(); List<Integer> patientIds = new Vector<Integer>(); if (attributes.size() > 0) { String sqlString = getDuplicatePatientsSQLString(attributes); if(sqlString != null) { SQLQuery sqlquery = sessionFactory.getCurrentSession().createSQLQuery(sqlString); patientIds = sqlquery.list(); if (patientIds.size() >= 1) { Query query = sessionFactory.getCurrentSession().createQuery( "from Patient p1 where p1.patientId in (:ids)"); query.setParameterList("ids", patientIds); patients = query.list(); } } } sortDuplicatePatients(patients, patientIds); return patients; }
Source:
<code>public Result submitRun() { DynamicForm bindedForm = new DynamicForm().bindFromRequest(); String configuration_id = bindedForm.get("configuration_id"); String url = bindedForm.get("url"); String author = bindedForm.get("author"); String repo = bindedForm.get("repo"); String comment = bindedForm.get("comment"); FrontEndDBInterface f = new FrontEndDBInterface(); String record_id = f.storeRunInfo(Integer.parseInt(configuration_id), url, author, repo, comment); WSResponse response = Core.startJob(configuration_id, url, record_id); if(response == null) return internalServerError("Server Not Found"); else <START> if(response.getStatus()==500) <END> return internalServerError(response.getBody()); else return redirect("/configuration?conf="+configuration_id); }</code><technical_language>If intellij, perform autoformatting once? formatted</technical_language>

Target:
public Result submitRun() { DynamicForm bindedForm = new DynamicForm().bindFromRequest(); String configuration_id = bindedForm.get("configuration_id"); String url = bindedForm.get("url"); String author = bindedForm.get("author"); String repo = bindedForm.get("repo"); String comment = bindedForm.get("comment"); FrontEndDBInterface f = new FrontEndDBInterface(); String record_id = f.storeRunInfo(Integer.parseInt(configuration_id), url, author, repo, comment); WSResponse response = Core.startJob(configuration_id, url, record_id); if(response == null) { AddRunViewModel viewModel = new AddRunViewModel(); viewModel.configuration_id = configuration_id; viewModel.default_url = url; viewModel.default_author = author; viewModel.default_repo = repo; viewModel.default_comment = comment; viewModel.error_message = "Server at given address was not found"; return ok(addRun.render(viewModel)); } else if(response.getStatus()==500) return internalServerError(response.getBody()); else return redirect("/configuration?conf="+configuration_id); }
Source:
<code>public Collection<ContentTypeFieldProperties> getFieldContentTypeProperties(){ <START> return null; <END> }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Return empty collection instead of null. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public Collection<ContentTypeFieldProperties> getFieldContentTypeProperties(){ return Collections.emptyList(); }
Source:
<code>public void testCreateTasksStartedFromCLI() { doReturn(getTasks(JobExecutionStatus.STARTED)).when(provider).getTaskListForCluster(CLUSTER_GUIDS[1]); doReturn(mockVdcReturn(true, Guid.newGuid())). when(backend).runInternalAction(any(VdcActionType.class), any(VdcActionParametersBase.class)); prepareMocksForTasksFromCLI(); tasksSyncJob.updateGlusterAsyncTasks(); Mockito.verify(jobRepository, times(0)).updateStep(any(Step.class)); Mockito.verify(tasksSyncJob, times(0)).endStepJob(any(Step.class)); <START> } <END></code><technical_language>Dont need verify execution of runInternalAction</technical_language>

Target:
public void testCreateTasksStartedFromCLI() { doReturn(getTasks(JobExecutionStatus.STARTED)).when(provider).getTaskListForCluster(CLUSTER_GUIDS[1]); doReturn(mockVdcReturn(true, Guid.newGuid())). when(backend).runInternalAction(any(VdcActionType.class), any(VdcActionParametersBase.class)); prepareMocksForTasksFromCLI(); tasksSyncJob.updateGlusterAsyncTasks(); Mockito.verify(jobRepository, times(0)).updateStep(any(Step.class)); Mockito.verify(taskUtils, times(0)).endStepJob(any(Step.class)); }
Source:
<code>private static Predicate<Location> isYouViewPlatform() { return new Predicate<Location>() { @Override public boolean apply(Location input) { Policy policy = input.getPolicy(); <START> if (policy == null) { <END> return false; } return Platform.YOUVIEW_IPLAYER.equals(policy.getPlatform()); } }; }</code><technical_language>return policy != null && Platform.YOUVIEW_IPLAYER.equals(policy.getPlatform())</technical_language>

Target:
private static Predicate<Location> isYouViewPlatform() { return new Predicate<Location>() { @Override public boolean apply(Location input) { Policy policy = input.getPolicy(); return policy != null && Platform.YOUVIEW_IPLAYER.equals(policy.getPlatform()); } }; }
Source:
<code>public void setPrisonerStatus(PrisonerStatus prisonerStatus, boolean log) { boolean freed = !this.prisonerStatus.isFree(); this.prisonerStatus = prisonerStatus; switch (prisonerStatus) { case PRISONER: case PRISONER_DEFECTOR: <START> getCampaign().changeRank(this, Ranks.RANK_BONDSMAN, true); <END> setRecruitment(null); setLastRankChangeDate(null); if (log) { ServiceLogger.madePrisoner(this, getCampaign().getDate(), getCampaign().getName(), ""); } break; case BONDSMAN: getCampaign().changeRank(this, Ranks.RANK_BONDSMAN, true); setRecruitment(null); setLastRankChangeDate(null); if (log) { ServiceLogger.madeBondsman(this, getCampaign().getDate(), getCampaign().getName(), ""); } break; case FREE: if (!isDependent()) { if (getCampaign().getCampaignOptions().getUseTimeInService()) { setRecruitment(getCampaign().getLocalDate()); } if (getCampaign().getCampaignOptions().getUseTimeInRank()) { setLastRankChangeDate(getCampaign().getLocalDate()); } } if (getRankNumeric() < 0) { getCampaign().changeRank(this, 0, false); } if (log) { if (freed) { ServiceLogger.freed(this, getCampaign().getDate(), getCampaign().getName(), ""); } else { ServiceLogger.joined(this, getCampaign().getDate(), getCampaign().getName(), ""); } } break; } if (!prisonerStatus.isFree()) { Unit u = getCampaign().getUnit(getUnitId()); if (u != null) { u.remove(this, true); } else { setUnitId(null); } } MekHQ.triggerEvent(new PersonChangedEvent(this)); }</code><technical_language>identical Bondsman functionality. Is this a) intended, b) if is, consolidated</technical_language>

Target:
public void setPrisonerStatus(PrisonerStatus prisonerStatus, boolean log) { if (getPrisonerStatus() == prisonerStatus) { return; } final boolean freed = !getPrisonerStatus().isFree(); final boolean isPrisoner = prisonerStatus.isPrisoner(); this.prisonerStatus = prisonerStatus; switch (prisonerStatus) { case PRISONER: case PRISONER_DEFECTOR: case BONDSMAN: getCampaign().changeRank(this, isPrisoner ? Ranks.RANK_PRISONER : Ranks.RANK_BONDSMAN, true); setRecruitment(null); setLastRankChangeDate(null); if (log) { if (isPrisoner) { ServiceLogger.madePrisoner(this, getCampaign().getDate(), getCampaign().getName(), ""); } else { ServiceLogger.madeBondsman(this, getCampaign().getDate(), getCampaign().getName(), ""); } } break; case FREE: if (!isDependent()) { if (getCampaign().getCampaignOptions().getUseTimeInService()) { setRecruitment(getCampaign().getLocalDate()); } if (getCampaign().getCampaignOptions().getUseTimeInRank()) { setLastRankChangeDate(getCampaign().getLocalDate()); } } if (getRankNumeric() < 0) { getCampaign().changeRank(this, 0, false); } if (log) { if (freed) { ServiceLogger.freed(this, getCampaign().getDate(), getCampaign().getName(), ""); } else { ServiceLogger.joined(this, getCampaign().getDate(), getCampaign().getName(), ""); } } break; } if (!prisonerStatus.isFree()) { Unit u = getCampaign().getUnit(getUnitId()); if (u != null) { u.remove(this, true); } else { setUnitId(null); } } MekHQ.triggerEvent(new PersonChangedEvent(this)); }
Source:
<code>public SpatialRule lookupRule(double lat, double lon) { if (lon < bounds.minLon || lon > bounds.maxLon || lat < bounds.minLat || lat > bounds.maxLat) <START> return EMPTY; <END> int xIndex = getXIndexForLon(lon); int yIndex = getYIndexForLat(lat); int ruleIndex = getRuleContainerIndex(xIndex, yIndex); SpatialRuleContainer ruleContainer = ruleContainers.get(ruleIndex); if (ruleContainer.size() == 1) { if (!exact) return ruleContainer.first(); if (!isBorderTile(xIndex, yIndex, ruleIndex)) return ruleContainer.first(); } for (SpatialRule rule : ruleContainer.getRules()) { for (Polygon p : rule.getBorders()) { if (p.contains(lat, lon)) { return rule; } } } return EMPTY; }</code><technical_language>is in SpatialRule write SpatialRule.EMPTY</technical_language>

Target:
public SpatialRule lookupRule(double lat, double lon) { if (lon < bounds.minLon || lon > bounds.maxLon || lat < bounds.minLat || lat > bounds.maxLat) return SpatialRule.EMPTY; int xIndex = getXIndexForLon(lon); int yIndex = getYIndexForLat(lat); int ruleIndex = getRuleContainerIndex(xIndex, yIndex); SpatialRuleContainer ruleContainer = ruleContainers.get(ruleIndex); if (ruleContainer.size() == 1) { if (!exact) return ruleContainer.first(); if (!isBorderTile(xIndex, yIndex, ruleIndex)) return ruleContainer.first(); } for (SpatialRule rule : ruleContainer.getRules()) { for (Polygon p : rule.getBorders()) { if (p.contains(lat, lon)) { return rule; } } } return SpatialRule.EMPTY; }
Source:
<code>protected void addReplicationRule(ConfigBag ruleArgs) { <START> Entity fromCluster = (Entity) ruleArgs.getStringKey("fromCluster"); <END> Entity toCluster = (Entity) ruleArgs.getStringKey("toCluster"); if (fromCluster==null && toCluster==null) throw new IllegalArgumentException("At least one of 'fromCluster' or 'toCluster' must be supplied"); if (fromCluster==null) fromCluster = this; if (toCluster==null) toCluster = this; String fromBucket = (String)ruleArgs.getStringKey("fromBucket"); String toBucket = (String)ruleArgs.getStringKey("toBucket"); if (fromBucket==null && toBucket==null) throw new IllegalArgumentException("At least one of 'fromBucket' or 'toBucket' must be supplied"); if (fromBucket==null) fromBucket = toBucket; if (toBucket==null) toBucket = fromBucket; if (!ruleArgs.getUnusedConfig().isEmpty()) { throw new IllegalArgumentException("Unsupported replication rule data: "+ruleArgs.getUnusedConfig()); } getDriver().addReplicationRule(toCluster, fromBucket, toBucket); }</code><technical_language>is fromCluster for? used</technical_language>

Target:
protected void addReplicationRule(ConfigBag ruleArgs) { Object toClusterO = Preconditions.checkNotNull(ruleArgs.getStringKey("toCluster"), "toCluster must not be null"); if (toClusterO instanceof String) { toClusterO = getManagementContext().lookup((String)toClusterO); } Entity toCluster = Tasks.resolving(toClusterO, Entity.class).context(getExecutionContext()).get(); String fromBucket = Preconditions.checkNotNull( (String)ruleArgs.getStringKey("fromBucket"), "fromBucket must be specified" ); String toBucket = (String)ruleArgs.getStringKey("toBucket"); if (toBucket==null) toBucket = fromBucket; if (!ruleArgs.getUnusedConfig().isEmpty()) { throw new IllegalArgumentException("Unsupported replication rule data: "+ruleArgs.getUnusedConfig()); } getDriver().addReplicationRule(toCluster, fromBucket, toBucket); }
Source:
<code>private void checkBackTrace(ArtifactReadable art, Integer current, IAttributeType thisType, IRelationTypeSide relType, IAttributeType otherType) throws IOException { List<ArtifactReadable> tracedToRequirements = Lists.newArrayList(art.getRelated(relType)); int maxCritVal = 4; int parentCritVal = 4; for (ArtifactReadable parent : tracedToRequirements) { if (otherType.equals(CoreAttributeTypes.SeverityCategory)) { <START> String intermediate = parent.getSoleAttributeAsString(otherType, "NH"); <END> if ("Unspecified".equals(intermediate)) { intermediate = "NH"; } parentCritVal = SafetyCriticalityLookup.getSeverityLevel(intermediate); } else if (otherType.equals(CoreAttributeTypes.ItemDAL)) { parentCritVal = SafetyCriticalityLookup.getDALLevel(parent.getSoleAttributeAsString(otherType, "E")); } else { throw new OseeArgumentException("Invalid attribute type: %s", otherType.toString()); } maxCritVal = Integer.min(maxCritVal, parentCritVal); } if (current < maxCritVal) { writer.writeCell(String.format("%s [Error:<%s]", SafetyCriticalityLookup.getDALLevelFromInt(current), SafetyCriticalityLookup.getDALLevelFromInt(maxCritVal))); } else { writer.writeCell(SafetyCriticalityLookup.getDALLevelFromInt(current)); } }</code><technical_language>org.eclipse.osee.framework.core.model.IAttribute.UNSPECIFIED</technical_language>

Target:
private void checkBackTrace(ArtifactReadable art, Integer current, IAttributeType thisType, IRelationTypeSide relType, IAttributeType otherType) throws IOException { List<ArtifactReadable> tracedToRequirements = Lists.newArrayList(art.getRelated(relType)); int maxCritVal = 4; int parentCritVal = 4; for (ArtifactReadable parent : tracedToRequirements) { if (otherType.equals(CoreAttributeTypes.SeverityCategory)) { String intermediate = parent.getSoleAttributeAsString(otherType, "NH"); if (IAttribute.UNSPECIFIED.equals(intermediate)) { intermediate = "NH"; } parentCritVal = SafetyCriticalityLookup.getSeverityLevel(intermediate); } else if (otherType.equals(CoreAttributeTypes.ItemDAL)) { parentCritVal = SafetyCriticalityLookup.getDALLevel(parent.getSoleAttributeAsString(otherType, "E")); } else { throw new OseeArgumentException("Invalid attribute type: %s", otherType.toString()); } maxCritVal = Integer.min(maxCritVal, parentCritVal); } if (current < maxCritVal) { writer.writeCell(String.format("%s [Error:<%s]", SafetyCriticalityLookup.getDALLevelFromInt(current), SafetyCriticalityLookup.getDALLevelFromInt(maxCritVal))); } else { writer.writeCell(SafetyCriticalityLookup.getDALLevelFromInt(current)); } }
Source:
<code>public void test( @ArquillianResource() @OperateOnDeployment(DEPLOYMENT_1) URL baseURL1 ) throws Exception { final EJBClientContext.Builder ejbClientBuilder = new EJBClientContext.Builder(); ejbClientBuilder.addTransportProvider(new RemoteTransportProvider()); final EJBClientConnection.Builder connBuilder = new EJBClientConnection.Builder(); connBuilder.setDestination(URI.create(String.format("remote+%s", baseURL1))); ejbClientBuilder.addClientConnection(connBuilder.build()); ejbClientBuilder.setClusterNodeSelector(new CustomClusterNodeSelector()); final EJBClientContext ejbCtx = ejbClientBuilder.build(); <START> EJBClientContext.getContextManager().setThreadDefault(ejbCtx); <END> Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, WildFlyInitialContextFactory.class.getName()); InitialContext ctx = new InitialContext(props); String lookupName = "ejb:/" + MODULE_NAME + "/" + HeartbeatBean.class.getSimpleName() + "!" + Heartbeat.class.getName(); Heartbeat bean = (Heartbeat) ctx.lookup(lookupName); Result<Date> res = bean.pulse(); Thread.sleep(CLIENT_TOPOLOGY_UPDATE_WAIT); callBeanOnNode(bean, NODE_4); callBeanOnNode(bean, NODE_2); callBeanOnNode(bean, NODE_4); callBeanOnNode(bean, NODE_4); callBeanOnNode(bean, NODE_1); callBeanOnNode(bean, NODE_3); ctx.close(); }</code><technical_language>I this need cleaned end of test</technical_language>

Target:
public void test( @ArquillianResource() @OperateOnDeployment(DEPLOYMENT_1) URL baseURL1 ) throws Exception { EJBClientContext BKP = null; try { final EJBClientContext.Builder ejbClientBuilder = new EJBClientContext.Builder(); ejbClientBuilder.addTransportProvider(new RemoteTransportProvider()); final EJBClientConnection.Builder connBuilder = new EJBClientConnection.Builder(); connBuilder.setDestination(URI.create(String.format("remote+%s", baseURL1))); ejbClientBuilder.addClientConnection(connBuilder.build()); ejbClientBuilder.setClusterNodeSelector(new CustomClusterNodeSelector()); BKP = EJBClientContext.getContextManager().getThreadDefault(); final EJBClientContext ejbCtx = ejbClientBuilder.build(); EJBClientContext.getContextManager().setThreadDefault(ejbCtx); Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, WildFlyInitialContextFactory.class.getName()); InitialContext ctx = new InitialContext(props); String lookupName = "ejb:/" + MODULE_NAME + "/" + HeartbeatBean.class.getSimpleName() + "!" + Heartbeat.class.getName(); Heartbeat bean = (Heartbeat) ctx.lookup(lookupName); Result<Date> res = bean.pulse(); Thread.sleep(CLIENT_TOPOLOGY_UPDATE_WAIT); callBeanOnNode(bean, NODE_4); callBeanOnNode(bean, NODE_2); callBeanOnNode(bean, NODE_4); callBeanOnNode(bean, NODE_4); callBeanOnNode(bean, NODE_1); callBeanOnNode(bean, NODE_3); ctx.close(); } finally { if ((BKP != null)) { EJBClientContext.getContextManager().setThreadDefault(BKP); } } }
Source:
<code>private static long parseDateTime(@Nullable String dateTimeString, @Nullable String subSecs, @Nullable String offsetString) { if (dateTimeString == null || !sNonZeroTimePattern.matcher(dateTimeString).matches()) return INVALID_DATE_TIME; ParsePosition pos = new ParsePosition(0); try { Date datetime = <START> sFormatter.parse(dateTimeString, pos); <END> if (offsetString != null) { dateTimeString = dateTimeString + " " + offsetString; ParsePosition position = new ParsePosition(0); datetime = sFormatterTz.parse(dateTimeString, position); } if (datetime == null) return INVALID_DATE_TIME; long msecs = datetime.getTime(); if (subSecs != null) { try { long sub = Long.parseLong(subSecs); while (sub > 1000) { sub /= 10; } msecs += sub; } catch (NumberFormatException e) { } } return msecs; } catch (IllegalArgumentException e) { return INVALID_DATE_TIME; } }</code><technical_language>putting this in else block need a new position variable</technical_language>

Target:
private static long parseDateTime(@Nullable String dateTimeString, @Nullable String subSecs, @Nullable String offsetString) { if (dateTimeString == null || !sNonZeroTimePattern.matcher(dateTimeString).matches()) return INVALID_DATE_TIME; ParsePosition pos = new ParsePosition(0); try { Date datetime; if (offsetString != null) { dateTimeString = dateTimeString + " " + offsetString; ParsePosition position = new ParsePosition(0); datetime = sFormatterTz.parse(dateTimeString, position); } else { datetime = sFormatter.parse(dateTimeString, pos); } if (datetime == null) return INVALID_DATE_TIME; long msecs = datetime.getTime(); if (subSecs != null) { try { long sub = Long.parseLong(subSecs); while (sub > 1000) { sub /= 10; } msecs += sub; } catch (NumberFormatException e) { } } return msecs; } catch (IllegalArgumentException e) { return INVALID_DATE_TIME; } }
Source:
<code>public static PrestoSparkSerializedPage toPrestoSparkSerializedPage(SerializedPage serializedPage) { Slice slice = serializedPage.getSlice(); checkArgument(slice.hasByteArray(), "slice is expected to be based on a byte array"); byte[] array = slice.byteArray(); if (slice.byteArrayOffset() != 0 || slice.length() != array.length) { <START> array = copyOfRange(array, slice.byteArrayOffset(), slice.byteArrayOffset() + slice.length()); <END> } return new PrestoSparkSerializedPage( array, serializedPage.getPositionCount(), serializedPage.getUncompressedSizeInBytes(), serializedPage.getPageCodecMarkers()); }</code><technical_language>nit: consider BlockUtil#compactArray</technical_language>

Target:
public static PrestoSparkSerializedPage toPrestoSparkSerializedPage(SerializedPage serializedPage) { Slice slice = serializedPage.getSlice(); checkArgument(slice.hasByteArray(), "slice is expected to be based on a byte array"); return new PrestoSparkSerializedPage( compactArray(slice.byteArray(), slice.byteArrayOffset(), slice.length()), serializedPage.getPositionCount(), serializedPage.getUncompressedSizeInBytes(), serializedPage.getPageCodecMarkers()); }
Source:
<code>getResourceCalculatorProcessTree(String pId) { ResourceCalculatorProcessTree pt = null; <START> if (processTreeClass == null && <END> CGroupsResourceCalculator.isAvailable()) { try { pt = new CGroupsResourceCalculator(pId); } catch (YarnException e) { LOG.info("CGroupsResourceCalculator cannot be created", e); } } pt = ResourceCalculatorProcessTree. getResourceCalculatorProcessTree( pId, processTreeClass, conf); return pt; }</code><technical_language>move this ResourceCalculatorProcessTree.getResourceCalculatorProcessTree()</technical_language>

Target:
getResourceCalculatorProcessTree(String pId) { ResourceCalculatorProcessTree pt = null; if (processTreeClass == null && CGroupsResourceCalculator.isAvailable()) { try { pt = new CGroupsResourceCalculator(pId); } catch (YarnException e) { LOG.info("CGroupsResourceCalculator cannot be created", e); } } if (pt == null) { pt = ResourceCalculatorProcessTree. getResourceCalculatorProcessTree( pId, processTreeClass, conf); } return pt; }
Source:
<code>public StreamInfo(Map<String,Object> map) { if (map!= null) { streamInfo = map; length = (Long) map.get(LENGTH); radixTreeKeys = (Long) map.get(RADIX_TREE_KEYS); radixTreeNodes = (Long) map.get(RADIX_TREE_NODES); groups = (Long) map.get(GROUPS); lastGeneratedId = (String) map.get(LAST_GENERATED_ID); firstEntry = (StreamEntry) map.get(FIRST_ENTRY); lastEntry = (StreamEntry) map.get(LAST_ENTRY); <START> } else throw new IllegalArgumentException("InfoMap can not be null"); <END> }</code><technical_language>If throwing runtime exception map is null throw NullPointerException</technical_language>

Target:
public StreamInfo(Map<String,Object> map) { streamInfo = map; length = (Long) map.get(LENGTH); radixTreeKeys = (Long) map.get(RADIX_TREE_KEYS); radixTreeNodes = (Long) map.get(RADIX_TREE_NODES); groups = (Long) map.get(GROUPS); lastGeneratedId = (StreamEntryID) map.get(LAST_GENERATED_ID); firstEntry = (StreamEntry) map.get(FIRST_ENTRY); lastEntry = (StreamEntry) map.get(LAST_ENTRY); }
Source:
<code>public Object get(Object key) { BeanClass beanClass = (BeanClass) key; final Class<?> controller = beanClass.getType(); String interfaceName = controller.getName() + "$linkTo"; Class<?> linkToInterface; try { linkToInterface = Class.forName(interfaceName); <START> } catch (ClassNotFoundException _) { <END> linkToInterface = createLinkToInterface(controller, interfaceName); } return proxifier.proxify(linkToInterface, new MethodInvocation<Object>() { @Override public Object intercept(Object proxy, Method method, Object[] args, SuperMethod superMethod) { String methodName = StringUtils.decapitalize(method.getName().replaceFirst("^get", "")); List<Object> params = args.length == 0 ? Collections.emptyList() : Arrays.asList((Object[]) args[0]); return new Linker(controller, methodName, params).toString(); } }); }</code><technical_language>I love variable name =)</technical_language>

Target:
public Object get(Object key) { BeanClass beanClass = (BeanClass) key; final Class<?> controller = beanClass.getType(); Class<?> linkToInterface = interfaces.get(controller); if (linkToInterface == null) { lock.lock(); try { linkToInterface = interfaces.get(controller); if (linkToInterface == null) { String interfaceName = controller.getName() + "$linkTo"; linkToInterface = createLinkToInterface(controller, interfaceName); interfaces.put(controller, linkToInterface); } } finally { lock.unlock(); } } return proxifier.proxify(linkToInterface, new MethodInvocation<Object>() { @Override public Object intercept(Object proxy, Method method, Object[] args, SuperMethod superMethod) { String methodName = StringUtils.decapitalize(method.getName().replaceFirst("^get", "")); List<Object> params = args.length == 0 ? Collections.emptyList() : Arrays.asList((Object[]) args[0]); return new Linker(controller, methodName, params).getLink(); } }); }