auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void handle(MethodInvocationTree tree, AnnotatedExecutableType method) { if (TreeUtils.isMethodInvocation(tree, collectionToArrayE, processingEnv)) { assert !tree.getArguments().isEmpty() : tree; ExpressionTree argument = tree.getArguments().get(0); <START> boolean argIsArrayCreation = <END> isHandledArrayCreation(argument, receiverName(tree.getMethodSelect())); boolean receiverIsNonNull = isNonNullReceiver(tree); boolean argIsHandled = argIsArrayCreation || isArrayLenZeroFieldAccess(argument); setComponentNullness(receiverIsNonNull && argIsHandled, method.getReturnType()); if (!receiverIsNonNull) { setComponentNullness(false, method.getParameterTypes().get(0)); } } }</code><technical_language>This lost a changes I in <LINK_0></technical_language>

Target:
public void handle(MethodInvocationTree tree, AnnotatedExecutableType method) { if (TreeUtils.isMethodInvocation(tree, collectionToArrayE, processingEnv)) { assert !tree.getArguments().isEmpty() : tree; ExpressionTree argument = tree.getArguments().get(0); boolean receiverIsNonNull = receiverIsCollectionOfNonNullElements(tree); boolean argIsHandled = isHandledArrayCreation(argument, receiverName(tree.getMethodSelect())) || (trustArrayLenZero && isArrayLenZeroFieldAccess(argument)); setComponentNullness(receiverIsNonNull && argIsHandled, method.getReturnType()); if (!receiverIsNonNull) { setComponentNullness(false, method.getParameterTypes().get(0)); } if (receiverIsNonNull && !argIsHandled) { if (argument.getKind() != Tree.Kind.NEW_ARRAY) { checker.reportWarning(tree, "toArray.nullable.elements.not.newarray"); } else { checker.reportWarning(tree, "toArray.nullable.elements.mismatched.size"); } } } }
Source:
<code>private boolean createCertificateRequest(final ClientHello clientHello, final DTLSFlight flight) throws HandshakeException { if ((clientAuthenticationWanted || clientAuthenticationRequired) && negotiatedSignatureAndHashAlgorithms != null && !negotiatedSignatureAndHashAlgorithms.isEmpty()) { CertificateRequest certificateRequest = new CertificateRequest(session.getPeer()); certificateRequest.addCertificateType(ClientCertificateType.ECDSA_SIGN); List<SignatureAndHashAlgorithm> serverOrdered = SignatureAndHashAlgorithm.getCommonSignatureAlgorithms( supportedSignatureAndHashAlgorithms, negotiatedSignatureAndHashAlgorithms); <START> certificateRequest.addSignatureAlgorithms(serverOrdered); <END> if (certificateVerifier != null) { List<X500Principal> subjects = CertPathUtil.toSubjects(Arrays.asList(certificateVerifier.getAcceptedIssuers())); certificateRequest.addCerticiateAuthorities(subjects); } wrapMessage(flight, certificateRequest); return true; } return false; }</code><technical_language>negotiatedSignatureAndHashAlgorithms != null && !negotiatedSignatureAndHashAlgorithms.isEmpty() **I get point here**, this sounds a bit strange if negotiatedSignatureAndHashAlgorithms null(or empty) create a certificate request. This sounds more critical me</technical_language>

Target:
private boolean createCertificateRequest(final ClientHello clientHello, final DTLSFlight flight) throws HandshakeException { if ((clientAuthenticationWanted || clientAuthenticationRequired) && negotiatedSignatureAndHashAlgorithms != null) { CertificateRequest certificateRequest = new CertificateRequest(session.getPeer()); certificateRequest.addCertificateType(ClientCertificateType.ECDSA_SIGN); List<SignatureAndHashAlgorithm> serverOrdered = SignatureAndHashAlgorithm.getCommonSignatureAlgorithms( supportedSignatureAndHashAlgorithms, negotiatedSignatureAndHashAlgorithms); certificateRequest.addSignatureAlgorithms(serverOrdered); if (certificateVerifier != null) { List<X500Principal> subjects = CertPathUtil.toSubjects(Arrays.asList(certificateVerifier.getAcceptedIssuers())); certificateRequest.addCerticiateAuthorities(subjects); } wrapMessage(flight, certificateRequest); return true; } return false; }
Source:
<code>private void validate() { if (useJdbcStore != null && useJdbcStore && storeDatasource != null && storeDatasource.equals("")) { throw new IllegalArgumentException("" <START> + "Jdbc store datasource must be presented along with enabled using Jdbc store"); <END> } }</code><technical_language>JDBC</technical_language>

Target:
private void validate() { if (useJdbcStore != null && useJdbcStore && storeDatasource != null && storeDatasource.equals("")) { throw new IllegalArgumentException("" + "JDBC store datasource must be presented along with enabled using JDBC store"); } }
Source:
<code>public static String updateStatusVar(LcnDefs.Var var, int value) throws IllegalArgumentException { int id = LcnDefs.Var.toVarId(var); if (id != -1) { <START> int x2cmd = id |= 0x40; <END> int b1 = (value >> 8) & 0xff; int b2 = value & 0xff; return String.format("X2%03d%03d%03d", x2cmd, b1, b2); } throw new IllegalArgumentException(); }</code><technical_language>affect result, clearer simple bitwise operator (|) instead of bitwise inclusive assignment operator (|=)</technical_language>

Target:
public static String updateStatusVar(LcnDefs.Var var, int value) throws IllegalArgumentException { int id = LcnDefs.Var.toVarId(var); if (id != -1) { int x2cmd = id | 0x40; int b1 = (value >> 8) & 0xff; int b2 = value & 0xff; return String.format("X2%03d%03d%03d", x2cmd, b1, b2); } throw new IllegalArgumentException(); }
Source:
<code>private void rewriteProcessMetadata(List<Prozess> processes) { <START> String currentProcessTitele = null; <END> for (Prozess process : processes) { try { currentProcessTitele = process.getTitel(); Fileformat gdzfile = process.readMetadataFile(); process.writeMetadataFile(gdzfile); Helper.setMeldung("rewriteOk", currentProcessTitele); } catch (Exception e) { StringBuilder message = new StringBuilder(127); if (currentProcessTitele != null) { message.append(currentProcessTitele); message.append(": "); } message.append(e.getClass().getSimpleName()); if (e.getMessage() != null) { message.append(": "); message.append(e.getMessage()); } Helper.setFehlerMeldung("rewriteError", message.toString()); } } }</code><technical_language>initialise this property currentProcessTitele (contains a spelling error) this property overwritten in iteration of loop</technical_language>

Target:
private void rewriteProcessMetadata(List<Prozess> processes) { for (Prozess process : processes) { String currentProcessTitle = null; try { currentProcessTitle = process.getTitel(); Fileformat gdzfile = process.readMetadataFile(); process.writeMetadataFile(gdzfile); Helper.setMeldung("rewriteOk", currentProcessTitle); } catch (Exception e) { StringBuilder message = new StringBuilder(127); if (currentProcessTitle != null) { message.append(currentProcessTitle); message.append(": "); } message.append(e.getClass().getSimpleName()); if (e.getMessage() != null) { message.append(": "); message.append(e.getMessage()); } Helper.setFehlerMeldung("rewriteError", message.toString()); } } }
Source:
<code>public void run() { while (inScanner.hasNextLine() && !isCanceled()) { String line = inScanner.nextLine(); <START> lines.add(line); <END> } }</code><technical_language>cancel() is called, this thread right adding line lines, concurrent exception while other thread calls getLines() works list if getLines() return list. I suggest wrap synchronized (this) { if(!isCanceled()) { lines.add(line); } } call cancel() command in getLines()</technical_language>

Target:
public void run() { while (inScanner.hasNextLine() && !isCanceled()) { synchronized(this) { if( !isCanceled()) { lines.add(inScanner.nextLine()); } } } }
Source:
<code>private long profile( PagedFile file, Profile[] existingProfiles ) throws IOException { long pagesInMemory = 0; Profile nextProfile = filterRelevant( existingProfiles, file ) .max( naturalOrder() ) .map( Profile::next ) .orElse( Profile.first( file.file() ) ); try ( OutputStream output = nextProfile.write( fs ); PageCursor cursor = file.io( 0, PF_SHARED_READ_LOCK | PF_NO_FAULT ) ) { int stepper = 0; int b = 0; <START> for ( ; ; ) <END> { if ( !cursor.next() ) { break; } if ( cursor.getCurrentPageId() != PageCursor.UNBOUND_PAGE_ID ) { pagesInMemory++; b |= 1 << stepper; } stepper++; if ( stepper == 8 ) { output.write( b ); b = 0; stepper = 0; } } output.write( b ); output.flush(); } filterRelevant( existingProfiles, file ) .filter( profile -> !refCounts.contains( profile ) ) .forEach( profile -> profile.delete( fs ) ); return pagesInMemory; }</code><technical_language>replaced while ( cursor.next() ) stopped is removed</technical_language>

Target:
private long profile( PagedFile file, Profile[] existingProfiles ) throws IOException { long pagesInMemory = 0; Profile nextProfile = filterRelevant( existingProfiles, file ) .max( naturalOrder() ) .map( Profile::next ) .orElse( Profile.first( file.file() ) ); try ( OutputStream output = nextProfile.write( fs ); PageCursor cursor = file.io( 0, PF_SHARED_READ_LOCK | PF_NO_FAULT ) ) { int stepper = 0; int b = 0; while ( cursor.next() ) { if ( cursor.getCurrentPageId() != PageCursor.UNBOUND_PAGE_ID ) { pagesInMemory++; b |= 1 << stepper; } stepper++; if ( stepper == 8 ) { output.write( b ); b = 0; stepper = 0; } } output.write( b ); output.flush(); } filterRelevant( existingProfiles, file ) .filter( profile -> !refCounts.contains( profile ) ) .forEach( profile -> profile.delete( fs ) ); return pagesInMemory; }
Source:
<code>public <V> V apply(InputStream stream, Type type) throws IOException { String data = Strings2.toStringAndClose(stream); Gson gson = new Gson(); Type mapType = new TypeToken<Map<String, Object>>(){}.getType(); Map<String, String> jsonMap = gson.fromJson(data, mapType); <START> Pattern p = Pattern.compile(".*/datacenters/(.*)/servers.*"); <END> Matcher m = p.matcher(jsonMap.get("href")); if (m.matches()) { String dataCenterId = m.group(1); jsonMap.put("dataCenterId", dataCenterId); data = (new Gson()).toJson(jsonMap); } try { return (V) json.fromJson(data, type); } finally { if (stream != null) stream.close(); } }</code><technical_language>move this a constant above? pattern is compiled once, method call. (edit) move this a class level constant</technical_language>

Target:
public <V> V apply(InputStream stream, Type type) throws IOException { try { return (V) json.fromJson(this.parseService.parseId(Strings2.toStringAndClose(stream), "datacenters", "dataCenterId"), type ); } finally { if (stream != null) stream.close(); } }
Source:
<code>private void createCoordinatorStream() { SystemAdmin coordinatorSystemAdmin = null; try { SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config); coordinatorSystemAdmin = systemAdmins.getSystemAdmin(coordinatorSystemStream.getSystem()); LOG.info("Starting the coordinator system admin."); <START> coordinatorSystemAdmin.start(); <END> String streamName = coordinatorSystemStream.getStream(); StreamSpec coordinatorSpec = StreamSpec.createCoordinatorStreamSpec(streamName, coordinatorSystemStream.getSystem()); if (coordinatorSystemAdmin.createStream(coordinatorSpec)) { LOG.info("Created coordinator stream: {}.", streamName); } else { LOG.info("Coordinator stream: already exists.", streamName); } } finally { if (coordinatorSystemAdmin != null) { LOG.info("Stopping the coordinator system admin."); coordinatorSystemAdmin.stop(); } } }</code><technical_language>starting/stopping system admins part of shared systemAdmins? a start/stop already</technical_language>

Target:
private void createCoordinatorStream() { SystemAdmin coordinatorSystemAdmin = null; SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config); coordinatorSystemAdmin = systemAdmins.getSystemAdmin(coordinatorSystemStream.getSystem()); String streamName = coordinatorSystemStream.getStream(); StreamSpec coordinatorSpec = StreamSpec.createCoordinatorStreamSpec(streamName, coordinatorSystemStream.getSystem()); if (coordinatorSystemAdmin.createStream(coordinatorSpec)) { LOG.info("Created coordinator stream: {}.", streamName); } else { LOG.info("Coordinator stream: already exists.", streamName); } }
Source:
<code>public void loadFromJSONObject( JSONObject jobj, Database db ) throws JSONException { super.loadFromJSONObject(jobj, db); m_lookupType = IndexLookupType.get( jobj.getString( Members.LOOKUP_TYPE.name() ) ); m_sortDirection = SortDirectionType.get( jobj.getString( Members.SORT_DIRECTION.name() ) ); m_purpose = jobj.has(Members.PURPOSE.name()) ? jobj.getInt(Members.PURPOSE.name()) : FOR_SCANNING_PERFORMANCE_OR_ORDERING; m_targetIndexName = jobj.getString(Members.TARGET_INDEX_NAME.name()); m_catalogIndex = db.getTables().get(super.m_targetTableName).getIndexes().get(m_targetIndexName); m_endExpression = AbstractExpression.fromJSONChild(jobj, Members.END_EXPRESSION.name(), m_tableScan); m_initialExpression = AbstractExpression.fromJSONChild(jobj, Members.INITIAL_EXPRESSION.name(), m_tableScan); AbstractExpression.loadFromJSONArrayChild(m_searchkeyExpressions, jobj, Members.SEARCHKEY_EXPRESSIONS.name(), m_tableScan); if ( ! jobj.isNull(Members.COMPARE_NOTDISTINCT.name())) { JSONArray jarray = jobj.getJSONArray(Members.COMPARE_NOTDISTINCT.name()); int numCols = jarray.length(); for (int ii = 0; ii < numCols; ++ii) { m_compareNotDistinct.add(jarray.getBoolean(ii)); } <START> } <END> m_skip_null_predicate = AbstractExpression.fromJSONChild(jobj, Members.SKIP_NULL_PREDICATE.name(), m_tableScan); }</code><technical_language>a factored out one-liner</technical_language>

Target:
public void loadFromJSONObject( JSONObject jobj, Database db ) throws JSONException { super.loadFromJSONObject(jobj, db); m_lookupType = IndexLookupType.get( jobj.getString( Members.LOOKUP_TYPE.name() ) ); m_sortDirection = SortDirectionType.get( jobj.getString( Members.SORT_DIRECTION.name() ) ); m_purpose = jobj.has(Members.PURPOSE.name()) ? jobj.getInt(Members.PURPOSE.name()) : FOR_SCANNING_PERFORMANCE_OR_ORDERING; m_targetIndexName = jobj.getString(Members.TARGET_INDEX_NAME.name()); m_catalogIndex = db.getTables().get(super.m_targetTableName).getIndexes().get(m_targetIndexName); m_endExpression = AbstractExpression.fromJSONChild(jobj, Members.END_EXPRESSION.name(), m_tableScan); m_initialExpression = AbstractExpression.fromJSONChild(jobj, Members.INITIAL_EXPRESSION.name(), m_tableScan); AbstractExpression.loadFromJSONArrayChild(m_searchkeyExpressions, jobj, Members.SEARCHKEY_EXPRESSIONS.name(), m_tableScan); loadBooleanArrayFromJSONObject(jobj, Members.COMPARE_NOTDISTINCT.name(), m_compareNotDistinct); m_skip_null_predicate = AbstractExpression.fromJSONChild(jobj, Members.SKIP_NULL_PREDICATE.name(), m_tableScan); }
Source:
<code>protected void maybeCommitOffsets(Consumer<?, ?> consumer, boolean hardCommit) { boolean isTimeToCommit = System.currentTimeMillis() - _lastCommittedTime > _offsetCommitInterval; if (hardCommit || isTimeToCommit) { if (hardCommit) { LOG.info("Calling flush on the producer."); _task.getEventProducer().flush(); consumer.commitSync(); for (TopicPartition tp : consumer.assignment()) { _flushlessProducer.getAckCheckpoint(tp.topic(), tp.partition()).ifPresent(ackCheckpoint -> { long committedCheckpoint = Optional.ofNullable(consumer.committed(tp)).map(OffsetAndMetadata::offset).orElse(0L); if (!Objects.equals(ackCheckpoint, committedCheckpoint)) { LOG.error( "Ack checkpoint should match committed checkpoint after flushing and checkpointing. Ack checkpoint: " + "{}, consumer position: {}", ackCheckpoint, committedCheckpoint); } }); } <START> _flushlessProducer.clear(); <END> } else { LOG.info("Trying to commit offsets."); Map<TopicPartition, OffsetAndMetadata> offsets = new HashMap<>(); for (TopicPartition tp : consumer.assignment()) { _flushlessProducer.getAckCheckpoint(tp.topic(), tp.partition()) .ifPresent(o -> offsets.put(tp, new OffsetAndMetadata(o + 1))); } consumer.commitSync(offsets); } _lastCommittedTime = System.currentTimeMillis(); } }</code><technical_language>log error message, if inFlight count is greater zero (before calling clear)</technical_language>

Target:
protected void maybeCommitOffsets(Consumer<?, ?> consumer, boolean hardCommit) { boolean isTimeToCommit = System.currentTimeMillis() - _lastCommittedTime > _offsetCommitInterval; if (hardCommit) { LOG.info("Calling flush on the producer."); _task.getEventProducer().flush(); consumer.commitSync(); for (TopicPartition tp : consumer.assignment()) { _flushlessProducer.getAckCheckpoint(tp.topic(), tp.partition()).ifPresent(ackCheckpoint -> { long committedCheckpoint = Optional.ofNullable(consumer.committed(tp)).map(OffsetAndMetadata::offset).orElse(0L); if (!Objects.equals(ackCheckpoint, committedCheckpoint)) { LOG.error( "Ack checkpoint should match committed checkpoint after flushing and checkpointing. Ack checkpoint: " + "{}, consumer position: {}", ackCheckpoint, committedCheckpoint); } }); long inFlightCount = _flushlessProducer.getInFlightCount(tp.topic(), tp.partition()); if (inFlightCount > 0) { LOG.error("Flushless producer inflight count for topic partition should be 0 after flush, but was {}", tp.topic(), tp.partition(), inFlightCount); } } _flushlessProducer.clear(); _lastCommittedTime = System.currentTimeMillis(); } else if (isTimeToCommit) { LOG.info("Trying to commit offsets."); Map<TopicPartition, OffsetAndMetadata> offsets = new HashMap<>(); for (TopicPartition tp : consumer.assignment()) { _flushlessProducer.getAckCheckpoint(tp.topic(), tp.partition()) .ifPresent(o -> offsets.put(tp, new OffsetAndMetadata(o + 1))); } consumer.commitSync(offsets); _lastCommittedTime = System.currentTimeMillis(); } }
Source:
<code>public Observable<GitHubRepository> getSelectRepository() { <START> return selectRepository; <END> }</code><technical_language>hide()</technical_language>

Target:
public Observable<GitHubRepository> getSelectRepository() { return selectRepository.hide(); }
Source:
<code>public void testSingletonFlatbush() { <START> List<Rectangle> items = new ArrayList(); <END> items.add(new Rectangle(0, 0, 1, 1)); Flatbush rtree = new Flatbush<Rectangle>(items.toArray(new Rectangle[] {})); assertEquals(rtree.findIntersections(everything), items); Rectangle hit = new Rectangle(1, 1, 2, 2); assertEquals(rtree.findIntersections(hit), items); Rectangle miss = new Rectangle(-1, -1, -0.1, -0.1); assertEquals(rtree.findIntersections(miss).size(), 0); }</code><technical_language>ImmutableList.of(...) - parameter for Flatbush: Flatbush<Rectangle> rtree = ... - inline hit miss variables - ditto testSingletonFlatbushXY List<Rectangle> items = ImmutableList.of(new Rectangle(0, 0, 1, 1)); Flatbush<Rectangle> rtree = new Flatbush<>(items.toArray(new Rectangle[] {})); assertEquals(findIntersections(rtree, EVERYTHING), items); // hit assertEquals(findIntersections(rtree, new Rectangle(1, 1, 2, 2)), items); // miss assertEquals(findIntersections(rtree, new Rectangle(-1, -1, -0.1, -0.1)).size(), 0);</technical_language>

Target:
public void testSingletonFlatbush() { List<Rectangle> items = ImmutableList.of(new Rectangle(0, 0, 1, 1)); Flatbush<Rectangle> rtree = new Flatbush<>(items.toArray(new Rectangle[] {})); assertEquals(findIntersections(rtree, EVERYTHING), items); assertEquals(findIntersections(rtree, new Rectangle(1, 1, 2, 2)), items); assertEquals(findIntersections(rtree, new Rectangle(-1, -1, -0.1, -0.1)), ImmutableList.of()); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!isCameraPermissionGranted(this)) { finish(); return; } requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager .LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); <START> setContentView(R.layout.activity_capture_selfie_new_api); <END> if (null == savedInstanceState) { getFragmentManager().beginTransaction() .replace(R.id.container, Camera2Fragment.newInstance()) .commit(); } ToastUtils.showLongToast(R.string.take_picture_instruction); }</code><technical_language>Please rename this layout file removing _new_api</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!isCameraPermissionGranted(this)) { finish(); return; } requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager .LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_capture_selfie); if (null == savedInstanceState) { getFragmentManager().beginTransaction() .replace(R.id.container, Camera2Fragment.newInstance()) .commit(); } ToastUtils.showLongToast(R.string.take_picture_instruction); }
Source:
<code>public View key(Object... key) { this.key = getKeyAsJsonElement(key); <START> uriBuilder.query("key", this.key); <END> return this; }</code><technical_language>change JsonElement String, fix bug complex keys, implicitly relying JsonElement's toString method returning a valid JSON string for part of URL. This assumption part of toString method's contract. gson.toJson guarantee sending in valid JSON in URL. for startKey endKey, below</technical_language>

Target:
public View key(Object... key) { this.key = getKeyAsJsonElement(key); uriBuilder.query("key", gson.toJson(this.key)); return this; }
Source:
<code>private OkHttpClient getOkHttpClient(File baseDir) { OkHttpClient.Builder okClientBuilder = new OkHttpClient.Builder(); okClientBuilder.addInterceptor(headerAuthorizationInterceptor); httpLoggingInterceptor = new HttpLoggingInterceptor(); httpLoggingInterceptor.setLevel(Logger.isVerboseLoggingEnabled() ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE); okClientBuilder.addInterceptor(httpLoggingInterceptor); okClientBuilder.addNetworkInterceptor(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Response response = chain.proceed(chain.request()); return response.newBuilder() <START> .addHeader("is304", String.valueOf(response.code() == HttpURLConnection.HTTP_NOT_MODIFIED)) <END> .build(); } }); okClientBuilder.retryOnConnectionFailure(true); if (baseDir != null) { final File cacheDir = new File(baseDir, "HttpResponseCache"); okClientBuilder.cache(new Cache(cacheDir, HTTP_RESPONSE_DISK_CACHE_MAX_SIZE)); } okClientBuilder.connectTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); okClientBuilder.readTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); okClientBuilder.writeTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); mClient = okClientBuilder.build(); return mClient; }</code><technical_language>I thought it, this instead: .addHeader("originalResponseCode", response.code()) some shorter KEY, u idea. do u think</technical_language>

Target:
private OkHttpClient getOkHttpClient(File baseDir) { OkHttpClient.Builder okClientBuilder = new OkHttpClient.Builder(); okClientBuilder.addInterceptor(headerAuthorizationInterceptor); httpLoggingInterceptor = new HttpLoggingInterceptor(); httpLoggingInterceptor.setLevel(Logger.isVerboseLoggingEnabled() ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE); okClientBuilder.addInterceptor(httpLoggingInterceptor); okClientBuilder.addNetworkInterceptor(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Response response = chain.proceed(chain.request()); return response.newBuilder() .addHeader(OKHTTP_HEADER, String.valueOf(response.code())) .build(); } }); okClientBuilder.retryOnConnectionFailure(true); if (baseDir != null) { final File cacheDir = new File(baseDir, "HttpResponseCache"); okClientBuilder.cache(new Cache(cacheDir, HTTP_RESPONSE_DISK_CACHE_MAX_SIZE)); } okClientBuilder.connectTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); okClientBuilder.readTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); okClientBuilder.writeTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); mClient = okClientBuilder.build(); return mClient; }
Source:
<code>private Summary makeSummary(Layer layer, String attr) throws JsonSyntaxException { OGCService cswService = Service.ogcHelper(Service.ServiceType.csw, layer.getServices()); log.debug("cswService", cswService); String cswEndpoint = cswService.getEndpoint(); log.debug("cswEndpoint", cswEndpoint); String summaryJson = null; log.debug("summaryJson", summaryJson); try { summaryJson = MetadataUtil.getSummaryFromWPS(cswEndpoint, attr); log.debug("summaryJsonMetadataUtil", summaryJson); } catch (IOException | ParserConfigurationException | SAXException | URISyntaxException ex) { log.error("Problem getting summary from item", ex); } Gson gson = GsonUtil.getDefault(); <START> log.debug("gson", gson); <END> Summary summary = gson.fromJson(summaryJson, Summary.class); log.debug("summary", summary); return summary; }</code><technical_language>This work want, gson is object log in this case</technical_language>

Target:
private Summary makeSummary(Layer layer, String attr) throws JsonSyntaxException { OGCService cswService = Service.ogcHelper(Service.ServiceType.csw, layer.getServices()); log.debug("cswService {}", cswService); String cswEndpoint = cswService.getEndpoint(); log.debug("cswEndpoint {}", cswEndpoint); String summaryJson = null; try { summaryJson = MetadataUtil.getSummaryFromWPS(cswEndpoint, attr); log.debug("summaryJsonMetadataUtil {}", summaryJson); } catch (IOException | ParserConfigurationException | SAXException | URISyntaxException ex) { log.error("Problem getting summary from item", ex); } Gson gson = GsonUtil.getDefault(); log.debug(String.valueOf(gson)); Summary summary = gson.fromJson(summaryJson, Summary.class); log.debug(String.valueOf(summary)); return summary; }
Source:
<code>public String getVersion() { String buildLabel = buildData.get(BUILD_LABEL); <START> return nullToEmpty(buildLabel); <END> }</code><technical_language>nit: please undo change then</technical_language>

Target:
public String getVersion() { String buildLabel = buildData.get(BUILD_LABEL); return buildLabel != null ? buildLabel : ""; }
Source:
<code>void init() { ngrinderContext = System.getProperty("ngrinder.context", "agent"); <START> workDirectory = System.getProperty("ngrinder.base.path", System.getProperty("user.dir")); <END> if (isControllerContext()) { controllerHomeDir = resolveControllerHomeDir(); controllerHomeTmpDir = (controllerHomeDir + File.separator + NGRINDER_CONTROLLER_TEMP_FOLDER); } this.initAccessOfDirectories(); this.initAccessOfHosts(); }</code><technical_language>ngrinder.user.dir</technical_language>

Target:
void init() { ngrinderContext = System.getProperty("ngrinder.context", "agent"); if (isControllerContext()) { controllerHomeDir = resolveControllerHomeDir(); controllerHomeTmpDir = (controllerHomeDir + File.separator + NGRINDER_CONTROLLER_TEMP_FOLDER); } this.initAccessOfDirectories(); this.initAccessOfHosts(); }
Source:
<code><START> public List<Member> findMembers(PerunSession sess, Vo vo, String searchString, boolean onlySponsored) throws InternalErrorException { <END> return getMembersManagerImpl().findMembers(sess, vo, searchString, onlySponsored); }</code><technical_language>need explicitly declare InternalErrorException, is RuntimeException</technical_language>

Target:
public List<Member> findMembers(PerunSession sess, Vo vo, String searchString, boolean onlySponsored) { return getMembersManagerImpl().findMembers(sess, vo, searchString, onlySponsored); }
Source:
<code>public Response delete(@PathParam("id") final String id) { <START> final OnmsMinion minion = getDao().get(id); <END> final String location = minion.getLocation(); Response response = super.delete(id); final EventBuilder eventBuilder = new EventBuilder(EventConstants.MONITORING_SYSTEM_DELETED_UEI, "Monitoring_System_Updates"); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_TYPE, OnmsMonitoringSystem.TYPE_MINION); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_ID, id); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_LOCATION, location); try { m_eventProxy.send(eventBuilder.getEvent()); } catch (final EventProxyException e) { LOG.warn(" Failed to send Event on Minion deletion " + e.getMessage(), e); } return response; }</code><technical_language>m_dao get rid of getter for it</technical_language>

Target:
public Response delete(@PathParam("id") final String id) { final OnmsMinion minion = getDao().get(id); final String location = minion.getLocation(); Response response = super.delete(id); final EventBuilder eventBuilder = new EventBuilder(EventConstants.MONITORING_SYSTEM_DELETED_UEI, "OpenNMS.WebUI"); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_TYPE, OnmsMonitoringSystem.TYPE_MINION); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_ID, id); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_LOCATION, location); try { m_eventProxy.send(eventBuilder.getEvent()); } catch (final EventProxyException e) { LOG.warn(" Failed to send Event on Minion deletion " + e.getMessage(), e); } return response; }
Source:
<code>private void editAnalysis() { for (TableItem item : fAnalysesTable.getSelection()) { String selection = XmlUtils.createXmlFileString(item.getText()); @Nullable File file = XmlUtils.listFiles().get(selection); if (file == null) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); return; } try { IEditorPart editorPart = IDE.openEditorOnFileStore(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), EFS.getStore(file.toURI())); editorPart.addPropertyListener(new IPropertyListener() { @Override public void propertyChanged(Object source, int propId) { <START> if (ISaveablePart.PROP_DIRTY == propId) { if (!editorPart.isDirty()) { loadXmlFile(file, false); } } <END> } }); performOk(); } catch (CoreException e) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), e.getMessage()); } } }</code><technical_language>Merge if statement</technical_language>

Target:
private void editAnalysis() { for (TableItem item : fAnalysesTable.getSelection()) { String selection = XmlUtils.createXmlFileString(item.getText()); @Nullable File file = XmlUtils.listFiles().get(selection); if (file == null) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); return; } try { IEditorPart editorPart = IDE.openEditorOnFileStore(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), EFS.getStore(file.toURI())); editorPart.addPropertyListener(new IPropertyListener() { @Override public void propertyChanged(Object source, int propId) { if (ISaveablePart.PROP_DIRTY == propId && !editorPart.isDirty()) { loadXmlFile(file, false); } } }); performOk(); } catch (CoreException e) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), e.getMessage()); } } }
Source:
<code>public AzureCloudInstanceInformation parseCloudInstanceInformation(List<String> responses) { AzureCloudInstanceInformation azureCloudInstanceInformation = null; for (String response : responses) { ObjectMapper mapper = new ObjectMapper(); try { JsonNode jsonNode = mapper.readTree(response); <START> JsonNode computeNode = jsonNode.path("compute"); <END> if (!computeNode.isMissingNode()) { String vmName = computeNode.path("vmId").getTextValue(); String platformFaultDomain = computeNode.path("platformFaultDomain").getTextValue(); String vmssName = computeNode.path("vmScaleSetName").getValueAsText(); AzureCloudInstanceInformation.Builder builder = new AzureCloudInstanceInformation.Builder(); builder.setInstanceName(vmName).setFaultDomain(platformFaultDomain) .setInstanceSetName(vmssName); azureCloudInstanceInformation = builder.build(); } } catch (IOException e) { LOG.error("Error in parsing cloud instance information: {}", response, e); } } return azureCloudInstanceInformation; }</code><technical_language>variables instead of hard code</technical_language>

Target:
public AzureCloudInstanceInformation parseCloudInstanceInformation(List<String> responses) { AzureCloudInstanceInformation azureCloudInstanceInformation = null; if (responses.size() > 1) { throw new HelixException("Multiple responses are not supported for Azure now"); } String response = responses.get(0); ObjectMapper mapper = new ObjectMapper(); try { JsonNode jsonNode = mapper.readTree(response); JsonNode computeNode = jsonNode.path(COMPUTE); if (!computeNode.isMissingNode()) { String vmName = computeNode.path(INSTANCE_NAME).getTextValue(); String platformFaultDomain = computeNode.path(DOMAIN).getTextValue(); String vmssName = computeNode.path(INSTANCE_SET_NAME).getValueAsText(); AzureCloudInstanceInformation.Builder builder = new AzureCloudInstanceInformation.Builder(); builder.setInstanceName(vmName).setFaultDomain(platformFaultDomain) .setInstanceSetName(vmssName); azureCloudInstanceInformation = builder.build(); } } catch (IOException e) { throw new HelixException(String.format("Error in parsing cloud instance information: {}", response, e)); } return azureCloudInstanceInformation; }
Source:
<code>public Map<String, Object> getPreferences() { Map<String, Object> preferences = new HashMap<String, Object>(); if (showMarks) { addMarkFields(suffix, preferences); } if (showErrorBars) { addErrorFields(suffix + ERROR_SUFFIX, preferences); } if (showLine) { addLineFields(suffix, preferences); } <START> if (preferences.isEmpty()) <END> addCommonFields(suffix, preferences); return preferences; }</code><technical_language>braces</technical_language>

Target:
public Map<String, Object> getPreferences() { Map<String, Object> preferences = new HashMap<String, Object>(); if (showMarks) { addMarkFields(suffix, preferences); } if (showErrorBars) { addErrorFields(suffix + ERROR_SUFFIX, preferences); } if (showLine) { addLineFields(suffix, preferences); } if (preferences.isEmpty()) { addCommonFields(suffix, preferences); } return preferences; }
Source:
<code>public void assertQuery(@Language("SQL") String actual, @Language("SQL") String expected, boolean ensureOrdering) { MaterializedResult actualResults = null; try { actualResults = runner.execute(runner.getDefaultSession(), actual).toTestTypes(); } catch (RuntimeException ex) { fail("Execution of 'actual' query failed: " + actual, ex); } MaterializedResult expectedResults = null; try { expectedResults = runner.execute(runner.getDefaultSession(), expected).toTestTypes(); } catch (RuntimeException ex) { fail("Execution of 'expected' query failed: " + expected, ex); } <START> assertEquals(actualResults.getTypes(), expectedResults.getTypes(), "For query: \n " + actual + "\n:"); <END> List<MaterializedRow> actualRows = actualResults.getMaterializedRows(); List<MaterializedRow> expectedRows = expectedResults.getMaterializedRows(); if (ensureOrdering) { if (!actualRows.equals(expectedRows)) { assertEquals(actualRows, expectedRows, "For query: \n " + actual + "\n:"); } } else { assertEqualsIgnoreOrder(actualRows, expectedRows, "For query: \n " + actual); } }</code><technical_language>I change message a bit to: "Types mismatch for query: \n " + actual + "\n:"</technical_language>

Target:
public void assertQuery(@Language("SQL") String actual, @Language("SQL") String expected, boolean ensureOrdering) { MaterializedResult actualResults = null; try { actualResults = runner.execute(runner.getDefaultSession(), actual).toTestTypes(); } catch (RuntimeException ex) { fail("Execution of 'actual' query failed: " + actual, ex); } MaterializedResult expectedResults = null; try { expectedResults = runner.execute(runner.getDefaultSession(), expected).toTestTypes(); } catch (RuntimeException ex) { fail("Execution of 'expected' query failed: " + expected, ex); } assertEquals(actualResults.getTypes(), expectedResults.getTypes(), "Types mismatch for query: \n " + actual + "\n:"); List<MaterializedRow> actualRows = actualResults.getMaterializedRows(); List<MaterializedRow> expectedRows = expectedResults.getMaterializedRows(); if (ensureOrdering) { if (!actualRows.equals(expectedRows)) { assertEquals(actualRows, expectedRows, "For query: \n " + actual + "\n:"); } } else { assertEqualsIgnoreOrder(actualRows, expectedRows, "For query: \n " + actual); } }
Source:
<code>public List<PartitionDescProto> getAllPartitions(final String tableName) { final BlockingInterface stub = conn.getTMStub(); GetPartitionsResponse response; try { response = stub.getPartitionsByTableName(null, conn.getSessionedString(tableName)); } catch (ServiceException e) { throw new RuntimeException(e); } <START> ensureOk(response.getState()); <END> return response.getPartitionList(); }</code><technical_language>UndefinedTableException UndefinedDatabaseException handled. exceptions thrown AbstractDBStore</technical_language>

Target:
public List<PartitionDescProto> getAllPartitions(final String tableName) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException { final BlockingInterface stub = conn.getTMStub(); PartitionListResponse response; try { response = stub.getPartitionsByTableName(null, conn.getSessionedString(tableName)); } catch (ServiceException e) { throw new RuntimeException(e); } throwsIfThisError(response.getState(), UndefinedDatabaseException.class); throwsIfThisError(response.getState(), UndefinedTableException.class); throwsIfThisError(response.getState(), UndefinedPartitionMethodException.class); ensureOk(response.getState()); return response.getPartitionList(); }
Source:
<code>public void get() { ToSolverConfig toSolverConfigModel = new ToSolverConfig( getSolverConfigModel() ); SolverConfig solverConfig = toSolverConfigModel.get(); <START> assertEquals( Long.valueOf( 1 ), solverConfig.getTerminationConfig().getMillisecondsSpentLimit() ); <END> assertEquals( 1, solverConfig.getTerminationConfig().getTerminationConfigList().size() ); assertEquals( Boolean.TRUE, solverConfig.getTerminationConfig().getTerminationConfigList().get( 0 ).getBestScoreFeasible() ); assertEquals( "testKsession", solverConfig.getScoreDirectorFactoryConfig().getKsessionName() ); assertEquals( ScoreDefinitionType.HARD_SOFT, solverConfig.getScoreDirectorFactoryConfig().getScoreDefinitionType() ); assertEquals( 1, solverConfig.getPhaseConfigList().size() ); ConstructionHeuristicPhaseConfig constructionHeuristicPhaseConfig = (ConstructionHeuristicPhaseConfig) solverConfig.getPhaseConfigList().get( 0 ); assertEquals( ConstructionHeuristicType.FIRST_FIT, constructionHeuristicPhaseConfig.getConstructionHeuristicType() ); }</code><technical_language>IMO, easier read assigning solverConfig.getTerminationConfig() a local variable</technical_language>

Target:
public void get() { ToSolverConfig toSolverConfigModel = new ToSolverConfig( getSolverConfigModel() ); SolverConfig solverConfig = toSolverConfigModel.get(); TerminationConfig terminationConfig = solverConfig.getTerminationConfig(); assertEquals( Long.valueOf( 1 ), terminationConfig.getMillisecondsSpentLimit() ); assertEquals( 1, terminationConfig.getTerminationConfigList().size() ); assertEquals( Boolean.TRUE, terminationConfig.getTerminationConfigList().get( 0 ).getBestScoreFeasible() ); assertEquals( "testKsession", solverConfig.getScoreDirectorFactoryConfig().getKsessionName() ); assertEquals( ScoreDefinitionType.HARD_SOFT, solverConfig.getScoreDirectorFactoryConfig().getScoreDefinitionType() ); assertEquals( 1, solverConfig.getPhaseConfigList().size() ); ConstructionHeuristicPhaseConfig constructionHeuristicPhaseConfig = (ConstructionHeuristicPhaseConfig) solverConfig.getPhaseConfigList().get( 0 ); assertEquals( ConstructionHeuristicType.FIRST_FIT, constructionHeuristicPhaseConfig.getConstructionHeuristicType() ); }
Source:
<code>public static void showNoGpsDialog(Activity activity, DialogInterface.OnClickListener onChange, DialogInterface.OnCancelListener onCancel) { AlertDialogFactory factory = new AlertDialogFactory(activity, activity.getString(R.string.no_gps_title), activity.getString(R.string.no_gps_message)); factory.setPositiveButton(activity.getString(R.string.change_settings), onChange); factory.setNegativeButton(activity.getString(R.string.cancel), onChange); if (onCancel != null) { factory.makeCancelable(); factory.setOnCancelListener(onCancel); } if (activity instanceof CommCareActivity) { ((CommCareActivity)activity).showAlertDialog(factory); } else { <START> factory.showDialog(); <END> } }</code><technical_language>Add a note in this case dialog persisted orientation changes</technical_language>

Target:
public static void showNoGpsDialog(Activity activity, DialogInterface.OnClickListener onChange, DialogInterface.OnCancelListener onCancel) { AlertDialogFactory factory = setupAlertFactory(activity, onChange, onCancel); factory.showDialog(); }
Source:
<code><START> public static Scheduler currentThread() { <END> Scheduler scheduler = RxAndroidPlugins.getInstance().getSchedulersHook().getCurrentThreadScheduler(); return scheduler != null ? scheduler : new HandlerScheduler(new Handler(Looper.myLooper())); }</code><technical_language>more tests: 1. For a Thread Looper check picks looper runs code thread. 2. For a Thread Looper fails create handler thread called Looper.prepare()</technical_language>

Target:
public static Scheduler currentThread() { Scheduler scheduler = RxAndroidPlugins.getInstance().getSchedulersHook().getCurrentThreadScheduler(); return scheduler != null ? scheduler : getCurrentThreadScheduler(); }
Source:
<code>private void dereferencePage(SerializedPage pageSplit, Lifespan lifespan) { long outstandingPageCount = outstandingPageCountPerLifespan.get(lifespan).decrementAndGet(); if (outstandingPageCount == 0 && noMorePagesForLifespan.contains(lifespan)) { <START> checkState(lifespanCompletionCallback != null); <END> lifespanCompletionCallback.accept(lifespan); } memoryManager.updateMemoryUsage(-pageSplit.getRetainedSizeInBytes()); }</code><technical_language>Please add a message in case fais</technical_language>

Target:
private void dereferencePage(SerializedPage pageSplit, Lifespan lifespan) { long outstandingPageCount = outstandingPageCountPerLifespan.get(lifespan).decrementAndGet(); if (outstandingPageCount == 0 && noMorePagesForLifespan.contains(lifespan)) { checkState(lifespanCompletionCallback != null, "lifespanCompletionCallback is not null"); lifespanCompletionCallback.accept(lifespan); } memoryManager.updateMemoryUsage(-pageSplit.getRetainedSizeInBytes()); }
Source:
<code>public final void createsFakeWithParams() throws IOException { final String key = "key"; final String akey = "anotherkey"; final String value = "value"; <START> final String avalue = "anothervalue"; <END> final String aavalue = "againanothervalue"; final RqForm req = new RqForm.Fake( new RqFake(), key, value, key, avalue, akey, aavalue ); MatcherAssert.assertThat( req.param(key), Matchers.hasItems(value, avalue) ); MatcherAssert.assertThat( req.param(akey), Matchers.hasItems(aavalue) ); MatcherAssert.assertThat( req.names(), Matchers.hasItems(key, akey) ); }</code><technical_language>@mbarbieri try a&b instead of anothervalue test fail</technical_language>

Target:
public final void createsFakeWithParams() throws IOException { final String key = "key"; final String akey = "anotherkey"; final String value = "value"; final String avalue = "a&b"; final String aavalue = "againanothervalue"; final RqForm req = new RqForm.Fake( new RqFake(), key, value, key, avalue, akey, aavalue ); MatcherAssert.assertThat( req.param(key), Matchers.hasItems(value, avalue) ); MatcherAssert.assertThat( req.param(akey), Matchers.hasItems(aavalue) ); MatcherAssert.assertThat( req.names(), Matchers.hasItems(key, akey) ); }
Source:
<code>private void addChatMessage(final String originalMessage, final String from) { final String message = Ascii.truncate(originalMessage, 200, "..."); <START> final String fullMessage = from + ": " + " " + message + "\n"; <END> final String currentAllText = allText.toString(); if (currentAllText.length() > MAX_LENGTH) { allText = new StringBuilder(currentAllText.substring(MAX_LENGTH / 2)); } allText.append(fullMessage); }</code><technical_language>Ok, this is I get. is this feature removed here</technical_language>

Target:
private void addChatMessage(final String originalMessage, final String from) { final String currentAllText = allText.toString(); if (currentAllText.length() > MAX_LENGTH) { allText = new StringBuilder(currentAllText.substring(MAX_LENGTH / 2)); } final String message = Ascii.truncate(originalMessage, 200, "..."); final String fullMessage = String.format("(%s) %s: %s\n", TimeManager.getLocalizedTime(), from, message); allText.append(fullMessage); }
Source:
<code>protected void processTrap() { validate(); m_trapProcessor.setVersion(getVersion()); m_trapProcessor.setCommunity(getCommunity()); m_trapProcessor.setAgentAddress(getAgentAddress()); m_trapProcessor.setTrapAddress(getTrapAddress()); LOG.debug("{} trap - trapInterface: ()", getVersion(), getTrapAddress()); m_trapProcessor.setTimeStamp(getTimeStamp()); m_trapProcessor.setTrapIdentity(getTrapIdentity()); int i = 0; try { for (i = 0; i < getPduLength(); i++) { processVarBindAt(i); } } catch (RuntimeException rte) { <START> LOG.error("Caught while processing varbind of trap; rethrowing. Trap info: {}", rte.getClass(), i+1, toString()); <END> throw rte; } }</code><technical_language>I change this a catch(Throwable) log Throwable's stack trace this sort of exception highly unexpected</technical_language>

Target:
protected void processTrap() { validate(); m_trapProcessor.setVersion(getVersion()); m_trapProcessor.setCommunity(getCommunity()); m_trapProcessor.setAgentAddress(getAgentAddress()); m_trapProcessor.setTrapAddress(getTrapAddress()); LOG.debug("{} trap - trapInterface: ()", getVersion(), getTrapAddress()); m_trapProcessor.setTimeStamp(getTimeStamp()); m_trapProcessor.setTrapIdentity(getTrapIdentity()); int i = 0; try { for (i = 0; i < getPduLength(); i++) { processVarBindAt(i); } } catch (Throwable t) { LOG.error("Caught while processing varbind of trap; rethrowing. Trap info: {}. Stack trace: {}", t.getClass(), i+1, toString(), t.getStackTrace()); throw t; } }
Source:
<code>public M2ServletContextListener() { Path tempDir = null; try { tempDir = Files.createTempDirectory("pom-extract"); } catch (IOException e) { <START> } <END> this.tempDir = tempDir; }</code><technical_language>log error</technical_language>

Target:
public M2ServletContextListener() { Path tempDir = null; try { tempDir = Files.createTempDirectory("pom-extract"); } catch (IOException e) { logger.error(e.getMessage(), e); } this.tempDir = tempDir; }
Source:
<code>protected void invoke(Object session, InvocationContext ctx, RemoveCommand command) { CompletableFuture<Object> future = invoker.invokeAsync(ctx, command); if (!command.hasAnyFlag(FlagBitSets.FORCE_WRITE_LOCK)) { Sync sync = (Sync)((SharedSessionContractImplementor) session).getCacheTransactionSynchronization(); sync.registerBeforeCommit(future); } else { log.trace("Removal was not applied immediatelly, waiting."); <START> future.join(); <END> } }</code><technical_language>long this wait for? Endlessly</technical_language>

Target:
protected void invoke(Object session, InvocationContext ctx, RemoveCommand command) { CompletableFuture<Object> future = invoker.invokeAsync(ctx, command); if (!command.hasAnyFlag(FlagBitSets.FORCE_WRITE_LOCK)) { Sync sync = (Sync)((SharedSessionContractImplementor) session).getCacheTransactionSynchronization(); sync.registerBeforeCommit(future); } else { log.trace("Removal was not applied immediately, waiting."); future.join(); } }