auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private BlobId(DataInputStream stream, ClusterMap clusterMap, boolean ensureFullyRead) throws IOException { <START> this.version = stream.readShort(); <END> switch (version) { case BLOB_ID_V1: flag = DEFAULT_FLAG; datacenterId = LEGACY_DATACENTER_ID; accountId = LEGACY_ACCOUNT_ID; containerId = LEGACY_CONTAINER_ID; break; case BLOB_ID_V2: flag = stream.readByte(); datacenterId = stream.readByte(); accountId = stream.readShort(); containerId = stream.readShort(); break; default: throw new IllegalArgumentException("blobId version " + version + " not supported."); } partitionId = clusterMap.getPartitionIdFromStream(stream); if (partitionId == null) { throw new IllegalArgumentException("Partition ID cannot be null"); } uuid = Utils.readIntString(stream); if (ensureFullyRead && stream.read() != -1) { throw new IllegalArgumentException("Stream should have no more available bytes to read"); } }</code><technical_language>minor: need this</technical_language>

Target:
private BlobId(DataInputStream stream, ClusterMap clusterMap, boolean ensureFullyRead) throws IOException { version = stream.readShort(); switch (version) { case BLOB_ID_V1: flag = DEFAULT_FLAG; datacenterId = UNKNOWN_DATACENTER_ID; accountId = UNKNOWN_ACCOUNT_ID; containerId = UNKNOWN_CONTAINER_ID; break; case BLOB_ID_V2: flag = stream.readByte(); datacenterId = stream.readByte(); accountId = stream.readShort(); containerId = stream.readShort(); break; default: throw new IllegalArgumentException("blobId version " + version + " not supported."); } partitionId = clusterMap.getPartitionIdFromStream(stream); if (partitionId == null) { throw new IllegalArgumentException("Partition ID cannot be null"); } uuid = Utils.readIntString(stream); if (ensureFullyRead && stream.read() != -1) { throw new IllegalArgumentException("Stream should have no more available bytes to read"); } }
Source:
<code>public Integer getConnectTimeoutOrDefault() { <START> if (Objects.isNull(connectTimeout)) { <END> return defaultConnectTimeout; } return connectTimeout; }</code><technical_language>suggestion if (null == connectTimeout) {</technical_language>

Target:
public Integer getConnectTimeoutOrDefault() { if (null == connectTimeout) { return defaultConnectTimeout; } return connectTimeout; }
Source:
<code><START> public static String remapFieldName(Class<?> clazz, String fieldName) <END> { String internalClassName = FMLDeobfuscatingRemapper.INSTANCE.unmap(Type.getInternalName(clazz)); return FMLDeobfuscatingRemapper.INSTANCE.mapFieldName(internalClassName, fieldName, null); }</code><technical_language>more clear this is supposed srg name naming "fieldSrgName"? (and for methods)</technical_language>

Target:
private static String remapFieldName(Class<?> clazz, String fieldName) { String internalClassName = FMLDeobfuscatingRemapper.INSTANCE.unmap(Type.getInternalName(clazz)); return FMLDeobfuscatingRemapper.INSTANCE.mapFieldName(internalClassName, fieldName, null); }
Source:
<code><START> public LoggerHandler() <END></code><technical_language>is required</technical_language>

Target:
public LoggerHandler() { ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor(); exec.scheduleWithFixedDelay( new Runnable() { @Override public void run() { extensions = null; } }, 1, REFRESH_INTERVAL_IN_SECONDS, TimeUnit.SECONDS ); }
Source:
<code>public static Map<String,String> toMap(List<EnvironmentProperty> properties) { if (properties != null) { final Map<String, String> result = new LinkedHashMap<String, String>(); for (EnvironmentProperty property:properties) { result.put(property.getName(), property.getValue()); } return result; } <START> return null; <END> }</code><technical_language>return Empty Map, callers need check</technical_language>

Target:
public static Map<String,String> toMap(List<EnvironmentProperty> properties) { final Map<String, String> result = new LinkedHashMap<String, String>(); if (properties != null) { for (EnvironmentProperty property:properties) { result.put(property.getName(), property.getValue()); } return result; } return result; }
Source:
<code>private void setEEfromBuild(Bndrun run) { String runee = run.getProperty(Constants.RUNEE); if (runee == null) { Optional.ofNullable(project.getPlugin("org.apache.maven.plugins:maven-compiler-plugin")) .map(Plugin::getConfiguration) .map(Xpp3Dom.class::cast) .map(dom -> dom.getChild("target")) .map(Xpp3Dom::getValue) <START> .map(EE::highestFromTargetVersion) <END> .map(Optional::get) .ifPresent(ee -> run.setProperty(Constants.RUNEE, ee.getEEName())); } }</code><technical_language>This needs a flatMap method returns Optional. need .map(Optional::get) :-)</technical_language>

Target:
private void setEEfromBuild(Bndrun run) { String runee = run.getProperty(Constants.RUNEE); if (runee == null) { Optional.ofNullable(project.getPlugin("org.apache.maven.plugins:maven-compiler-plugin")) .map(Plugin::getConfiguration) .map(Xpp3Dom.class::cast) .map(dom -> dom.getChild("target")) .map(Xpp3Dom::getValue) .flatMap(EE::highestFromTargetVersion) .ifPresent(ee -> run.setProperty(Constants.RUNEE, ee.getEEName())); } }
Source:
<code><START> public Map<String, Object> getApplicationPropertiesMap(boolean createIfAbsent) { <END> ApplicationProperties appMap = lazyDecodeApplicationProperties(); Map<String, Object> map = null; if (appMap != null) { map = appMap.getValue(); } if (map == null) { if (createIfAbsent) { map = new HashMap<>(); this.applicationProperties = new ApplicationProperties(map); } else { map = Collections.EMPTY_MAP; } } return map; }</code><technical_language>This wasnt public prevent people screwing map , for of immutable message sections, knowledge of message object, screw up. Exposing unwise (and appears glance unecessary additional reference of method exist diff)</technical_language>

Target:
protected Map<String, Object> getApplicationPropertiesMap(boolean createIfAbsent) { ApplicationProperties appMap = lazyDecodeApplicationProperties(); Map<String, Object> map = null; if (appMap != null) { map = appMap.getValue(); } if (map == null) { if (createIfAbsent) { map = new HashMap<>(); this.applicationProperties = new ApplicationProperties(map); } else { map = Collections.EMPTY_MAP; } } return map; }
Source:
<code>public Official getOfficialById(int id) { EntityManager entityManager = entityManagerFactory.createEntityManager(); EntityTransaction transaction = entityManager.getTransaction(); transaction.begin(); <START> TypedQuery<Official> query = entityManager.createQuery("from Official p where p.member_id = " + id, Official.class); <END> Official official = query.getSingleResult(); transaction.commit(); entityManager.close(); return official; }</code><technical_language>parameter binding is preferred avoid sql injection</technical_language>

Target:
public Official getOfficialById(int id) { EntityManager entityManager = entityManagerFactory.createEntityManager(); EntityTransaction transaction = entityManager.getTransaction(); transaction.begin(); TypedQuery<Official> query = entityManager.createQuery("from Official p where p.member_id = :id", Official.class); query.setParameter("id", id); Official official = query.getSingleResult(); transaction.commit(); entityManager.close(); return official; }
Source:
<code>public List<String> getDependencies() { <START> return Collections.singletonList(A_R_projectsBasePath); <END> }</code><technical_language>Is reason A_GR_projectName is missing there</technical_language>

Target:
public List<String> getDependencies() { List<String> dependencies = new ArrayList<>(); dependencies.add(A_GR_projectName); dependencies.add(A_R_projectsBasePath); return dependencies; }
Source:
<code>public void testDynamicColor() throws CQLException { Expression color = toExpression("if_then_else(equalTo(field, 1), '#8080C0', '#CC8030')"); Stroke stroke = styleFactory.stroke(color, null, null, null, null, null, null); Fill fill = styleFactory.fill(null, color, null ); Mark mark = styleFactory.mark(toExpression("circle"), fill, stroke); Graphic graphic = styleFactory.graphic( Collections.singletonList(mark),null, null, null, null, null); PointSymbolizer symbolizer = styleFactory.pointSymbolizer("symbolizer", toExpression("geom"), null, null, graphic ); final Style s = styleFromRules(catchAllRule(symbolizer)); assertEquals("0.0.0=&0.0.0.fill.color=%238080C0&0.0.0.name=&0.0.0.stroke.color=%238080C0", encode(s, fieldIs1)); <START> assertEquals("0.0.0=&0.0.0.fill.color=C08030&0.0.0.name=&0.0.0.stroke.color=C08030", encode(s, fieldIs2)); <END> }</code><technical_language>Hmm... honestly? failing: Failed tests: testDynamicColor(org.geoserver.kml.icons.IconPropertiesTest): expected:<...0=&0.0.0.fill.color=[C08030&0.0.0.name=&0.0.0.stroke.color=C0]8030> was:<...0=&0.0.0.fill.color=[%23CC8030&0.0.0.name=&0.0.0.stroke.color=%23CC]8030> Check icon server expectations (was written me)</technical_language>

Target:
public void testDynamicColor() throws CQLException { Expression color = toExpression("if_then_else(equalTo(field, 1), '#8080C0', '#CC8030')"); Stroke stroke = styleFactory.stroke(color, null, null, null, null, null, null); Fill fill = styleFactory.fill(null, color, null); Mark mark = styleFactory.mark(toExpression("circle"), fill, stroke); Graphic graphic = styleFactory.graphic(Collections.singletonList(mark), null, null, null, null, null); PointSymbolizer symbolizer = styleFactory.pointSymbolizer( "symbolizer", toExpression("geom"), null, null, graphic); final Style s = styleFromRules(catchAllRule(symbolizer)); assertEquals( "0.0.0=&0.0.0.fill.color=%238080C0&0.0.0.name=&0.0.0.stroke.color=%238080C0", encode(s, fieldIs1)); assertEquals( "0.0.0=&0.0.0.fill.color=%23CC8030&0.0.0.name=&0.0.0.stroke.color=%23CC8030", encode(s, fieldIs2)); }
Source:
<code>private String convertDaysToMidnightTimestamp(String columnName) { <START> return format("(CAST (%s AS BIGINT) * %s)", columnName, TimeUnit.DAYS.toMillis(1)); <END> }</code><technical_language>static import for days</technical_language>

Target:
private String convertDaysToMidnightTimestamp(String columnName) { return format("(CAST (%s AS BIGINT) * %s)", columnName, DAYS.toMillis(1)); }
Source:
<code>default <U extends T> CompletableFuture<T> toCompletableFuture() { <START> return CompletableFuture.completedFuture(Boolean.TRUE).thenApply(t -> get()); <END> }</code><technical_language>This is a good handle exceptions in CompletionStage. However, mentioned below, sense handle Try.NonFatalException in a special way. FatalException NonFatalException created of a Try, control is safe unbox them. I.e. purpose is wrap exceptions in a RuntimeException. I code this: java final CompletableFuture<T> completableFuture = new CompletableFuture<>(); try { completableFuture.complete(get()); } catch(Try.FatalException x) { throw x; } catch(Try.NonFatalException x) { completableFuture.completeExceptionally(x.getCause()); } catch(Throwable x) { completableFuture.completeExceptionally(x); } return completableFuture;</technical_language>

Target:
default <U extends T> CompletableFuture<T> toCompletableFuture() { final CompletableFuture<T> completableFuture = new CompletableFuture<>(); try { completableFuture.complete(get()); } catch (Try.FatalException x) { throw x; } catch (Try.NonFatalException x) { completableFuture.completeExceptionally(x.getCause()); } catch (Throwable x) { completableFuture.completeExceptionally(x); } return completableFuture; }
Source:
<code>public static int getNumberOfColumns(FormEntryPrompt formEntryPrompt, Context context) { int numColumns = 1; String appearance = getAppearance(formEntryPrompt); if (appearance.contains(COLUMNS_N) || appearance.contains(COMPACT_N)) { try { String columnsAppearance = appearance.contains(COLUMNS_N) ? COLUMNS_N : COMPACT_N; <START> if (appearance.contains(columnsAppearance)) { <END> try { appearance = appearance.substring(appearance.indexOf(columnsAppearance), appearance.length()); int idx = appearance.indexOf(columnsAppearance); if (idx != -1) { String substringFromNumColumns = appearance.substring(idx + columnsAppearance.length()); numColumns = Integer.parseInt(substringFromNumColumns.substring(0, substringFromNumColumns.contains(" ") ? substringFromNumColumns.indexOf(' ') : substringFromNumColumns.length())); } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } else if (appearance.contains(COLUMNS)) { switch (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) { case Configuration.SCREENLAYOUT_SIZE_SMALL: numColumns = 2; break; case Configuration.SCREENLAYOUT_SIZE_NORMAL: numColumns = 3; break; case Configuration.SCREENLAYOUT_SIZE_LARGE: numColumns = 4; break; case Configuration.SCREENLAYOUT_SIZE_XLARGE: numColumns = 5; break; default: numColumns = 3; } } return numColumns; }</code><technical_language>I this check is necessary top-level conditional</technical_language>

Target:
public static int getNumberOfColumns(FormEntryPrompt formEntryPrompt, Context context) { int numColumns = 1; String appearance = getSanitizedAppearanceHint(formEntryPrompt); if (appearance.contains(COLUMNS_N) || appearance.contains(COMPACT_N)) { try { String columnsAppearance = appearance.contains(COLUMNS_N) ? COLUMNS_N : COMPACT_N; try { appearance = appearance.substring(appearance.indexOf(columnsAppearance)); int idx = appearance.indexOf(columnsAppearance); if (idx != -1) { String substringFromNumColumns = appearance.substring(idx + columnsAppearance.length()); numColumns = Integer.parseInt(substringFromNumColumns.substring(0, substringFromNumColumns.contains(" ") ? substringFromNumColumns.indexOf(' ') : substringFromNumColumns.length())); } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } else if (appearance.contains(COLUMNS)) { switch (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) { case Configuration.SCREENLAYOUT_SIZE_SMALL: numColumns = 2; break; case Configuration.SCREENLAYOUT_SIZE_NORMAL: numColumns = 3; break; case Configuration.SCREENLAYOUT_SIZE_LARGE: numColumns = 4; break; case Configuration.SCREENLAYOUT_SIZE_XLARGE: numColumns = 5; break; default: numColumns = 3; } } return numColumns; }
Source:
<code><START> public HDPath extend(ChildNumber child1, ChildNumber child2) { <END> List<ChildNumber> mutable = new ArrayList<>(this.unmodifiableList); mutable.add(child1); mutable.add(child2); return new HDPath(mutable); }</code><technical_language>nitpick: (style) this follow extend(ChildNumber child) method</technical_language>

Target:
public HDPath extend(ChildNumber child1, ChildNumber child2) { List<ChildNumber> mutable = new ArrayList<>(this.unmodifiableList); mutable.add(child1); mutable.add(child2); return new HDPath(this.hasPrivateKey, mutable); }
Source:
<code>public void parseParentPom(File file) { try { <START> parseParentPom(new FileInputStream(file)); <END> } catch (FileNotFoundException ex) { LOGGER.error("Error while opening parent POM file", ex); } }</code><technical_language>close streams</technical_language>

Target:
public void parseParentPom(File file) { try (FileInputStream fileInputStream = new FileInputStream(file)) { parseParentPom(fileInputStream); } catch (IOException ex) { LOGGER.error("Error while reading parent POM file", ex); } }
Source:
<code>public PathInfo flush(long position, boolean overwrite) { <START> DataLakeRequestConditions requestConditions = null; <END> if (!overwrite) { requestConditions = new DataLakeRequestConditions().setIfNoneMatch(Constants.HeaderConstants.ETAG_WILDCARD); } return flushWithResponse(position, false, false, null, requestConditions, null, Context.NONE).getValue(); }</code><technical_language>this instantiate a new DataLakeRequestConditions? other places instantiate instead of leaving null</technical_language>

Target:
public PathInfo flush(long position, boolean overwrite) { DataLakeRequestConditions requestConditions = new DataLakeRequestConditions(); if (!overwrite) { requestConditions = new DataLakeRequestConditions().setIfNoneMatch(Constants.HeaderConstants.ETAG_WILDCARD); } return flushWithResponse(position, false, false, null, requestConditions, null, Context.NONE).getValue(); }
Source:
<code>public Model read(InputStream input, Map<String, ?> options) throws IOException, ModelParseException { String location = PolyglotModelUtil.getLocation(options); String fixLocation = fixLocation(location); File file = new File(fixLocation); if (!fixLocation.equals(location)) { <START> try (InputStreamReader stream = new InputStreamReader(new FileInputStream(file), <END> getPrimaryArtifactCharset())) { return read(stream, file, options); } } try (InputStreamReader stream = new InputStreamReader(input, getPrimaryArtifactCharset())) { return read(stream, file, options); } }</code><technical_language>Thinking a bit more I close original stream first. input.close(); create a new input = new FileInputStream(file); closed try { } finally { } mentioned below</technical_language>

Target:
public Model read(InputStream input, Map<String, ?> options) throws IOException, ModelParseException { String location = PolyglotModelUtil.getLocation(options); String fixLocation = fixLocation(location); File file = new File(fixLocation); if (!fixLocation.equals(location)) { input.close(); try (InputStreamReader stream = new InputStreamReader(new FileInputStream(file), getPrimaryArtifactCharset())) { return read(stream, file, options); } } try (InputStreamReader stream = new InputStreamReader(input, getPrimaryArtifactCharset())) { return read(stream, file, options); } }
Source:
<code>public boolean isSoftLimitReached(Guid volumeId) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume != null) { GlusterVolumeSnapshotConfig config = getGlusterVolumeSnapshotConfigDao().getConfigByClusterIdAndName(volume.getClusterId(), "snap-max-soft-limit"); if (config != null) { String configValue = config.getParamValue(); <START> if (configValue.endsWith("%")) { <END> configValue = configValue.substring(0, configValue.length() - 1); } int snapMaxSoftLimitPcnt = Integer.parseInt(configValue); int snapshotCount = volume.getSnapshotsCount(); int snapMaxLimit = volume.getSnapMaxLimit(); return snapshotCount >= (snapMaxLimit * snapMaxSoftLimitPcnt) / 100; } } return false; }</code><technical_language>replaced String configValue = StringUtils.removeEnd(config.getParamValue(), "%") basically same</technical_language>

Target:
public boolean isSoftLimitReached(Guid volumeId) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume != null) { GlusterVolumeSnapshotConfig config = getGlusterVolumeSnapshotConfigDao().getConfigByClusterIdAndName(volume.getClusterId(), "snap-max-soft-limit"); if (config != null) { String configValue = StringUtils.removeEnd(config.getParamValue(), "%"); int snapMaxSoftLimitPcnt = Integer.parseInt(configValue); int snapshotCount = volume.getSnapshotsCount(); int snapMaxLimit = volume.getSnapMaxLimit(); return snapshotCount >= (snapMaxLimit * snapMaxSoftLimitPcnt) / 100; } } return false; }
Source:
<code><START> private Event getNextEvent(List<Event> listEvents) { <END> if (listEvents == null || listEvents.size() == 0) { return null; } Event ret = listEvents.get(0); for (Event e : listEvents) { if (e.getStart().isBefore(ret.getStart())) { ret = e; } } return ret; }</code><technical_language>please put a line break methods</technical_language>

Target:
private Event getNextEvent(List<Event> listEvents) { if (listEvents == null || listEvents.size() == 0) { return null; } Event ret = null; for (Event e : listEvents) { if (e.getStart().isAfterNow()) { if (ret == null) { ret = e; } else { if (e.getStart().isBefore(ret.getStart())) { ret = e; } } } } return ret; }
Source:
<code>public static Stream<DocumentWriteOperation> from(Stream<? extends AbstractWriteHandle> content, final DocumentUriMaker uriMaker) { final class DocumentWriteOperationImpl implements DocumentWriteOperation { public DocumentWriteOperationImpl(AbstractWriteHandle content, String uri) { this.content = content; this.uri = uri; } private AbstractWriteHandle content; <START> private String uri; <END> @Override public OperationType getOperationType() { return null; } @Override public String getUri() { return uri; } @Override public DocumentMetadataWriteHandle getMetadata() { return null; } @Override public AbstractWriteHandle getContent() { return content; } @Override public String getTemporalDocumentURI() { return null; } } final class WrapperImpl { DocumentWriteOperation mapper(AbstractWriteHandle content) { String uri = uriMaker.apply(content); if (uri == null) throw new MarkLogicInternalException("Uri could not be created"); return new DocumentWriteOperationImpl(content, uri); } } WrapperImpl wrapperImpl = new WrapperImpl(); return content.map(wrapperImpl::mapper); }</code><technical_language>For consistency readability, fields move top of class (that is, constructor)</technical_language>

Target:
public static Stream<DocumentWriteOperation> from(Stream<? extends AbstractWriteHandle> content, final DocumentUriMaker uriMaker) { if(content == null || uriMaker == null) throw new IllegalArgumentException("Content and/or Uri maker cannot be null"); final class DocumentWriteOperationImpl implements DocumentWriteOperation { private AbstractWriteHandle content; private String uri; public DocumentWriteOperationImpl(AbstractWriteHandle content, String uri) { this.content = content; this.uri = uri; } @Override public OperationType getOperationType() { return null; } @Override public String getUri() { return uri; } @Override public DocumentMetadataWriteHandle getMetadata() { return null; } @Override public AbstractWriteHandle getContent() { return content; } @Override public String getTemporalDocumentURI() { return null; } } final class WrapperImpl { private DocumentUriMaker docUriMaker; WrapperImpl(DocumentUriMaker uriMaker){ this.docUriMaker = uriMaker; } DocumentWriteOperation mapper(AbstractWriteHandle content) { String uri = docUriMaker.apply(content); if (uri == null) throw new MarkLogicInternalException("Uri could not be created"); return new DocumentWriteOperationImpl(content, uri); } } WrapperImpl wrapperImpl = new WrapperImpl(uriMaker); return content.map(wrapperImpl::mapper); }
Source:
<code>public void applyTitle(final String title, <START> final MutationContext mutationContext) { <END> if (title != null && title.trim().length() > 0 && getShapeView() instanceof HasTitle) { final HasTitle hasTitle = (HasTitle) getShapeView(); hasTitle.setTitle(title); hasTitle.refreshTitle(); } }</code><technical_language>mutationContext parameter is in this Class (but in 8 method declaration). I suppose add this parameter in future easier clean it</technical_language>

Target:
public void applyTitle(final String title, final MutationContext mutationContext) { if (title != null && getShapeView() instanceof HasTitle) { final HasTitle hasTitle = (HasTitle) getShapeView(); hasTitle.setTitle(title); hasTitle.refreshTitle(); } }
Source:
<code>protected void completeRequest(BlockReadRequestContext context) throws Exception { BlockReader reader = null; try { reader = context.getBlockReader(); if (reader != null) { reader.close(); } } finally { if (!mWorker.unlockBlock(context.getRequest().getSessionId(), context.getRequest().getId())) { if (reader != null) { mWorker.closeUfsBlock(context.getRequest().getSessionId(), context.getRequest().getId()); context.setBlockReader(null); <START> } <END> } } }</code><technical_language>Is a functional change here, lose error message of failing close block reader</technical_language>

Target:
protected void completeRequest(BlockReadRequestContext context) throws Exception { BlockReader reader = null; try { reader = context.getBlockReader(); if (reader != null) { reader.close(); } } catch (Exception e) { LOG.warn("Failed to close block reader for block with error {}.", context.getRequest().getId(), e.getMessage()); } finally { if (!mWorker.unlockBlock(context.getRequest().getSessionId(), context.getRequest().getId())) { if (reader != null) { mWorker.closeUfsBlock(context.getRequest().getSessionId(), context.getRequest().getId()); context.setBlockReader(null); } } } }
Source:
<code>public KubernetesClientException asClientException() { final Throwable cause = getCause(); <START> return getCause() instanceof KubernetesClientException ? <END> (KubernetesClientException) cause : new KubernetesClientException(getMessage(), cause); }</code><technical_language>suggestion return instanceof KubernetesClientException</technical_language>

Target:
public KubernetesClientException asClientException() { final Throwable cause = getCause(); return cause instanceof KubernetesClientException ? (KubernetesClientException) cause : new KubernetesClientException(getMessage(), cause); }
Source:
<code><START> public ShardSpecLookup getLookup(final List<ShardSpec> shardSpecs) <END> { final ImmutableMap.Builder<Integer, ShardSpec> shardSpecsMapBuilder = ImmutableMap.builder(); for (ShardSpec spec : shardSpecs) { shardSpecsMapBuilder.put(spec.getPartitionNum(), spec); } final Map<Integer, ShardSpec> shardSpecMap = shardSpecsMapBuilder.build(); return new ShardSpecLookup() { @Override public ShardSpec getShardSpec(InputRow row) { return shardSpecMap.get((long) hash(row) % getPartitions()); } }; }</code><technical_language>if this arraylist, pull list avoid map</technical_language>

Target:
public ShardSpecLookup getLookup(final List<ShardSpec> shardSpecs) { return new ShardSpecLookup() { @Override public ShardSpec getShardSpec(InputRow row) { int index = Math.abs(hash(row) % getPartitions()); return shardSpecs.get(index); } }; }
Source:
<code>private MemoryStoreImpl(final HTrace hTrace, final OperationRouter<Long> router, final BlockResolver<Long> blockResolver, final RemoteOpHandler<Long> remoteOpHandler, @Parameter(NumStoreThreads.class) final int numStoreThreads) { hTrace.initialize(); this.router = router; this.blockResolver = blockResolver; this.remoteOpHandler = remoteOpHandler; <START> for (final int blockId : router.getInitialLocalBlockIds()) { <END> blocks.put(blockId, new Block()); } initExecutor(numStoreThreads); }</code><technical_language>initBlocks() this.blocks = initBlocks()</technical_language>

Target:
private MemoryStoreImpl(final HTrace hTrace, final OperationRouter<Long> router, final BlockResolver<Long> blockResolver, final RemoteOpHandler<Long> remoteOpHandler, @Parameter(NumStoreThreads.class) final int numStoreThreads) { hTrace.initialize(); this.router = router; this.blockResolver = blockResolver; this.remoteOpHandler = remoteOpHandler; initBlocks(); initExecutor(numStoreThreads); }
Source:
<code>public List<DocumentRevision> call(SQLDatabase db) throws Exception { String sql = String.format("SELECT " + DatastoreImpl.FULL_DOCUMENT_COLS + " FROM revs, docs" + " WHERE docid IN ( %1$s ) AND current = 1 AND docs.doc_id = revs" + <START> ".doc_id " + <END> " ORDER BY docs.doc_id ", DatabaseUtils.makePlaceholders(docIds.size ())); String[] args = docIds.toArray(new String[docIds.size()]); List<DocumentRevision> docs = DatastoreImpl.getRevisionsFromRawQuery(db, sql, args, attachmentsDir, attachmentStreamFactory); return DatastoreImpl.sortDocumentsAccordingToIdList(docIds, docs); }</code><technical_language>formatting is a bit weird</technical_language>

Target:
public List<DocumentRevision> call(SQLDatabase db) throws Exception { String sql = String.format("SELECT " + DatastoreImpl.FULL_DOCUMENT_COLS + " FROM revs, docs" + " WHERE docid IN ( %1$s ) AND current = 1 AND docs.doc_id = revs.doc_id " + " ORDER BY docs.doc_id ", DatabaseUtils.makePlaceholders(docIds.size ())); String[] args = docIds.toArray(new String[docIds.size()]); List<DocumentRevision> docs = DatastoreImpl.getRevisionsFromRawQuery(db, sql, args, attachmentsDir, attachmentStreamFactory); return DatastoreImpl.sortDocumentsAccordingToIdList(docIds, docs); }
Source:
<code>public void setTransactionIsolation(int level) throws SQLException { checkClosed(); if (level == Connection.TRANSACTION_NONE) { throw new PSQLException(GT.tr("Transaction isolation level {0} not supported.", "TRANSACTION_NONE"), PSQLState.INVALID_PARAMETER_VALUE); } else if (level == this.isolationLevel && cacheXactState) { return; } <START> if (queryExecutor.getTransactionState() != TransactionState.IDLE) { <END> throw new PSQLException( GT.tr("Cannot change transaction isolation level in the middle of a transaction."), PSQLState.ACTIVE_SQL_TRANSACTION); } String isolationLevelName; switch (level) { case Connection.TRANSACTION_READ_COMMITTED: isolationLevelName = "READ COMMITTED"; break; case Connection.TRANSACTION_SERIALIZABLE: isolationLevelName = "SERIALIZABLE"; break; case Connection.TRANSACTION_REPEATABLE_READ: isolationLevelName = "REPEATABLE READ"; break; case Connection.TRANSACTION_READ_UNCOMMITTED: isolationLevelName = "READ UNCOMMITTED"; break; default: isolationLevelName = null; } if (isolationLevelName == null) { throw new PSQLException(GT.tr("Transaction isolation level {0} not supported.", level), PSQLState.NOT_IMPLEMENTED); } String isolationLevelSQL = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL " + isolationLevelName; execSQLUpdate(isolationLevelSQL); this.isolationLevel = level; LOGGER.log(Level.FINE, " setTransactionIsolation = {0}", isolationLevelName); }</code><technical_language>Is a reason move code around</technical_language>

Target:
public void setTransactionIsolation(int level) throws SQLException { checkClosed(); if (queryExecutor.getTransactionState() != TransactionState.IDLE) { throw new PSQLException( GT.tr("Cannot change transaction isolation level in the middle of a transaction."), PSQLState.ACTIVE_SQL_TRANSACTION); } if (level == Connection.TRANSACTION_NONE) { throw new PSQLException(GT.tr("Transaction isolation level {0} not supported.", "TRANSACTION_NONE"), PSQLState.INVALID_PARAMETER_VALUE); } else if (this.isolationLevel == level && cacheIsolationState) { return; } String isolationLevelName; switch (level) { case Connection.TRANSACTION_READ_COMMITTED: isolationLevelName = "READ COMMITTED"; break; case Connection.TRANSACTION_SERIALIZABLE: isolationLevelName = "SERIALIZABLE"; break; case Connection.TRANSACTION_REPEATABLE_READ: isolationLevelName = "REPEATABLE READ"; break; case Connection.TRANSACTION_READ_UNCOMMITTED: isolationLevelName = "READ UNCOMMITTED"; break; default: isolationLevelName = null; } if (isolationLevelName == null) { throw new PSQLException(GT.tr("Transaction isolation level {0} not supported.", level), PSQLState.NOT_IMPLEMENTED); } String isolationLevelSQL = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL " + isolationLevelName; execSQLUpdate(isolationLevelSQL); this.isolationLevel = level; LOGGER.log(Level.FINE, " setTransactionIsolation = {0}", this.isolationLevel); }
Source:
<code>public void init(FilterConfig config) throws ServletException { <START> encoding = config.getInitParameter("requestEncoding"); <END> if (encoding == null) { encoding = "UTF-8"; } Enumeration enumeration = config.getInitParameterNames(); this.excludePatterns = new LinkedList(); this.maxWaitDurations = new HashMap(); while (enumeration.hasMoreElements()) { String paramName = (String) enumeration.nextElement(); String paramValue = config.getInitParameter(paramName); if (paramName.startsWith("excludePattern")) { Pattern excludePattern = Pattern.compile(paramValue); this.excludePatterns.add(excludePattern); } else if (paramName.startsWith("maxWaitMilliseconds.")) { String durationString = paramName.substring("maxWaitMilliseconds.".length()); int endDuration = durationString.indexOf('.'); if (endDuration != -1) { durationString = durationString.substring(0, endDuration); } Long duration = Long.valueOf(durationString); Pattern waitPattern = Pattern.compile(paramValue); this.maxWaitDurations.put(waitPattern, duration); } } }</code><technical_language>this parameter defined set value? nice if added proper this file</technical_language>

Target:
public void init(FilterConfig config) throws ServletException { Enumeration enumeration = config.getInitParameterNames(); this.excludePatterns = new LinkedList(); this.maxWaitDurations = new HashMap(); while (enumeration.hasMoreElements()) { String paramName = (String) enumeration.nextElement(); String paramValue = config.getInitParameter(paramName); if (paramName.startsWith("excludePattern")) { Pattern excludePattern = Pattern.compile(paramValue); this.excludePatterns.add(excludePattern); } else if (paramName.startsWith("maxWaitMilliseconds.")) { String durationString = paramName.substring("maxWaitMilliseconds.".length()); int endDuration = durationString.indexOf('.'); if (endDuration != -1) { durationString = durationString.substring(0, endDuration); } Long duration = Long.valueOf(durationString); Pattern waitPattern = Pattern.compile(paramValue); this.maxWaitDurations.put(waitPattern, duration); } } }
Source:
<code>public void testPerJobWithArchive() throws Exception { final Configuration flinkConfig = createDefaultConfiguration(YarnConfigOptions.UserJarInclusion.DISABLED); final JobGraph archiveJobGraph = YarnTestArchiveJob.getArchiveJobGraph(tmp.newFolder(), flinkConfig); runTest(() -> deployPerJob(flinkConfig, archiveJobGraph, false)); <START> } <END></code><technical_language>problem failure set arg false. I set true</technical_language>

Target:
public void testPerJobWithArchive() throws Exception { final Configuration flinkConfig = createDefaultConfiguration(YarnConfigOptions.UserJarInclusion.DISABLED); final JobGraph archiveJobGraph = YarnTestArchiveJob.getArchiveJobGraph(tmp.newFolder(), flinkConfig); runTest(() -> deployPerJob(flinkConfig, archiveJobGraph, true)); }
Source:
<code><START> public <END> void setM(Market currentMarket) { this.currentMarket = currentMarket; }</code><technical_language>this method changed private</technical_language>

Target:
private void setM(Market currentMarket) { this.currentMarket = currentMarket; }
Source:
<code>public Map<String, String> getServerMetadata(@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName, @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr) { TableType tableType = Constants.validateTableType(tableTypeStr); <START> if (tableType == TableType.REALTIME) <END> throw new ControllerApplicationException(LOGGER, "Table type : " + tableTypeStr + " not yet supported.", Status.NOT_IMPLEMENTED); List<String> tableNamesWithType = getExistingTableNamesWithType(tableName, Constants.validateTableType(tableTypeStr)); Map<String, String> segmentsMetadata = null; try { segmentsMetadata = getSegmentsMetadataFromServer(tableNamesWithType.get(0)); } catch (InvalidConfigException e) { throw new ControllerApplicationException(LOGGER, "Failed to load segment reload status for table: " + tableName, Status.NOT_FOUND); } catch (IOException ioe) { throw new ControllerApplicationException(LOGGER, "Error parsing response to cluster config!", Response.Status.BAD_REQUEST, ioe); } if (segmentsMetadata == null) throw new ControllerApplicationException(LOGGER, "Table: " + tableName + " not found.", Status.NOT_FOUND); return segmentsMetadata; }</code><technical_language>nit: wrap this in {}</technical_language>

Target:
public String getServerMetadata(@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName, @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr) { LOGGER.info("Received a request to fetch metadata for all segments for table {}", tableName); TableType tableType = Constants.validateTableType(tableTypeStr); if (tableType == TableType.REALTIME) { throw new ControllerApplicationException(LOGGER, "Table type : " + tableTypeStr + " not yet supported.", Status.NOT_IMPLEMENTED); } String tableNameWithType = getExistingTableNamesWithType(tableName, tableType).get(0); String segmentsMetadata; try { JsonNode segmentsMetadataJson = getSegmentsMetadataFromServer(tableNameWithType); segmentsMetadata = JsonUtils.objectToPrettyString(segmentsMetadataJson); } catch (InvalidConfigException e) { throw new ControllerApplicationException(LOGGER, e.getMessage(), Status.BAD_REQUEST); } catch (IOException ioe) { throw new ControllerApplicationException(LOGGER, "Error parsing Pinot server response: " + ioe.getMessage(), Status.INTERNAL_SERVER_ERROR, ioe); } return segmentsMetadata; }
Source:
<code>private void compareWith(OpenEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); if (selection.isEmpty()) return; StagingEntry stagingEntry = (StagingEntry) selection.getFirstElement(); switch (stagingEntry.getState()) { case ADDED: case CHANGED: case REMOVED: case UNTRACKED: <START> runCommand(ActionCommands.COMPARE_WITH_HEAD_ACTION, selection); <END> break; case MISSING: case MODIFIED: case PARTIALLY_MODIFIED: case CONFLICTING: default: runCommand(ActionCommands.COMPARE_WITH_INDEX_ACTION, selection); } }</code><technical_language>This is I expect. I expect a comparison index HEAD</technical_language>

Target:
private void compareWith(OpenEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); if (selection.isEmpty()) return; StagingEntry stagingEntry = (StagingEntry) selection.getFirstElement(); switch (stagingEntry.getState()) { case ADDED: case CHANGED: case REMOVED: case UNTRACKED: runCommand(ActionCommands.COMPARE_INDEX_WITH_HEAD_ACTION, selection); break; case MISSING: case MODIFIED: case PARTIALLY_MODIFIED: case CONFLICTING: default: runCommand(ActionCommands.COMPARE_WITH_INDEX_ACTION, selection); } }
Source:
<code>public void fetchUsers() { try { logger.info("Start fetching users from GitHub..."); List<User> users = githubApi.fetchAllOrgaMembers(); users.forEach(u -> logger.debug("fetched user: " + u.username)); users.forEach(userService::insertOrUpdate); logger.info("Finished fetching users from GitHub,"); } catch (IOException e) { <START> logger.error("Error fetchint users from GitHub: " + e.getMessage(), e); <END> } }</code><technical_language>spelling --> fetchin(G)</technical_language>

Target:
public void fetchUsers() { try { logger.info("Start fetching users from GitHub..."); List<User> users = githubApi.fetchAllOrgaMembers(); users.forEach(u -> logger.debug("fetched user: " + u.username)); users.forEach(userService::insertOrUpdate); logger.info("Finished fetching users from GitHub,"); } catch (IOException e) { logger.error("Error fetching users from GitHub: " + e.getMessage(), e); } }
Source:
<code>public static void sendTitle(Player player, String message, int fadein, int stay, int fadeout) { try { CraftPlayer craftplayer = (CraftPlayer) player; PlayerConnection connection = craftplayer.getHandle().playerConnection; String finalmessage = message.replaceAll("&", "§"); IChatBaseComponent chatTitle = ChatSerializer.a("{\"text\": \"" + finalmessage + "\"}"); PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, chatTitle, fadein, stay, fadeout); connection.sendPacket(title); } catch (Exception e) { <START> TFM_Log.severe(e.getLocalizedMessage()); <END> TFM_Log.severe("Title packet send failed. Your server jar is likely outdated."); } }</code><technical_language>Please log entire stacktrace here</technical_language>

Target:
public static void sendTitle(Player player, String message, int fadein, int stay, int fadeout) { try { CraftPlayer craftplayer = (CraftPlayer) player; PlayerConnection connection = craftplayer.getHandle().playerConnection; String finalmessage = message.replaceAll("&", "§"); IChatBaseComponent chatTitle = ChatSerializer.a("{\"text\": \"" + finalmessage + "\"}"); PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, chatTitle, fadein, stay, fadeout); connection.sendPacket(title); } catch (Exception e) { TFM_Log.severe("Title packet failed to send for player: " + player.getName()); TFM_Log.severe(e.getStackTrace().toString()); } }
Source:
<code>public void should_apply_up_and_down_topology_events_when_ignored() { driverContext .loadBalancingPolicyWrapper() <START> .setDistance(metadataRegularNode, NodeDistance.IGNORED); <END> ConditionChecker.checkThat(() -> metadataRegularNode.getOpenConnections() == 0) .as("Driver closed all connections") .before(10, TimeUnit.SECONDS) .becomesTrue(); assertThat(metadataRegularNode).hasState(NodeState.UP).isNotReconnecting(); driverContext .eventBus() .fire(TopologyEvent.suggestDown(metadataRegularNode.getConnectAddress())); ConditionChecker.checkThat( () -> metadataRegularNode.getState() == NodeState.DOWN && metadataRegularNode.getDistance() == NodeDistance.IGNORED && metadataRegularNode.getOpenConnections() == 0 && !metadataRegularNode.isReconnecting()) .as("SUGGEST_DOWN event applied") .before(10, TimeUnit.SECONDS) .becomesTrue(); driverContext.eventBus().fire(TopologyEvent.suggestUp(metadataRegularNode.getConnectAddress())); ConditionChecker.checkThat( () -> metadataRegularNode.getState() == NodeState.UP && metadataRegularNode.getDistance() == NodeDistance.IGNORED && metadataRegularNode.getOpenConnections() == 0 && !metadataRegularNode.isReconnecting()) .as("SUGGEST_UP event applied") .before(10, TimeUnit.SECONDS) .becomesTrue(); }</code><technical_language>awesome fire arbitrary events event bus</technical_language>

Target:
public void should_apply_up_and_down_topology_events_when_ignored() { driverContext .loadBalancingPolicyWrapper() .setDistance(metadataRegularNode, NodeDistance.IGNORED); ConditionChecker.checkThat( () -> assertThat(metadataRegularNode) .isUp() .isIgnored() .hasOpenConnections(0) .isNotReconnecting()) .as("Driver closed all connections to ignored node") .before(10, TimeUnit.SECONDS) .becomesTrue(); driverContext .eventBus() .fire(TopologyEvent.suggestDown(metadataRegularNode.getConnectAddress())); ConditionChecker.checkThat( () -> assertThat(metadataRegularNode) .isDown() .isIgnored() .hasOpenConnections(0) .isNotReconnecting()) .as("SUGGEST_DOWN event applied") .before(10, TimeUnit.SECONDS) .becomesTrue(); driverContext.eventBus().fire(TopologyEvent.suggestUp(metadataRegularNode.getConnectAddress())); ConditionChecker.checkThat( () -> assertThat(metadataRegularNode) .isUp() .isIgnored() .hasOpenConnections(0) .isNotReconnecting()) .as("SUGGEST_UP event applied") .before(10, TimeUnit.SECONDS) .becomesTrue(); }
Source:
<code>public void unsubscribe() { <START> mCompositeSubscription.unsubscribe(); <END> }</code><technical_language>I RxJava Android code style anywhere. adopt here</technical_language>

Target:
public void unsubscribe() { compositeSubscription.unsubscribe(); }
Source:
<code>public static SafeHtml sanitizeHtml(String html) { <START> if (html == null) { <END> html = ""; } return SafeHtmlUtils.fromTrustedString(dialogSanitize(html)); }</code><technical_language>StringUtil.notNull() for this well</technical_language>

Target:
public static SafeHtml sanitizeHtml(String html) { if (StringUtil.isNullOrEmpty(html)) { html = ""; } return SafeHtmlUtils.fromTrustedString(dialogSanitize(html)); }
Source:
<code>public String execute() throws Exception { ActionContext previous = ActionContext.getContext(); <START> ActionContext.bound(invocation.getInvocationContext()); <END> try { return invocation.invoke(); } finally { if (cleanupContext) ActionContext.bound(previous); } }</code><technical_language>candidate for bind() if method is created</technical_language>

Target:
public String execute() throws Exception { ActionContext previous = ActionContext.getContext(); ActionContext.bind(invocation.getInvocationContext()); try { return invocation.invoke(); } finally { if (cleanupContext) ActionContext.bind(previous); } }
Source:
<code><START> private synchronized ResourceBundle getResourceBundle(Locale locale) { <END> try { if (!resourceBundlesByLocale.containsKey(locale)) { resourceBundlesByLocale.put(locale, ResourceBundle.getBundle(messageSource, locale)); } } catch (RuntimeException e) { log.error("File: '{}' could not be loaded: {}", messageSource, e.getMessage()); log.debug("Exception", e); } return resourceBundlesByLocale.get(locale); }</code><technical_language>Hmm, idea: faster load messages for existing locales startup (IMO messages/locales memory issue) calling synchronized method for translated message in user request</technical_language>

Target:
private ResourceBundle getResourceBundle(Locale locale) { try { if (!resourceBundlesByLocale.containsKey(locale)) { resourceBundlesByLocale.put(locale, ResourceBundle.getBundle(messageSource, locale)); } } catch (RuntimeException e) { log.error("File: '{}' could not be loaded: {}", messageSource, e.getMessage()); log.debug("Exception", e); } return resourceBundlesByLocale.get(locale); }
Source:
<code>public void validateSpaceAndThreshold() { AddVmCommand<VmManagementParametersBase> command = setupCanAddVmTests(0, 0); doReturn(ValidationResult.VALID).when(storageDomainValidator).isDomainWithinThresholds(); <START> doReturn(ValidationResult.VALID).when(storageDomainValidator).hasSpaceForNewDisks(any(List.class)); <END> doReturn(storageDomainValidator).when(command).createStorageDomainValidator(any(StorageDomain.class)); assertTrue(command.validateSpaceRequirements()); verify(storageDomainValidator, times(TOTAL_NUM_DOMAINS)).hasSpaceForNewDisks(any(List.class)); verify(storageDomainValidator, never()).hasSpaceForClonedDisks(any(List.class)); }</code><technical_language>s/any(List.class)/anyList/</technical_language>

Target:
public void validateSpaceAndThreshold() { AddVmCommand<VmManagementParametersBase> command = setupCanAddVmTests(0, 0); doReturn(ValidationResult.VALID).when(storageDomainValidator).isDomainWithinThresholds(); doReturn(ValidationResult.VALID).when(storageDomainValidator).hasSpaceForNewDisks(anyList()); doReturn(storageDomainValidator).when(command).createStorageDomainValidator(any(StorageDomain.class)); assertTrue(command.validateSpaceRequirements()); verify(storageDomainValidator, times(TOTAL_NUM_DOMAINS)).hasSpaceForNewDisks(anyList()); verify(storageDomainValidator, never()).hasSpaceForClonedDisks(anyList()); }
Source:
<code><START> protected void setNotificationSender(NotificationSender notificationSender) { <END> if (log.isDebugEnabled()) { log.debug("Un-setting notification sender in Entitlement bundle"); } this.notificationSender = notificationSender; }</code><technical_language>bindings set NotificationSender, means this method get called</technical_language>

Target:
protected void setNotificationSender(NotificationSender notificationSender) { if (log.isDebugEnabled()) { log.debug("Un-setting notification sender"); } TOTPManagerComponent.notificationSender = notificationSender; }
Source:
<code>public void cancelFirmwareUpdate(final ThingUID thingUID){ Preconditions.checkNotNull(thingUID, "Thing UID must not be null."); <START> final FirmwareUpdateHandler firmwareUpdateHandler = getFirmwareUpdateHandler(thingUID); <END> if (firmwareUpdateHandler == null) { throw new IllegalArgumentException( String.format("There is no firmware update handler for thing with UID %s.", thingUID)); } logger.debug("Canceling firmware update for thing with UID {}.", thingUID); firmwareUpdateHandler.cancel(); }</code><technical_language>updateFirmware throws IllegalStateException -updateFirmware cancelFirmwareUpdate code for firmware update handler check</technical_language>

Target:
public void cancelFirmwareUpdate(final ThingUID thingUID) { Preconditions.checkNotNull(thingUID, "Thing UID must not be null."); final FirmwareUpdateHandler firmwareUpdateHandler = getFirmwareUpdateHandler(thingUID); if (firmwareUpdateHandler == null) { throw new IllegalArgumentException( String.format("There is no firmware update handler for thing with UID %s.", thingUID)); } final ProgressCallbackImpl progressCallback = getProgressCallback(thingUID); getPool().submit(new Runnable() { @Override public void run() { try { SafeMethodCaller.call(new SafeMethodCaller.ActionWithException<Void>() { @Override public Void call() { logger.debug("Canceling firmware update for thing with UID {}.", thingUID); firmwareUpdateHandler.cancel(); return null; } }); } catch (ExecutionException e) { logger.error(String.format( "Unexpected exception occurred while canceling firmware update of thing with UID %s.", thingUID), e.getCause()); progressCallback.failedInternal("unexpected-handler-error-during-cancel"); } catch (TimeoutException e) { logger.error(String.format("Timeout occurred while canceling firmware update of thing with UID %s.", thingUID), e); progressCallback.failedInternal("timeout-error-during-cancel"); } } }); }