auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testImapAsyncClientExceptionWithSessionIdClientContext() { final ImapAsyncClientException.FailureType failureType = ImapAsyncClientException.FailureType.CHANNEL_DISCONNECTED; <START> final Long sessionId = 5L; <END> final String sessCtx = "T123riceratops123@scar123y.com"; final ImapAsyncClientException ex = new ImapAsyncClientException(failureType, sessionId, sessCtx); Assert.assertEquals(ex.getFaiureType(), failureType, "result mismatched."); Assert.assertNull(ex.getCause(), "cause of exception mismatched."); Assert.assertEquals(ex.getMessage(), "failureType=CHANNEL_DISCONNECTED,sId=5,uId=T123riceratops123@scar123y.com", "result mismatched."); }</code><technical_language>revert</technical_language>

Target:
public void testImapAsyncClientExceptionWithSessionIdClientContext() { final ImapAsyncClientException.FailureType failureType = ImapAsyncClientException.FailureType.CHANNEL_DISCONNECTED; final Long sessionId = new Long(5); final String sessCtx = "T123riceratops123@scar123y.com"; final ImapAsyncClientException ex = new ImapAsyncClientException(failureType, sessionId, sessCtx); Assert.assertEquals(ex.getFaiureType(), failureType, "result mismatched."); Assert.assertNull(ex.getCause(), "cause of exception mismatched."); Assert.assertEquals(ex.getMessage(), "failureType=CHANNEL_DISCONNECTED,sId=5,uId=T123riceratops123@scar123y.com", "result mismatched."); }
Source:
<code>public void validate(Application application, ApplicationValidationErrors validationErrors) { <START> if (Strings.isNullOrEmpty(Optional.ofNullable(application.getEmail()).orElse("").trim())) { <END> validationErrors.rejectValue( "email", "application.email.empty", "Application must have a non-empty email"); } }</code><technical_language>I Strings.isNullOrEmpty(application.getEmail()) Optional.ofNullable(application.getEmail()).orElse("").trim().isEmpty()</technical_language>

Target:
public void validate(Application application, ApplicationValidationErrors validationErrors) { if (Optional.ofNullable(application.getEmail()).orElse("").trim().isEmpty()) { validationErrors.rejectValue( "email", "application.email.empty", "Application must have a non-empty email"); } }
Source:
<code>private void setDefaultValues() { fCharsetEditor.loadDefault(); fWideCharsetEditor.loadDefault(); fShowBinarySourceFilesButton.setSelection(DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) .getBoolean(CCorePreferenceConstants.SHOW_SOURCE_FILES_IN_BINARIES, true)); fShowSourceNotFoundEditor.setSelection(DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) .getBoolean(CCorePreferenceConstants.SHOW_SOURCE_NOT_FOUND_EDITOR, true)); fShowSourceNotFoundAllTime.setSelection(DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) .getBoolean(CCorePreferenceConstants.SHOW_SOURCE_NOT_FOUND_EDITOR_ALL_TIME, true)); fShowSourceNotFoundOnlyCaseSourceNotFound.setSelection(!DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) .getBoolean(CCorePreferenceConstants.SHOW_SOURCE_NOT_FOUND_EDITOR_ALL_TIME, true)); <START> fShowSourceNotFoundAllTime.setEnabled(true); fShowSourceNotFoundOnlyCaseSourceNotFound.setEnabled(true); <END> }</code><technical_language>management of enabled radios is currently in 4(?) places in this file. cases long, worth extracting a method</technical_language>

Target:
private void setDefaultValues() { fCharsetEditor.loadDefault(); fWideCharsetEditor.loadDefault(); fShowBinarySourceFilesButton.setSelection(DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) .getBoolean(CCorePreferenceConstants.SHOW_SOURCE_FILES_IN_BINARIES, true)); fShowSourceNotFoundAllTime.setSelection(true); fShowSourceNotFoundOnlyCaseSourceNotFound.setSelection(false); fShowSourceNotFoundEditor.setSelection(false); }
Source:
<code>public String getPreconditionAnnotation(VariableElement elt, AField f) { AnnotatedTypeMirror declaredType = fromElement(elt); <START> if (!(declaredType.getAnnotations().contains(NULLABLE) <END> || declaredType.getAnnotations().contains(POLYNULL) || declaredType.getAnnotations().contains(MONOTONIC_NONNULL))) { return null; } for (scenelib.annotations.Annotation a : f.type.tlAnnotationsHere) { if (a.def.name.equals("org.checkerframework.checker.nullness.qual.NonNull")) { return requiresNonNullAnno(elt); } } return null; }</code><technical_language>getAnnotations().contains replaced hasAnnotation</technical_language>

Target:
public String getPreconditionAnnotation(VariableElement elt, AField f) { AnnotatedTypeMirror declaredType = fromElement(elt); if (!(declaredType.hasAnnotation(NULLABLE) || declaredType.hasAnnotation(POLYNULL) || declaredType.hasAnnotation(MONOTONIC_NONNULL))) { return null; } for (scenelib.annotations.Annotation a : f.type.tlAnnotationsHere) { if (a.def.name.equals("org.checkerframework.checker.nullness.qual.NonNull")) { return requiresNonNullAnno(elt); } } return null; }
Source:
<code>public void writeTo(OptionalLong entity, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { if (!entity.isPresent()) { <START> throw new NoContentException("Empty content."); <END> } entityStream.write(Long.toString(entity.getAsLong()).getBytes(StandardCharsets.US_ASCII)); }</code><technical_language>if a fan of this exception, forces of another exception mapper. a WebApplicationException Response.noContent().build()</technical_language>

Target:
public void writeTo(OptionalLong entity, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { if (!entity.isPresent()) { throw new WebApplicationException(Status.NO_CONTENT); } entityStream.write(Long.toString(entity.getAsLong()).getBytes(StandardCharsets.US_ASCII)); }
Source:
<code>public SerializedPage serialize(Page page) { SliceOutput serializationBuffer = new DynamicSliceOutput(toIntExact((page.getSizeInBytes() + Integer.BYTES))); writeRawPage(page, serializationBuffer, blockEncodingSerde); byte markings = PageCodecMarker.none(); if (!compressor.isPresent()) { <START> return new SerializedPage(serializationBuffer.slice(), markings, page.getPositionCount(), serializationBuffer.size()); <END> } int maxCompressedLength = maxCompressedLength(serializationBuffer.size()); byte[] compressionBuffer = new byte[maxCompressedLength]; int actualCompressedLength = compressor.get().compress(serializationBuffer.slice().getBytes(), 0, serializationBuffer.size(), compressionBuffer, 0, maxCompressedLength); if (((1.0 * actualCompressedLength) / serializationBuffer.size()) > MINIMUM_COMPRESSION_RATIO) { return new SerializedPage(serializationBuffer.slice(), markings, page.getPositionCount(), serializationBuffer.size()); } else { return new SerializedPage( Slices.copyOf(Slices.wrappedBuffer(compressionBuffer, 0, actualCompressedLength)), PageCodecMarker.COMPRESSED.mark(markings), page.getPositionCount(), serializationBuffer.size()); } }</code><technical_language>PageCodecMarker.none() for clarity</technical_language>

Target:
public SerializedPage serialize(Page page) { SliceOutput serializationBuffer = new DynamicSliceOutput(toIntExact(page.getSizeInBytes() + Integer.BYTES)); writeRawPage(page, serializationBuffer, blockEncodingSerde); Slice slice = serializationBuffer.slice(); int uncompressedSize = serializationBuffer.size(); byte markers = PageCodecMarker.none(); if (compressor.isPresent()) { ByteBuffer compressionBuffer = ByteBuffer.allocate(compressor.get().maxCompressedLength(uncompressedSize)); compressor.get().compress(slice.toByteBuffer(), compressionBuffer); compressionBuffer.flip(); if ((((double) compressionBuffer.remaining()) / uncompressedSize) <= MINIMUM_COMPRESSION_RATIO) { slice = Slices.wrappedBuffer(compressionBuffer); markers = COMPRESSED.set(markers); } } if (spillCipher.isPresent()) { slice = Slices.wrappedBuffer(spillCipher.get().encrypt(slice.toByteBuffer())); markers = ENCRYPTED.set(markers); } else { slice = Slices.copyOf(slice); } return new SerializedPage(slice, markers, page.getPositionCount(), uncompressedSize); }
Source:
<code>public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartNoneEvent emptyTop = getStartNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, StartNoneEvent.class); assertGeneralSet(emptyTop.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); if (getMarshallerType() == Marshaller.NEW) { <START> assertEquals(emptyTop.getExecutionSet().getSlaDueDate().getValue(), ""); <END> } }</code><technical_language>suggestion assertEquals(emptyTop.getExecutionSet().getSlaDueDate().getValue(), EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartNoneEvent emptyTop = getStartNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, StartNoneEvent.class); assertGeneralSet(emptyTop.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertNotNull(emptyTop.getExecutionSet()); assertStartEventSlaDueDate(emptyTop.getExecutionSet(), EMPTY_VALUE); }
Source:
<code>public void readRecuperaveis(){ File f = Configuracoes.getInstancia().getDiretorioTemporario(); f.mkdirs(); for (File arquivo : f.listFiles()) { if (arquivo.isDirectory()) { } else { if(arquivo.getName().contains(".por")) { <START> arquivosIniciais.add(arquivo);; <END> } } } }</code><technical_language>why??? :)</technical_language>

Target:
public void readRecuperaveis(){ File f = Configuracoes.getInstancia().getDiretorioTemporario(); f.mkdirs(); for (File arquivo : f.listFiles()) { if (!arquivo.isDirectory()) { if(isArquivoRecuperado(arquivo)) { if(arquivo.getName().contains("Sem título")) { arquivosIniciais.add(arquivo); } else { arquivosRecuperados.add(arquivo); } } } } }
Source:
<code>public static void testJPADep(Map<DependencyType, List<DynamicPomDependency>> mapping) { List<DynamicPomDependency> deps = mapping.get(DependencyType.JPA); assertThat(deps).hasSize(1); DynamicPomDependency dep = deps.get(0); assertThat(dep.getGroupID()).isEqualToIgnoringCase("org.hibernate.javax.persistence"); assertThat(dep.getArtifactID()).isEqualToIgnoringCase("hibernate-jpa-2.1-api"); <START> assertThat(dep.getVersion()).isEqualToIgnoringCase("1.0.2.Final"); <END> assertThat(dep.getScope()).isEmpty(); }</code><technical_language>"org.hibernate.javax.persistence", "hibernate-jpa-2.1-api", "1.0.2.Final" Good candidates for constants</technical_language>

Target:
public static void testJPADep(Map<DependencyType, List<DynamicPomDependency>> mapping) { List<DynamicPomDependency> deps = mapping.get(DependencyType.JPA); assertThat(deps).hasSize(1); DynamicPomDependency dep = deps.get(0); assertThat(dep.getGroupID()).isEqualToIgnoringCase(GROUP_ID_TEST); assertThat(dep.getArtifactID()).isEqualToIgnoringCase(ARTIFACT_ID_TEST); assertThat(dep.getVersion()).isEqualToIgnoringCase(VERSION_ID_TEST); assertThat(dep.getScope()).isEmpty(); }
Source:
<code>protected void testExpirationFilter(Object keyToFilterOut, Long keyToFilterOutLifespan, Object keyToUse, Long keyToUselifespan, CacheEventFilter<? super Object, ? super String> filter) { Cache<Object, String> cache0 = cache(0, CACHE_NAME); cache0.put(keyToFilterOut, FIRST_VALUE, keyToFilterOutLifespan, TimeUnit.MILLISECONDS); ClusterListener clusterListener = listener(); cache0.addListener(clusterListener, filter, null); ts0.advance(keyToFilterOutLifespan + 1); ts1.advance(keyToFilterOutLifespan + 1); ts2.advance(keyToFilterOutLifespan + 1); <START> assertEquals(clusterListener.events.size(), 0); <END> assertNull(cache0.get(keyToFilterOut)); String expectedValue = keyToUse + "-expiring"; cache0.put(keyToUse, keyToUse + "-expiring", keyToUselifespan, TimeUnit.MILLISECONDS); ts0.advance(keyToUselifespan + 1); ts1.advance(keyToUselifespan + 1); ts2.advance(keyToUselifespan + 1); assertNull(cache0.get(keyToUse)); verifySimpleExpirationEvents(clusterListener, 2, keyToUse, expectedValue); }</code><technical_language>event get fired if filtered accessed key reaper ran. switch this line 699</technical_language>

Target:
protected void testExpirationFilter(Object keyToFilterOut, Long keyToFilterOutLifespan, Object keyToUse, Long keyToUselifespan, CacheEventFilter<? super Object, ? super String> filter) { Cache<Object, String> cache0 = cache(0, CACHE_NAME); cache0.put(keyToFilterOut, FIRST_VALUE, keyToFilterOutLifespan, TimeUnit.MILLISECONDS); ClusterListener clusterListener = listener(); cache0.addListener(clusterListener, filter, null); ts0.advance(keyToFilterOutLifespan + 1); ts1.advance(keyToFilterOutLifespan + 1); ts2.advance(keyToFilterOutLifespan + 1); assertNull(cache0.get(keyToFilterOut)); assertEquals(clusterListener.events.size(), 0); String expectedValue = keyToUse + "-expiring"; cache0.put(keyToUse, keyToUse + "-expiring", keyToUselifespan, TimeUnit.MILLISECONDS); ts0.advance(keyToUselifespan + 1); ts1.advance(keyToUselifespan + 1); ts2.advance(keyToUselifespan + 1); assertNull(cache0.get(keyToUse)); verifySimpleExpirationEvents(clusterListener, 2, keyToUse, expectedValue); }
Source:
<code>public void onPreMerge(Repository repo, CodeReviewCommit commit, ProjectState destProject, NameKey destBranch, Id patchSetId) throws MergeValidationException { try { db = schemaFactory.open(); PatchSetApproval psa = approvalsUtil.getSubmitter(db, commit.notes(), patchSetId); if (psa == null) { throw new MergeValidationException( <START> CommitMergeStatus.SETTING_PARENT_PROJECT_ONLY_ALLOWED_BY_ADMIN); <END> } final IdentifiedUser submitter = identifiedUserFactory.create(psa.getAccountId()); if (!submitter.getCapabilities().canAdministrateServer()) { throw new MergeValidationException(CommitMergeStatus.MISSING_DEPENDENCY); } } catch (OrmException e) { throw new MergeValidationException( CommitMergeStatus.SETTING_PARENT_PROJECT_ONLY_ALLOWED_BY_ADMIN); } finally { if (db != null) { db.close(); } } }</code><technical_language>This match actual error want report. of enums; I arbitrary error message</technical_language>

Target:
public void onPreMerge(Repository repo, CodeReviewCommit commit, ProjectState destProject, NameKey destBranch, Id patchSetId) throws MergeValidationException { try { db = schemaFactory.open(); PatchSetApproval psa = approvalsUtil.getSubmitter(db, commit.notes(), patchSetId); if (psa == null) { throw new MergeValidationException( CommitMergeStatus.REJECTED_BY_PLUGIN, "Submitter not found"); } final IdentifiedUser submitter = identifiedUserFactory.create(psa.getAccountId()); if (!submitter.getCapabilities().canAdministrateServer()) { throw new MergeValidationException(CommitMergeStatus.REJECTED_BY_PLUGIN, "Submitter is not admin"); } } catch (OrmException e) { throw new MergeValidationException( CommitMergeStatus.REJECTED_BY_PLUGIN, "DB error"); } finally { if (db != null) { db.close(); } } }
Source:
<code>public GlacierResponseException(String message, HttpCommand command, HttpResponse response, GlacierError error, Throwable cause) { super(message, command, response, cause); <START> this.error = checkNotNull(error); <END> }</code><technical_language>[minor] In general, form checkNotNull(error, "error")</technical_language>

Target:
public GlacierResponseException(String message, HttpCommand command, HttpResponse response, GlacierError error, Throwable cause) { super(message, command, response, cause); this.error = checkNotNull(error, "error"); }
Source:
<code>public List<DocumentModel> getSubscribedDocuments(String prefixedPrincipalName) { String nxql = String.format( <START> "SELECT * FROM Document WHERE ecm:mixinType ='Notifiable' " + "AND ecm:isCheckedInVersion = 0 " <END> + "AND notif:notifications/*/subscribers/* = " + NXQL.escapeString(prefixedPrincipalName)); return UnrestrictedDocFetcher.query(nxql); }</code><technical_language>please replace Notifiable part of string SubscriptionAdapter.NOTIFIABLE_FACET</technical_language>

Target:
public List<DocumentModel> getSubscribedDocuments(String prefixedPrincipalName) { String nxql = "SELECT * FROM Document WHERE ecm:mixinType = '" + SubscriptionAdapter.NOTIFIABLE_FACET + "' " + "AND ecm:isCheckedInVersion = 0 " + "AND notif:notifications/*/subscribers/* = " + NXQL.escapeString(prefixedPrincipalName); return UnrestrictedDocFetcher.query(nxql); }
Source:
<code>protected static final String formatMessage(String message, Arg<?>... args) { if (args.length == 0) { return message; } String[] stringifiedArgs = Arrays.stream(args) .map(arg -> String.format("%s=%s", arg.getName(), toJson(arg.getValue()))) .toArray(String[]::new); <START> return String.format("%s {%s}", message, String.join(", ", stringifiedArgs)); <END> }</code><technical_language>highly encourage writing some JMH benchmarks for this method making is efficient written this allocate a ton of garbage streams, joiner, String.format, a time service is throwing exceptions, concerned cascading failures</technical_language>

Target:
protected static final String formatMessage(String message, Arg<?>... args) { if (args.length == 0) { return message; } StringBuilder builder = new StringBuilder(); builder.append(message).append(" {"); for (int i = 0; i < args.length; i++) { if (i > 0) { builder.append(", "); } Arg<?> arg = args[i]; builder.append(arg.getName()).append("=").append(toJson(arg.getValue())); } builder.append("}"); return builder.toString(); }
Source:
<code>public static String getClientIp(final String ip, final String xff) { <START> if (xff == null || "-".equals(xff) || "".equals(xff)) { <END> return ip; } else { String[] proxiedIps = xff.split(","); try { for (String proxiedIp : proxiedIps) { Matcher ip4 = IP4PATTERN.matcher(proxiedIp); Matcher ip6 = IP6PATTERN.matcher(proxiedIp); if ((!( proxiedIp.startsWith("127.0") || proxiedIp.startsWith("192.168") || proxiedIp.startsWith("10.") )) && ( ip4.matches() || ip6.matches() ) ) { return proxiedIp; } } return ip; } catch (ArrayIndexOutOfBoundsException e) { return ip; } } }</code><technical_language>standardise syntax here? value=benchmark, benchmark=value,benchmark=value, respectively, for comparisons. Change to: if (xff == null || xff.equals("-") || xff.equals("")) { for easier logical reading is code</technical_language>

Target:
public static String getClientIp(final String ip, final String xff) { if (xff == null || xff.isEmpty() || xff.equals("-")) { return ip; } else { String[] proxiedIps = xff.split(","); try { for (String proxiedIp : proxiedIps) { int ipVersion = getIpVersion(proxiedIp); if ((!( proxiedIp.startsWith("127.0") || proxiedIp.startsWith("192.168") || proxiedIp.startsWith("10.") || proxiedIp.startsWith("169.254") )) && ( ipVersion == 4 || ipVersion == 6 ) ) { return proxiedIp; } } return ip; } catch (ArrayIndexOutOfBoundsException e) { return ip; } } }
Source:
<code>public C get(K key) { C value = map.get(key); if (value == null) { value = supplier.get(); <START> C previousValue = map.put(key, value); <END> if (previousValue != null) { value = previousValue; } } return value; }</code><technical_language>previously discussed this is thread safe. Map.computeIfAbsent() Map.putIfAbsent() introduced in JDK8 I propose add ConcurrentMap<K, C> concurrentMap field param constructor. illegal provide suppliers. get() method branches. for regular map: if (map.get(key) == null) { V newValue = supplier.get(key); if (newValue != null) map.put(key, newValue); } branch for ConcurrentMap - current version putIfAbsent() instead of put(). Of course, modify SetMultimap ListMultimap</technical_language>

Target:
public C get(K key) { C value; if (concurrentMap != null) { value = concurrentMap.get(key); if (value == null ) { value = supplier.get(); if (value != null) { C previousValue = concurrentMap.putIfAbsent(key, value); if (previousValue != null) { value = previousValue; } } } } else { value = map.get(key); if (value == null ) { value = supplier.get(); if (value != null) { C previousValue = map.put(key, value); if (previousValue != null) { value = previousValue; } } } } return value; }
Source:
<code>public static String getAverageMemberLoadByMemberId(String Id, String startTime, String endTime) throws RestAPIException { String memberLoadAverageQuery = "SELECT value AS MEMBER_AVERAGE_LOAD_AVERAGE,ID,timeStamp FROM HealthStatisticsTable " + "WHERE ID = \"" + Id + "\" AND timeStamp BETWEEN " + startTime + " AND " + endTime + " AND " + "type = \"member_average_load_average\" GROUP BY from_unixtime(timeStamp/1000,\"%Y-%m-%d %H:%i\");"; List<AverageLoadAverageBean> averageMemberLoadList = new ArrayList<AverageLoadAverageBean>(); ConnectionHandler connectionHandler = new ConnectionHandler(); try { Statement statement = connectionHandler.getsqlConnection().createStatement(); ResultSet result = statement.executeQuery(memberLoadAverageQuery); while (result.next()) { averageMemberLoadList.add(new AverageLoadAverageBean("", result.getLong("TIMESTAMP"), result.getDouble("MEMBER_AVERAGE_LOAD_AVERAGE"), result.getString("ID"))); } } catch (SQLException ex) { log.error("SQLException: ", ex); throw new RestAPIException(ex.getMessage()); } catch (Exception ex) { log.error("Exception: ", ex); throw new RestAPIException(ex.getMessage()); } finally { try { connectionHandler.closeConnection(); } catch (SQLException ex) { log.error("SQLException: ", ex); throw new RestAPIException(ex.getMessage()); } } if (!averageMemberLoadList.isEmpty()) { return new Gson().toJson(averageMemberLoadList); } else { <START> <END> return null; } }</code><technical_language>Please remove blank lines format code</technical_language>

Target:
public static String getAverageMemberLoadByMemberId(String Id, String startTime, String endTime) throws RestAPIException { String memberLoadAverageQuery = "SELECT value AS 'MEMBER_AVERAGE_LOAD_AVERAGE' , ID , timeStamp FROM " + HELATH_STAT_TABLE +" WHERE ID =? " +" AND timeStamp BETWEEN ? " +" AND ? " +" AND " +" type = \"member_average_load_average\" GROUP BY from_unixtime(timeStamp/1000,\"%Y-%m-%d %H:%i\");"; List<AverageLoadAverageBean> averageMemberLoadList = new ArrayList<AverageLoadAverageBean>(); ConnectionHandler connectionHandler = new ConnectionHandler(); PreparedStatement prepareStatement; try { prepareStatement= connectionHandler.getsqlConnection().prepareStatement(memberLoadAverageQuery); prepareStatement.setString(1, Id); prepareStatement.setString(2, startTime); prepareStatement.setString(3, endTime); ResultSet result = prepareStatement.executeQuery(); while (result.next()) { averageMemberLoadList.add(new AverageLoadAverageBean("", result.getLong("TIMESTAMP"), result.getDouble("MEMBER_AVERAGE_LOAD_AVERAGE"), result.getString("ID"))); } } catch (SQLException ex) { log.error("SQLException: ", ex); throw new RestAPIException(ex.getMessage(),ex); } catch (Exception ex) { log.error("Exception: ", ex); throw new RestAPIException(ex.getMessage(),ex); } finally { try { connectionHandler.closeConnection(); } catch (SQLException ex) { log.error("SQLException: ", ex); throw new RestAPIException(ex.getMessage(),ex); } } if (!averageMemberLoadList.isEmpty()) { return new Gson().toJson(averageMemberLoadList); } else { return null; } }
Source:
<code>public boolean deletePhonenumber() { if (selectedPhonenumber != null) { return loadTestDataService.deletePhonenumber(selectedPhonenumber); } else { addPatientErrorMessages("Phonenumber have to be select to be deleted"); } return false; <START> } <END></code><technical_language>1. Refactor save code GenericDAO remove redundant logic. 2. consistent other DML operations in GenericDAOImpl.java, initialize actionResult true change logic accordingly. Refer GenericDAOImpl.update method</technical_language>

Target:
public boolean deletePhonenumber() { boolean result = false; if (selectedPhonenumber != null) { result = loadTestDataService.deletePhonenumber(selectedPhonenumber); } else { addPatientErrorMessages(msgForSelectDelete("phonenumber")); } return result; }
Source:
<code>public void toJSONString(JSONStringer stringer) throws JSONException { super.toJSONString(stringer); stringer.key(Members.ISNULL.name()); stringer.value(m_isNull); stringer.key(Members.VALUE.name()); if (m_isNull) { stringer.value("NULL"); } else { switch (m_valueType) { case INVALID: throw new JSONException("ConstantValueExpression.toJSONString(): value_type should never be VoltType.INVALID"); case NULL: stringer.value("null"); break; case TINYINT: stringer.value(Long.valueOf(m_value)); break; case SMALLINT: stringer.value(Long.valueOf(m_value)); break; case INTEGER: stringer.value(Long.valueOf(m_value)); break; case BIGINT: stringer.value(Long.valueOf(m_value)); break; case FLOAT: stringer.value(Double.valueOf(m_value)); break; case STRING: stringer.value(m_value); break; case VARBINARY: stringer.value(m_value); break; case TIMESTAMP: try { stringer.value(Long.valueOf(m_value)); } catch (NumberFormatException e) { <START> stringer.value(Timestamp.valueOf(m_value)); <END> } break; case DECIMAL: stringer.value(m_value); break; case BOOLEAN: stringer.value(Boolean.valueOf(m_value)); break; default: throw new JSONException("ConstantValueExpression.toJSONString(): Unrecognized value_type " + m_valueType); } } }</code><technical_language>create a CVE m_value is formatted a long, a date a time. I if is a codepaths reach create CVEs more consistently, picking a long representation a date+time representation</technical_language>

Target:
public void toJSONString(JSONStringer stringer) throws JSONException { super.toJSONString(stringer); stringer.key(Members.ISNULL.name()); stringer.value(m_isNull); stringer.key(Members.VALUE.name()); if (m_isNull) { stringer.value("NULL"); } else { switch (m_valueType) { case INVALID: throw new JSONException("ConstantValueExpression.toJSONString(): value_type should never be VoltType.INVALID"); case NULL: stringer.value("null"); break; case TINYINT: stringer.value(Long.valueOf(m_value)); break; case SMALLINT: stringer.value(Long.valueOf(m_value)); break; case INTEGER: stringer.value(Long.valueOf(m_value)); break; case BIGINT: stringer.value(Long.valueOf(m_value)); break; case FLOAT: stringer.value(Double.valueOf(m_value)); break; case STRING: stringer.value(m_value); break; case VARBINARY: stringer.value(m_value); break; case TIMESTAMP: stringer.value(Long.valueOf(m_value)); break; case DECIMAL: stringer.value(m_value); break; case BOOLEAN: stringer.value(Boolean.valueOf(m_value)); break; default: throw new JSONException("ConstantValueExpression.toJSONString(): Unrecognized value_type " + m_valueType); } } }
Source:
<code>private AbstractSqlWriter createQueryWriter(SqlContext context, QueryData queryData, QueryType queryType) throws OseeCoreException { <START> IOseeBranch branch = getBranchToSearch(queryData); <END> return new ArtifactQuerySqlWriter(logger, dbService, sqlProvider, context, queryType, branch.getUuid()); }</code><technical_language>getBranchToSearch method return null, is important perform null check error is easy debug in case</technical_language>

Target:
private AbstractSqlWriter createQueryWriter(SqlContext context, QueryData queryData, QueryType queryType) throws OseeCoreException { IOseeBranch branch = getBranchToSearch(queryData); Conditions.checkNotNull(branch, "branch"); return new ArtifactQuerySqlWriter(logger, dbService, sqlProvider, context, queryType, branch.getUuid()); }
Source:
<code>public TaskInfo updateTask( Session session, TaskId taskId, Optional<PlanFragment> fragment, List<TaskSource> sources, OutputBuffers outputBuffers, Optional<TableWriteInfo> tableWriteInfo) { requireNonNull(session, "session is null"); requireNonNull(taskId, "taskId is null"); requireNonNull(fragment, "fragment is null"); requireNonNull(sources, "sources is null"); requireNonNull(outputBuffers, "outputBuffers is null"); if (resourceOvercommit(session)) { queryContexts.getUnchecked(taskId.getQueryId()).setResourceOvercommit(); } else { queryContexts.getUnchecked( taskId.getQueryId()).setMemoryLimits( <START> SystemSessionProperties.getQueryMaxTaskMemory(session), <END> SystemSessionProperties.getQueryMaxTotalTaskMemory(session)); } SqlTask sqlTask = tasks.getUnchecked(taskId); sqlTask.recordHeartbeat(); return sqlTask.updateTask(session, fragment, sources, outputBuffers, tableWriteInfo); }</code><technical_language>static import</technical_language>

Target:
public TaskInfo updateTask( Session session, TaskId taskId, Optional<PlanFragment> fragment, List<TaskSource> sources, OutputBuffers outputBuffers, Optional<TableWriteInfo> tableWriteInfo) { requireNonNull(session, "session is null"); requireNonNull(taskId, "taskId is null"); requireNonNull(fragment, "fragment is null"); requireNonNull(sources, "sources is null"); requireNonNull(outputBuffers, "outputBuffers is null"); if (resourceOvercommit(session)) { queryContexts.getUnchecked(taskId.getQueryId()).setResourceOvercommit(); } else { queryContexts.getUnchecked( taskId.getQueryId()).setMemoryLimits( getQueryMaxMemoryPerNode(session), getQueryMaxTotalMemoryPerNode(session)); } SqlTask sqlTask = tasks.getUnchecked(taskId); sqlTask.recordHeartbeat(); return sqlTask.updateTask(session, fragment, sources, outputBuffers, tableWriteInfo); }
Source:
<code>protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp1 = args[0]; ObjectPointable op; if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) { TaggedValuePointable temptvp = ppool.takeOne(TaggedValuePointable.class); try { tvp1.getValue(sp1); int size1 = sp1.getEntryCount(); int size2; for (int i = 0; i < size1; i++) { sp1.getEntry(i, temptvp); if (temptvp.getTag() == ValueTag.OBJECT_TAG) { op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); temptvp.getValue(op); op.getKeys(temptvp); temptvp.getValue(sp2); size2 = sp2.getEntryCount(); for (int j = 0; j < size2; j++) { TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY .createPointable(); sp2.getEntry(j, tvp); pointables.add(tvp); } } } removeDuplicates(pointables); abvs.reset(); sb.reset(abvs); for (TaggedValuePointable tvp : pointables) { sb.addItem(tvp); } sb.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { ppool.giveBack(temptvp); } } else if (tvp1.getTag() == ValueTag.OBJECT_TAG) { try { op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); tvp1.getValue(op); op.getKeys(result); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } else { try { abvs.reset(); <START> sb.reset(abvs); <END> sb.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } }</code><technical_language>empty sequence constant</technical_language>

Target:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp1 = args[0]; ObjectPointable op; if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) { List<TaggedValuePointable> pointables = new ArrayList<>(); TaggedValuePointable temptvp = ppool.takeOne(TaggedValuePointable.class); try { tvp1.getValue(sp1); int size1 = sp1.getEntryCount(); int size2; for (int i = 0; i < size1; i++) { sp1.getEntry(i, temptvp); if (temptvp.getTag() == ValueTag.OBJECT_TAG) { op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); temptvp.getValue(op); op.getKeys(temptvp); temptvp.getValue(sp2); size2 = sp2.getEntryCount(); for (int j = 0; j < size2; j++) { TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY .createPointable(); sp2.getEntry(j, tvp); pointables.add(tvp); } } } removeDuplicates(pointables); abvs.reset(); sb.reset(abvs); for (TaggedValuePointable tvp : pointables) { sb.addItem(tvp); } sb.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { ppool.giveBack(temptvp); } } else if (tvp1.getTag() == ValueTag.OBJECT_TAG) { try { op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); tvp1.getValue(op); op.getKeys(result); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } else { XDMConstants.setEmptySequence(result); } }
Source:
<code>public String getMimeType(final String fileId) throws IOException { if (getFile(fileId) != null) { FileUtil.getFileMimeType(getFile(fileId).getFile()); } return null; <START> } <END></code><technical_language>This function **always** returns null. appears error</technical_language>

Target:
public String getMimeType(final String fileId) { FileWidgetUpload fileWidget = getFile(fileId); if (fileWidget != null) { return FileUtil.getFileMimeType(fileWidget.getFile()); } return null; }
Source:
<code>public void testCreateConfigMapAlreadyExisting() throws Exception { final KubernetesConfigMap configMap = buildTestingConfigMap(); this.flinkKubeClient.createConfigMap(configMap).get(); mockCreateConfigMapAlreadyExisting(configMap.getInternalResource()); configMap.getData().put(TESTING_CONFIG_MAP_KEY, TESTING_CONFIG_MAP_NEW_VALUE); try { this.flinkKubeClient.createConfigMap(configMap).get(); <START> fail("Exception should be thrown."); <END> } catch (Exception ex) { assertThat(ex.getMessage(), containsString("Failed to create ConfigMap " + TESTING_CONFIG_MAP_NAME)); } final Optional<KubernetesConfigMap> currentOpt = this.flinkKubeClient.getConfigMap(TESTING_CONFIG_MAP_NAME); assertThat(currentOpt.isPresent(), is(true)); assertThat(currentOpt.get().getData().get(TESTING_CONFIG_MAP_KEY), is(TESTING_CONFIG_MAP_VALUE)); }</code><technical_language>is good state fail (e.g. "Overwrite existing config map fail exception.")</technical_language>

Target:
public void testCreateConfigMapAlreadyExisting() throws Exception { final KubernetesConfigMap configMap = buildTestingConfigMap(); this.flinkKubeClient.createConfigMap(configMap).get(); mockCreateConfigMapAlreadyExisting(configMap.getInternalResource()); configMap.getData().put(TESTING_CONFIG_MAP_KEY, TESTING_CONFIG_MAP_NEW_VALUE); try { this.flinkKubeClient.createConfigMap(configMap).get(); fail("Overwrite an already existing config map should fail with an exception."); } catch (Exception ex) { final String errorMsg = "Failed to create ConfigMap " + TESTING_CONFIG_MAP_NAME; assertThat(ex, FlinkMatchers.containsMessage(errorMsg)); } final Optional<KubernetesConfigMap> currentOpt = this.flinkKubeClient.getConfigMap(TESTING_CONFIG_MAP_NAME); assertThat(currentOpt.isPresent(), is(true)); assertThat(currentOpt.get().getData().get(TESTING_CONFIG_MAP_KEY), is(TESTING_CONFIG_MAP_VALUE)); }
Source:
<code>public void addTableDefinition(String tableName, TableDefinition definition) { Preconditions.checkArgument( !tableDefinitions.containsKey(tableName) && !indexDefinitions.containsKey(tableName), "Table already defined: %s", tableName); Preconditions.checkArgument( Schemas.isTableNameValid(tableName), "Invalid table name " + tableName); if (!ignoreTableNameLengthChecks) { int internalTableNameLength = Schemas.getInternalTableNameLength(tableName, namespace); Preconditions.checkArgument( internalTableNameLength < POSTGRES_TABLE_NAME_CHAR_LIMIT, "Table name %s is too long, exceeds Cassandra and Postgres limits. " + "If running using a different KVS, set the ignoreTableNameLength flag.", tableName); <START> Preconditions.checkArgument( <END> internalTableNameLength < CASSANDRA_TABLE_NAME_CHAR_LIMIT, "Table name %s is too long, exceeds Cassandra limit. " + "If running using a different KVS, set the ignoreTableNameLength flag.", tableName); } tableDefinitions.put(tableName, definition); }</code><technical_language>Cassandra check postgres limit is lower, ensure users warned message</technical_language>

Target:
public void addTableDefinition(String tableName, TableDefinition definition) { Preconditions.checkArgument( !tableDefinitions.containsKey(tableName) && !indexDefinitions.containsKey(tableName), "Table already defined: %s", tableName); Preconditions.checkArgument( Schemas.isTableNameValid(tableName), "Invalid table name " + tableName); if (!ignoreTableNameLengthChecks) { String internalTableName = AbstractKeyValueService.internalTableName( TableReference.create(namespace, tableName)); List<CharacterLimitType> kvsExceeded = new ArrayList<>(); if (internalTableName.length() > AtlasDbConstants.CASSANDRA_TABLE_NAME_CHAR_LIMIT) { kvsExceeded.add(CharacterLimitType.CASSANDRA); } if (internalTableName.length() > AtlasDbConstants.POSTGRES_TABLE_NAME_CHAR_LIMIT) { kvsExceeded.add(CharacterLimitType.POSTGRES); } Preconditions.checkArgument( kvsExceeded.isEmpty(), "Internal table name %s is too long, known to exceed character limits for " + "the following KVS: %s. If using a table prefix, please ensure that the concatenation " + "of the prefix with the internal table name is below the KVS limit. " + "If running only against a different KVS, set the ignoreTableNameLength flag.", tableName, StringUtils.join(kvsExceeded, ", ")); } tableDefinitions.put(tableName, definition); }
Source:
<code>protected final boolean matchesSafely(final T item) { try { <START> this.itext = this.text(item); <END> return this.body.matches(this.itext); } catch (final IOException ex) { throw new IllegalStateException(ex); } }</code><technical_language>@olenagerasimova correct usage of Hamcrest-matchers, inconsistent state of matcher. check correct describe in describeMismatchSafely argument</technical_language>

Target:
protected final boolean matchesSafely(final T item) { try { return this.body.matches(this.text(item)); } catch (final IOException ex) { throw new IllegalStateException(ex); } }
Source:
<code>public static boolean isPublishSubscribe(String pathOrUri) { <START> return pathOrUri != null && pathOrUri.endsWith(PUBLISH_SUBSCRIBE_PATH); <END> }</code><technical_language>pubsub handler matches ^/ */, this logic needs different</technical_language>

Target:
public static boolean isPublishSubscribe(String pathOrUri) { return pathOrUri != null && pathOrUri.equals(PUBLISH_SUBSCRIBE_PATH); }
Source:
<code>public List<String> getSupportedProducts() { <START> return Arrays.asList(SupportedProduct.DATAPREP); <END> }</code><technical_language>Arrays.singleton()</technical_language>

Target:
public List<String> getSupportedProducts() { return Collections.singletonList(SupportedProduct.DATAPREP); }
Source:
<code><START> public DefaultCacheEventListenerBuilder() { <END> }</code><technical_language>Constructor of a builder private</technical_language>

Target:
private DefaultCacheEventListenerBuilder() { }
Source:
<code><START> public ResponseEntity<MetricValueForCommit[]> getMetricValues(@Validated @RequestBody GetMetricsForCommitCommand command, @PathVariable("projectId") Long projectId){ <END> return new ResponseEntity<>(getMetricValuesOfCommitUseCase.get(command, projectId), HttpStatus.OK); }</code><technical_language>UseCase</technical_language>

Target:
public ResponseEntity<List<MetricValueForCommit>> getMetricValues(@Validated @RequestBody GetMetricsForCommitCommand command, @PathVariable("projectId") Long projectId){ return new ResponseEntity<>(getMetricValuesOfCommitUseCase.get(command, projectId), HttpStatus.OK); }
Source:
<code>private FilteredTree createFilteredTree(Composite parent) { FilteredTree filteredTree = new RootElementsFilteredTree(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); <START> filteredTree.setInitialText(PDEUIMessages.FeaturesView_searchPlaceholder); <END> PatternFilter patternFilter = filteredTree.getPatternFilter(); patternFilter.setIncludeLeadingWildcard(true); TreeViewer viewer = filteredTree.getViewer(); viewer.setComparer(new FeatureElementComparer()); viewer.setLabelProvider(new PDELabelProvider()); viewer.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { handleOpen(); } }); viewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { Collection<?> selection = getViewerSelection(); openAction.setEnabled(!selection.isEmpty()); copyAction.setEnabled(!selection.isEmpty()); } }); return filteredTree; }</code><technical_language>'type filter text' in error log? clearer, filters search in included features (which is fine)</technical_language>

Target:
private FilteredTree createFilteredTree(Composite parent) { FilteredTree filteredTree = new RootElementsFilteredTree(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); filteredTree.setInitialText(PDEUIMessages.FeaturesView_searchPlaceholder); PatternFilter patternFilter = filteredTree.getPatternFilter(); patternFilter.setIncludeLeadingWildcard(true); TreeViewer viewer = filteredTree.getViewer(); viewer.setComparer(new FeatureElementComparer()); viewer.setLabelProvider(new PDELabelProvider()); viewer.addDoubleClickListener(event -> handleOpen()); viewer.addSelectionChangedListener(event -> { Collection<?> selection = getViewerSelection(); fOpenAction.setEnabled(!selection.isEmpty()); fCopyAction.setEnabled(!selection.isEmpty()); }); return filteredTree; }
Source:
<code>public Map<String, Integer> getConnectedHostIPAndPort() { <START> Map<String, Integer> map = Maps.newHashMap(); <END> for (NodeConnection conn : m_connections) { map.put(conn.getSocketAddress().getAddress().getHostAddress(), (conn.getSocketAddress().getPort())); } return Collections.unmodifiableMap(map); }</code><technical_language>nit. map named map</technical_language>

Target:
public Map<String, Integer> getConnectedHostIPAndPort() { Map<String, Integer> connectedHostIPAndPortMap = Maps.newHashMap(); for (NodeConnection conn : m_connections) { connectedHostIPAndPortMap.put(conn.getSocketAddress().getAddress().getHostAddress(), (conn.getSocketAddress().getPort())); } return Collections.unmodifiableMap(connectedHostIPAndPortMap); }
Source:
<code>public void deletePushedAssetsByEnvironment(final String assetId, final String environmentId) throws DotDataException { new DotConnect().setSQL(DELETE_ASSETS_BY_ASSET_ID_AND_ENV) .addParam(assetId).addParam(environmentId).loadResult(); <START> cache.clearCache(); <END> }</code><technical_language>suggestion cache.removePushedAssetById(assetId, environmentId);</technical_language>

Target:
public void deletePushedAssetsByEnvironment(final String assetId, final String environmentId) throws DotDataException { new DotConnect().setSQL(DELETE_ASSETS_BY_ASSET_ID_AND_ENV) .addParam(assetId).addParam(environmentId).loadResult(); cache.removePushedAssetById(assetId, environmentId); }
Source:
<code>public void removeEndpoint(InetAddressAndPort endpoint) { <START> replicaSet.removeIf(r -> r.getEndpoint().equals(endpoint)); <END> }</code><technical_language>Allocates a lambda</technical_language>

Target:
public void removeEndpoint(InetAddressAndPort endpoint) { Iterator<Replica> iterator = replicaSet.iterator(); while (iterator.hasNext()) { Replica next = iterator.next(); if (next.getEndpoint().equals(endpoint)) { iterator.remove(); } } }
Source:
<code>public Binder build(Annotation annotation) { return new Binder<BindTimelineLog, LoggingProtos.TimelineLog>() { public void bind(SQLStatement q, BindTimelineLog bind, LoggingProtos.TimelineLog arg) { q.bind("account_id", arg.getAccountId()); <START> q.bind("date_of_night", String.valueOf(arg.getNightOfTimeline())); END> q.bind("algorithm", arg.getAlgorithm().getNumber()); q.bind("error", arg.getError().getNumber()); if (arg.hasTimestampWhenLogGenerated()) { q.bind("created_at", new Timestamp(arg.getTimestampWhenLogGenerated())); } else { q.bind("created_at", (Timestamp) null); } } }; }</code><technical_language>Prod string representation of night of</technical_language>

Target:
public Binder build(Annotation annotation) { return new Binder<BindTimelineLog, LoggingProtos.TimelineLog>() { public void bind(SQLStatement q, BindTimelineLog bind, LoggingProtos.TimelineLog arg) { q.bind("account_id", arg.getAccountId()); q.bind("date_of_night", arg.getNightOf()); q.bind("algorithm", arg.getAlgorithm().getNumber()); q.bind("error", arg.getError().getNumber()); if (arg.hasTimestampWhenLogGenerated()) { q.bind("created_at", new Timestamp(arg.getTimestampWhenLogGenerated())); } else { q.bind("created_at", (Timestamp) null); } } }; }
Source:
<code>public UserCredentials getUserCredentials(String username) { loadCredentials(); UserCredentials uc = credentialsMap.get(username); <START> if (uc == null) { <END> uc = new UserCredentials(); } return uc; }</code><technical_language>loadCredentials throw IOException ? I is handled here</technical_language>

Target:
public UserCredentials getUserCredentials(String username) throws IOException { loadCredentials(); UserCredentials uc = credentialsMap.get(username); if (uc == null) { uc = new UserCredentials(); } return uc; }
Source:
<code>protected void composeLine(final AllelicCount record, final DataLine dataLine) { dataLine.append(record.getInterval().getContig()) .append(record.getInterval().getEnd()) .append(record.getRefReadCount()) .append(record.getAltReadCount()) <START> .append(record.getRefNucleotide().name()) <END> .append(record.getAltNucleotide().name()); }</code><technical_language>record.getRefNucleotide() null</technical_language>

Target:
protected void composeLine(final AllelicCount record, final DataLine dataLine) { Utils.validateArg(record.getAltNucleotide() != null && record.getRefNucleotide() != null, "AllelicCount must have all fields specified to be written to file."); dataLine.append(record.getInterval().getContig()) .append(record.getInterval().getEnd()) .append(record.getRefReadCount()) .append(record.getAltReadCount()) .append(record.getRefNucleotide().name()) .append(record.getAltNucleotide().name()); }
Source:
<code>protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { mvs.reset(); try { ab.reset(mvs); TaggedValuePointable tvp1 = args[0]; if (tvp1.getTag() == ValueTag.ARRAY_TAG) { tvp1.getValue(ap); TaggedValuePointable tvp2 = args[1]; TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class); tvp2.getValue(lp); if ((int) lp.getLong() > ap.getEntryCount()) <START> throw new RuntimeException("The argument is out of bounds"); <END> ap.getEntry((int) lp.getLong() - 1, tempTvp); try { if (ap.getEntryCount() != 0) ab.addItem(tempTvp); else ab.addItem(tvp1); } finally { ppool.giveBack(tempTvp); } ab.finish(); } } catch (IOException e) { e.printStackTrace(); } result.set(mvs); }</code><technical_language>return empty sequence here</technical_language>

Target:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp1 = args[0]; TaggedValuePointable tvp2 = args[1]; if (!(tvp1.getTag() == ValueTag.ARRAY_TAG || tvp1.getTag() == ValueTag.OBJECT_TAG)) { throw new SystemException(ErrorCode.FORG0006); } if (tvp1.getTag() == ValueTag.ARRAY_TAG) { if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) { throw new SystemException(ErrorCode.FORG0006); } TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class); mvs.reset(); try { ab.reset(mvs); tvp1.getValue(ap); tvp2.getValue(lp); if ((int) lp.getLong() > ap.getEntryCount()) { ab.finish(); result.set(mvs); return; } ap.getEntry((int) lp.getLong() - 1, tempTvp); ab.addItem(ap.getEntryCount() != 0 ? tempTvp : tvp1); ab.finish(); result.set(mvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { ppool.giveBack(tempTvp); } } }
Source:
<code>ContributionsPresenter(ContributionsRepository repository, @Named(CommonsApplicationModule.MAIN_THREAD) Scheduler mainThreadScheduler,@Named(CommonsApplicationModule.IO_THREAD) Scheduler ioThreadScheduler) { this.repository = repository; <START> compositeDisposable=new CompositeDisposable(); <END> this.mainThreadScheduler=mainThreadScheduler; this.ioThreadScheduler=ioThreadScheduler; }</code><technical_language>is CompositeDisposable assigned twice</technical_language>

Target:
ContributionsPresenter(ContributionsRepository repository, @Named(CommonsApplicationModule.MAIN_THREAD) Scheduler mainThreadScheduler,@Named(CommonsApplicationModule.IO_THREAD) Scheduler ioThreadScheduler) { this.repository = repository; this.mainThreadScheduler=mainThreadScheduler; this.ioThreadScheduler=ioThreadScheduler; }
Source:
<code>public void onPostServerTick() { <START> this.onPreServerTick(this.getMinecraftServerInstance()); <END> }</code><technical_language>java this.onPostServerTick(this.getMinecraftServerInstance());</technical_language>

Target:
public void onPostServerTick() { this.onPostServerTick(this.getMinecraftServerInstance()); }